Benchmarking Frontend Code Generation in Chinese LLMs: An Engineering Evaluation Framework
This article presents a reusable framework for evaluating the frontend generation capabilities of large language models based on a controlled experiment using the same real-world requirements document. It examines why generating a page is not the same as delivering a working project, breaks down performance across login, list, and form pages, and shows that the remaining gap lies in requirement comprehension and state modeling rather than raw coding ability. It closes with practical engineering recommendations—structured requirements, incremental generation, automated acceptance tests, and clear human-AI division of labor—to help teams obtain reliable delivery results from current models.
1. Background: Why “Generating a Page” Is Not the Same as “Delivering a Project”
Over the past year, the code generation capabilities of large language models have evolved rapidly from “completing snippets” to “outputting runnable projects.” A common claim in the community is that certain Chinese models can now be compared head-to-head with leading international closed-source models, especially on interface generation tasks. These discussions attract a lot of attention, but the question that actually matters to developers is not “which one is stronger.” It is: under real business requirements, can the generated frontend project enter the delivery pipeline, and exactly where does the gap lie?
The original hands-on material describes a complete controlled experiment: the same frontend requirements document was given to two categories of models, and the output was accepted page by page. This article abstracts that experiment into a reusable evaluation method, strips away specific product attributes, and discusses only capability dimensions and engineering conclusions.
It is worth emphasizing that the difficulty of frontend generation has never been “writing JSX or template syntax.” It comes down to three things:
- Requirement fidelity: whether the filtering conditions, field relationships, and validation rules written in the document are fully understood and implemented;
- Engineering completeness: whether the output is directly accessible, well-structured, and extensible;
- Delivery efficiency: whether the time from submitting requirements to obtaining a usable artifact falls within an acceptable range.
2. Experiment Design: Using Real Requirements for Verifiable Comparison
For the conclusions to be credible, the experiment had to satisfy three conditions.
First, the requirements came from a real project rather than a toy example. The document included composite requirements such as a carousel, filtering interactions, form fields, and validation logic. Such requirements naturally carry ambiguity and implicit constraints, which best expose a model’s comprehension weaknesses.
Second, no technology stack was imposed, so the models’ default choices and engineering habits could be observed. In this experiment, the models defaulted to a component-based frontend framework and directly produced an accessible project URL instead of scattered code snippets. From an engineering perspective, this is a clear plus, because it moves the output from a “demo” to something “runnable.”
Third, the same requirements and the same document were used, with acceptance performed page by page. The acceptance dimensions were fixed: whether the page structure was complete, whether the functionality was fully present, whether the interaction details matched the document, and whether the visual style reached a deliverable standard.
3. Scenario-Based Findings: The Capability Curve Is Not Uniform Across Page Types
3.1 Login Page: Clear Structure, Simple Constraints, Highest Completeness
The login page contained a carousel and a basic form, with clear requirement boundaries and few states. The models fully implemented the carousel and the main functionality with no obvious omissions—at a level where it could go live after minor tweaks.
This illustrates a pattern: when a page has a small state space and explicit constraints, the model’s fidelity approaches its upper limit. Such tasks place low demands on comprehension and mainly test code organization.
3.2 List Page: Comprehension Begins to Degrade
The problems concentrated on the list page. The filter items and linkage logic explicitly written in the document were not implemented, and performance was consistent across multiple list pages, indicating that this was not an occasional mistake but a systematic capability gap.
From an engineering perspective, the complexity of the list page comes from “implicit constraints”: how filtering and pagination coexist, how empty states are handled, and whether the page number resets after a condition changes. These are often covered by a single sentence in the document, and models tend to produce only a “structurally correct” skeleton while dropping the functional semantics.
3.3 Form Page: Insufficient Fidelity for Field Relationships and Validation Logic
The form page was runnable overall, but field linkage, validation rules, and interaction details deviated from the document. Forms are the most state-management-intensive scenario in the frontend: fields have dependencies and mutual exclusions, and validation timing (on blur, on submit, triggered by linkage) significantly affects the experience. The model’s deviation here is essentially insufficient ability to reconstruct a complex state machine.
3.4 Visual Style: Engineering Usability Over Product Polish
The overall UI was at a level of “slightly better than the prototype,” but still fell short of the finished result produced by a mature component library paired with an atomic styling approach. The design felt engineering-oriented and lacked distinctiveness. For most internal systems this is already sufficient; for user-facing consumer products, design involvement is still required.
4. Comparative Analysis: The Gap Lies in Comprehension Depth, Not Coding Ability
Placing the outputs of the two model categories side by side yields a clear capability layering:
| Acceptance Dimension | One Category of Models | The Other Category of Models | Nature of the Gap |
|---|---|---|---|
| Login page | Near-complete | Near-complete | No obvious gap |
| List page | Constraints such as filtering missing | More complete structure and constraints | Comprehension depth |
| Form page | Deviations in fields and validation | More accurate field relationships | State modeling ability |
| Generation time | Noticeably slower (or affected by queuing and quotas) | On the order of minutes | Engineering efficiency |
The conclusion is not complicated: the gap in code generation ability is narrowing, while the gap in requirement comprehension depth remains significant. The time difference is often related to free quotas and queuing policies and should not be treated as the sole indicator of model capability.
5. Engineering Recommendations: Bringing Generation into a Controlled Process
Given these capability boundaries, the practical approach is not to wait for models to become stronger but to restructure the collaboration workflow.
- Structure the requirements document. Make implicit constraints explicit, for example by listing filter fields, linkage rules, validation timing, and empty-state requirements as a checklist.
Filter area:- Fields: category (single select), price range (numeric pair), listing time (range)- Linkage: reset the price range when the category changes- Pagination: return to page 1 after any filter changesForm area:- Field dependency: show the unified social credit code and make it required after selecting "Enterprise"- Validation timing: validate format on blur, validate cross-field consistency on submit
Generate in small steps per page. Split submissions by login page, list page, and form page, and accept each step before continuing, avoiding error accumulation from one-shot generation.
Establish automated acceptance. Use component tests to cover critical paths such as filter linkage and form validation, turning “looks correct” into “tests pass.”
Define a clear human-AI division of labor. The model handles skeletons and boilerplate code, while developers handle state modeling, boundary handling, and visual standards. When stable delivery and consistent style are required, engineering workflows can be completed with relevant general cloud capabilities from Baidu AI Cloud (for example, using a container platform to host the runtime, and log services with monitoring and alerting to ensure observability).
6. Implications for the Open-Source Ecosystem and Industry Evolution
Benchmarking model capabilities is not the endpoint. The real significance lies in three points. First, open-source and open-weight solutions lower the barrier to “runnable project generation,” giving more teams automated capability from prototype to delivery. Second, the focus of competition is shifting from “whether it can generate” to “comprehension depth and verifiability,” and evaluation methods should shift from demo effects to verifiable engineering metrics. Third, the human-AI collaboration paradigm is stabilizing—humans define constraints and acceptance criteria, while models produce output at scale.
The practical takeaway for developers is this: treat the model as an efficient but unreliable implementer, and build a closed loop with structured requirements, incremental generation, and automated testing. Only then can you reliably obtain engineering benefits at the current capability level.
