Evaluating LLM Code Generation: A Reproducible Benchmark and Engineering Playbook
Every time a new LLM ships, the community fills with leaderboard claims that are hard to reproduce. This article takes a different approach: it feeds a real frontend requirements document to a model, observes how it builds a runnable project from scratch, and scores the result across four dimensions: requirement comprehension, feature fidelity, visual and interaction quality, and generation speed. Using three sample pages (login, list, and form), it shows where models stay strong, where comprehension degrades, and why structured requirements and standardized deliverables matter more than raw speed. Readers will find a reusable evaluation framework for tool selection, plus practical guidance on bringing AI generation into a controlled workflow.
1. Background: Beyond the Hype, You Need a Reproducible Evaluation Method
Every time a new generation of LLMs is released, the community quickly fills with claims about “capability benchmarks” and “across-the-board superiority.” These conclusions usually come from scattered samples, with no unified requirements input or acceptance criteria, so their reference value is limited. For developers and enterprise engineering teams, the real questions are not leaderboard rankings but whether a model can reliably turn a requirements document into working software, reduce rework, and fit into an existing development workflow.
This article takes a different angle. Using a real frontend requirements document as input, it observes the model’s end-to-end performance in generating a runnable project from scratch, and breaks the evaluation into four dimensions: requirement comprehension, feature fidelity, visual and interaction quality, and generation efficiency. The same dimensions apply to assessing any AI coding tool and can serve as a general framework for internal selection and acceptance.
One caveat: generation speed is affected by account quotas, concurrent queuing, model versions, and network conditions, so a single session is not enough to draw a performance conclusion. Stability in requirement comprehension is the core variable that determines engineering usability.
2. Evaluation Design: Making Inputs and Acceptance Reproducible
For conclusions to hold up, the evaluation must fix the variables first.
- Fixed input: the same requirements document, covering the page inventory, field definitions, validation rules, interaction flows, and style constraints.
- Output requirement: no fixed tech stack; the model may choose its own framework, but it must produce a directly accessible, runnable project URL rather than isolated code snippets.
- Acceptance criteria: check feature coverage page by page, record missing and deviating items, and distinguish “occasional omissions” from “systematic weaknesses.”
The most critical criterion is a runnable deliverable. Code snippets alone still leave developers to scaffold the project, fill in dependencies, and wire up routing, which carries high hidden costs. Only a directly accessible project is ready to enter review.
3. Hands-On Observations: A Capability Gradient Across Three Pages
3.1 Login Page: Close to Usable
The login page includes common modules such as a carousel, form inputs, and status feedback. The model implemented the carousel and main interactions largely as documented, with complete page functionality and no obvious gaps, putting it at a level of “minor adjustments before release.” With mature structures and high patternization, this kind of page is where current models perform best.
3.2 List Page: Comprehension Starts to Degrade
Problems cluster on the list page: filter options explicitly written in the document were not implemented, and the same omission repeated across multiple list pages. The page skeleton is correct and data rendering works, but “functional semantics” were reduced to “visual structure.”
This points to a pattern: models tend to reproduce high-frequency, patternized UI skeletons, while business rules that require cross-section correlation (filter conditions tied to query parameters, empty states linked to pagination) are easily lost. The engineering response is to make such rules explicitly structured rather than relying on natural-language narration.
3.3 Form Page: Field Relationships and Validation Logic Fall Short
The form page runs overall, but the field set, linkage relationships, validation timing, and message copy deviate from the document. A complex form is essentially a state machine: field visibility dependencies, cross-field validation, and unified validation before submission. Once these constraints are scattered across descriptive text, the model struggles to reproduce them fully.
A practical approach is to describe fields and rules with a declarative structure, giving the model a clear anchor:
{"field": "phone","visibleWhen": { "field": "accountType", "equals": "mobile" },"rules": [{ "type": "required", "message": "Please enter your phone number" },{ "type": "pattern", "value": "^1\\d{10}$", "message": "Invalid phone number format" }],"validateOn": ["blur", "submit"]}
After migrating validation rules from prose to structured configuration, the probability of missing fields and rules drops significantly, and it becomes easier for human reviewers to check items off one by one.
4. Style and Engineering Quality: Usable Over Impressive
Visually, the generated results are usually more complete than common prototypes, but still fall short of the standardized visuals of a mature component system. The overall look is engineering-oriented and minimal, lacking memorable design touches. For most internal systems and middle-office scenarios, this “engineering usability over product polish” orientation is reasonable. For customer-facing products, additional design constraints are needed as input, such as grid specifications, color and spacing tokens, and component reuse requirements.
5. Root-Cause Analysis: The Gap Is Comprehension Depth, Not Generation
Observing different models against the same document reveals a clear dividing line: simple pages are close to each other, and the gap appears where “comprehension depth” is required, such as the semantics of filtering and querying, dependencies between fields, and validation and interaction details. Speed differences relate more to quotas and load, while comprehension accuracy directly determines the amount of rework.
From an engineering perspective, comprehension depth breaks down into three capabilities: aggregating information across sections, inferring implicit constraints, and making trade-offs among conflicting rules. Improving these three capabilities depends not only on the model’s own iteration but more on standardizing the input side.
6. Practical Recommendations: Bringing AI Generation into a Controlled Process
- Structure the requirements document: separate the page inventory, field tables, and rule tables; avoid long narrative paragraphs.
- Make complex logic explicit: express filtering, linkage, and validation with configuration or pseudocode.
- Generate in small steps and accept page by page: split tasks by page and check feature coverage page by page.
- Build a regression checklist: turn historical omissions into a checklist and a team asset.
- Standardize deliverables: unify the project scaffold, code standards, and static checks to lower integration costs.
- Connect with general cloud capabilities: static artifacts can be hosted on object storage and served through a content delivery network, API services can run on a container platform, and observability can be achieved with logging and monitoring with alerting. Model services can be invoked on demand through relevant Baidu AI Cloud platforms, which helps with quota and cost management.
7. Conclusion
Head-to-head comparisons of a single model generate buzz but rarely guide engineering decisions. What is more valuable is a stable evaluation framework: fixed inputs, clear acceptance criteria, and a distinction between occasional and systematic issues. Once requirements are expressed in a structured way and deliverables are constrained by standards, fluctuations in model capability are absorbed by the process, and AI-assisted development can truly move from “an impressive demo” to “stable output.”
