Execution Guided Line-by-Line Code Generation
Not on the map. Why?
Abstract (arXiv)
We present a novel approach to neural code generation that incorporates real-time execution signals into the language model generation process. While large language models (LLMs) have demonstrated impressive code generation capabilities, they typically do not utilize execution feedback during inference, a critical signal that human programmers regularly leverage. Our method, Execution-Guided Classifier-Free Guidance (EG-CFG), dynamically incorporates execution signals as the model generates code, providing line-by-line feedback that guides the generation process toward executable solutions. EG-CFG employs a multi-stage process: first, we conduct beam search to sample candidate program completions for each line; second, we extract execution signals by executing these candidates against test cases; and finally, we incorporate these signals into the prompt during generation. By maintaining consistent signals across tokens within the same line and refreshing signals at line boundaries, our approach provides coherent guidance while preserving syntactic structure. Moreover, the method naturally supports native parallelism at the task level in which multiple agents operate in parallel, exploring diverse reasoning paths and collectively generating a broad set of candidate solutions. Our experiments across diverse coding tasks demonstrate that EG-CFG significantly improves code generation performance compared to standard approaches, achieving state-of-the-art results across various levels of complexity, from foundational problems to challenging competitive programming and data science tasks. Our code is available at: https://github.com/boazlavon/eg_cfg
Key facts. Cited by 10 papers in the map (data through 7 Oct 2026). Builds on 42 of its 52 references that are in the map. First posted on arXiv 12 Jun 2025.
Builds on
42 of 52 references.
References · 42
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,355
- 2021Diffusion Models Beat GANs on Image Synthesiscited by 8,185
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2020Measuring Massive Multitask Language Understandingcited by 7,768
- 2022Classifier-Free Diffusion Guidancecited by 5,717
- 2022Self-Consistency Improves Chain of Thought Reasoning in Language Modelscited by 5,601
- 2023Toolformer: Language Models Can Teach Themselves to Use Toolscited by 4,072
- 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,064
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2023Tree of Thoughts: Deliberate Problem Solving with Large Language Modelscited by 3,155
30 more
- 2019The Curious Case of Neural Text Degenerationcited by 2,881
- 2023MetaGPT: Meta Programming for A Multi-Agent Collaborative Frameworkcited by 1,761
- 2022Competition-Level Code Generation with AlphaCodecited by 1,427
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,154
- 2023Teaching Large Language Models to Self-Debugcited by 963
- 2021Measuring Coding Challenge Competence With APPScited by 879
- 2021Show Your Work: Scratchpads for Intermediate Computation with Language Modelscited by 871
- 2019MathQA: Towards Interpretable Math Word Problem Solving with Operation-Based Formalismscited by 653
- 2024A Survey on Large Language Models for Code Generationcited by 646
- 2022PAL: Program-aided Language Modelscited by 635
- 2022DS-1000: A Natural and Reliable Benchmark for Data Science Code Generationcited by 442
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 389
- 2022CodeT: Code Generation with Generated Testscited by 369
- 2023Self-collaboration Code Generation via ChatGPTcited by 255
- 2024MapCoder: Multi-Agent Code Generation for Competitive Problem Solvingcited by 177
- 2022DocPrompting: Generating Code by Retrieving the Docscited by 151
- 2024Debug like a Human: A Large Language Model Debugger via Verifying Runtime Execution Step-by-stepcited by 123
- 2023Self-planning Code Generation with Large Language Modelscited by 121
- 2023Large Language Models as Analogical Reasonerscited by 107
- 2023Stay on topic with Classifier-Free Guidancecited by 90
- 2023CodeScore: Evaluating Code Generation by Learning Code Executioncited by 66
- 2023xCodeEval: A Large Scale Multilingual Multitask Benchmark for Code Understanding, Generation, Translation and Retrievalcited by 46
- 2024From Code to Correctness: Closing the Last Mile of Code Generation with Hierarchical Debuggingcited by 46
- 2023SelfEvolve: A Code Evolution Framework via Large Language Modelscited by 43
- 2025CODESIM: Multi-Agent Code Generation and Problem Solving through Simulation-Driven Planning and Debuggingcited by 31
- 2025QualityFlow: An Agentic Workflow for Program Synthesis Controlled by LLM Quality Checkscited by 22
- 2023MoTCoder: Elevating Large Language Models with Modular of Thought for Challenging Programming Taskscited by 9
- 2024Planning-Driven Programming: A Large Language Model Programming Workflowcited by 7
- 2024GenX: Mastering Code and Test Generation with Execution Feedbackcited by 4
- 2024Artificial Expert Intelligence through PAC-reasoningcited by 3
Built on by
Citing papers per year: 2025: 2; 2026: 8.
10 papers.
- 2026Code as Agent Harnesscited by 40
- 2026Towards Execution-Grounded Automated AI Researchcited by 19
- 2025A Comprehensive Survey on Benchmarks and Solutions in Software Engineering of LLM-Empowered Agentic Systemcited by 15
- 2026Controlled Self-Evolution for Algorithmic Code Optimizationcited by 11
- 2026EsoLang-Bench: Evaluating Genuine Reasoning in Large Language Models via Esoteric Programming Languagescited by 4
- 2026Falsification, Not Exposure: An Internally Preregistered Placebo-Controlled Decomposition of Self-Repair Feedback in Frozen Small Code Modelscited by 3
- 2025Out-of-Distribution Generalization in the ARC-AGI Domain: Comparing Execution-Guided Neural Program Synthesis and Test-Time Fine-Tuningcited by 2
- 2026Executing as You Generate: Hiding Execution Latency in LLM Code Interpreterscited by 2
- 2026Verifier-Guided Code Translation via Meta-Step Decodingcited by 1
- 2026Enhancing Mathematical Problem Solving in LLMs through Execution-Driven Reasoning Augmentationcited by 0
- 2026Falsification, Not Exposure: An Internally Preregistered Placebo-Controlled Decomposition of Self-Repair Feedback in Frozen Small Code Models30 Jun 2026
- 2026Code as Agent Harness18 May 2026
- 2026Verifier-Guided Code Translation via Meta-Step Decoding17 May 2026
- 2026Executing as You Generate: Hiding Execution Latency in LLM Code Interpreters1 Apr 2026
- 2026EsoLang-Bench: Evaluating Genuine Reasoning in Large Language Models via Esoteric Programming Languages10 Mar 2026
- 2026Enhancing Mathematical Problem Solving in LLMs through Execution-Driven Reasoning Augmentation3 Feb 2026
- 2026Towards Execution-Grounded Automated AI Research20 Jan 2026
- 2026Controlled Self-Evolution for Algorithmic Code Optimization12 Jan 2026
- 2025A Comprehensive Survey on Benchmarks and Solutions in Software Engineering of LLM-Empowered Agentic System10 Oct 2025
- 2025Out-of-Distribution Generalization in the ARC-AGI Domain: Comparing Execution-Guided Neural Program Synthesis and Test-Time Fine-Tuning17 Jul 2025
Similar, not cited
Close in wording, no citation either way
- 2025Adaptive Classifier-Free Guidance via Dynamic Low-Confidence Masking
- 2025PACIFIC: a framework for generating benchmarks to check Precise Automatically Checked Instruction Following In Code
- 2024StepCoder: Improve Code Generation with Reinforcement Learning from Compiler Feedback
- 2025CodeRL+: Improving Code Generation via Reinforcement with Execution Semantics Alignment
- 2026VeriInteresting: An Empirical Study of Model Prompt Interactions in Verilog Code Generation
- 2023AI Chain on Large Language Model for Unsupervised Control Flow Graph Generation for Statically-Typed Partial Code
- 2024RLEF: Grounding Code LLMs in Execution Feedback with Reinforcement Learning
- 2024Adaptable Logical Control for Large Language Models