Self-Execution Simulation Improves Coding Models
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.
69d4a9682c523d36431fb2f9
Gallil Maimon
claimed_verified
2026-04-07T08:32:58.431Z
66b9bc2dacdbc1d0b39c3b50
https://cdn-avatars.huggingface.co/v1/production/uploads/noauth/hwR0pVfP_E8XjimXIxDOU.jpeg
Gallil Maimon
gallilmaimon
user
gallilmaimon
69d4a9682c523d36431fb2fa
Ori Yoran
69d4a9682c523d36431fb2fb
Felix Kreuk
69d4a9682c523d36431fb2fc
Michael Hassid
69d4a9682c523d36431fb2fd
Gal Cohen
claimed_verified
2026-04-07T08:32:53.663Z
635aa711b13777d661f99a71
/avatars/78409dd88639cb9e74c055223b7540d1.svg
Gal Cohen
galco
user
galco
69d4a9682c523d36431fb2fe
Pierre Chambon
69d4a9682c523d36431fb2ff
Yossi Adi
Self-Execution Simulation Improves Coding Models
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.
Code large language models can be trained to simulate program execution step-by-step, improving competitive programming performance through supervised fine-tuning and reinforcement learning with verifiable rewards.
Code LLMs program execution supervised fine-tuning reinforcement learning competitive programming execution simulation self-verification iterative self-fixing