Lune

AAAI2024Top-tier venue

When Do Program-of-Thought Works for Reasoning?

Zhen Bi, Ningyu Zhang, Yinuo Jiang, Shumin Deng, Guozhou Zheng, Huajun Chen

Abstract

In the realm of embodied artificial intelligence, the reasoning capabilities of Large Language Models (LLMs) play a pivotal role. Although there are effective methods like program-ofthought prompting for LLMs which uses programming language to tackle complex reasoning tasks, the specific impact of code data on the improvement of reasoning capabilities remains under-explored. To address this gap, we propose complexity-impacted reasoning score (CIRS), which combines structural and logical attributes, to measure the correlation between code and reasoning abilities. Specifically, we use the abstract syntax tree to encode the structural information and calculate logical complexity by considering the difficulty and the cyclomatic complexity. Through an empirical analysis, we find not all code data of complexity can be learned or understood by LLMs. Optimal level of complexity is critical to the improvement of reasoning abilities by program-aided prompting. Then we design an autosynthesizing and stratifying algorithm, and apply it to instruction generation for mathematical reasoning and code data filtering for code generation tasks. Extensive results demonstrates the effectiveness of our proposed approach.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

3 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Personalized Decision Modeling: Utility Optimization or Textualized-Symbolic Reasoning cites Language Models are Few-Shot Learners
  • Personalized Decision Modeling: Utility Optimization or Textualized-Symbolic Reasoning cites Unlocking the Capabilities of Thought: A Reasoning Boundary Framework to Quantify and Optimize Chain-of-Thought
  • Personalized Decision Modeling: Utility Optimization or Textualized-Symbolic Reasoning cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • KnowPrompt: Knowledge-aware Prompt-tuning with Synergistic Optimization for Relation Extraction cites Language Models are Few-Shot Learners
  • PAL: Program-aided Language Models cites Language Models are Few-Shot Learners
  • PAL: Program-aided Language Models cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • On Code-Induced Reasoning in LLMs cites Language Models are Few-Shot Learners
  • Unlocking the Capabilities of Thought: A Reasoning Boundary Framework to Quantify and Optimize Chain-of-Thought cites PAL: Program-aided Language Models
  • Unlocking the Capabilities of Thought: A Reasoning Boundary Framework to Quantify and Optimize Chain-of-Thought cites Language Models are Few-Shot Learners
  • Unlocking the Capabilities of Thought: A Reasoning Boundary Framework to Quantify and Optimize Chain-of-Thought cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • Specializing Smaller Language Models towards Multi-Step Reasoning cites Language Models are Few-Shot Learners
  • Specializing Smaller Language Models towards Multi-Step Reasoning cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers3

  1. Unlocking the Capabilities of Thought: A Reasoning Boundary Framework to Quantify and Optimize Chain-of-ThoughtQiguang Chen, Libo Qin, Jiaqi Wang, Jingxuan Zhou et al.NeurIPS 2024 · 104 citations
  2. On Code-Induced Reasoning in LLMsAbdul Waheed, Zhen Wu, Carolyn Rose, Daphne IppolitoICLR 2026 · 6 citations
  3. Personalized Decision Modeling: Utility Optimization or Textualized-Symbolic ReasoningYibo Zhao, Yang Zhao, Hongru Du, Hao (Frank) YangNeurIPS 2025 · 3 citations

Builds on13

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma et al.NeurIPS 2022 · 22,562 citations
  3. PAL: Program-aided Language ModelsLuyu Gao, Aman Madaan, Shuyan Zhou, Uri Alon et al.ICML 2023 · 700 citations
  4. KnowPrompt: Knowledge-aware Prompt-tuning with Synergistic Optimization for Relation ExtractionXiang Chen, Ningyu Zhang, Xin Xie, Shumin Deng et al.WWW 2022 · 488 citations
  5. Specializing Smaller Language Models towards Multi-Step ReasoningYao Fu, Hao Peng, Litu Ou, Ashish Sabharwal et al.ICML 2023 · 347 citations

Related papers

  1. Scaling Code-Assisted Chain-of-Thoughts and Instructions for Model ReasoningHonglin Lin, Qizhi Pei, Zhuoshi Pan, Yu Li et al.NeurIPS 2025 · 12 citations
  2. CodeComplex: Dataset for Worst-Case Time Complexity PredictionSeung-Yeop Baik, Joonghyuk Hahn, Jungin Kim, Aditi et al.EMNLP Findings 2025
  3. The Magic of IF: Investigating Causal Reasoning Abilities in Large Language Models of CodeXiao Liu, Da Yin, Chen Zhang, Yansong Feng et al.ACL Findings 2023 · 9 citations
  4. Code to Think, Think to Code: A Survey on Code-Enhanced Reasoning and Reasoning-Driven Code Intelligence in LLMsDayu Yang, Tianyang Liu, Daoan Zhang, Antoine Simoulin et al.EMNLP 2025 · 1 citation
  5. At Which Training Stage Does Code Data Help LLMs Reasoning?Yingwei Ma, Yue Liu, Yue Yu, Yuanliang Zhang et al.ICLR 2024 · 106 citations
Dusk over the sea between two cliffs drawn in fine vertical lines