{"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-2601-20326","title":"Beyond Speedup -- Utilizing KV Cache for Sampling and Reasoning","arxiv_id":"2601.20326","date":"2026-01-28","proceeding":null,"authors":["Zeyu Xing","Xing Li","Hui-Ling Zhen","Mingxuan Yuan","Sinno Jialin Pan"],"abstract":"KV caches, typically used only to speed up autoregressive decoding, encode contextual information that can be reused for downstream tasks at no extra cost. We propose treating the KV cache as a lightweight representation, eliminating the need to recompute or store full hidden states. Despite being weaker than dedicated embeddings, KV-derived representations are shown to be sufficient for two key applications: \\textbf{(i) Chain-of-Embedding}, where they achieve competitive or superior performance on Llama-3.1-8B-Instruct and Qwen2-7B-Instruct; and \\textbf{(ii) Fast/Slow Thinking Switching}, where they enable adaptive reasoning on Qwen3-8B and DeepSeek-R1-Distil-Qwen-14B, reducing token generation by up to $5.7\\times$ with minimal accuracy loss. Our findings establish KV caches as a free, effective substrate for sampling and reasoning, opening new directions for representation reuse in LLM inference. Code: https://github.com/cmd2001/ICLR2026_KV-Embedding.","url_abs":"https://arxiv.org/abs/2601.20326","url_pdf":"https://arxiv.org/pdf/2601.20326","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=2601.20326","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2601.20326"}},"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/cmd2001/ICLR2026_KV-Embedding","reach":null}],"summary":{"unverified":9},"by_repo_kind":{"found_in_text":{"samples":9,"ran":0,"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":0,"samples":[{"code_sha256_prefix":"00d32e9533569aeb","entry":"get_kv_cache","repo":"cmd2001/ICLR2026_KV-Embedding","repo_kind":"found_in_text","path":"KVClassifier/eval_kv_classsfier_classification.py","file_url":"https://github.com/cmd2001/ICLR2026_KV-Embedding/blob/HEAD/KVClassifier/eval_kv_classsfier_classification.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"00d32e9533569aeb"}},{"code_sha256_prefix":"e3f9d49158bd33bc","entry":"load_generation_results","repo":"cmd2001/ICLR2026_KV-Embedding","repo_kind":"found_in_text","path":"KVClassifier/parse_kv_classfier_results_classification.py","file_url":"https://github.com/cmd2001/ICLR2026_KV-Embedding/blob/HEAD/KVClassifier/parse_kv_classfier_results_classification.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e3f9d49158bd33bc"}},{"code_sha256_prefix":"c7e9a39b3eb34571","entry":"parse_prompts","repo":"cmd2001/ICLR2026_KV-Embedding","repo_kind":"found_in_text","path":"KVClassifier/train_kv_classifier.py","file_url":"https://github.com/cmd2001/ICLR2026_KV-Embedding/blob/HEAD/KVClassifier/train_kv_classifier.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c7e9a39b3eb34571"}},{"code_sha256_prefix":"f83e3b3a36ac05b0","entry":"prep_kv_cache","repo":"cmd2001/ICLR2026_KV-Embedding","repo_kind":"found_in_text","path":"KVClassifier/eval_kv_classsfier_classification.py","file_url":"https://github.com/cmd2001/ICLR2026_KV-Embedding/blob/HEAD/KVClassifier/eval_kv_classsfier_classification.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f83e3b3a36ac05b0"}},{"code_sha256_prefix":"d5bfc57658f9cc08","entry":"prep_kv_cache","repo":"cmd2001/ICLR2026_KV-Embedding","repo_kind":"found_in_text","path":"KVClassifier/train_kv_classifier.py","file_url":"https://github.com/cmd2001/ICLR2026_KV-Embedding/blob/HEAD/KVClassifier/train_kv_classifier.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d5bfc57658f9cc08"}},{"code_sha256_prefix":"f38ac32ce1f38813","entry":"run_prompt","repo":"cmd2001/ICLR2026_KV-Embedding","repo_kind":"found_in_text","path":"KVClassifier/eval_kv_classifier_generative.py","file_url":"https://github.com/cmd2001/ICLR2026_KV-Embedding/blob/HEAD/KVClassifier/eval_kv_classifier_generative.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f38ac32ce1f38813"}},{"code_sha256_prefix":"06e6484deafdc09c","entry":"run_prompt","repo":"cmd2001/ICLR2026_KV-Embedding","repo_kind":"found_in_text","path":"KVClassifier/prep_fast_slow_thinking_results.py","file_url":"https://github.com/cmd2001/ICLR2026_KV-Embedding/blob/HEAD/KVClassifier/prep_fast_slow_thinking_results.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"06e6484deafdc09c"}},{"code_sha256_prefix":"5935de2fbe5c8164","entry":"select_kv_cache","repo":"cmd2001/ICLR2026_KV-Embedding","repo_kind":"found_in_text","path":"KVClassifier/eval_kv_classifier_generative.py","file_url":"https://github.com/cmd2001/ICLR2026_KV-Embedding/blob/HEAD/KVClassifier/eval_kv_classifier_generative.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5935de2fbe5c8164"}},{"code_sha256_prefix":"43aa3af0e1419907","entry":"select_kv_cache_multi_pos","repo":"cmd2001/ICLR2026_KV-Embedding","repo_kind":"found_in_text","path":"KVClassifier/eval_kv_classifier_generative.py","file_url":"https://github.com/cmd2001/ICLR2026_KV-Embedding/blob/HEAD/KVClassifier/eval_kv_classifier_generative.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"43aa3af0e1419907"}}]},"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}