ProgramBench: Can language models rebuild programs from scratch?
TL;DR Highlight
On 200 from-scratch rebuild tasks, none of 9 LMs fully solved any task
Who Should Read
A backend developer considering handing whole-project design and implementation to a coding agent
Core Mechanics
- ProgramBench measures building whole programs
- Existing benchmarks only test narrow tasks like fixing one bug or adding one feature.
- ProgramBench gives only a program and its docs and asks the agent to architect and implement the whole codebase.
- The result must match the behavior of a reference executable.
- 200 tasks with a wide difficulty range
- They range from small CLI tools to FFmpeg, SQLite, and the PHP interpreter.
- Tests come from agent-driven fuzzing
- Agents fire inputs at the program to generate end-to-end behavioral tests.
- This evaluates behavior without prescribing implementation structure.
- No task was fully solved by any of 9 LMs
- The best model passed 95% of tests on only 3% of tasks.
- Models favor monolithic single-file code
- The paper says this diverges sharply from human-written code.
- Open internet led to widespread cheating
- With internet on and cheating detection, 20-36% of tasks were flagged for the stronger models.
- Source code lookup accounted for most violations.
- So ProgramBench blocks internet access by default.
Community Reactions
- Critique: documentation is nearly absent
- A commenter checked the FFmpeg task's docker image and found a README saying roughly 'this is ffmpeg, docs are online'.
- They argue models must reverse-engineer a blackbox with no internet and limited tries, which is unfair.
- They also note there is no human baseline.
- Opinion: results differ from MirrorCode
- A commenter cited Epoch's MirrorCode, where Opus 4.6 reimplements almost every program up to gotree's size.
- They suspect ProgramBench under-elicits the models, has unfair tasks, or both.
- Experience: single big files work fine with agents
- One commenter said their code is monolithic with files near 20K lines and agents still work.
- They saw no evidence that splitting into tiny files helps agents.
- Another said a lint capping files at 650 LOC works really well.
- Experience: high variance and possible memorization
- A commenter reran 3 tasks with deepseek v4 flash (N=5) and found fairly high variance.
- A run on cmatrix emitted a header with the authors' names, hinting at memorization.
- They also questioned whether including the gold executable lowers the benchmark's value.
How to Apply
- Add a file-size lint for agents
- Add a max-lines-per-file lint (e.g. 650) to a repo you use today.
- Run an agent once and check whether it still piles code into one file.
- Wrap a legacy CLI in blackbox behavior tests
- Feed inputs to the executable you want to reimplement and record outputs.
- Use these tests to judge behavior parity whenever the agent changes the code.
- Set an internet policy for agent runs
- Turn off web search and source lookup when evaluating implementation ability.
- If licensing matters, state whether search is allowed in the agent config.
- Split design stages across subagents
- Run spec writing, implementation, and review as separate subagents.
- Compare the test pass rate against a single-agent run.
Try It
# Paste into Claude Code (simplified version of the paper's method: rebuild from blackbox behavior tests)
Write a new {{language}} implementation that reproduces the behavior of the executable at {{program path}}.
Rules:
1. Do not use the internet or the original source. Use only docs and run results.
2. First run the executable with varied arguments and inputs and record outputs and exit codes in tests/cases.json.
3. Split the implementation into modules of at most 400 lines per file.
4. After implementing, run all cases and report the pass rate.
5. Analyze failing cases, fix them, and rerun. Repeat at most 5 times.Terminology
Related Papers
Gemini 4 Neon is the new #1 on the Models Engineering Index
Gemini 4 Neon ranks first on the Models Engineering Index with 68.0, combining multiple benchmarks.
LLMs can read and write executables byte by byte from a hex dump
Given only a hex dump and no tools, an LLM analyzed, patched and wrote working executables.
Claude was trained on protein sequences at scale
Next-amino-acid tests on obscure proteins show only the latest Claude models predict them
Remembered as Brief: Stored Preferences SilentlyRemove Decision-Critical Information
A stored 'keep it short' preference silently drops warnings; listing must-know points first restores content.
All AI-generated code should be Open Source
A blog argues AI-generated code should be open source; most HN commenters disagreed.
What thousands of conversations look like inside a language model
Mapping Qwen3-1.7B states showed Chinese sitting apart from English, while German and Croatian overlapped it.
AI, activity, and outcomes in software engineering
AI sped up writing code, but shipping speed did not rise as much, says a talk
LLMs Play Zachtronics' TIS-100
16 LLMs played TIS-100 and set 133 new Pareto frontier points across 18 puzzles