cs.CLSep 13, 2026

The Imitation Game: When LLMs Learn to Reason Like Programs via Code-Centric Reasoning Data Synthesis

Authors: Jinyang Zhang, Weibin Liao, Keqin Bao, Sihang Li, Shaobo Wang, Muyang Ye, Hongxin Ding, Yue Fang, 

Organizations: School of Computer Science, Peking University · Qwen Team, Alibaba Group · EPIC Lab, SJTU · College of Computer Science and Technology, Zhejiang University.

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.

Figures & tables

Appendix figures & tables20 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Enhancing the Code Reasoning Capabilities of LLMs via Consistency-based Reinforcement Learning

    May 18, 2026Zhanyue Qin, Jia Feng, Yibo Lyu +4Reinforcement LearningRL for Language Model Reasoning

  2. Learning from Synthetic Data Improves Multi-hop Reasoning

    Mar 2, 2026Anmol Kabra, Yilun Yin, Albert Gong +6RL for Language Model ReasoningMulti-Hop Reasoning

  3. Tandem: Riding Together with Large and Small Language Models for Efficient Reasoning

    Apr 26, 2026Zichuan Fu, Xian Wu, Guojing Li +7Efficient Language Model ReasoningLLM Inference Acceleration