Code to Think, Think to Code: A Survey on Code-Enhanced Reasoning and Reasoning-Driven Code Intelligence in LLMs
Dayu Yang, Tianyang Liu, Daoan Zhang, Antoine Simoulin, Xiaoyi Liu, Yuwei Cao, Zhaopu Teng, Xin Qian, Grey Yang, Jiebo Luo, Julian McAuley
TL;DR
<3-5 sentence high-level summary> The paper surveys the bidirectional relationship between code and reasoning in LLMs, arguing that executable and structured code provides a robust medium for reasoning while enhanced reasoning expands the scope and quality of code intelligence. It presents a taxonomy and synthesis of approaches spanning executable program-based reasoning (PoT/PaL), dynamic code-language integration, non-executable code representations, and code-driven training, as well as reasoning-driven code generation, code understanding, interactive programming, and autonomous code agents. It also reviews benchmarks and evaluation frameworks (e.g., CRUXEval, CodeMMLU, SWE-bench) and identifies core challenges—interpretability, scalability, data quality, and safe tool usage—offering future directions like code-language hybrids, modular agents, and RL-based improvements. The work aims to guide researchers and practitioners toward more interpretable, reliable, and capable code-centric AI systems with stronger reasoning faculties.
Abstract
In large language models (LLMs), code and reasoning reinforce each other: code offers an abstract, modular, and logic-driven structure that supports reasoning, while reasoning translates high-level goals into smaller, executable steps that drive more advanced code intelligence. In this study, we examine how code serves as a structured medium for enhancing reasoning: it provides verifiable execution paths, enforces logical decomposition, and enables runtime validation. We also explore how improvements in reasoning have transformed code intelligence from basic completion to advanced capabilities, enabling models to address complex software engineering tasks through planning and debugging. Finally, we identify key challenges and propose future research directions to strengthen this synergy, ultimately improving LLM's performance in both areas.
