atlas

Research map / Large language models / Agents, code and math

NExT: Teaching Large Language Models to Reason about Code Execution

ICML 2024 · Large language models › Agents, code and math · approach: Execution-based code verification · 6 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes NExT, a self-training method that finetunes PaLM 2-L to generate natural-language rationales grounded in inline-formatted execution traces for program repair, filtered by unit tests.

Problem

LLMs trained on code surface text lack semantic understanding of program execution, and CoT prompting with execution traces in natural language is unreliable for program repair.

Approach

Iterative expert-iteration self-training where the model is given inline-commented execution traces as input and learns to produce natural-language rationales plus fixes, with unit-test results as the weak-supervision filter; training focuses on hard problems and always finetunes from the initial checkpoint.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
apply NExT self-training with rationales and execution tracesPaLM 2-L · MBPP-Rpass@1: 23.2 -> 49.3Helped
apply NExT self-training with rationales and execution tracesPaLM 2-L · MBPP-Rpass@25: 65.0 -> 79.4Helped
apply NExT self-training with rationales and execution tracesPaLM 2-L · HumanEvalPackpass@1: 32.2 -> 42.5Helped
add natural-language rationales during iterative training (ablation)NExT on PaLM 2-L · MBPP-Rpass@25: 71.8 -> 79.4Helped
add natural-language rationales during iterative training (ablation)NExT on PaLM 2-L · HumanEvalPackpass@25: 69.4 -> 76.5Helped
add execution traces during training (ablation)NExT on PaLM 2-L · MBPP-Rpass@1: 44.1 -> 49.3Helped
add execution traces during training (ablation)NExT on PaLM 2-L · HumanEvalPackpass@1: 38.1 -> 42.5Helped
train only on hard examples instead of both easy and hard examples (ablation)NExT on PaLM 2-L · MBPP-Rpass@25: 73.4 -> 79.4Helped
train only on hard examples instead of both easy and hard examples (ablation)NExT on PaLM 2-L · HumanEvalPackpass@25: 76.6 -> 76.5No clear effect
remove traces from the input at test time (ablation)NExT trained with traces · MBPP-Rpass@1: 49.3 -> 40.8Hurt
add execution traces to few-shot CoT prompting (ablation)PaLM 2-L · MBPP-Rpass@1: 16.3 -> 23.2Helped
add execution traces to few-shot CoT prompting (ablation)PaLM 2-L · HumanEvalPackpass@1: 30.3 -> 32.2Helped

Surprising findings

Limitations

Experimental setup

Datasets: MBPP-Repair (MBPPR, newly constructed from MBPP) HumanEvalFix augmented with EvalPlus tests (HumanEvalPack)

Benchmarks: MBPPR HumanEvalPack (HumanEvalFix with EvalPlus tests)

Metrics: pass@k end-to-end fix rate proxy-based pass@k using smaller LMs human rating of rationale quality (explain bugs, suggest fix

Baselines: PaLM 2-L 3-shot GPT-4 GPT-3.5 Mixtral-8x7B DeepSeek Coder 33B StarCoder SelfAPR-style NExT w/o rationale NExT w/o traces

Builds on: STaR SelfAPR Scratchpad Self-Debugging chain-of-thought prompting

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy