Refusal Tokens: A Simple Way to Calibrate Refusals in Large Language Models

Neel Jain, Aditya Shrivastava, Chenyang Zhu, Daben Liu, Alfy Samuel, Ashwinee Panda, Anoop Kumar, Micah Goldblum, Tom GoldsteinSubmission to ICLR 2025 · Rejected

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

Abstract

A key component of building safe and reliable language models is enabling the models to appropriately refuse to follow certain instructions or answer certain questions. We may want models to output refusal messages for various categories of user queries, for example, ill-posed questions, instructions for committing illegal acts, or queries which require information past the model's knowledge horizon. Engineering models that refuse to answer such questions is complicated by the fact that an individual may want their model to exhibit varying levels of sensitivity for refusing queries of various categories, and different users may want different refusal rates. The current default approach involves training multiple models with varying proportions of refusal messages from each category to achieve the desired refusal rates, which is computationally expensive and may require training a new model to accommodate each user's desired preference over refusal rates. To address these challenges, we propose refusal tokens, one such token for each refusal category or a single refusal token, which are prepended to the model's responses during training. We then show how to increase or decrease the probability of generating the refusal token for each category during inference to steer the model's refusal behavior. Refusal tokens enable controlling a single model's refusal rates without the need of any further fine-tuning, but only by selectively intervening during generation.
BibTeX
@inproceedings{jain2025refusal,
  author = {Neel Jain and Aditya Shrivastava and Chenyang Zhu and Daben Liu and Alfy Samuel and Ashwinee Panda and Anoop Kumar and Micah Goldblum and Tom Goldstein},
  title = {{Refusal Tokens: A Simple Way to Calibrate Refusals in Large Language Models}},
  booktitle = {COLM},
  year = {2025},
  url = {https://openreview.net/forum?id=Pbs4i3FgbD},
}
Figure