Cross-context KV-cache reuse speeds up LLM security review but silently changes 40–86% of reports and suppresses 22–90% of vulnerability findings relative to exact dense inference on the same input.
| Model | Changed | Agreement | Vuln. Marking | Silencing | Lost / Added | ||||
|---|---|---|---|---|---|---|---|---|---|
| Qwen2.5-3B-Instruct | 0.1 | 49 | 71.4% (35/49) | 48.6% (71/146) | 4.7% (23/490) | 21.7% [5.0, 40.0] | 5 / 12 | [, 34.7] | 0.14 |
| 0.3 | 61 | 73.8% (45/61) | 50.8% (92/181) | 5.1% (31/610) | 29.0% [10.3, 48.3] | 9 / 11 | [, 23.0] | 0.82 | |
| 0.5 | 66 | 71.2% (47/66) | 53.3% (104/195) | 5.3% (35/660) | 25.7% [8.8, 44.1] | 9 / 16 | [, 30.3] | 0.23 | |
| Qwen2.5-Coder-7B-Instruct | 0.1 | 51 | 52.9% (27/51) | 70.0% (98/140) | 7.5% (38/510) | 89.5% [64.5, 100] | 34 / 0 | [, ] | 0.001 |
| 0.3 | 62 | 41.9% (26/62) | 73.9% (122/165) | 6.1% (38/620) | 89.5% [64.0, 100] | 34 / 0 | [, ] | 0.001 | |
| 0.5 | 69 | 40.6% (28/69) | 75.4% (129/171) | 5.5% (38/690) | 89.5% [64.0, 100] | 34 / 0 | [, ] | 0.001 | |
| Llama-3.2-3B-Instruct | 0.1 | 41 | 85.4% (35/41) | 60.1% (122/203) | 3.4% (14/410) | 28.6% [0.0, 53.8] | 4 / 21 | [19.5, 63.4] | 0.001 |
| 0.3 | 64 | 84.4% (54/64) | 65.9% (193/293) | 5.3% (34/640) | 35.3% [20.0, 50.0] | 12 / 26 | [4.7, 39.1] | 0.03 | |
| 0.5 | 70 | 85.7% (60/70) | 63.0% (206/327) | 5.1% (36/700) | 38.9% [23.5, 54.2] | 14 / 31 | [7.1, 41.4] | 0.02 | |
| Pooled | 0.1 | 141 | 68.8% (97/141) | 59.5% (291/489) | 5.3% (75/1410) | 57.3% [34.3, 73.2] | 43 / 33 | [, 14.2] | 0.30 |
| 0.3 | 187 | 66.8% (125/187) | 63.7% (407/639) | 5.5% (103/1870) | 53.4% [36.1, 67.0] | 55 / 37 | [, 7.0] | 0.08 | |
| 0.5 | 205 | 65.9% (135/205) | 63.3% (439/693) | 5.3% (109/2050) | 52.3% [34.9, 65.5] | 57 / 47 | [, 11.2] | 0.38 |
Going deeper
| Model | Changed | Agreement | Silencing | Lost / Added | ||||
|---|---|---|---|---|---|---|---|---|
| Qwen2.5-3B-Instruct | 0.00 | 83 | 95.2% (79/83) | 84.0% (173/206) | 41.1% (23/56) [29.0, 53.0] | 23 / 15 | [, 4.8] | 0.26 |
| 0.04 | 67 | 83.6% (56/67) | 69.7% (115/165) | 19.1% (9/47) [9.1, 30.6] | 9 / 20 | [0.0, 32.3] | 0.06 | |
| 0.08 | 89 | 83.1% (74/89) | 67.3% (152/226) | 21.3% (13/61) [11.3, 31.2] | 13 / 24 | [, 26.7] | 0.10 | |
| 0.16 | 90 | 73.3% (66/90) | 63.9% (145/227) | 14.8% (9/61) [6.0, 24.2] | 9 / 24 | [3.3, 30.0] | 0.01 | |
| 0.32 | 90 | 67.8% (61/90) | 64.8% (147/227) | 6.6% (4/61) [0.0, 14.5] | 4 / 33 | [17.8, 47.8] | 0.001 | |
| 0.50 | 90 | 64.4% (58/90) | 63.9% (145/227) | 11.5% (7/61) [3.5, 20.3] | 7 / 31 | [12.2, 41.1] | 0.001 | |
| 0.75 | 90 | 60.0% (54/90) | 73.1% (166/227) | 16.4% (10/61) [7.4, 26.6] | 10 / 22 | [0.0, 26.8] | 0.05 | |
| 1.00 | 90 | 0.0% (0/90) | 100.0% (227/227) | 0.0% (0/61) | 0 / 0 | 0.0 | – | |
| Qwen2.5-Coder-7B-Instruct | 0.00 | 90 | 96.7% (87/90) | 77.1% (162/210) | 100.0% (37/37) [100, 100] | 37 / 11 | [, 8.9] | 0.001 |
| 0.04 | 90 | 93.3% (84/90) | 76.2% (160/210) | 83.8% (31/37) [57.1, 100] | 31 / 3 | [, ] | 0.001 | |
| 0.08 | 90 | 86.7% (78/90) | 67.1% (141/210) | 78.4% (29/37) [46.2, 96.4] | 29 / 58 | [, 88.9] | 0.003 | |
| 0.16 | 90 | 80.0% (72/90) | 60.5% (127/210) | 78.4% (29/37) [46.3, 96.4] | 29 / 24 | [, 35.6] | 0.58 | |
| 0.32 | 90 | 64.4% (58/90) | 64.8% (136/210) | 40.5% (15/37) [12.1, 75.6] | 15 / 14 | [, 30.0] | 1.00 | |
| 0.50 | 90 | 58.9% (53/90) | 69.5% (146/210) | 16.2% (6/37) [0.0, 42.9] | 6 / 34 | [4.4, 64.4] | 0.001 | |
| 0.75 | 90 | 34.4% (31/90) | 86.7% (182/210) | 8.1% (3/37) [0.0, 26.7] | 3 / 11 | [, 23.3] | 0.06 | |
| 1.00 | 90 | 0.0% (0/90) | 100.0% (210/210) | 0.0% (0/37) | 0 / 0 | 0.0 | – |
Imagine you hire two inspectors to check a building. The first walks every room and writes notes. The second inspector gets the first one's notes instead of walking the rooms again, saving time. The question is: does the second inspector reach the same conclusions?
This paper runs the experiment. A code-generating AI writes a program, and a security-reviewing AI checks it for vulnerabilities. Normally the reviewer reads the code from scratch. With KV-cache reuse, it borrows the generator's internal representation of that code instead. The reviewer sees the same code either way, and everything else is identical.
The result: borrowing saves about half the startup time, but it changes 40–86% of security reports and silences up to 90% of the vulnerability findings the reviewer would have flagged on its own. Most silenced findings do not flip from bad to good; they flip from bad to does-not-apply, as though the reviewer forgot the topic existed. A second reuse method shows the same drift, and it disappears only when every token is recomputed.
The abstract, word for word, with the seven densest phrases unpacked.
Multi-agent software engineering increasingly relies on specialized agents to generate, review, and validate code, creating redundancy when the same program is processed across different contexts. Cross-context key–value (KV) cache reuse can reduce this cost, but whether it preserves security-critical decisions remains unclear1. We study this as an inference-fidelity problem2 by holding the model, code, prompt, and decoding configuration fixed and comparing approximate reuse against identical-input exact dense inference. Across 533 paired gate-hit executions spanning three open-weight models, KVCOMM admits 65.8% of validator calls to reuse and achieves a mean 2.52 × TTFT speedup3. Yet approximate execution changes 40.6–85.7% of security reports and silences 21.7–89.5% of dense vulnerability findings4. Most silenced findings transition from Fail to Not Applicable rather than to Pass5. The net effect on the number of findings is model-dependent: on a common denominator, reuse removes findings for the code-specialized model but replaces them with different findings for the general-purpose models, so the reported set of vulnerabilities is not preserved even where its size is. A structurally distinct KV-reuse method, CacheBlend, also alters decisions under partial recomputation, and the deviation vanishes under an all-recompute control6. PrimeVul experiments further show that both mechanisms can suppress dense detections corresponding to externally labeled vulnerabilities7. Cross-context KV reuse can therefore improve inference efficiency while silently altering downstream security behavior.
Two lines of work converge: multi-agent LLM systems and cross-context KV-cache reuse.
Read five parts of it, in this order.
Skip Section 2 if you know vLLM, KVCOMM, and CacheBlend. Skip Appendices C and D unless you plan to reproduce.
If the fidelity loss is smaller than it looks, these are the places to check.
These rates should be interpreted with their denominators in mind. Dense Fail verdicts constituted only 3.4–7.5% of rule comparisons in each configuration, so silencing is conditioned on a much smaller population than overall agreement, and its intervals are wide. The Qwen2.5-Coder-7B-Instruct result is also concentrated: its 38 dense Fail verdicts come from 8 artifacts, and all 34 silenced findings come from 7 of them. These are the same artifacts at every threshold, because the additional tasks admitted at higher γ contributed no dense findings of their own. The repeated 89.5% is therefore one observation over seven artifacts, not three independent replications.
| Variant | Changed | Agreement | Silencing | Lost / Added | Exit via NA | ||
|---|---|---|---|---|---|---|---|
| Original | 62 | 41.9% (26/62) | 73.9% (122/165) | 89.5% (34/38) [64.0, 100] | 34 / 0 | [, ] | 31/34 |
| Task order, seed 1 | 73 | 79.5% (58/73) | 62.8% (115/183) | 89.5% (34/38) [65.0, 100] | 34 / 0 | [, ] | 31/34 |
| Task order, seed 2 | 74 | 54.1% (40/74) | 79.0% (143/181) | 87.1% (27/31) [54.5, 100] | 27 / 6 | [, 2.7] | 24/27 |
| Rules reversed | 62 | 54.8% (34/62) | 88.7% (141/159) | 52.4% (11/21) [26.3, 78.6] | 11 / 13 | [, 19.4] | 7/11 |
The evaluation covers three open-weight models at the 3B–7B scale, one two-agent generator–validator topology, greedy decoding, a single accelerator environment, and ten authentication-oriented security controls. Behavior at frontier-model scale, with heterogeneous agent models, over deeper or multi-round agent interactions, under different decoding strategies, or across broader secure-coding policies remains unmeasured.
Nothing on this page was recomputed. Every claim points to the paper so you can check it.
More latest news
Read all