Search papers, labs, and topics across Lattice.
SafeCtrl-RL is introduced, an inference-time framework that uses reinforcement learning to dynamically adjust prompts and control LLM behavior without retraining. The RL agent learns to select prompt adjustment strategies based on dialogue context, effectively suppressing unsafe behaviors through iterative refinement. Experiments across multiple LLMs demonstrate that SafeCtrl-RL improves safety and response quality compared to existing prompt optimization methods, while also offering favorable performance-efficiency trade-offs.
LLMs can be made significantly safer at inference time, without any retraining, by using RL to dynamically optimize prompts based on dialogue context.
Ensuring safe and contextually appropriate behaviour in Large Language Models (LLMs) remains a critical challenge for real-world deployment. We present \textbf{SafeCtrl-RL}, an inference-time behavioural control framework that enables adaptive safety regulation without model retraining or parameter modification. The method formulates dialogue generation as a sequential decision process, where a reinforcement learning agent dynamically selects prompt adjustment strategies based on contextual feedback. This allows unsafe behaviours to be suppressed through iterative refinement, which we conceptualise as inference-time behavioural unlearning. Evaluated across multiple LLMs and unsafe dialogue scenarios, SafeCtrl-RL consistently improves safety and response quality, outperforms existing prompt-based optimisation methods, and achieves favourable performance--efficiency trade-offs. **Warning: This paper may contain examples of harmful language, and reader discretion is recommended.