LaVGuard: Selective Decoding for Contextual Value Drift
Organizations: State Key Laboratory of General Artificial Intelligence, School of Intelligence Science and Technology, Peking University · College of Artificial Intelligence, Tsinghua University · University of Chinese Academy of Sciences · China United Network Communications Group Co., Ltd.
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.
Figures & tables
| Method | AUPRC | AUROC | Macro-F1 | Risk recall | Benign FPR | TPR@5% | FPR@95% |
|---|---|---|---|---|---|---|---|
| Content/output guard | .86 .025 | .82 .025 | .62 .03 | .68 .03 | .04 .01 | .45 .04 | .38 .04 |
| Global boundary | .90 .02 | .87 .02 | .68 .025 | .74 .025 | .05 .01 | .58 .035 | .28 .035 |
| Context-conditioned | .95 .015 | .92 .015 | .76 .025 | .83 .02 | .04 .01 | .72 .03 | .18 .03 |
| LaVGuard | .96 .015 | .93 .015 | .79 .02 | .86 .02 | .04 .01 | .76 .03 | .15 .025 |
| Method | Single F1 | Risk F1 | Risk safety | Risk pass | Benign safety | Over-refusal | Token ratio | Latency (ms) |
|---|---|---|---|---|---|---|---|---|
| Base | .76 .03 | .55 .025 | .55 .03 | .62 .035 | .84 .015 | .03 .008 | .00 .00 | 720 20 |
| SafeInfer | .82 .025 | .58 .025 | .76 .025 | .82 .025 | .79 .02 | .18 .015 | .00 .00 † | 760 30 |
| LaVGuard | .87 .02 | .84 .02 | .88 .02 | .91 .02 | .81 .018 | .08 .01 | .12 .012 | 830 40 |
| Method | Token prec. | Token rec. | Gain/token | Risk safety | Benign utility | Token ratio | Mean KL |
|---|---|---|---|---|---|---|---|
| Random token | .18 .04 | .20 .04 | .015 .005 | .70 .03 | .79 .02 | .12 .015 | .04 .006 |
| Position-matched | .22 .04 | .24 .04 | .020 .006 | .72 .03 | .79 .02 | .12 .015 | .04 .006 |
| All-token | 1.00 .00 | 1.00 .00 | .035 .007 | .89 .02 | .68 .025 | 1.00 .00 | .18 .015 |
| Boundary only | .00 .00 | .00 .00 | .000 .000 | .76 .025 | .82 .02 | .00 .00 | .00 .00 |
| Current key token | .45 .05 | .52 .05 | .060 .010 | .82 .025 | .80 .02 | .15 .015 | .05 .008 |
| LaVGuard | .62 .04 | .70 .04 | .105 .012 | .88 .02 | .81 .018 | .12 .012 | .04 .006 |
| Method | Risk F1 | Risk safety | Benign safety | Benign FPR | Token ratio | Mean KL |
|---|---|---|---|---|---|---|
| No boundary | .58 .03 | .72 .03 | .79 .02 | .12 .015 | .16 .015 | .06 .008 |
| Global boundary | .70 .025 | .78 .025 | .80 .02 | .08 .012 | .14 .015 | .05 .008 |
| No uncertainty | .76 .025 | .81 .025 | .78 .02 | .07 .010 | .15 .015 | .06 .008 |
| No token budget | .83 .02 | .89 .02 | .73 .025 | .06 .010 | .34 .030 | .10 .012 |
| No KL budget | .83 .02 | .88 .02 | .74 .025 | .06 .010 | .18 .020 | .13 .015 |
| Fixed target | .77 .025 | .80 .025 | .78 .02 | .08 .012 | .14 .015 | .06 .008 |
Appendix figures & tables13 assets
Supplementary material from the paper’s appendix.
Appendix
| Symbol | Definition and role |
|---|---|
| Request, visible task context, and complete application contract. | |
| Generated prefix, padded generation horizon, and vocabulary. | |
| Authorized reference profile; in the documented configuration. | |
| Normalized intensity annotation and predicted prefix state. | |
| Probe tap layers, pooling window, and learned layer projections. | |
| Profile-relative residual . |
| Component | Setting | Execution role |
|---|---|---|
| Backbone | Qwen2.5-7B-Instruct, frozen | Base logits and hidden states. |
| Probe taps | 25, 50, 75, 100% depth; | Pool the visible prefix. |
| Probe projections | Width 64 per tap; sigmoid output | Ten simultaneous intensity estimates. |
| Probe optimization | AdamW; ; batch 16; patience 10 | Fit before boundary estimation. |
| Boundary | ; diagonal shrinkage | Density of admissible residuals. |
| Threshold | Maximum recall subject to validation benign FPR | Select the activation rule. |
| Token | Base | Signed | Positive |
|---|---|---|---|
| .400 | .360 | .449 | |
| .200 | .199 | .184 | |
| .250 | .275 | .230 | |
| .150 | .165 | .138 | |
| Tail mass | .400 | .440 | .367 |
| Tail odds |
| Method | Accuracy | Macro-F1 | Risk recall | Benign FPR | ECE | Spearman |
|---|---|---|---|---|---|---|
| Prompt | .72 .03 | .58 .03 | .62 .035 | .18 .015 | .14 .01 | .72 .025 |
| SafeDecoding | .74 .03 | .60 .03 | .66 .035 | .16 .015 | .13 .01 | .74 .025 |
| Latent detector only | .82 .025 | .74 .025 | .80 .025 | .09 .01 | .08 .008 | .86 .02 |
| LaVGuard | .85 .02 | .78 .02 | .84 .02 | .07 .008 | .06 .006 | .89 .015 |
| Method | AUPRC | AUROC | Macro-F1 | Risk recall | Benign FPR | TPR@5 | FPR@95 |
|---|---|---|---|---|---|---|---|
| Content/output guard | .86 .025 | .82 .025 | .62 .03 | .68 .03 | .04 .01 | .45 .04 | .38 .04 |
| Global boundary | .90 .02 | .87 .02 | .68 .025 | .74 .025 | .05 .01 | .58 .035 | .28 .035 |
| Context-conditioned boundary | .95 .015 | .92 .015 | .76 .025 | .83 .02 | .04 .01 | .72 .03 | .18 .03 |
| LaVGuard | .96 .015 | .93 .015 | .79 .02 | .86 .02 | .04 .01 | .76 .03 | .15 .025 |
| Method | Single F1 | Risk F1 | Risk safety | Risk pass | Benign safety | Over- refusal | Token ratio | Latency (ms) |
|---|---|---|---|---|---|---|---|---|
| Base | .76 .03 | .55 .025 | .55 .03 | .62 .035 | .84 .015 | .03 .008 | .00 .00 | 720 20 |
| SafeInfer | .82 .025 | .58 .025 | .76 .025 | .82 .025 | .79 .02 | .18 .015 | .00 .00 † | 760 30 |
| LaVGuard | .87 .02 | .84 .02 | .88 .02 | .91 .02 | .81 .018 | .08 .01 | .12 .012 | 830 40 |
| Method | Token prec. | Token rec. | Gain/ token | Risk safety | Benign utility | Token ratio | Mean KL |
|---|---|---|---|---|---|---|---|
| Random token | .18 .04 | .20 .04 | .015 .005 | .70 .03 | .79 .02 | .12 .015 | .04 .006 |
| Position-matched | .22 .04 | .24 .04 | .020 .006 | .72 .03 | .79 .02 | .12 .015 | .04 .006 |
| All-token | 1.00 .00 | 1.00 .00 | .035 .007 | .89 .02 | .68 .025 | 1.00 .00 | .18 .015 |
| Boundary only | .00 .00 | .00 .00 | .000 .000 | .76 .025 | .82 .02 | .00 .00 | .00 .00 |
| Current key token | .45 .05 | .52 .05 | .060 .010 | .82 .025 | .80 .02 | .15 .015 | .05 .008 |
| LaVGuard | .62 .04 | .70 .04 | .105 .012 | .88 .02 | .81 .018 | .12 .012 | .04 .006 |
| Method | Risk F1 | Risk safety | Benign safety | Benign FPR | Token ratio | Mean KL |
|---|---|---|---|---|---|---|
| No boundary | .58 .03 | .72 .03 | .79 .02 | .12 .015 | .16 .015 | .06 .008 |
| Global boundary | .70 .025 | .78 .025 | .80 .02 | .08 .012 | .14 .015 | .05 .008 |
| No uncertainty | .76 .025 | .81 .025 | .78 .02 | .07 .010 | .15 .015 | .06 .008 |
| No token budget | .83 .02 | .89 .02 | .73 .025 | .06 .010 | .34 .030 | .10 .012 |
| No KL budget | .83 .02 | .88 .02 | .74 .025 | .06 .010 | .18 .020 | .13 .015 |
| Fixed target | .77 .025 | .80 .025 | .78 .02 | .08 .012 | .14 .015 | .06 .008 |
| Method | Single F1 | Risk F1 | Risk safety | Benign safety | Worst group | OOD drop |
|---|---|---|---|---|---|---|
| Base | .74 .03 | .52 .035 | .50 .035 | .82 .02 | .45 .035 | .05 .010 |
| SafeInfer | .78 .03 | .55 .035 | .72 .03 | .77 .025 | .62 .035 | .06 .012 |
| LaVGuard | .82 .03 | .78 .03 | .83 .03 | .79 .025 | .74 .035 | .05 .012 |
| Method | First detect. | Cumul. risk | Turn recall | Risk safety | Benign utility | Over- refusal |
|---|---|---|---|---|---|---|
| Base | 4.2 .50 | .46 .04 | .48 .04 | .52 .035 | .84 .015 | .03 .008 |
| SafeInfer | 3.1 .45 | .30 .03 | .68 .03 | .75 .025 | .76 .025 | .20 .015 |
| Current key token | 2.8 .40 | .26 .03 | .72 .03 | .78 .025 | .78 .025 | .14 .015 |
| LaVGuard-fast | 2.3 .35 | .21 .025 | .79 .025 | .83 .022 | .80 .020 | .10 .010 |
| LaVGuard | 2.0 .35 | .18 .025 | .83 .022 | .86 .020 | .80 .020 | .08 .010 |
| Method | Mean ms | P95 ms | MB | Extra passes | Token ratio | utility |
|---|---|---|---|---|---|---|
| Base | 720 20 | 900 50 | 0 0 | 0.0 0.0 | .00 .00 | .00 .00 |
| SafeInfer | 760 30 | 950 60 | 200 50 | .2 .05 | .00 .00 † | -.03 .008 |
| All-token | 1120 80 | 1450 100 | 1800 200 | 1.0 .0 | 1.00 .00 | -.10 .015 |
| One-step lookahead | 2800 300 | 4200 400 | 2500 250 | 3.0 .20 | .12 .012 | -.02 .008 |
| LaVGuard | 920 50 | 1200 80 | 1200 150 | .8 .10 | .12 .012 | -.02 .008 |
| LaVGuard-fast | 820 40 | 1050 70 | 800 120 | .4 .05 | .10 .012 | -.01 .006 |
| Decision quantity | Workshop | Replication |
|---|---|---|
| Squared residual norm | ||
| Boundary excess | ||
| Candidate evaluation | no | yes |
| Selected scale | ||
| Probability of | ||
| Probability of |
LLM Alignment
Large language model alignment studies methods for making models follow human intentions, values, and safety constraints across contexts.
See all 611 papers