{"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-2608-19662","title":"ReCache: Efficient KV Cache Reuse and Compression for Tool-Augmented LLM Agents","arxiv_id":"2608.19662","date":"2026-08-20","proceeding":null,"authors":["Yichu Fang","Sitong Wei","Haozhe Hu","Xiaoyu Shen"],"abstract":"Agentic language models repeatedly encode tool and skill schemas that recur across requests in different combinations and orders, preventing standard prefix caching from reusing their key--value (KV) states. We introduce \\textbf{ReCache}, a framework for independently caching resource representations while reducing their inference-time computational and memory overhead. Resource-wise attention removes cross-resource interactions and assigns resource-local positions, producing composition-invariant KV blocks. ReCache then restricts resource visibility to contribution-selected layer--KV-head-group routes and retains only invocation-critical fields through structural and semantic pruning. We evaluate ReCache on a benchmark assembled from seven public tool- and skill-use datasets, including resource-disjoint tests. Resource-wise attention matches dense invocation performance (82.3\\% versus 82.4\\% Inv-F1) while providing a 3.655$\\times$ time-to-first-token speedup. The complete framework reduces allocated KV-tensor memory by 92.43\\% and accelerates attention by 1.423$\\times$. These results show that separating reusable schema encoding from selective resource access substantially reduces agentic inference costs with limited effectiveness loss. The code is available at https://github.com/EIT-NLP/ReCache.","url_abs":"https://arxiv.org/abs/2608.19662","url_pdf":"https://arxiv.org/pdf/2608.19662","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=2608.19662","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2608.19662"}},"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/EIT-NLP/ReCache","reach":null}],"summary":{"ran":8,"unverified":3},"by_repo_kind":{"found_in_text":{"samples":11,"ran":8,"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":11,"samples":[{"code_sha256_prefix":"a6bb3295cd92cb08","entry":"compact_masked_sdpa","repo":"EIT-NLP/ReCache","repo_kind":"found_in_text","path":"capsule/src/compact_attention.py","file_url":"https://github.com/EIT-NLP/ReCache/blob/HEAD/capsule/src/compact_attention.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a6bb3295cd92cb08"}},{"code_sha256_prefix":"5e960b1ca7bef007","entry":"get_shifted_labels","repo":"EIT-NLP/ReCache","repo_kind":"found_in_text","path":"capsule/src/modeling_utils.py","file_url":"https://github.com/EIT-NLP/ReCache/blob/HEAD/capsule/src/modeling_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"5e960b1ca7bef007"}},{"code_sha256_prefix":"df02a4d06d5ad0f2","entry":"makedirs","repo":"EIT-NLP/ReCache","repo_kind":"found_in_text","path":"capsule/src/utils.py","file_url":"https://github.com/EIT-NLP/ReCache/blob/HEAD/capsule/src/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"df02a4d06d5ad0f2"}},{"code_sha256_prefix":"141f4c8b387bca52","entry":"mask_nested_lists","repo":"EIT-NLP/ReCache","repo_kind":"found_in_text","path":"capsule/src/chat.py","file_url":"https://github.com/EIT-NLP/ReCache/blob/HEAD/capsule/src/chat.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"141f4c8b387bca52"}},{"code_sha256_prefix":"b8a81a4b39c05cff","entry":"move_to_device","repo":"EIT-NLP/ReCache","repo_kind":"found_in_text","path":"capsule/src/modeling_utils.py","file_url":"https://github.com/EIT-NLP/ReCache/blob/HEAD/capsule/src/modeling_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b8a81a4b39c05cff"}},{"code_sha256_prefix":"7598dbd722b803a3","entry":"optional_grad_ctx","repo":"EIT-NLP/ReCache","repo_kind":"found_in_text","path":"capsule/src/modeling_utils.py","file_url":"https://github.com/EIT-NLP/ReCache/blob/HEAD/capsule/src/modeling_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7598dbd722b803a3"}},{"code_sha256_prefix":"6e49393a385cd311","entry":"optional_grad_ctx","repo":"EIT-NLP/ReCache","repo_kind":"found_in_text","path":"capsule/src/utils.py","file_url":"https://github.com/EIT-NLP/ReCache/blob/HEAD/capsule/src/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6e49393a385cd311"}},{"code_sha256_prefix":"401295e921e431be","entry":"split_resource_sdpa","repo":"EIT-NLP/ReCache","repo_kind":"found_in_text","path":"capsule/src/compact_attention.py","file_url":"https://github.com/EIT-NLP/ReCache/blob/HEAD/capsule/src/compact_attention.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"401295e921e431be"}},{"code_sha256_prefix":"561fab9ba99c10a9","entry":"apply_chat_template","repo":"EIT-NLP/ReCache","repo_kind":"found_in_text","path":"capsule/src/chat.py","file_url":"https://github.com/EIT-NLP/ReCache/blob/HEAD/capsule/src/chat.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"561fab9ba99c10a9"}},{"code_sha256_prefix":"63d36f1757a0760e","entry":"get_conv_template","repo":"EIT-NLP/ReCache","repo_kind":"found_in_text","path":"capsule/src/chat.py","file_url":"https://github.com/EIT-NLP/ReCache/blob/HEAD/capsule/src/chat.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"63d36f1757a0760e"}},{"code_sha256_prefix":"eea85b841e68681d","entry":"split_file_dir_name_ext","repo":"EIT-NLP/ReCache","repo_kind":"found_in_text","path":"capsule/src/utils.py","file_url":"https://github.com/EIT-NLP/ReCache/blob/HEAD/capsule/src/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"eea85b841e68681d"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.CL","source":"arxiv_2026.jsonl"},"syntology_extracted_results":null}