Elamur Research⌕
☰
home / papers / 2025 / InftyThink: Breaking the Length Limits of Long-Context Reasoning in Large Language Models

InftyThink: Breaking the Length Limits of Long-Context Reasoning in Large Language Models

Paper · 2025 · Yuchen Yan, Yongliang Shen, Yang Liu et al.

Summary

Reasoning-oriented LLMs such as DeepSeek-R1 handle hard problems by writing very long chains of thought. This approach has three costs. Attention cost grows quadratically with output length. Generation can be cut off at the maximum context size before an answer appears. Quality also drops once text exceeds the short windows (roughly 4k–8k tokens) used in pre-training. Compression methods only shorten a single chain, so the authors restructure the reasoning process instead. In InftyThink, the model works in short rounds. Each round sees the question plus a summary of earlier progress, reasons for a limited stretch, and writes a new summary that replaces the old context. Memory use therefore rises and resets in a sawtooth shape, which keeps cost bounded while allowing any number of rounds. To teach this behaviour, the authors converted the OpenR1-Math corpus into 333K iterative training examples and fine-tuned several base models. Compared with standard long-chain reasoning, the result is lower latency and higher accuracy with no architectural changes. This suggests reasoning depth and efficiency need not be traded off.

Key points

  • Training data: OpenR1-Math, a SFT corpus distilled from DeepSeek-R1, was reorganised into 333K instances. Each instance contains linked reasoning segments and progress summaries.
  • Results for Qwen2.5-Math-7B: the abstract reports gains of 3–11%. The introduction gives about +2% on MATH500, +11% on AIME24 and +9% on GPQA_diamond.
  • Inference format: every iteration takes the question and the previous summary as input. It then produces a <think> segment followed by either a new summary or, in the last round, the final conclusion.
  • Adaptive depth: on easy items (e.g., a GPQA_diamond example), the model stops after one iteration and behaves like vanilla reasoning. Harder AIME-style problems trigger several rounds.
  • Related work contrasted: CoT-Valve, TokenSkip and LightThinker all still produce one continuous chain. InftyThink instead changes the reasoning paradigm itself.

Our summary of the paper, in our own words — not its text. The work belongs to its authors; read it at the links above.

 Fields, topics and concepts

Cite

Cite as Yuchen Yan, Yongliang Shen, Yang Liu, Jin Jiang, Mengdi Zhang, Jian Shao and Yueting Zhuang. 2025. InftyThink: Breaking the Length Limits of Long-Context Reasoning in Large Language Models. arXiv:2503.06692.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.48550/arxiv.2503.06692 · arXiv 2503.06692

@misc{yan2025inftythink,
  title = {{InftyThink: Breaking the Length Limits of Long-Context Reasoning in Large Language Models}},
  author = {Yuchen Yan, Yongliang Shen, Yang Liu, Jin Jiang, Mengdi Zhang, Jian Shao and Yueting Zhuang},
  year = {2025},
  doi = {10.48550/arxiv.2503.06692},
  eprint = {2503.06692},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.48550/arxiv.2503.06692}
}

References

