MetaSC: Test-Time Safety Specification Optimization for Language Models
Víctor Gallego
TL;DR
MetaSC introduces online optimization of language-model safety reasoning by dynamically refining safety specifications at inference time without modifying model weights. It combines a self-critique loop with a meta-critique component to adapt prompts governing critique and revision, enabling rapid adaptation to diverse safety contexts. Empirical results show substantial safety gains against jailbreaks across several models and strong performance on the BiGGen safety tasks, using as few as 10 optimization steps. The approach offers a weight-free alternative to safety fine-tuning and suggests broad applicability to other specification-driven control settings.
Abstract
We propose a novel dynamic safety framework that optimizes language model (LM) safety reasoning at inference time without modifying model weights. Building on recent advances in self-critique methods, our approach leverages a meta-critique mechanism that iteratively updates safety prompts-termed specifications-to drive the critique and revision process adaptively. This test-time optimization not only improves performance against adversarial jailbreak requests but also in diverse general safety-related tasks, such as avoiding moral harm or pursuing honest responses. Our empirical evaluations across several language models demonstrate that dynamically optimized safety prompts yield significantly higher safety scores compared to fixed system prompts and static self-critique defenses. Code released at https://github.com/vicgalle/meta-self-critique.git .
