{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/arxiv-2605-18053","title":"Protection Is (Nearly) All You Need: Structural Protection Dominates Scoring in Globally Capped KV Eviction","arxiv_id":"2605.18053","date":"2026-05-18","proceeding":null,"authors":["Gabriel Garcia"],"abstract":"We study KV cache eviction under a shared globally capped decode-time harness. Seven policies (LRU, H2O, SnapKV, StreamingLLM, Ada-KV, QUEST, Random) share a prompt-boundary vulnerability: without structural protection, they collapse to near-zero quality on six pure-transformer models (F1$\\leq$0.064). Reserving 10\\% of cache at each boundary recovers 69--90\\% of the $C{=}2{,}048$ reference-ceiling quality on seven LongBench models at $C{=}256$ (13\\% retention); a ten-model panel spans 68--98\\%. An attention-mass pilot (Qwen2.5-3B, $N{=}30$) suggests why: the position-0 sink holds ${\\sim}75\\%$ of prefix mass, while other boundary tokens sit near ${\\sim}0.41{\\times}$ uniform expectation, so attention scorers retain the sink but still drop structurally critical tokens. With protection, simplified score-isolation variants are TOST-equivalent to LRU at $K{=}32$ ($Δ{=}0.02$); at $K{=}8$, attention policies pairwise converge yet beat LRU by 0.011--0.021 F1 across $C{=}256$ and $C{=}512$. Faithful Ada-KV/QUEST add ${\\sim}0.03$--$0.04$ F1 on Mistral-7B and Phi-3.5 beyond simplified variants. A NIAH-32K regime-transfer pilot on Qwen3-4B (decode vs.\\ prefill, $C{\\in}\\{512,2048\\}$) shows near-identical protection lifts (ratio 0.99--1.00). At 64K, protection helps but recovery is modest; faithful per-head scoring matches full-cache ceiling on Gemma-3-4B at 6.3\\% retention only when the model already supports strong 64K retrieval without eviction. Overall: protection dominates; scoring differences are secondary once boundaries are guarded; per-head allocation gives a further modest gain.","url_abs":"https://arxiv.org/abs/2605.18053","url_pdf":"https://arxiv.org/pdf/2605.18053","source":{"archive":null,"snapshot":"2025-07-28","note":"not in the Papers with Code archive (frozen at the snapshot)","row_kind":"graph","title_abstract_authors_date":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)"},"code_links":[],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2605.18053","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2605.18053"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/gpgabriel25/KVCacheBoundaryProtection","reach":null}],"summary":{"ran":2,"unverified":4},"by_repo_kind":{"found_in_text":{"samples":6,"ran":2,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":6,"samples":[{"code_sha256_prefix":"ee1da01d035102ce","entry":"build_feature_vector","repo":"gpgabriel25/KVCacheBoundaryProtection","repo_kind":"found_in_text","path":"src/counterfact_kv_eviction/interfaces.py","file_url":"https://github.com/gpgabriel25/KVCacheBoundaryProtection/blob/HEAD/src/counterfact_kv_eviction/interfaces.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"ee1da01d035102ce"}},{"code_sha256_prefix":"a10d2a66c1c0a302","entry":"inspect_safetensors_metadata","repo":"gpgabriel25/KVCacheBoundaryProtection","repo_kind":"found_in_text","path":"src/counterfact_kv_eviction/jax_safetensors_loader.py","file_url":"https://github.com/gpgabriel25/KVCacheBoundaryProtection/blob/HEAD/src/counterfact_kv_eviction/jax_safetensors_loader.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"a10d2a66c1c0a302"}},{"code_sha256_prefix":"ddc2c864fdaa555c","entry":"batch_predict","repo":"gpgabriel25/KVCacheBoundaryProtection","repo_kind":"found_in_text","path":"src/counterfact_kv_eviction/estimator.py","file_url":"https://github.com/gpgabriel25/KVCacheBoundaryProtection/blob/HEAD/src/counterfact_kv_eviction/estimator.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"ddc2c864fdaa555c"}},{"code_sha256_prefix":"e9fecb08058e345e","entry":"check_safetensors_compatibility","repo":"gpgabriel25/KVCacheBoundaryProtection","repo_kind":"found_in_text","path":"src/counterfact_kv_eviction/jax_safetensors_loader.py","file_url":"https://github.com/gpgabriel25/KVCacheBoundaryProtection/blob/HEAD/src/counterfact_kv_eviction/jax_safetensors_loader.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"e9fecb08058e345e"}},{"code_sha256_prefix":"493e64524493507b","entry":"check_safetensors_file_compatibility","repo":"gpgabriel25/KVCacheBoundaryProtection","repo_kind":"found_in_text","path":"src/counterfact_kv_eviction/jax_safetensors_loader.py","file_url":"https://github.com/gpgabriel25/KVCacheBoundaryProtection/blob/HEAD/src/counterfact_kv_eviction/jax_safetensors_loader.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"493e64524493507b"}},{"code_sha256_prefix":"7ce53772f6a98f99","entry":"load_model","repo":"gpgabriel25/KVCacheBoundaryProtection","repo_kind":"found_in_text","path":"src/counterfact_kv_eviction/jax_inference.py","file_url":"https://github.com/gpgabriel25/KVCacheBoundaryProtection/blob/HEAD/src/counterfact_kv_eviction/jax_inference.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"7ce53772f6a98f99"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.LG","source":"arxiv_2026.jsonl"},"syntology_extracted_results":null}