How Large Language Models Write Code: Why Engineering Delivery Standards Are the Real Bottleneck
This article explains why large language models often fail to produce reliable engineering output despite generating runnable code. It breaks the code generation workflow into five stages—requirement parsing, context construction, solution planning, patch generation, and verification—and outlines four gaps between code that runs and code that passes review. It then presents four practices for approaching engineering standards, along with a clear division of responsibility between AI coding tools and human engineers.
1. The Problem Is Not Whether the Model Can Code, but the Delivery Standard
Engineers with years of experience often notice a gap after trying AI coding tools: the demos look impressive, yet the tools struggle to produce stable output once integrated into daily workflows. The root cause is not a lack of coding ability. It is that the standard for engineering delivery is far higher than “generating a piece of runnable code.”
A qualified engineering delivery usually carries several implicit constraints: the person submitting the change must fully understand the logic behind it; the scope of the change must correspond strictly to the problem, with no unrelated refactoring mixed in; the change must be reviewable by colleagues within a limited time; and it must also satisfy style conventions, documentation updates, test coverage, and rollback capability. Together, these constraints define what “high-quality engineering” means, and most of them are not part of the model’s default optimization targets.
So when discussing AI coding tools, a more useful question is not “Can it write code?” but “Across a complete delivery chain, which stages are reliable and which ones still require a human backstop?”
2. Five Key Stages in the Code Generation Pipeline
Breaking down how an agent works reveals five stages, each with its own failure mode.
- Requirement parsing. Converting a ticket’s natural-language description into decidable goals and acceptance criteria. The failure mode is missing implicit constraints—for example, implementing only the main flow while ignoring boundary conditions and exception branches.
- Context construction. Retrieving relevant files, interface definitions, data structures, and historical changes to form a limited context window input. The failure mode is “not seeing a key constraint,” which leads to code inconsistent with the existing architecture.
- Solution planning. Determining the change points, the scope of impact, and the execution order. The failure mode is being locally correct but globally conflicting—for example, new logic that bypasses the existing unified error handling.
- Patch generation. Outputting a diff that can be applied directly rather than rewriting an entire block. The failure mode is imprecise formatting, incorrect indentation, or wrong reference paths, making the patch impossible to apply directly.
- Verification and correction. Running builds, static checks, and tests, then iterating based on feedback. The failure mode is “self-confirmation bias,” where the model tends to believe its own code is correct and skips real verification.
A schematic view of the flow:
Ticket description-> Goals and acceptance criteria (decidable)-> Context set (files/interfaces/constraints)-> Change plan (change points + impact scope)-> Diff patch (minimal change)-> Verification feedback (build/static checks/tests)-> Human review and merge
The defining characteristic of this chain is that the quality of verification feedback directly sets the upper limit on the quality of the final output.
3. Four Gaps Between “It Runs” and “It Passes Review”
The first gap is change granularity. Generative models tend to deliver a “complete implementation,” often adjusting directory structure, renaming variables, or swapping dependency styles along the way, which makes it hard for reviewers to separate necessary changes from noise.
The second is explainability. The submitter needs to justify every changed line. If the code comes from “black-box generation” and the author cannot explain it, the cost of later debugging and iteration rises significantly.
The third is implicit constraints. Team conventions, legacy compatibility requirements, and specific business definitions are often not written in the code, so the model has no way to infer them.
The fourth is verification completeness. Passing compilation only shows that the syntax is correct; there is still distance between that and correct behavior, acceptable performance, and no security risks.
4. Four Practices That Bring Output Closer to Engineering Standards
Prioritize context engineering. Give the agent stable context sources: interface contracts, data structure definitions, descriptions of directory responsibilities, style conventions, and recent related changes. The more structured the context, the closer the output stays to the existing architecture.
Make constraints explicit. Write acceptance criteria as decidable items, for example, “add only one read-only interface, do not change the existing return structure, and route exceptions through the existing error codes.” The clearer the constraints, the less the model needs to fill gaps by guessing.
Minimize changes. Require output in the form of a diff patch and prohibit unrelated reordering; do a “line-by-line restatement” of the generated change, and delete or rewrite any part the author cannot explain.
Back it with a verification system. Wire builds, static checks, unit tests, integration tests, and any necessary performance and security scans into an automated pipeline so that machines make the judgment instead of subjective opinion. Container platforms can help keep environments consistent, while logging services and monitoring alerts can show whether behavior after release matches expectations.
5. Where the Boundary Between Humans and Machines Lies
What is suitable to hand to AI coding tools are scenarios with clear patterns and low verification cost: boilerplate code, unit test skeletons, interface adapter layers, filling in logging and error handling, and explaining or suggesting refactors for existing code.
What engineers must lead are goal definition, solution trade-offs, impact assessment, and final review sign-off. The responsible party cannot be transferred, and the review stage should not be replaced by “generated means approved.”
In engineering practice at Baidu AI Cloud, a common approach is to consolidate these capabilities into team-level standards: unified context templates, a unified verification pipeline, and a unified review checklist, so that the output of AI coding tools is brought into the existing engineering system rather than floating outside it.
6. Conclusion
What AI coding tools truly change is the marginal cost of the coding stage, not the engineering standard itself. Once generation becomes cheaper, the bottleneck quickly shifts to requirement clarification, context supply, and verification capability. Build those three well, and generated code can move from “good enough for a demo” to “passes review and stays under control in production.”
