CLAILGApr 28

Test-Time Safety Alignment

arXiv:2604.2616784.32 citations
AI Analysis

For developers of aligned LLMs, this provides a test-time method to override safety failures without retraining, but it is incremental as it extends existing embedding control to aligned models.

The paper tackles safety alignment of LLMs by optimizing input word embeddings to minimize semantic harmfulness in responses, achieving neutralization of all safety-flagged responses on standard benchmarks.

Recent work has shown that a model's input word embeddings can serve as effective control variables for steering its behavior toward outputs that satisfy desired properties. However, this has only been demonstrated for pretrained text-completion models on the relatively simple objective of reducing surface-level profanity in short continuations. A natural and practically important question is how well input embeddings can control aligned models, which produce an imbalanced bimodal refuse-or-comply output distribution rather than the smooth distribution characteristic of open-ended generation. We explore this in the context of safety, showing that input word embeddings can be optimized in a sub-lexical manner to minimize the semantic harmfulness of aligned model responses. Our approach uses zeroth-order gradient estimation of a black-box text-moderation API with respect to the input embeddings, and then applies gradient descent on these embeddings to minimize the harmfulness of the generated text. Experiments show that the proposed method can neutralize every safety-flagged response on standard safety benchmarks.

Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes