Kelp: A streaming guardrail for large models based on latent dynamics-guided risk detectionKelp: A Streaming Safeguard for Large Models via Latent Dynamics-Guided Risk Detection
The research team proposes Kelp, a plug-in guardrail framework embedded in the large model generation pipeline that detects risks in real time during generation. It uses a streaming latent dynamics head (SLD) to read the model's intermediate hidden states, models the temporal evolution of risk over the generated sequence, and introduces an anchored temporal consistency (ATC) loss to constrain harm predictions to increase monotonically using a benign-to-harmful temporal prior. The team also releases StreamGuardBench, a streaming guardrail benchmark based on the immediate responses of each protected model, covering text and vision-language tasks. The authors report that across multiple models and datasets, Kelp achieves an average F1 15.61% higher than existing post-hoc guardrails and prior plug-in probes, with 20M parameters and less than 0.5 ms added latency per token.