LaVGuard: Selective Decoding for Contextual Value Drift

Jiale Dai, Liuxian Ma, Hongcan Deng, Xiaoke Niu, Wenjing Zhang, Zhaoxiang Liu, Shiguo Lian, Guojie SongarXiv 2026 · arXiv

TL;DR

LaVGuard is a selective decoding framework designed to prevent "contextual value drift"—when an LLM’s response, though safe, emphasizes values that conflict with a specific task. By using a task-relative "value contract" and explicit budgets for token changes and KL divergence, LaVGuard steers generation back toward authorized priorities only when necessary, significantly improving adherence to task-specific values without retraining the underlying model.

What Problem Does This Paper Address?

Standard LLM safety focuses on preventing prohibited content (e.g., hate speech, dangerous instructions). However, a response can be perfectly "safe" but still fail a task by expressing the wrong priorities. The authors call this contextual value drift.

Imagine an assistant asked to help organize a team while "preserving autonomy." If the model generates a response like "Assign everyone a role and require compliance," it hasn't said anything harmful, but it has privileged conformity over the requested self-direction.

The challenge is that "correct" values are task-dependent. Security is great for a banking app but might be stifling for a creative writing prompt. Existing steering methods often apply global changes or lack explicit bounds, potentially damaging the model's general capabilities or over-correcting benign text.

Methods

LaVGuard introduces a "Contract-Observe-Locate-Continue" loop to manage these trade-offs:

  1. The Contract: Before generation, a user or policy owner provides an "authorized profile"—a 10-dimensional vector based on Schwartz’s basic human values (e.g., Achievement, Self-direction, Security).
  2. Observe & Locate: As the model generates, a frozen "value probe" reads the hidden states of the visible prefix to estimate its current value intensities. The system calculates the residual (the difference between the observed values and the contract). A Gaussian Mixture Model (GMM) acts as a gate; if the residual falls outside a learned "task-relative region," an intervention is triggered.
  3. Selective Decoding: Instead of steering every token, LaVGuard only acts at "active" positions where drift is detected.
  4. Allocate with Budgets: When the gate is "on," the system evaluates the top-M candidate tokens. It uses an exponential logit tilt to favor tokens that move the prefix closer to a "prototype" of the authorized values. Crucially, this intervention is constrained by two explicit resources:
  5. $B_{tok}$: A budget for the total number of positions changed.
  6. $B_{KL}$: A budget for the cumulative KL divergence from the base model's distribution.
Figure 1 : Task-relative selective decoding. The authorized profile and the frozen probe’s visible-prefix state meet in the residual; the two-dimensional region illustrates the fitted geometry. Boundary exceedance and remaining position and KL allowances enable candidate evaluation. The paired continuations express contrasting priorities under a shared content guard. Along the decoding ribbon, cinnabar marks a changed sampling kernel, counted by It; Kt is that step’s conditional KL cost. Unchanged kernels consume neither allowance. The task, trajectory, responses, and ribbon are constructed illustrations; profile and state cells indicate dimensions.

Datasets

The authors introduced a benchmark protocol containing 200 variants across 100 prompt families, categorized into:

  • Value Migration: Prompts where the model is likely to drift from one value to another.
  • Content-safe Value-Risk: Scenarios where the model might express inappropriate priorities without violating standard safety rules.
  • Hard-Safety: Baseline safety tasks drawn from AdvBench and HarmBench.
  • Benign Control: Standard tasks to ensure the controller doesn't intervene when it shouldn't.

Key Insights and Ideas

  • Task-Relative Geometry: The core "aha moment" is that safety is a residual. By subtracting the task profile from the observed state, the same language can be judged differently depending on the context. A high "conformity" score might be fine for a military simulation but a "drift" for a creative workshop.
  • Selective Intervention is Efficient: Acting at every position (all-token steering) often degrades quality. LaVGuard achieves high safety scores with a mean intervention ratio of only 0.12 (changing about 1 in 8 tokens).
  • Budgets as a Safety Valve: By explicitly accounting for KL divergence and token changes, the authors provide a mathematical guarantee on how much the response distribution can shift, preventing the "runaway steering" seen in some other methods.
A detailed look at a single guarded decoding step, showing the GMM gate and KL bisection search.

Key Results

  • Improved Detection: Profile conditioning (using the task-specific contract) raised the True Positive Rate (TPR) for detecting drift from .58 to .72 at a fixed 5% False Positive Rate.
  • Superior Steering: At a shared intervention ratio of .12, LaVGuard achieved a risk-safety score of .88, significantly outperforming position-matched edits (.72) and random selection (.70).
  • Utility Preservation: While "all-token" intervention reached a slightly higher risk safety (.89), it severely damaged "benign utility" (.68). LaVGuard maintained a much higher benign utility of .81.
  • Latency: The overhead is modest, increasing latency from 720ms (base) to 830ms per response, primarily due to evaluating candidate branches.

Limitations and Future Work

  • Representation Scope: The 10-dimensional Schwartz profile is an "operational representation" and doesn't capture every nuance of human values or social context.
  • Probe Dependency: The value probe is trained on specific annotated prefixes; its accuracy may vary if the model encounters highly out-of-distribution language.
  • Computational Cost: Evaluating candidate branches requires additional backbone passes. While the authors propose a "Fast" configuration, scaling to very long responses or massive models remains a challenge.
  • Future Directions: The authors suggest exploring adaptive budget allocation across multi-turn dialogues and refining the "ambiguity band" where the controller might abstain from intervening if the signal is unclear.

Summary updated

Abstract

A content-safe response can still promote priorities that conflict with its task: an assistant may demand compliance when asked to preserve autonomy. We study contextual value drift as a task-relative decoding problem with an explicit allowance for change. LaVGuard separates an authorized ten-dimensional profile from a frozen estimate of the values expressed in the visible prefix. A profile-relative density gate selects when to evaluate candidate continuations; their signed progress determines a logit tilt constrained by both changed-position and cumulative-KL budgets. We establish local surrogate improvement, pathwise budget feasibility, and a bound on response-distribution change. Profile conditioning raises boundary TPR at 5% FPR from .58 to .72. At the same .12 mean intervention ratio, the selection study reports risk-safety scores of .88 for LaVGuard and .72 for position-matched edits. The resulting interface makes task priorities actionable while keeping the extent of intervention explicit and bounded.
BibTeX
@misc{dai2026lavguard,
  author = {Jiale Dai and Liuxian Ma and Hongcan Deng and Xiaoke Niu and Wenjing Zhang and Zhaoxiang Liu and Shiguo Lian and Guojie Song},
  title = {{LaVGuard: Selective Decoding for Contextual Value Drift}},
  year = {2026},
  eprint = {2610.29135},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2610.29135},
}
Figure