72 references, 34 of them with a card of ours. ↗ leads to the work, «find» searches for one we have no id for yet.

  1. Pranjal Aggarwal and Sean Welleck. L1: Controlling how long a reasoning model thinks with reinforcement learning. In Second Conference on Language Modeling, August 2025.
  2. Daman Arora and Andrea Zanette. Training language models to reason efficiently. In The Thirty-Ninth Annual Conference on Neural Information Processing Systems, October 2025. find
  3. Jacob Austin, Augustus Odena, Maxwell Nye, Maarten Bosma, Henryk Michalewski, et al. Program synthesis with large language models, August 2021.
  4. Bradley Brown, Jordan Juravsky, Ryan Ehrlich, Ronald Clark, Quoc V. Le, Christopher Ré, and Azalia Mirhoseini. Large language monkeys: Scaling inference compute with repeated sampling, July 2024.
  5. Guoxin Chen, Minpeng Liao, Chengxi Li, and Kai Fan. Alphamath almost zero: Process supervision without process. In The Thirty-Eighth Annual Conference on Neural Information Processing Systems, November 2024.
  6. Guoxuan Chen, Han Shi, Jiawei Li, Yihang Gao, Xiaozhe Ren, et al. Sepllm: Accelerate large language models by compressing one segment into one separator. In Forty-Second International Conference on Machine Learning, June 2025. find
  7. Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde de Oliveira Pinto, et al. Evaluating large language models trained on code, July 2021.
  8. Shouyuan Chen, Sherman Wong, Liangjian Chen, and Yuandong Tian. Extending context window of large language models via positional interpolation, June 2023. find
  9. Jeffrey Cheng and Benjamin Van Durme. Compressed chain of thought: Efficient reasoning through dense representations, December 2024. find
  10. Meng Fang, Xiangpeng Wan, Fei Lu, Fei Xing, and Kai Zou. Mathodyssey: Benchmarking mathematical problem-solving skills in large language models using odyssey math data. Scientific Data, 12(1):1392, August 2025. ISSN 2052-4463. doi: 10.1038/s41597-025-05283-3. find
  11. Jonas Geiping, Sean Michael McLeish, Neel Jain, John Kirchenbauer, Siddharth Singh, et al. Scaling up test-time compute with latent reasoning: A recurrent depth approach. In The Thirty-Ninth Annual Conference on Neural Information Processing Systems, October 2025. find
  12. Google DeepMind. Gemini flash thinking. https://deepmind.google/technologies/gemini/flash-thinking/, 2025. ↗
  13. Aaron Grattafiori, Abhimanyu Dubey, Abhinav Jauhri, Abhinav Pandey, Abhishek Kadian, et al. The llama 3 herd of models, November 2024.
  14. Xinyu Guan, Li Lyna Zhang, Yifei Liu, Ning Shang, Youran Sun, et al. rstar-math: Small llms can master math reasoning with self-evolved deep thinking. In Forty-Second International Conference on Machine Learning, June 2025.
  15. Etash Kumar Guha, Ryan Marten, Sedrick Keh, Negin Raoof, Georgios Smyrnis, et al. Openthoughts: Data recipes for reasoning models. In The Fourteenth International Conference on Learning Representations, October 2025.
  16. Daya Guo, Qihao Zhu, Dejian Yang, Zhenda Xie, Kai Dong, et al. Deepseek-coder: When the large language model meets programming – the rise of code intelligence, January 2024. find
  17. Daya Guo, Dejian Yang, Haowei Zhang, Junxiao Song, Peiyi Wang, et al. Deepseek-r1 incentivizes reasoning in llms through reinforcement learning. Nature, 645(8081):633–638, September 2025. ISSN 1476-4687. doi: 10.1038/s41586-025-09422-z.
  18. Tingxu Han, Zhenting Wang, Chunrong Fang, Shiyu Zhao, Shiqing Ma, et al. Token-budget-aware llm reasoning. In Findings of the Association for Computational Linguistics: ACL 2025, pp. 24842–24855, Vienna, Austria, July 2025. Association for Computational Linguistics. ISBN 979-8-89176-256-5. doi: 10.1…
  19. Shibo Hao, Sainbayar Sukhbaatar, DiJia Su, Xian Li, Zhiting Hu, Jason E. Weston, and Yuandong Tian. Training large language models to reason in a continuous latent space. In Second Conference on Language Modeling, August 2025. find
  20. Dan Hendrycks, Collin Burns, Saurav Kadavath, Akul Arora, Steven Basart, et al. Measuring mathematical problem solving with the math dataset. In Thirty-Fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track (Round 2), August 2021.
  21. Jie Huang and Kevin Chen-Chuan Chang. Towards reasoning in large language models: A survey. In Anna Rogers, Jordan Boyd-Graber, and Naoaki Okazaki (eds.), Findings of the Association for Computational Linguistics: ACL 2023, pp. 1049–1065, Toronto, Canada, July 2023. Association for Computational Lin…
  22. Jia LI, Edward Beeching, Lewis Tunstall, Ben Lipkin, Roman Soletskyi, et al. Numinamath-1.5. https://huggingface.co/datasets/AI-MO/NuminaMath-1.5, February 2025. ↗
  23. Jin Jiang, Yuchen Yan, Yang Liu, Jianing Wang, Shuai Peng, et al. Logicpro: Improving complex logical reasoning via program-guided learning. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 26200–26218, Vienna, Austria, July 2025…
  24. Yu Kang, Xianghui Sun, Liangyu Chen, and Wei Zou. C3ot: Generating shorter chain-of-thought without compromising effectiveness, December 2024. find
  25. Kimi Team, Angang Du, Bofei Gao, Bowei Xing, Changjiu Jiang, et al. Kimi k1.5: Scaling reinforcement learning with llms, January 2025.
  26. Yuri Kuratov, Aydar Bulatov, Petr Anokhin, Ivan Rodkin, Dmitry Igorevich Sorokin, Artyom Sorokin, and Mikhail Burtsev. Babilong: Testing the limits of llms with long context reasoning-in-a-haystack. In The Thirty-Eight Conference on Neural Information Processing Systems Datasets and Benchmarks Track… find
  27. Woosuk Kwon, Zhuohan Li, Siyuan Zhuang, Ying Sheng, Lianmin Zheng, et al. Efficient memory management for large language model serving with pagedattention. In Proceedings of the 29th Symposium on Operating Systems Principles, pp. 611–626, Koblenz Germany, October 2023. ACM. doi: 10.1145/3600006.3613…
  28. Ehsan Latif, Yifan Zhou, Shuchen Guo, Yizhu Gao, Lehong Shi, et al. A systematic assessment of openai o1-preview for higher order thinking in education, October 2024a. find
  29. Ehsan Latif, Yifan Zhou, Shuchen Guo, Lehong Shi, Yizhu Gao, et al. Can openai o1 outperform humans in higher-order cognitive thinking?, December 2024b. find
  30. Jia Li, Edward Beeching, Lewis Tunstall, Ben Lipkin, Roman Soletskyi, et al. Numinamath: The largest public dataset in ai4maths with 860k pairs of competition math problems and solutions, July 2024a. find
  31. Mo Li, Songyang Zhang, Yunxin Liu, and Kai Chen. Needlebench: Can llms do retrieval and reasoning in 1 million context window?, July 2024b. find
  32. Hunter Lightman, Vineet Kosaraju, Yuri Burda, Harrison Edwards, Bowen Baker, et al. Let’s verify step by step. In The Twelfth International Conference on Learning Representations, October 2023. — Let's Verify Step by Step
  33. Tengxiao Liu, Qipeng Guo, Xiangkun Hu, Cheng Jiayang, Yue Zhang, Xipeng Qiu, and Zheng Zhang. Can language models learn to skip steps? In The Thirty-Eighth Annual Conference on Neural Information Processing Systems, November 2024. find
  34. Haotian Luo, Haiying He, Yibo Wang, Jinluan Yang, Rui Liu, et al. Ada-r1: Hybrid-cot via bi-level adaptive reasoning optimization. In The Thirty-Ninth Annual Conference on Neural Information Processing Systems, October 2025. find
  35. Shangke Lyu, Linjuan Wu, Yuchen Yan, Xingyu Wu, Hao Li, et al. Hierarchical budget policy optimization for adaptive reasoning, August 2025. find
  36. Xinyin Ma, Guangnian Wan, Runpeng Yu, Gongfan Fang, Xinchao Wang, et al. Cot-valve: Length-compressible chain-of-thought tuning. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 6025–6035, Vienna, Austria, July 2025. Association…
  37. Niklas Muennighoff, Zitong Yang, Weijia Shi, Xiang Lisa Li, Li Fei-Fei, et al. S1: Simple test-time scaling. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing, pp. 20275–20321, Suzhou, China, November 2025. Association for Computational Linguistics. ISBN 979-8…
  38. Open Thoughts Team. Open thoughts. open-thoughts, January 2025. find
  39. OpenAI. Introducing openai o1. https://openai.com/index/introducing-openai-o1-preview/, 2024. ↗
  40. OpenAI. Learning to reason with llms. https://openai.com/index/learning-to-reason-with-llms/, 2024. ↗
  41. Jianhui Pang, Fanghua Ye, Derek Wong, Xin He, Wanshun Chen, et al. Anchor-based large language models. In Findings of the Association for Computational Linguistics: ACL 2024, pp. 4958–4976, Bangkok, Thailand, August 2024. Association for Computational Linguistics. doi: 10.18653/v1/ 2024.findings-acl… find
  42. Qwen, An Yang, Baosong Yang, Beichen Zhang, Binyuan Hui, et al. Qwen2.5 technical report, January 2025. find
  43. Qwen Team. Qwq: Reflect deeply on the boundaries https://qwenlm.github.io/blog/qwq-32b-preview/, November 2024. of the unknown. ↗
  44. David Rein, Betty Li Hou, Asa Cooper Stickland, Jackson Petty, Richard Yuanzhe Pang, et al. Gpqa: A graduate-level google-proof q&a benchmark. In First Conference on Language Modeling, August 2024.
  45. Baptiste Rozière, Jonas Gehring, Fabian Gloeckle, Sten Sootla, Itai Gat, et al. Code llama: Open foundation models for code, January 2024.
  46. Zhihong Shao, Peiyi Wang, Qihao Zhu, Runxin Xu, Junxiao Song, et al. Deepseekmath: Pushing the limits of mathematical reasoning in open language models, February 2024.
  47. Xuan Shen, Yizhou Wang, Xiangxi Shi, Yanzhi Wang, Pu Zhao, and Jiuxiang Gu. Efficient reasoning with hidden thinking, January 2025. find
  48. Charlie Victor Snell, Jaehoon Lee, Kelvin Xu, and Aviral Kumar. Scaling llm test-time compute optimally can be more effective than scaling parameters for reasoning. In The Thirteenth International Conference on Learning Representations, October 2024. find
  49. Jianlin Su, Yu Lu, Shengfeng Pan, Ahmed Murtadha, Bo Wen, and Yunfeng Liu. Roformer: Enhanced transformer with rotary position embedding, November 2023.
  50. Jiankai Sun, Chuanyang Zheng, Enze Xie, Zhengying Liu, Ruihang Chu, et al. A survey of reasoning with foundation models, January 2024. find
  51. Ziyu Wan, Xidong Feng, Muning Wen, Stephen Marcus McAleer, Ying Wen, Weinan Zhang, and Jun Wang. Alphazero-like tree-search can guide large language model decoding and training. In Proceedings of the 41st International Conference on Machine Learning, volume 235 of ICML’24, pp. 49890–49920, Vienna, A… find
  52. Yue Wang, Qiuzhi Liu, Jiahao Xu, Tian Liang, Xingyu Chen, et al. Thoughts are all over the place: On the underthinking of long reasoning models. In The Thirty-Ninth Annual Conference on Neural Information Processing Systems, October 2025. find
  53. Xingyu Wu, Yuchen Yan, Shangke Lyu, Linjuan Wu, Yiwen Qiu, et al. Lapo: Internalizing reasoning efficiency via length-adaptive policy optimization, August 2025. find
  54. Heming Xia, Chak Tou Leong, Wenjie Wang, Yongqi Li, Wenjie Li, et al. Tokenskip: Controllable chain-of-thought compression in llms. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing, pp. 3351–3363, Suzhou, China, November 2025. Association for Computational Li…
  55. Guangxuan Xiao, Yuandong Tian, Beidi Chen, Song Han, and Mike Lewis. Efficient streaming language models with attention sinks. In The Twelfth International Conference on Learning Representations, October 2023. find
  56. Yuchen Yan, Jin Jiang, Yang Liu, Yixin Cao, Xin Xu, et al. S^3cmath: Spontaneous step-level self-correction makes large language models better mathematical reasoners. Proceedings of the AAAI Conference on Artificial Intelligence, 39(24):25588–25596, April 2025. ISSN 2374-3468. doi: 10.1609/aaai.v39i… — [doi:10.1609/aaai.v39i24.34749](https://doi.org/10.1609/aaai.v39i24.34749) find
  57. Yuchen Yan, Liang Jiang, Jin Jiang, Shuaicheng Li, Zujie Wen, et al. Inftythink+: Effective and efficient infinite-horizon reasoning via reinforcement learning, February 2026. find
  58. An Yang, Beichen Zhang, Binyuan Hui, Bofei Gao, Bowen Yu, et al. Qwen2.5-math technical report: Toward mathematical expert model via self-improvement, September 2024.
  59. Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, Izhak Shafran, Karthik R. Narasimhan, and Yuan Cao. React: Synergizing reasoning and acting in language models. In The Eleventh International Conference on Learning Representations, September 2022.
  60. Shunyu Yao, Dian Yu, Jeffrey Zhao, Izhak Shafran, Thomas L. Griffiths, Yuan Cao, and Karthik R. Narasimhan. Tree of thoughts: Deliberate problem solving with large language models. In Thirty-Seventh Conference on Neural Information Processing Systems, November 2023. find
  61. Yixin Ye, Zhen Huang, Yang Xiao, Ethan Chern, Shijie Xia, and Pengfei Liu. Limo: Less is more for reasoning. In Second Conference on Language Modeling, August 2025.
  62. Longhui Yu, Weisen Jiang, Han Shi, Jincheng Yu, Zhengying Liu, et al. Metamath: Bootstrap your own mathematical questions for large language models. In The Twelfth International Conference on Learning Representations, October 2023.
  63. Tao Yuan, Xuefei Ning, Dong Zhou, Zhijie Yang, Shiyao Li, et al. Lv-eval: A balanced long-context benchmark with 5 length levels up to 256k. In Second Conference on Language Modeling, August 2025.
  64. Zhiyuan Zeng, Qinyuan Cheng, Zhangyue Yin, Bo Wang, Shimin Li, et al. Scaling of search and learning: A roadmap to reproduce o1 from reinforcement learning perspective, December 2024. find
  65. Jiajie Zhang, Nianyi Lin, Lei Hou, Ling Feng, Juanzi Li, et al. Adaptthink: Reasoning models can learn when to think. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing, pp. 3716–3730, Suzhou, China, November 2025a. Association for Computational Linguistics. IS…
  66. Jintian Zhang, Yuqi Zhu, Mengshu Sun, Yujie Luo, Shuofei Qiao, et al. Lightthinker: Thinking step-by-step compression. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing, pp. 13307–13328, Suzhou, China, November 2025b. Association for Computational Linguistics.…
  67. Zhenyu Zhang, Ying Sheng, Tianyi Zhou, Tianlong Chen, Lianmin Zheng, et al. H2o: Heavy-hitter oracle for efficient generative inference of large language models. In Thirty-Seventh Conference on Neural Information Processing Systems, November 2023. find
  68. Lianmin Zheng, Liangsheng Yin, Zhiqiang Xie, Chuyue Sun, Jeff Huang, et al. Sglang: Efficient execution of structured language model programs. In The Thirty-Eighth Annual Conference on Neural Information Processing Systems, November 2024.
  69. Tianyang Zhong, Zhengliang Liu, Yi Pan, Yutong Zhang, Yifan Zhou, et al. Evaluation of openai o1: Opportunities and challenges of agi, September 2024.
  70. Denny Zhou, Nathanael Schärli, Le Hou, Jason Wei, Nathan Scales, et al. Least-to-most prompting enables complex reasoning in large language models. In The Eleventh International Conference on Learning Representations, September 2022.
  71. Wangchunshu Zhou, Yuchen Eleanor Jiang, Peng Cui, Tiannan Wang, Zhenxin Xiao, et al. Recurrentgpt: Interactive generation of (arbitrarily) long text, May 2023.
  72. C ONTENTS \#\# Introduction Methods 2.1 InftyThink Reasoning Paradigm . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1.1 Vanilla Paradigm of Long-Context Reasoning . . . . . . . . . . . . . . . 2.1.2 Iterative Reasoning with Summarization: InftyThink . . . . . . . . . . . . Data Reconstructio… find

Updated

↑ back to top

This page in Markdown → https://md.research.elamur.ai/free/en/papers/yan-2025-inftythink-breaking-length-limits-long/