TL;DR
Refusal mechanisms in large language models (LLMs) are notoriously brittle, often causing models to either over-refuse harmless queries or fail on dangerous ones. By prepending a dedicated [refuse] (or category-specific) token to refusal responses during supervised fine-tuning, the authors enable test-time calibration: developers can adjust the softmax threshold of this single token to dial refusal rates up or down like a knob—all without retraining.
What Problem Does This Paper Address?
Deploying LLMs safely requires models to decline unsafe, ill-posed, or out-of-scope prompts. However, controlling when a model refuses is challenging:
- Models frequently over-refuse harmless queries (high Type II error), degrading usability (as seen in early versions of Llama-2-chat).
- Aligning refusal behavior typically requires expensive iterative retraining with varying dataset mixtures to hit target refusal rates.
- Different applications have conflicting tolerances across different refusal domains (e.g., strict safety compliance vs. answering temporally ambiguous queries).
Currently, adjusting a model's refusal threshold after training is difficult without retraining or adding complex external guardrail classifiers.
Methods
The authors introduce Refusal Tokens:
- Supervised Fine-Tuning (SFT) with Meta-Tokens: During SFT, training responses are prepended with either a
[refuse]token (for non-compliant responses) or a[respond]token (for compliant answers). They also explore multi-category tokens corresponding to specific refusal rationales. - Inference-Time Thresholding: At test time, the model generates the first token. The softmax probability $p([\text{refuse}] \mid \text{prompt})$ serves as an interpretable confidence score. If this probability exceeds a user-chosen threshold $T \in [0, 1]$, the model emits
[refuse]and proceeds to generate a refusal; otherwise, it proceeds with[respond]. - Multi-Category & Sum Thresholding: Using distinct tokens for individual refusal categories allows independent steering (e.g., suppressing or boosting refusals only for indeterminate questions) via category thresholding or sum thresholding across category tokens.
- Borderline / Contrast Data Inclusion: Training pairs are balanced with contrast examples—benign queries that closely resemble refusal queries but should be answered.
User Prompt ──> Model First Token Probability ──> p([refuse]) > T ? ──┬── Yes ──> Emit [refuse] ──> Refusal text
└── No ──> Emit [respond] ──> Standard answer
Datasets
- CoCoNot (Brahman et al., 2024): Used for primary training and evaluation. Spans 5 refusal categories (Humanizing, Indeterminate, Incomplete, Safety, Unsupported) covering 26 subcategories (~10k refusal SFT examples, ~1k contrast examples, and 1,379 evaluation queries).
- Temporal Dataset (New): ~4k instruction-response pairs created to examine the role of contrast data. Consists of ~2k post-cutoff news queries (requiring refusal) and ~2k pre-cutoff news queries (1990–2020) acting as answerable contrast data. Evaluated on 200 human-verified temporal questions, CoCoNot subsets, and TriviaQA.
- Instruction Baselines: UltraChat and Stanford Alpaca.
- Auxiliary Evaluations: XSTest (safety and false refusal benchmark) and standard benchmarks (MMLU, ARC, HellaSwag, TruthfulQA).
Key Insights and Ideas
- Model as its Own Pre-Execution Classifier: Prepending a synthetic token forces the model to classify its intent before generating downstream text, allowing internal representations to condition the subsequent generation directly.
- Contrast Data is Non-Negotiable: Training solely on refusal examples causes aggressive generalization, increasing false refusals on unrelated tasks (e.g., TriviaQA refusals jumped from ~0% to ~15%). Adding closely matched contrast data anchors the decision boundary and prevents collateral over-refusal.
- Fine-Grained Category Steerability: Category-specific tokens act as decoupled dials. Users can scale up sensitivity for safety or indeterminate queries without inadvertently inflating refusals on other classes.
- SFT Trumps DPO for Behavioral Tokens: Initial experiments showed Direct Preference Optimization (DPO) alone struggled to establish the token-behavior link; supervised fine-tuning is necessary to instill the token association.
Key Results
- Out-of-the-Box Gains: Even without thresholding, simply training with refusal tokens on CoCoNot improved the refusal F1 score from 0.918 to 0.940 on Llama-3 8B, reducing the error rate by 26.8% while preserving general capabilities (MMLU/ARC scores remained flat at ~0.62).
- Targeted Calibration: Applying category-wise thresholding ($T = 0.1$) to the two lowest-performing categories (Humanizing and Indeterminate) increased overall F1 from 0.935 to 0.946. Refusal rates for these classes rose by ~5% and ~8% respectively, with almost no increase in false refusals on contrast data (0.116 vs. 0.119). In contrast, adjusting a single global refusal token doubled the contrast error rate to 0.228.
- Improved Generation Consistency: Across five stochastic generations per query, models trained with refusal tokens produced the identical response type (refuse vs. respond) in 87% of prompts, compared to 81% for standard models.
- Probability Calibration: Post-hoc temperature scaling ($\tau = 2$) lowered min-max adjusted Expected Calibration Error (ECE) from 0.13 to 0.08.
Limitations and Future Work
- Disclaimers vs. Refusals: Token-generation agreement is high but imperfect. In edge cases (particularly Humanizing requests), models emitted a refusal token and included a disclaimer ("As an AI..."), but then answered the question, leading LLM judges to label the response as compliant.
- Category Semantic Overlap: Cross-category bleeding occurs when prompts contain multiple traits (e.g., financial advice requests hitting safety, temporal limits, and humanizing constraints simultaneously).
- Adversarial / Jailbreak Vulnerabilities: If an API allows users to inject prefill tokens, adversaries could force the
[respond]token to bypass safety guardrails. Securing the generation prefix against user injection remains essential.
Summary updated