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:
- 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).
- 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.
- Selective Decoding: Instead of steering every token, LaVGuard only acts at "active" positions where drift is detected.
- 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:
- $B_{tok}$: A budget for the total number of positions changed.
- $B_{KL}$: A budget for the cumulative KL divergence from the base model's distribution.
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.
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