Abstract
Large language models (LLMs) are increasingly applied in diverse real-world scenarios, each governed by bespoke behavioral and safety specifications (spec) custom-tailored by users or organizations. These spec, categorized into safety-spec and behavioral-spec, vary across scenarios and evolve with changing preferences and requirements. We formalize this challenge as specification alignment, focusing on LLMs' ability to follow dynamic, scenario-specific spec from both behavioral and safety perspectives. To address this challenge, we propose Align3, a lightweight method that employs Test-Time Deliberation (TTD) with hierarchical reflection and revision to reason over the specification boundaries. We further present SpecBench, a unified benchmark for measuring specification alignment, covering 5 scenarios, 103 spec, and 1,500 prompts. Experiments on 15 reasoning and 18 instruct models with several TTD methods, including Self-Refine, TPO, and MoreThink, yield three key findings: (i) test-time deliberation enhances specification alignment; (ii) Align3 advances the safety-helpfulness trade-off frontier with minimal overhead; (iii) SpecBench effectively reveals alignment gaps. These results highlight the potential of test-time deliberation as an effective strategy for reasoning over the real-world specification boundaries.
Introduction
Standard alignment techniques like Reinforcement Learning from Human Feedback (RLHF) typically aim for a "one-size-all" model of safety and helpfulness. However, real-world applications require bespoke specifications (specs). For instance, a storytelling bot for children requires much stricter safety boundaries than a biochemical research assistant, yet both must remain highly functional.
The authors identify a "safety-behavior trade-off": models often become "over-aligned," refusing harmless prompts out of excessive caution, or "under-aligned," ignoring specific behavioral constraints to provide a generic answer. This challenge is formalized as specification alignment—the ability of a model to follow dynamic, fine-grained, and scenario-specific rules that evolve over time.
Methods and Benchmark
To address the alignment gap, the paper proposes Test-Time Deliberation (TTD). Rather than retraining the model, TTD allows the model to "think" and refine its response during the inference phase. The primary contribution is ALIGN3, a three-step, single-pass TTD intervention:
- Behavior Optimization: The model focuses on maximizing helpfulness and meeting behavioral goals (e.g., word count, tone).
- Safety-Guided Refinement: The model reviews its internal reasoning chain to identify and remove safety risks.
- Holistic Specification Audit: A final reflection step where the model audits its planned response against all specs.
The study also introduces SpecBench, a unified benchmark covering five diverse scenarios: Biochem, Child, Code, Health, and Travel. It includes 103 unique specifications and 1,500 prompts. To ensure robustness, "WildTeaming" tactics were used to reframe unsafe prompts into adversarial versions that are harder for models to detect.
Key Insights and Results
A major finding is that reasoning models (like DeepSeek-R1 or Qwen-thinking) are naturally better at following specs. Their internal "thought" process acts as a space to weigh different specifications before answering. Furthermore, the study shows that TTD methods shift the "safety-helpfulness" trade-off frontier outward.
Key performance metrics include:
- Performance Gains: ALIGN3 raised the Specification Alignment Rate (SAR) of Qwen3-14B from 51.03% to 62.92%.
- Efficiency: ALIGN3 achieves these gains with minimal token overhead, typically adding fewer than 400 extra tokens.
- The SAR Metric: This new metric penalizes models heavily for safety violations—if a model violates a safety-spec, its score for that prompt is zero, regardless of helpfulness.
- Benchmark Leaders: GPT-5-chat achieved the highest overall SAR at 82.14%, followed by specialized reasoning models.
Conclusion
SpecBench effectively reveals alignment gaps in current LLMs. However, the results demonstrate that test-time deliberation, particularly through efficient single-pass methods like ALIGN3, is a powerful strategy for navigating complex, real-world specification boundaries. Future work may involve scaling test-time compute further or using TTD insights to generate high-quality synthetic data for training.
Summary updated