Evaluating Front-End Code Generation in LLMs: Benchmarks and the Case for Open Weights
This article compares a Chinese open-weight model against an international closed-source flagship model on a real front-end requirement covering a login page, a product listing page, and a form page. It breaks evaluation into five measurable dimensions—requirement coverage, structural correctness, interaction completeness, runnability, and generation efficiency—and shows a clear capability decay curve across the three pages. The core gap lies in understanding implicit constraints rather than raw coding ability. The article also explains the practical value of open weights and offers actionable advice for developers running their own evaluations.
1. Background: Why “Generating a Page” Is Not the Same as “Delivering an Engineering Result”
Over the past year, general-purpose LLMs with code generation capabilities have been widely adopted to assist front-end development. A common claim in the community is that “a certain model is approaching the level of the international top tier,” but such conclusions are often based on isolated demo clips. The standard for actual engineering delivery is far more demanding: Can the requirements document be fully parsed? Can field definitions and validation relationships be accurately reproduced? Can the output run directly? Is the iteration speed acceptable?
This article uses a real front-end requirement as a sample to run a head-to-head comparison between a domestic open-weight model (referred to as the “model under test”) and an international closed-source flagship model (referred to as the “reference model”). The requirements document covers three parts—a login page, a product listing page, and a form page—and explicitly specifies a carousel, filtering conditions, field validation, and interaction logic. The focus of this evaluation is not “how similar it looks,” but “what is missing and why.”
2. Methodology and Scoring Dimensions
To make the conclusions reproducible, subjective impressions should be broken down into five quantifiable dimensions:
- Requirement coverage: the proportion of listed feature points that are implemented;
- Structural correctness: whether the page hierarchy, routing, and component breakdown are reasonable;
- Interaction completeness: whether filtering, linkage, validation, and error states form a closed loop;
- Runnability: whether the output can be accessed directly rather than only producing fragments;
- Generation efficiency: the time and stability from submission to preview.
An illustrative scoring logic can be written as:
score = (0.35 * coverage # highest weight for requirement coverage+ 0.25 * interaction # interaction completeness next+ 0.20 * structure+ 0.10 * runnable+ 0.10 * efficiency)
Making the weights explicit avoids the misjudgment of “it looks good, so it must be strong.”
3. Results: A Capability Decay Curve Across Three Pages
The login page performed the most stably. The carousel, form, and basic layout were all implemented according to the document, reaching a level that is “ready to ship with minor tweaks,” with clear structure and no obvious gaps.
Decay began to appear on the listing page. The page skeleton and data rendering were correct, but the filter items specified in the document were entirely missing. It is worth emphasizing that this was not an occasional omission but a common issue across multiple listing pages, indicating a systematic weakness in “feature enumeration under multiple constraints.”
The form page showed the most pronounced decay. The field set, inter-field dependencies, validation rules, and interaction details were not fully reproduced according to the document; the page ran, but the semantics were incomplete. A complex form is essentially a “state machine plus a set of constraints,” which places the highest demands on a model’s long-context consistency.
In terms of style, the visual quality of the output was better than typical prototype drafts, but still fell short of mature component library templates. The overall result leaned toward engineering, prioritizing “engineering usability over product polish.”
In terms of efficiency, the model under test took roughly half an hour or more to generate, with queuing during peak hours; the reference model finished in about three minutes. It should be noted that the speed difference is related to whether free quotas are used and to concurrency strategy, and cannot be directly equated with a gap in model capability.
4. Root Cause: Depth of Understanding, Not Generation Ability
Looking at the performance across the three pages together, the conclusion is fairly clear: the gap is not in “whether it can write code,” but in “whether it understood the constraints.” The international closed-source model reproduced field relationships, filtering logic, and validation details more faithfully, which essentially reflects a more complete extraction of implicit constraints in long documents.
The engineering improvement approach follows accordingly: structure the requirements document, explicitly list the feature checklist and acceptance criteria, and have the model align item by item, which can significantly mitigate the “missing implementation” problem.
acceptance:- page: listitems: [keyword_search, category_filter, price_range, sort]must_pass: true
5. What Open Weights Actually Mean
The value of open weights is concentrated in three areas: first, private deployment, so sensitive business data stays within the internal network; second, fine-tuning, which allows injecting an enterprise’s own design specifications and component usage into the model; third, cost control, avoiding the spending pressure that comes with linearly growing call volume. Correspondingly, an open-source approach requires the enterprise to take on the operational responsibility for inference resources, monitoring and alerting, logging services, and version upgrades—a different engineering trade-off from calling a managed service.
For cloud deployment, a common general-purpose combination is: a container platform hosting the inference service, object storage holding artifacts and datasets, a message queue for peak shaving, and a logging and monitoring system for observability. These general-purpose capabilities form the shared infrastructure foundation for both the self-built and managed routes.
6. Practical Advice for Developers
First, evaluations should use the same task, the same document, and the same acceptance criteria, avoiding conclusions drawn from demo clips. Second, break long requirements into structured input with an acceptance checklist. Third, apply manual review or a second generation pass for high-decay areas such as list filtering and form validation. Fourth, when selecting a model, weigh private deployment, fine-tuning, response latency, and concurrency stability together, rather than looking only at a single generation result. The competition between open and closed source will ultimately push the overall capability level upward—and that is the more worthwhile long-term gain beyond the evaluation itself.
