Does rewriting just the broken chunk of code cause fewer bugs than having AI regenerate the whole file?
Does block-level code regeneration reduce errors compared to file-level generation?
This explores whether having an AI rewrite only the specific chunk of code that needs changing produces fewer mistakes than having it regenerate an entire file. The corpus has no direct head-to-head comparison, but several nearby findings point the same way.
This explores whether regenerating only the block of code that needs to change causes fewer errors than regenerating the whole file. To be direct: none of the notes in this collection compares block-level and file-level generation head to head. What the corpus does have is evidence on three related questions: what happens to content an AI rewrites but didn't need to change, whether breaking work into small pieces makes it more reliable, and how much it matters to find the right spot before editing. Together they suggest an answer, though not a measured one.
The strongest clue comes from documents, not code. When LLMs are handed documents to work on over many steps, weaker models damage them by visibly deleting content. Frontier models do something harder to catch: they quietly corrupt content while the document still looks intact Does model capability change how documents degrade?. This bears on file-level regeneration because every line the model rewrites is a line it can silently change. If you regenerate a whole file to fix one function, the other 95% of the file is exposed to this kind of damage. Block-level editing limits how much can go wrong, so mistakes stay small and easier to find in review.
The second clue is about decomposition. MAKER completed tasks a million steps long with zero errors by breaking them into tiny subtasks and voting on each step. Small, non-reasoning models were enough once the pieces were small enough Can extreme task decomposition enable reliable execution at million-step scale?. This wasn't a code-editing study, but the principle carries over: small units of work can be checked one at a time, and errors don't pile up. A block is a smaller unit than a file. Feedback loops work the same way. FeedA11y does better than one-shot prompting because it repeatedly feeds an accessibility checker's results back into generation Can feeding accessibility violations back into code generation improve results?. Narrow, targeted fixes fit that loop better than full rewrites.
The catch is that block-level editing only helps if the model picks the right block. One study reorganized a code repository around what the code actually does at runtime. With that map, weaker planning models located the code they needed as precisely as much stronger models did Can better code maps help weaker planners match stronger models?. So finding the right spot may matter as much as how big the edit is. Editing the wrong block cleanly is still a bug. Notably, when the Darwin Gödel Machine was left to improve its own coding agent through trial and error, better code editing and better context management were among the capabilities it discovered on its own Can AI systems improve themselves through trial and error?. How an agent edits code turns out to have a large effect on its results, not a small one.
One warning cuts across all of this: code that runs isn't the same as code that's correct. In CAD generation, fine-tuning alone produced code that executed 91% of the time but matched the intended shape only about half the time Can CAD code be syntactically correct yet geometrically wrong?. LLM-written web code likewise passed surface accessibility checks while missing deeper requirements Do large language models write more accessible web code than humans?. Whatever size of edit you choose, "it compiles" will miss the most dangerous errors. That is the same silent-corruption problem that makes whole-file rewrites risky.
Sources 7 notes
DELEGATE-52 shows weaker LLMs degrade documents through visible deletion, while frontier models degrade through subtle corruption that preserves surface integrity. This shift makes frontier failures harder to detect and potentially more dangerous at workflow scale.
MAKER solves million-step tasks with zero errors by decomposing into minimal subtasks, applying voting at each step, and flagging correlated errors. Surprisingly, small non-reasoning models suffice when decomposition is extreme enough, inverting the standard approach to hard problems.
FeedA11y's ReAct-based feedback loop significantly outperforms zero-shot, few-shot, and self-criticism prompting by iteratively feeding evaluator results back into generation. However, it still struggles with nuanced ARIA constraints like keyboard navigation and focus management, suggesting evaluator feedback alone cannot substitute for domain expertise.
A behavior-indexed repository linking code to runtime actions raised plan quality, cut planner tokens by 8-13%, and let weaker models achieve the same code-localization precision as substantially stronger ones across multiple benchmarks.
DGM replaces formal proofs with empirical benchmarking and maintains an evolutionary archive of agent variants, achieving 2.5× improvement on SWE-bench and 2.2× on Polyglot by discovering capabilities like better code editing and context management.
Show all 7 sources
Supervised fine-tuning alone produces 91% executable CAD code but only 50% geometric IoU. Chain-of-thought reasoning raises IoU to 61%, while RL post-training pushes it to 72%, showing the two capabilities decouple during early training.
GPT-4o and Qwen2.5-Coder outperformed human developers on contrast and alt text but struggled with ARIA attributes. Both models produced code that passed surface-level automated checks while missing deeper semantic requirements.
Papers this line draws on 8
The research behind the notes this line reads — ranked by how closely each paper relates.
- Human or LLM? A Comparative Study on Accessible Code Generation Capability
- LLM Based Web Accessibility Repair: An Empirical Study of Detection, Remediation, and Cost
- Generative UI: LLMs are Effective UI Generators
- The Illusion of Diminishing Returns: Measuring Long Horizon Execution in LLMs
- ScreenCoder: Advancing Visual-to-Code Generation for Front-End Automation via Modular Multimodal Agents
- Code Aesthetics with Agentic Reward Feedback
- The Darwin Gödel Machine: AI that improves itself by rewriting its own code
- Darwin Godel Machine: Open-Ended Evolution of Self-Improving Agents