Fast but forgetful: cross-agent KV reuse undermines the decision fidelity of LLM safety reviewFast but Forgetful: Cross-Agent KV Reuse Breaks Decision Fidelity in LLM Security Review
The authors evaluate the impact of cross-agent KV reuse on safety review: KVCOMM speeds up TTFT by an average of 2.52× on VIBE, but changes 40.6–85.7% of reports.
- Multi-agent security review processes the same code repeatedly across contexts. KV reuse can reduce prefill cost, but whether it preserves the rule-level security decisions of exact dense inference remains unclear.
- With the model, code, prompts, and decoding configuration fixed, KVCOMM and CacheBlend are compared in pairs against dense execution on the same input; decision fidelity is measured on VIBE, and the loss of vulnerability findings under external labels is measured on PrimeVul.
- KVCOMM has a hit rate of 65.8% on VIBE, and the average TTFT speedup across nine configurations is 2.52×, but it changes 40.6–85.7% of reports. CacheBlend partial recomputation also changes decisions, and on PrimeVul there is loss of external-label findings.
- The authors note that dense is not the security ground truth, and the evaluated models are relatively weak standalone vulnerability detectors; the experiments cover only three 3B–7B open-source models, one two-agent topology, and one policy, and do not explain the FAIL→NA mechanism or mitigations beyond the evaluation threshold.
- Benchmarks
- MINIMAXAI/VIBEPrimeVul
- Metrics
- Hit RateTTFT speedupReport deviationApplicable-only agreementVulnerability silencing S∆FAILTarget-CWE recallTarget-CWE FPRSGT
Through paired experiments, researchers find that cross-context KV cache reuse accelerates inference while changing the decisions of LLM safety review. The experiments compare KVCOMM, CacheBlend, and exact dense inference on the same inputs across three open-weight models: Qwen2.5-3B-Instruct, Llama-3.2-3B-Instruct, and Qwen2.5-Coder-7B-Instruct. In 533 paired executions, KVCOMM incorporates 65.8% of verifier calls into reuse and achieves an average 2.52× TTFT speedup, but changes 40.6–85.7% of safety reports, and 21.7–89.5% of dense vulnerability findings are silently suppressed, most of them changing from Fail to Not Applicable; the code-specialized model shows a net reduction in findings, while the general models replace them with different findings. CacheBlend likewise changes decisions under partial recomputation, and the deviation disappears under a full recomputation control; PrimeVul experiments show that both mechanisms suppress detections corresponding to externally annotated vulnerabilities.
Why it was selectedThe paper uses paired experiments to quantify the extent to which KV cache reuse, while accelerating inference, changes safety review conclusions; this can be used to assess decision fidelity before deploying such optimizations in safety-critical workflows.
Related events and news
1 events · 0 news mentions
- This event's paper
跨上下文KV缓存复用改变LLM安全审查决策
Paper analysis
What problem does this paper attempt to solve?
Study whether cross-context KV reuse can preserve the dense decisions of security review while accelerating inference.
The core question is: does reusing the KV cache of the same code across agents change the decisions that the downstream security verifier originally produced via exact dense inference.
- Problem setting: The upstream generation agent AG produces code c, and the downstream verification agent AV prefills the same code again under different system prompts and dialogue contexts, forming the repeated computation AG → c → AV. The authors use systems such as AgenticSCR, which separate vulnerability detection from verification, to illustrate this setting.
- Gap in existing research: CacheBlend, EPIC, and KVCOMM reduce prefill cost, but the authors argue that approximate reuse is not necessarily behavior-neutral; existing work discusses changes in LLM judge verdicts and the context isolation risk of HijackKV, but has not yet examined rule-level decisions when the reused content itself is evidence for security review.
- Core setup: The authors define the problem as inference fidelity, not absolute vulnerability detection accuracy. Dense inference is the exact-execution reference for the same model and same input, not the ground truth of vulnerabilities; even if aggregate accuracy is unchanged, individual dense vulnerability findings may disappear.
- Research object and boundaries: This is not a threat-model experiment in which an attacker injects or manipulates the cache, but a measurement of behavioral deviation introduced by serving optimization. The intervention is only receiver-side KV approximation; the model, code, prompts, security policy, and decoding configuration are fixed.
- Paper contributions: Build a generator–verifier paired pipeline, evaluate KVCOMM on three open-source models, and reproduce with CacheBlend; further analyze PASS, FAIL, NOT APPLICABLE (NA) transitions and the loss of findings corresponding to external PrimeVul labels.
What related research exists?
Related work falls into three groups: agent safety review, KV cache optimization, and the behavioral and safety risks of reuse.
Agentic software engineering and security code review
- ChatDev (Qian et al., 2024), MetaGPT (Hong et al., 2024), AgentCoder (Huang et al., 2023): Organize multi-agent software development through role division, standardized collaboration processes, and the separation of generation, testing, and execution, respectively.
- AgenticSCR (Charoenwet et al., 2026): Assigns vulnerability detection and verification to different agents; Pearce et al. (2025), Khoury et al. (2023), and Pandey and Kumar (2026) study the security of one-shot LLM code generation, and Singh et al. (2026) discuss iterative self-review and verification.
- Zhou et al. (2025), Far and Feyzi (2025), Fan et al. (2023): Study vulnerability detection and automated repair, respectively. The paper notes that these works mainly study model capability under conventional inference, whereas this paper instead examines whether cross-agent representation reuse preserves security decisions.
KV cache and cross-context reuse
- vLLM (Kwon et al., 2023), SGLang (Zheng et al., 2024): Support exact prefix caching, avoiding recomputation of identical prefixes; different system instructions or histories form context-dependent KV representations.
- Orca, LLM.int8(), KIVI, H2O, StreamingLLM, SnapKV, Prompt Cache: Cover scheduling and memory management, model or cache quantization, token eviction, and precomputed prompt modules; the paper summarizes them as reuse aimed at memory efficiency, long contexts, or compatible prompt structures.
- CacheBlend (Yao et al., 2025), EPIC (Hu et al., 2025), KVCOMM (Ye et al., 2025): Use selective recomputation, position-independent reuse, and anchor-based offset and position correction, respectively, extending reuse beyond exact prefixes.
Behavioral and security risks of reuse
- Liang et al. (2026): Study how cross-context reuse in LLM-as-a-Judge weakens cross-candidate interaction and changes verdicts.
- HijackKV (Zhang et al., 2026): Points out that position-independent KV states may retain information from the original computation context, creating an isolation risk.
- Positioning of this paper: The authors state that the above studies do not examine the reuse of program evidence that serves as the basis for agent security decisions, and therefore directly evaluate rule-level verdict fidelity.
Controls and data: The experiments do not include a separate vulnerability detection model baseline; the execution control is dense prefill on the same input, KVCOMM and CacheBlend are the evaluated reuse mechanisms, and r=1 is the full recomputation control within the CacheBlend path. The data use MINIMAXAI/VIBE and PrimeVul.
How does the paper address this problem?
Same-input dense–reuse pairs isolate KV approximation, and fidelity is measured through efficiency, verdict shifts, and label consequences.
The overall approach is to have the generator always generate code densely, then have the same verifier reuse code spans via KVCOMM or CacheBlend, and compare against execution with exactly the same dense input; only requests where approximation actually occurred enter the fidelity analysis.
Paired procedure and intervention control
- Fixed input: each dense–reuse pair contains the same system instruction, task, generated code, safety policy and report format request; only code spans are directly reused, while verifier instructions and policy tokens are not reused.
- Reuse first, then reference: KVCOMM first follows the natural gating path; a gate hit produces an approximate report R, then a measurement-only dense prefill yields D, and D is not written back to the online anchor pool, so that reference collection does not affect subsequent reuse.
- Compare only gate hits: gate misses go dense and are counted only toward reuse coverage, not forming fidelity pairs. In the control described in Appendix A, disabling approximation exactly reproduces the paired dense reference, on which basis the authors rule out the evaluation framework, parsing and residual nondeterminism as sources of deviation.
Two reuse mechanisms
- KVCOMM four stages: anchor matching compares candidate value representations with length-compatible anchors via di=‖ Vc−Vi‖2; gating is then performed by the entropy of the similarity distribution, and on a hit K and V are reconstructed with the anchor offset, followed by correction of the receiver-side positions.
- Gating condition: reuse is allowed when H(p)≤γlog2 n, otherwise it falls back to dense prefill. Experiments take γ∈{0.1, 0.3, 0.5}, with at most 20 active anchors in the online pool, and the implementation-native least-frequently-used eviction when the limit is reached.
- CacheBlend: independently prefilled reusable chunks are merged and tokens are selectively recomputed; the recomputation count is m(r)=⌊rNns⌋. VIBE takes r∈{0, 0.04, 0.08, 0.16, 0.32, 0.5, 0.75, 1}, PrimeVul takes {0, 0.16, 1}, and 0.16 is the default value.
- Full recomputation control: r=1 recomputes all eligible tokens but retains CacheBlend's chunk materialization and fusion, so it is not an independent conventional dense prefill.
Data, policies and inference configuration
- VIBE: 90 unlabeled application development prompts are drawn from MINIMAXAI/VIBE, stratified by five domains and three difficulty levels; used to determine whether dense decisions are preserved, not to measure absolute detection accuracy.
- PrimeVul: 100 vulnerable functions and their respective 100 patched counterparts are used, covering ten target CWEs; the policy is replaced with ten rules for the corresponding CWEs. A dedicated CodeProvider exactly prefills the functions, and vulnerable and patched versions are swept separately to avoid cross-arm anchor contamination.
- Verdict semantics: each rule must output one of PASS, FAIL or NA; NA is used only when the rule's subject (e.g., passwords, session tokens, database queries) is absent, and is not an uncertain or abstention category.
- Models and decoding: Qwen2.5-3B-Instruct, Llama-3.2-3B-Instruct, Qwen2.5-Coder-7B-Instruct; all use greedy decoding, with a maximum generation of 6000 tokens, sampling disabled, and paired execution with fixed software seed and decoding configuration.
Metrics and statistics
- Efficiency and deviation: Hit Rate is Nhit/N; TTFT speedup is the dense TTFT of each pair divided by the reuse TTFT; Changed counts reports in which at least one rule changed, and Agreement counts only rules where dense is PASS/FAIL.
- Finding loss and net change: S is the proportion of dense FAILs that become PASS or NA under reuse; L and A count lost and newly added FAILs respectively, and ∆FAIL=1000(A−L)/number of rule comparisons, with negative values indicating fewer findings after reuse.
- Intervals and tests: L vs. A uses an exact two-sided McNemar test; S and ∆FAIL use 95% percentile intervals from 5000 artifact-level bootstrap resamples, and PrimeVul proportions with small denominators use 95% Wilson intervals.
- Parsing rules: pairs in which any report is unparseable are excluded, and the analyzable n is reported; Appendix B additionally gives per-side parsing results and an all-attempt analysis that counts unparseable reuse reports as lost. PrimeVul additionally measures target-CWE recall, FPR and SGT under external labels.
What experiments did the paper conduct?
KVCOMM speeds up but frequently changes verdicts; CacheBlend reproduces deviations, and PrimeVul shows that labeled vulnerability findings are also lost.
Experimental setup
- Models under test: Qwen2.5-3B-Instruct, Llama-3.2-3B-Instruct, Qwen2.5-Coder-7B-Instruct; CacheBlend supports only the two Qwen configurations, and the required Llama configuration was not run.
- VIBE scale: 90 tasks; KVCOMM is 3 models×3 thresholds, 90 calls per cell, 810 in total, with 533 gate hits. CacheBlend is 90 attempts per cell, with 8 r values for each of the two models.
- PrimeVul scale: 100 vulnerable and 100 patched attempts per cell; KVCOMM measures SGT only on gate hits, and CacheBlend has no corresponding gate.
- Execution controls: KVCOMM uses the Hugging Face Transformers stack, and CacheBlend uses a separate fixed vLLM stack; all comparisons are against a dense reference on the same stack, and no direct cross-stack performance comparison is made.
- Decision method: the verifier itself outputs PASS/FAIL/NA for ten rules; the paper does not use an LLM judge or human accuracy review, and metrics are computed from parsed rule verdicts.
- Statistics and repetition: 5000 artifact-level bootstrap and exact McNemar tests; the main table is not multiple independent repetitions. Appendix C reran Qwen2.5-Coder-7B, γ=0.3 after three months, and 62/90 hits and all 62 verdict pairs reproduced exactly.
Main results
According to Table 1 and Table 2; all are KVCOMM gate-hit pairs on VIBE, Changed is the report change rate, and S is conditioned on dense FAIL.
Swipe horizontally to read the table
Model γ n Changed S Lost / Added ∆FAIL (per thousand comparisons) Qwen2.5-3B-Instruct 0.1 49 71.4% 21.7% 5 / 12 +14.3, p=0.14 Qwen2.5-3B-Instruct 0.3 61 73.8% 29.0% 9 / 11 +3.3, p=0.82 Qwen2.5-3B-Instruct 0.5 66 71.2% 25.7% 9 / 16 +10.6, p=0.23 Qwen2.5-Coder-7B-Instruct 0.1 51 52.9% 89.5% 34 / 0 −66.7, p<0.001 Qwen2.5-Coder-7B-Instruct 0.3 62 41.9% 89.5% 34 / 0 −54.8, p<0.001 Qwen2.5-Coder-7B-Instruct 0.5 69 40.6% 89.5% 34 / 0 −49.3, p<0.001 Llama-3.2-3B-Instruct 0.1 41 85.4% 28.6% 4 / 21 +41.5, p<0.001 Llama-3.2-3B-Instruct 0.5 70 85.7% 38.9% 14 / 31 +24.3, p=0.02 The table omits Llama γ=0.3 to control row count: n=64, Changed 84.4%, S 35.3%, Lost/Added 12/26, ∆FAIL +21.9, p=0.03 (Table 2).
- Efficiency: Table 1 reports an overall hit rate of 65.8% (533/810) across nine configurations, and the unweighted mean of the per-cell average TTFT speedup is 2.52×; speedups by model are Qwen2.5-3B 1.81–1.90×, Coder-7B 1.74–1.82×, Llama 3.77–4.00×.
- Net effect varies by model: Coder-7B has a net loss at every threshold, Llama has a net increase at every threshold, and Qwen2.5-3B shows no significant difference at any threshold; the authors therefore emphasize that reuse did not preserve “which findings,” rather than uniformly reducing the number of findings.
- Concentrated denominator: dense FAIL accounts for only 3.4–7.5% of rule comparisons in each configuration; Coder-7B's 38 dense FAILs come from 8 artifacts, its 34 silenced findings come from 7 of them, and the three thresholds are the same batch of artifacts, not three independent repetitions.
Verdict shifts and rule differences
- NA is the main exit: the Figure 2 caption gives changed comparisons as 259/1410, 332/1870, 361/2050 (γ=0.1/0.3/0.5); the main text states that about 90% of changed comparisons have NA on at least one side, with the dominant shift being PASS→NA, followed by NA→PASS.
- Silencing is mostly not directly to PASS: at the three thresholds, 40/43, 47/55, and 49/57 dense findings go FAIL→NA, with only 3–8 going directly to PASS; the Discussion summarizes FAIL→NA across models as 85.5–93.0% of silenced findings.
- Differences across rules: Table 3 at γ=0.3 over 187 pooled gate hits shows No hardcoded credentials at 89.4% (143/160), while CSPRNG session tokens, Lockout/rate limiting, and Single-use expiring tokens are all 0.0%, with denominators of only 11, 8, and 7 respectively.
CacheBlend reproduction and efficiency
- Partial recomputation still changes verdicts: in Table 5, Changed for the two Qwen models ranges from 34.4–96.7%; Coder-7B has S=100.0% (37/37) at r=0, 78.4% (29/37) at r=0.16, and still 8.1% (3/37) at r=0.75.
- Full recomputation control goes to zero: both models at r=1 have Changed 0.0%, Agreement 100.0%, and Lost/Added 0/0; the authors state that this links the deviation to the degree of KV approximation, but this control still differs from independent dense prefill.
- Cost under two accounting conventions: fused-only in Table 4 is 1.87–3.12× at r=0 and 0.16; after also counting the single materialization, all 540 executions are slower than same-stack dense, with a case-weighted average end-to-end ratio of 0.24×.
PrimeVul external-label results
- KVCOMM loses label findings: in Table 6, SGT for Qwen2.5-3B is 41.7% (5/12) to 46.2% (6/13), and for Coder-7B is 66.7% (8/12) to 69.2% (9/13); Llama has only 2–4 paired dense true positives per cell, and the paper reports only counts, not interpreting them as rates.
- Marginal metrics can mask paired loss: for Qwen2.5-3B, KVCOMM γ=0.1, dense and reuse target-CWE recall are both 14.8%, but reuse loses 5/12 paired dense true positives, offset by target-FAIL on other functions.
- CacheBlend exceptions: Qwen2.5-3B has SGT of 27.3% (3/11) and 28.6% (2/7) at r=0 and 0.16; Coder-7B is 100.0% (13/13) in both cells, but reuse has no target-CWE FAIL on either vulnerable or patched, which the authors explain as verdict collapse rather than selective suppression of these 13 findings.
- Parse coverage effect: in Table 7, after counting unparseable reuse reports as lost, Qwen2.5-3B CacheBlend all-attempt SGT rises from 3/11 to 7/15 (r=0) and from 2/7 to 10/15 (r=0.16); KVCOMM SGT is unchanged.
Other ablations and analyses
- Task order: for Coder-7B, γ=0.3, the two shuffled orders give S of 89.5% and 87.1%, and Changed of 79.5% and 54.1% (Table 8).
- Reversed rule order: in the same cell, S drops to 52.4% (11/21), ∆FAIL=+3.2, p=0.84, and the original net loss disappears (Table 8).
- Tighter thresholds: S for Coder-7B is 89.5% at all three γ, for Qwen2.5-3B is 21.7%, 29.0%, 25.7%, and for Llama increases with γ to 28.6%, 35.3%, 38.9% (Table 2).
- Generation truncation: among the 90 VIBE artifacts, Coder-7B has 0 truncated, Qwen2.5-3B has 9, and Llama has 37 (Appendix D).
- Cross-stack dense differences: dense execution on the two serving stacks disagrees on 33.3% of reports and 11.6% of findings, so the paper makes only same-stack comparisons (Appendix D).
What are some points that can be further explored?
The authors list limitations including ground truth, model scale, policy sensitivity, and mechanism, and decision drift needs to be explained and mitigated in future work.
Limitations and future directions noted by the authors
- dense is not a safety ground truth: the models under test are weaker standalone vulnerability detectors, and the authors state that the results should not be extrapolated to capable security reviewers (Section 6, Limitations).
- Labels and samples are concentrated: PrimeVul has a small true-positive denominator per configuration, and VIBE findings are also concentrated in a few artifacts (Section 6). target-CWE FAIL is still coarse matching and cannot prove that the explanation localized the specific defect fixed by the patch (Appendices B, D).
- Limited coverage: only three small open-source models, one dual-agent topology, and one authentication-oriented policy (Section 6).
- Mechanism and mitigation unresolved: the paper does not establish the mechanism of the FAIL→NA shift, nor does it evaluate mitigations other than entropy thresholding (Section 6).
- Policy format sensitivity: reversing the rule order roughly halves the silencing in the corresponding Coder-7B cell; only one alternative order was tested, and alternative policy wording was not tested (Section 6, Appendix D).
- External validity untested: frontier-model scale, heterogeneous agent models, deeper or multi-turn interaction, other decoding strategies, and broader secure-coding policies were not measured (Appendix D, External validity).
Scope of experimental coverage
- Models and scale: three models under test, all 3B–7B open-source instruction models; CacheBlend was run only on the two Qwen models (Section 4.3, Appendix A).
- Tasks and topology: VIBE is 90 unlabeled prompts; PrimeVul is 100 vulnerable and 100 patched attempts per cell, and the pipeline is single-generator to single-verifier in both (Section 4.1, 4.5).
- Reuse and defense evaluation: the reuse mechanisms are KVCOMM and CacheBlend; the mitigation variables include only the KVCOMM entropy threshold and the CacheBlend recomputation ratio, and no other defenses were evaluated (Section 4.4, Section 6).
- Selection conditions: KVCOMM fidelity covers only the subpopulation selected by the gate, and changing γ also changes the treated population, so it cannot be regarded as repeated measurement on the same task set (Appendix D).
- Environment and reproduction: experiments ran on one NVIDIA H100 with greedy decoding and a 6000-token limit; the main results do not report the number of independent repetitions per cell, and Appendix C reports only a latency rerun of one KVCOMM cell (Section 4.3, Appendices C, D).
Summarize the main content of the paper
Through paired experiments, the paper shows that the TTFT gains from KV reuse may be accompanied by drift in safety review decisions.
This is an inference fidelity study for multi-agent security code review, concerned with whether serving optimization preserves the decisions that the same model would make under exact execution, rather than comparing the absolute capability of vulnerability detectors.
- Problem: The generation agent and the verification agent process the same code in different contexts, so exact prefix caching cannot be reused directly; approximate reuse such as KVCOMM and CacheBlend reduces prefill but may change rule-level security verdicts.
- Method: With code, prompts, model, and greedy decoding fixed, reuse reports are paired with dense reports on the same input. VIBE measures Changed, Agreement, S, and ∆FAIL; PrimeVul measures SGT using external CWE labels; dense serves only as the execution reference.
- Efficiency results: KVCOMM hit 533 of the 810 verification requests on VIBE, a hit rate of 65.8%; the unweighted mean of the average TTFT speedup across the nine model–threshold configuration cells is 2.52× (Table 1).
- Fidelity results: Across configurations, KVCOMM changed 40.6–85.7% of gate-hit reports and silences 21.7–89.5% of dense FAIL findings (Table 2). Coder-7B has a net loss of findings, Llama a net increase, and Qwen2.5-3B shows no significant net difference.
- Transitions and reproduction: Most silenced findings shift from FAIL to NA rather than directly to PASS; CacheBlend also changes decisions under all partial recomputation settings, and in the r=1 full recomputation control both Qwen models recover 0% Changed and 100% Agreement (Table 5).
- Consequences under external labels: On PrimeVul, KVCOMM's SGT is 41.7–46.2% for Qwen2.5-3B and 66.7–69.2% for Coder-7B; even when the marginal recall of dense and reuse is the same, paired true positives can still be lost (Table 6).
The authors accordingly argue for decision-level fidelity as an evaluation criterion for deploying approximate KV reuse in safety-critical agent workflows. The authors also emphasize that small true-positive denominators, concentration in a few artifacts, sensitivity to rule order, and coverage of only small models and a single topology limit numerical extrapolation; the FAIL→NA mechanism and mitigations beyond the threshold remain to be studied.
Research lineage
1 foundations · 0 follow-ups in libraryNo later in-library follow-ups recorded yet.
Hover or focus a connected paper to inspect the citation context.