{"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-2511-13223","title":"TokenSqueeze: Performance-Preserving Compression for Reasoning LLMs","arxiv_id":"2511.13223","date":"2025-11-17","proceeding":"NeurIPS","authors":["Yuxiang Zhang","Zhengxu Yu","Weihang Pan","Zhongming Jin","Qiang Fu","Deng Cai","Binbin Lin","Jieping Ye"],"abstract":"Emerging reasoning LLMs such as OpenAI-o1 and DeepSeek-R1 have achieved strong performance on complex reasoning tasks by generating long chain-of-thought (CoT) traces. However, these long CoTs result in increased token usage, leading to higher inference latency and memory consumption. As a result, balancing accuracy and reasoning efficiency has become essential for deploying reasoning LLMs in practical applications. Existing long-to-short (Long2Short) methods aim to reduce inference length but often sacrifice accuracy, revealing a need for an approach that maintains performance while lowering token costs. To address this efficiency-accuracy tradeoff, we propose TokenSqueeze, a novel Long2Short method that condenses reasoning paths while preserving performance and relying exclusively on self-generated data. First, to prevent performance degradation caused by excessive compression of reasoning depth, we propose to select self-generated samples whose reasoning depth is adaptively matched to the complexity of the problem. To further optimize the linguistic expression without altering the underlying reasoning paths, we introduce a distribution-aligned linguistic refinement method that enhances the clarity and conciseness of the reasoning path while preserving its logical integrity. Comprehensive experimental results demonstrate the effectiveness of TokenSqueeze in reducing token usage while maintaining accuracy. Notably, DeepSeek-R1-Distill-Qwen-7B fine-tuned using our proposed method achieved a 50\\% average token reduction while preserving accuracy on the MATH500 benchmark. TokenSqueeze exclusively utilizes the model's self-generated data, enabling efficient and high-fidelity reasoning without relying on manually curated short-answer datasets across diverse applications. Our code is available at https://github.com/zhangyx1122/TokenSqueeze.","url_abs":"https://arxiv.org/abs/2511.13223","url_pdf":"https://arxiv.org/pdf/2511.13223","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":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2511.13223","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2511.13223"}},"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/zhangyx1122/TokenSqueeze","reach":{"status":"ok"}}],"summary":{"ran":1,"unverified":19},"by_repo_kind":{"found_in_text":{"samples":20,"ran":1,"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":20,"samples":[{"code_sha256_prefix":"e88118a107b326d1","entry":"is_equiv","repo":"zhangyx1122/TokenSqueeze","repo_kind":"found_in_text","path":"utils/math500_verify.py","file_url":"https://github.com/zhangyx1122/TokenSqueeze/blob/HEAD/utils/math500_verify.py","link_basis":"plan_row","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":"e88118a107b326d1"}},{"code_sha256_prefix":"809c0178a7ae90ff","entry":"choice_answer_clean","repo":"zhangyx1122/TokenSqueeze","repo_kind":"found_in_text","path":"utils/qwen_verify.py","file_url":"https://github.com/zhangyx1122/TokenSqueeze/blob/HEAD/utils/qwen_verify.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":"809c0178a7ae90ff"}},{"code_sha256_prefix":"054091f2e78d9eec","entry":"compute_score","repo":"zhangyx1122/TokenSqueeze","repo_kind":"found_in_text","path":"utils/math500_verify.py","file_url":"https://github.com/zhangyx1122/TokenSqueeze/blob/HEAD/utils/math500_verify.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":"054091f2e78d9eec"}},{"code_sha256_prefix":"4eed1f4a7be28b06","entry":"get_answer","repo":"zhangyx1122/TokenSqueeze","repo_kind":"found_in_text","path":"utils/tools.py","file_url":"https://github.com/zhangyx1122/TokenSqueeze/blob/HEAD/utils/tools.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":"4eed1f4a7be28b06"}},{"code_sha256_prefix":"645a0fc1825a551c","entry":"get_item_hash_number","repo":"zhangyx1122/TokenSqueeze","repo_kind":"found_in_text","path":"step3_generate_rewrite_data.py","file_url":"https://github.com/zhangyx1122/TokenSqueeze/blob/HEAD/step3_generate_rewrite_data.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":"645a0fc1825a551c"}},{"code_sha256_prefix":"bacdc9de18ac7371","entry":"get_kl_divergence","repo":"zhangyx1122/TokenSqueeze","repo_kind":"found_in_text","path":"step4_cal_kl_for_rewrite_data.py","file_url":"https://github.com/zhangyx1122/TokenSqueeze/blob/HEAD/step4_cal_kl_for_rewrite_data.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":"bacdc9de18ac7371"}},{"code_sha256_prefix":"914ae020e2d944f4","entry":"get_model_and_tokenizer","repo":"zhangyx1122/TokenSqueeze","repo_kind":"found_in_text","path":"utils/tools.py","file_url":"https://github.com/zhangyx1122/TokenSqueeze/blob/HEAD/utils/tools.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":"914ae020e2d944f4"}},{"code_sha256_prefix":"e4e817be08b2ac02","entry":"get_ppl","repo":"zhangyx1122/TokenSqueeze","repo_kind":"found_in_text","path":"utils/tools.py","file_url":"https://github.com/zhangyx1122/TokenSqueeze/blob/HEAD/utils/tools.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":"e4e817be08b2ac02"}},{"code_sha256_prefix":"58ad512ca891a50b","entry":"get_prob","repo":"zhangyx1122/TokenSqueeze","repo_kind":"found_in_text","path":"step4_cal_kl_for_rewrite_data.py","file_url":"https://github.com/zhangyx1122/TokenSqueeze/blob/HEAD/step4_cal_kl_for_rewrite_data.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":"58ad512ca891a50b"}},{"code_sha256_prefix":"97818df7f4fc45f5","entry":"get_prob_kv","repo":"zhangyx1122/TokenSqueeze","repo_kind":"found_in_text","path":"step4_cal_kl_for_rewrite_data.py","file_url":"https://github.com/zhangyx1122/TokenSqueeze/blob/HEAD/step4_cal_kl_for_rewrite_data.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":"97818df7f4fc45f5"}},{"code_sha256_prefix":"fb37d3c84b18e368","entry":"is_digit","repo":"zhangyx1122/TokenSqueeze","repo_kind":"found_in_text","path":"utils/qwen_verify.py","file_url":"https://github.com/zhangyx1122/TokenSqueeze/blob/HEAD/utils/qwen_verify.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":"fb37d3c84b18e368"}},{"code_sha256_prefix":"f326075fb5f40749","entry":"latex_eval","repo":"zhangyx1122/TokenSqueeze","repo_kind":"found_in_text","path":"utils/orz_verify.py","file_url":"https://github.com/zhangyx1122/TokenSqueeze/blob/HEAD/utils/orz_verify.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":"f326075fb5f40749"}},{"code_sha256_prefix":"5662e5ee755b541c","entry":"normalize_final_answer","repo":"zhangyx1122/TokenSqueeze","repo_kind":"found_in_text","path":"utils/orz_verify.py","file_url":"https://github.com/zhangyx1122/TokenSqueeze/blob/HEAD/utils/orz_verify.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":"5662e5ee755b541c"}},{"code_sha256_prefix":"7d4b7f8c3875b126","entry":"parse_digits","repo":"zhangyx1122/TokenSqueeze","repo_kind":"found_in_text","path":"utils/qwen_verify.py","file_url":"https://github.com/zhangyx1122/TokenSqueeze/blob/HEAD/utils/qwen_verify.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":"7d4b7f8c3875b126"}},{"code_sha256_prefix":"62c0b9272e324d3a","entry":"process_item","repo":"zhangyx1122/TokenSqueeze","repo_kind":"found_in_text","path":"step5_generate_rewrite_dpo_pair.py","file_url":"https://github.com/zhangyx1122/TokenSqueeze/blob/HEAD/step5_generate_rewrite_dpo_pair.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":"62c0b9272e324d3a"}},{"code_sha256_prefix":"2f67c7621d2b63bf","entry":"process_pair_longfalse","repo":"zhangyx1122/TokenSqueeze","repo_kind":"found_in_text","path":"step2_fliter_dpo_datasets.py","file_url":"https://github.com/zhangyx1122/TokenSqueeze/blob/HEAD/step2_fliter_dpo_datasets.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":"2f67c7621d2b63bf"}},{"code_sha256_prefix":"53a8a2e9d14cedfd","entry":"remove_boxed","repo":"zhangyx1122/TokenSqueeze","repo_kind":"found_in_text","path":"utils/math500_verify.py","file_url":"https://github.com/zhangyx1122/TokenSqueeze/blob/HEAD/utils/math500_verify.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":"53a8a2e9d14cedfd"}},{"code_sha256_prefix":"3dcb40e5ce9bac48","entry":"repeatness","repo":"zhangyx1122/TokenSqueeze","repo_kind":"found_in_text","path":"utils/orz_verify.py","file_url":"https://github.com/zhangyx1122/TokenSqueeze/blob/HEAD/utils/orz_verify.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":"3dcb40e5ce9bac48"}},{"code_sha256_prefix":"791da81670e617a4","entry":"timeout_call","repo":"zhangyx1122/TokenSqueeze","repo_kind":"found_in_text","path":"utils/merged_verify.py","file_url":"https://github.com/zhangyx1122/TokenSqueeze/blob/HEAD/utils/merged_verify.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":"791da81670e617a4"}},{"code_sha256_prefix":"952f974b7981a318","entry":"tokenize_length","repo":"zhangyx1122/TokenSqueeze","repo_kind":"found_in_text","path":"step5_generate_rewrite_dpo_pair.py","file_url":"https://github.com/zhangyx1122/TokenSqueeze/blob/HEAD/step5_generate_rewrite_dpo_pair.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":"952f974b7981a318"}}]},"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_api"},"syntology_extracted_results":null}