cs.CLMar 11, 2026

Self-Execution Simulation Improves Coding Models

Authors: Gallil Maimon, Ori Yoran, Felix Kreuk, Michael Hassid, Gal Cohen, Pierre Chambon, Yossi Adi

Organizations: FAIR team, Meta · Hebrew University of Jerusalem · Inria

Abstract

A promising research direction in enabling LLMs to generate consistently correct code involves addressing their inability to properly estimate program execution, particularly for code they generate. In this work, we demonstrate that Code LLMs can be trained to simulate program execution in a step-by-step manner and that this capability can be leveraged to improve competitive programming performance. Our approach combines supervised fine-tuning on natural language execution traces, textual explanations grounded in true execution, with reinforcement learning using verifiable rewards. We introduce two complementary objectives: output prediction given code and inputs, and solving competitive programming tasks with either ground-truth or self-predicted execution feedback. These objectives enable models to perform self-verification over multiple candidate solutions, and iterative self-fixing by simulating test execution. Across multiple competitive programming benchmarks, our method yields consistent improvements over standard reasoning approaches. We further present ablations and analysis to elucidate the role of execution simulation and its limitations.

Figures & tables

Appendix figures & tables7 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. RefineRL: Advancing Competitive Programming with Self-Refinement Reinforcement Learning

    Apr 1, 2026Shaopeng Fu, Xingxing Zhang, Li Dong +1RL for Code GenerationLLM Self-Refinement

  2. A-ProS: Towards Reliable Autonomous Programming Through Multi-Model Feedback

    May 18, 2026Anika Tabassum, Md Sifat Hossain, Md. Fahim Arefin +2LLM Self-RefinementExecution-Guided Code Generation