Selective Safety Steering via Value-Filtered Decoding

Bat-Sheva Einbinder, Hen Davidov, Yee Whye Teh, Yarin Gal, Yaniv Romano

TL;DR

Researchers have developed Value-Filtered Decoding (VFD), a new inference-time method that makes LLMs safer by selectively filtering tokens during generation. Unlike previous methods that constantly nudge the model and degrade its helpfulness, VFD provides a mathematical guarantee to limit unnecessary interventions, preserving the original model's style and quality while ensuring safety.

What Problem Does This Paper Address?

Aligning Large Language Models (LLMs) with human values is a balancing act. While we want models to be safe, over-correcting often leads to the "alignment tax"—a drop in helpfulness, fluency, and the specific "personality" of the base model.

Current "decoding-time" steering methods (like Gibbs reweighting) work by tilting the probability of every token toward safer options. The problem? These methods are "always-on." They intervene even when the model was already going to say something perfectly safe. This constant interference distorts the model's output, making it less helpful or coherent. Furthermore, these existing methods offer no formal guarantees on how often they will "falsely" intervene on safe content.

Methods

The authors propose Value-Filtered Decoding (VFD). Instead of reweighting the entire probability distribution, VFD uses a hard threshold.

  1. The Value Function: The authors train a small, 3-layer MLP "value head" that looks at the model’s internal hidden states. This head predicts the probability that the entire final response will be safe, given the current partial sentence.
  2. Truncated Sampling: During generation, the model proposes a token. If the value function for that token is above a threshold ($c$), it’s accepted. If it’s below, it’s rejected, and the model samples again.
  3. Conformal Risk Control: This is the clever bit. To solve the problem of "unnecessary interventions," the authors use a statistical framework called Conformal Risk Control. By using a small holdout set of safe examples, they can mathematically calibrate the threshold ($c$) to ensure that the rate of false interventions (Type-I error) stays below a user-defined level ($\alpha$).

Datasets

The study evaluated VFD across three major safety alignment benchmarks:

  • HH-RLHF: A standard dataset for "Helpful and Harmless" feedback.
  • BeaverTails: A dataset specifically designed for safety alignment and red-teaming.
  • PKU-SafeRLHF: A large-scale dataset featuring multi-level safety preferences.

The researchers used Mistral-7B-Instruct-v0.3 as the base model and Llama-3.1-8B-Instruct as the "judge" to evaluate the safety and helpfulness of the final outputs.

Key Insights and Ideas

  • The "Indicator" Advantage: Most steering methods use an "exponential tilt" (Gibbs policy), which can amplify small errors in safety estimation. VFD uses a binary indicator (accept/reject). The authors prove that this makes VFD more robust to estimation errors—it only fails if the error is large enough to push a value across the threshold.
  • The Martingale Property: The paper treats the "safety value" of a generating sentence as a martingale (a sequence of random variables where the future expectation is equal to the current value). This allows them to use Ville’s Inequality to provide the first formal bound on false intervention rates in LLM steering.
  • Selective Intervention is Key: By only stepping in when the "safety floor" is threatened, VFD maintains a much higher cosine similarity to the base model than any other baseline. It keeps the model's "vibe" intact while still blocking the bad stuff.

Key Results

  • Superior Trade-offs: VFD consistently outperformed baselines like ARGS, Controlled Decoding, and CARDS. It achieved higher safety scores while maintaining significantly higher helpfulness and similarity to the base model.
  • Guaranteed Error Control: Empirical tests confirmed that the "False Intervention Rate" (how often the filter messes with a safe sentence) closely tracked the theoretical target ($\alpha$). If you set the budget for mistakes at 10%, the model actually hits that target.
  • Efficiency: Despite using rejection sampling, VFD is computationally competitive. Because it only rejects tokens when necessary, the "sampling budget" isn't exhausted on safe prompts, keeping generation speeds high.

Limitations and Future Work

While promising, the authors note a few areas for growth:

  • Binary Rewards: The current math assumes a binary "safe/unsafe" reward. Extending this to continuous rewards (e.g., "how helpful is this on a scale of 1-10") would make the method more versatile.
  • Sparse Feedback: The value function is currently trained on "trajectory-level" rewards (did the whole thing end up safe?). Incorporating intermediate, token-level rewards could make the interventions even more precise.
  • Training Requirement: Unlike some "plug-and-play" methods, VFD requires training a value classifier and having access to a small calibration dataset of safe responses.

In short, VFD moves us closer to a world where "safe" doesn't have to mean "lobotomized," providing a principled way to keep LLMs on the rails without losing what makes them useful in the first place.

Summary updated

BibTeX
@inproceedings{einbinder2026selective,
  author = {Bat-Sheva Einbinder and Hen Davidov and Yee Whye Teh and Yarin Gal and Yaniv Romano},
  title = {{Selective Safety Steering via Value-Filtered Decoding}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=zsrEQJOOeK},
}
Figure