{"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/get-more-with-less-synthesizing-recurrence","title":"Get More with LESS: Synthesizing Recurrence with KV Cache Compression for Efficient LLM Inference","arxiv_id":"2402.09398","date":"2024-02-14","proceeding":null,"authors":["Harry Dong","Xinyu Yang","Zhenyu Zhang","Zhangyang Wang","Yuejie Chi","Beidi Chen"],"abstract":"Many computational factors limit broader deployment of large language models. In this paper, we focus on a memory bottleneck imposed by the key-value (KV) cache, a computational shortcut that requires storing previous KV pairs during decoding. While existing KV cache methods approach this problem by pruning or evicting large swaths of relatively less important KV pairs to dramatically reduce the memory footprint of the cache, they can have limited success in tasks that require recollecting a majority of previous tokens. To alleviate this issue, we propose LESS, a simple integration of a (nearly free) constant sized cache with eviction-based cache methods, such that all tokens can be queried at later decoding steps. Its ability to retain information throughout time shows merit on a variety of tasks where we demonstrate LESS can help reduce the performance gap from caching everything, sometimes even matching it, all while being efficient. Relevant code can be found at https://github.com/hdong920/LESS.","url_abs":"https://arxiv.org/abs/2402.09398v2","url_pdf":"https://arxiv.org/pdf/2402.09398v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"get-more-with-less-synthesizing-recurrence","repo_url":"https://github.com/hdong920/less","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok"}}],"tasks":[],"methods":[{"method_slug":"focus","method_name":"Focus"},{"method_slug":"pruning","method_name":"Pruning"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2402.09398","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2402.09398"}},"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":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/hdong920/less","reach":{"status":"ok"}}],"summary":{"ran_violates":1,"ran":9,"ran_draft_wrong":2,"unverified":5},"by_repo_kind":{"official":{"samples":17,"ran":12,"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":17,"samples":[{"code_sha256_prefix":"0928f497e20fb443","entry":"mean","repo":"hdong920/less","repo_kind":"official","path":"src/lm_eval/metrics.py","file_url":"https://github.com/hdong920/less/blob/HEAD/src/lm_eval/metrics.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":2,"contract_check":"VIOLATES","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0928f497e20fb443"}},{"code_sha256_prefix":"57e732507bad40db","entry":"escaped_split","repo":"hdong920/less","repo_kind":"official","path":"src/lm_eval/utils.py","file_url":"https://github.com/hdong920/less/blob/HEAD/src/lm_eval/utils.py","link_basis":"harvester_set","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":"57e732507bad40db"}},{"code_sha256_prefix":"dcc45d61b99a2dc4","entry":"get_A_mask","repo":"hdong920/less","repo_kind":"official","path":"src/masks.py","file_url":"https://github.com/hdong920/less/blob/HEAD/src/masks.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":"dcc45d61b99a2dc4"}},{"code_sha256_prefix":"6abf882bc9dad32f","entry":"get_h2o_mask","repo":"hdong920/less","repo_kind":"official","path":"src/masks.py","file_url":"https://github.com/hdong920/less/blob/HEAD/src/masks.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":"6abf882bc9dad32f"}},{"code_sha256_prefix":"6f65cb198dfad4fa","entry":"get_target_attn","repo":"hdong920/less","repo_kind":"official","path":"src/train_kernels.py","file_url":"https://github.com/hdong920/less/blob/HEAD/src/train_kernels.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":"6f65cb198dfad4fa"}},{"code_sha256_prefix":"b0e9637d655792e9","entry":"get_target_attn_out","repo":"hdong920/less","repo_kind":"official","path":"src/train_kernels.py","file_url":"https://github.com/hdong920/less/blob/HEAD/src/train_kernels.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":"b0e9637d655792e9"}},{"code_sha256_prefix":"359c35fdcd7a0ee5","entry":"group","repo":"hdong920/less","repo_kind":"official","path":"src/lm_eval/utils.py","file_url":"https://github.com/hdong920/less/blob/HEAD/src/lm_eval/utils.py","link_basis":"harvester_set","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":"359c35fdcd7a0ee5"}},{"code_sha256_prefix":"ea06eaae4fc1eaf0","entry":"hash_args","repo":"hdong920/less","repo_kind":"official","path":"src/lm_eval/base.py","file_url":"https://github.com/hdong920/less/blob/HEAD/src/lm_eval/base.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ea06eaae4fc1eaf0"}},{"code_sha256_prefix":"44957f7d4ab6aaec","entry":"local_heavy_hitter_mask_nonoverlap","repo":"hdong920/less","repo_kind":"official","path":"src/masks.py","file_url":"https://github.com/hdong920/less/blob/HEAD/src/masks.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":"44957f7d4ab6aaec"}},{"code_sha256_prefix":"518b2201c66c2ad3","entry":"pop_stddev","repo":"hdong920/less","repo_kind":"official","path":"src/lm_eval/metrics.py","file_url":"https://github.com/hdong920/less/blob/HEAD/src/lm_eval/metrics.py","link_basis":"harvester_set","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":"518b2201c66c2ad3"}},{"code_sha256_prefix":"d40f0123e8a8f5c0","entry":"sample_stddev","repo":"hdong920/less","repo_kind":"official","path":"src/lm_eval/metrics.py","file_url":"https://github.com/hdong920/less/blob/HEAD/src/lm_eval/metrics.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d40f0123e8a8f5c0"}},{"code_sha256_prefix":"cd999ad59caf84a7","entry":"simple_parse_args_string","repo":"hdong920/less","repo_kind":"official","path":"src/lm_eval/utils.py","file_url":"https://github.com/hdong920/less/blob/HEAD/src/lm_eval/utils.py","link_basis":"harvester_set","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":"cd999ad59caf84a7"}},{"code_sha256_prefix":"996c34a5a32eee44","entry":"get_activations_layer","repo":"hdong920/less","repo_kind":"official","path":"src/train_kernels.py","file_url":"https://github.com/hdong920/less/blob/HEAD/src/train_kernels.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":"996c34a5a32eee44"}},{"code_sha256_prefix":"e17b6c1ff661e9bd","entry":"get_c4","repo":"hdong920/less","repo_kind":"official","path":"src/data_processing.py","file_url":"https://github.com/hdong920/less/blob/HEAD/src/data_processing.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":"e17b6c1ff661e9bd"}},{"code_sha256_prefix":"5b616f4c20a2e4bb","entry":"get_wikitext2","repo":"hdong920/less","repo_kind":"official","path":"src/data_processing.py","file_url":"https://github.com/hdong920/less/blob/HEAD/src/data_processing.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":"5b616f4c20a2e4bb"}},{"code_sha256_prefix":"b0bc7ae197230a33","entry":"load_modules","repo":"hdong920/less","repo_kind":"official","path":"src/eval_gen.py","file_url":"https://github.com/hdong920/less/blob/HEAD/src/eval_gen.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":"b0bc7ae197230a33"}},{"code_sha256_prefix":"9d95c14130837ee4","entry":"make_table","repo":"hdong920/less","repo_kind":"official","path":"src/lm_eval/evaluator.py","file_url":"https://github.com/hdong920/less/blob/HEAD/src/lm_eval/evaluator.py","link_basis":"harvester_set","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":"9d95c14130837ee4"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}