The Imitation Game: When LLMs Learn to Reason Like Programs via Code-Centric Reasoning Data Synthesis
Jinyang Zhang, Weibin Liao, Keqin Bao, Sihang Li, Shaobo Wang, Muyang Ye, Hongxin Ding, Yue Fang, Tianyi Tang, Fei Huang, Kexin Yang, Xingzhang Ren, Dayiheng Liu
Abstract
Large Language Models (LLMs) excel at programming tasks but frequently fail at deterministic, fine-grained reasoning in natural language, relying heavily on semantic approximations rather than robust symbolic execution. To bridge this gap, we propose MIMIC, a framework that leverages executable code as a rigorous medium for reasoning data synthesis. MIMIC fundamentally transforms algorithms into verifiable reasoning trajectories through narrative fusion, code-guided test synthesis, and dynamic code instrumentation. Crucially, these explicit intermediate execution states naturally form a Code-Instrumented Reward (CIR), providing dense, high-fidelity process supervision for reinforcement learning without external reward models. Extensive evaluations reveal that models trained via SFT and GRPO on our synthesized dataset achieve substantial, consistent gains. Our method significantly elevates accuracy across general reasoning, complex mathematical benchmarks, and fine-grained deterministic tasks, demonstrating that the procedural rigor of executable code can effectively unlock and enhance the generalized reasoning capabilities of LLMs. Our code and data are available at https://github.com/zjy1298/MIMIC.
Create a lesson
Metadata
- Categories
- cs.CL, cs.AI
- Comments
- Accepted by EMNLP26 main
Related papers
Trallie: from Free-Form Text to Structured Data with LLMs
Shared title terminologycs.CLVijayasri Iyer, Cristiano De Nobili, Mubashir Hussain Shah et al.
When Does Reasoning Help Entity Disambiguation? Small LLMs In-Domain and Under Shift
Shared title terminologycs.CLSamy Haffoudhi, Fabian M Suchanek, Nils Holzenberger
Towards Scalable RLVR: Multimodal Instruction Following Data Synthesis and Distillation
Shared title terminologycs.CLYirong Zeng, Zhang Sai, Yuxian Wang et al.
Hindsight Bias in Clinical Temporal Reasoning: How Future Data Exposure Affects Large Language Model Judgment
Shared title terminologycs.CLMisaki Matsuura, Sayantan Kumar, Ojas Kadam et al.
RFCLLM: Evaluating LLMs' Reasoning Ability of Network Protocol State Machines
Shared title terminologycs.CLAnqi Chen, Dan Goldwasser, Cristina Nita-Rotaru
IRTIQA: Evolving in English, Evaluated in Urdu -- Does Agent Self-Evolution Transfer from English to Urdu and Code-Switched Input?
Shared title terminologycs.CLAbdullah Hashmat, Danish Javed, Usman Naseem et al.