cs.LGMar 10, 2026

Towards a Neural Debugger for Python

Authors: Maximilian Beck, Jonas Gehring, Jannik Kossen, Gabriel Synnaeve

Organizations: Johannes Kepler University Linz, Institute for Machine Learning · Meta FAIR CodeGen Team

Abstract

Training large language models (LLMs) on Python execution traces grounds them in code execution and enables the line-by-line execution prediction of whole Python programs, effectively turning them into neural interpreters (FAIR CodeGen Team et al., 2025). However, developers rarely execute programs step by step; instead, they use debuggers to stop execution at certain breakpoints and step through relevant portions only while inspecting or modifying program variables. Existing neural interpreter approaches lack such interactive control. To address this limitation, we introduce neural debuggers: language models that emulate traditional debuggers, supporting operations such as stepping into, over, or out of functions, as well as setting breakpoints at specific source lines. We show that neural debuggers -- obtained via fine-tuning large LLMs or pre-training smaller models from scratch -- can reliably model both forward execution (predicting future states and outputs) and inverse execution (inferring prior states or inputs) conditioned on debugger actions. Evaluated on CruxEval, our models achieve strong performance on both output and input prediction tasks, demonstrating robust conditional execution modeling. Our work takes first steps towards future agentic coding systems in which neural debuggers serve as a world model for simulated debugging environments, providing execution feedback or enabling agents to interact with real debugging tools. This capability lays the foundation for more powerful code generation, program understanding, and automated debugging.

Figures & tables

Appendix figures & tables7 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Precise Debugging Benchmark: Is Your Model Debugging or Regenerating?

    Apr 19, 2026Miaosen Chai, Wang Bill Zhu, Shangshang Wang +5LLM EvaluationAutomated Program Repair

  2. Self-Execution Simulation Improves Coding Models

    Mar 11, 2026Gallil Maimon, Ori Yoran, Felix Kreuk +4Execution-Guided Code GenerationLLM Self-Correction

  3. StepCodeReasoner: Aligning Code Reasoning with Stepwise Execution Traces via Reinforcement Learning

    May 12, 2026Hao Wang, Rui Li, Lei Sha +1RL for Language Model ReasoningExecution-Guided Code Generation