Evaluating Front-End Code Generation in Chinese LLMs: Benchmarks and the Case for Open Weights
This article presents a practical evaluation of how general-purpose LLMs with code generation capabilities handle end-to-end front-end engineering tasks. It defines five observable dimensions of engineering usability, outlines a reproducible testing method, and reports findings from a real project: page skeletons pass, but business semantics lose points. The analysis attributes the gap to semantic decay in long contexts and recommends structuring requirements, automating acceptance checks, and splitting generation into steps. It also explains why open weights matter for private deployment, fine-tuning, cost control, and ecosystem evolution, along with a practical checklist for teams adopting code generation.
1. The Problem: From Impressive Demos to Engineering Usability
Over the past year, general-purpose LLMs with code generation capabilities have rapidly become an assistive role in development workflows. In demos, generating a polished landing page from a single sentence is no longer surprising. But when you hand the model a real requirements document containing multiple pages, multiple fields, and multiple validation rules, and ask it to produce a runnable front-end project end to end, the results are often far less encouraging.
The value of this kind of evaluation is that it shifts the measuring stick from “does it look right” back to “can it be delivered.” The criteria for engineering usability are not mysterious; they can be broken down into five observable dimensions:
- Requirement coverage: the proportion of listed features that are actually implemented;
- Depth of understanding: whether field relationships, state transitions, and boundary conditions are modeled correctly;
- Interaction completeness: whether filtering, linkage, validation, and error messages form a closed loop;
- Generation efficiency: the time from submission to an accessible artifact;
- Visual and engineering standards: whether the styling system is consistent and the directory structure supports further development.
Note that this article does not rank specific products. Instead, it abstracts a real project practice into a general evaluation method that teams can reference during selection and process design.
2. Designing the Evaluation for Reproducibility
For evaluation conclusions to hold up, both inputs and judgments must be standardized. The recommended minimal setup is as follows.
On the requirements side, prepare a clearly structured requirements document containing at least: a page inventory, field definitions for each page, field types and required rules, filter conditions and default values for list pages, validation rules and error messages for form pages, and navigation relationships between pages. The closer the document is to a real development deliverable, the more meaningful the evaluation.
On the execution side, fix the variables: do not specify a tech stack, and observe the model’s default selection tendency; do not add multi-turn prompt corrections, and record the completeness of the first output; keep the generated artifact URL for page-by-page acceptance.
On the acceptance side, use a scoring sheet. Record each feature as “fully implemented / partially implemented / not implemented,” then convert the results into a coverage rate. A sample record structure can be written as:
{"page": "list","items": [{"feature": "keyword_search", "status": "partial"},{"feature": "status_filter", "status": "missing"},{"feature": "pagination", "status": "done"}],"coverage": 0.33}
The benefit of this structured record is that conclusions are no longer subjective impressions but data that can be compared horizontally and tracked vertically.
3. Observed Results: Page Skeletons Pass, Business Semantics Lose Points
In one complete practice run, the model chose a component-based front-end framework without any tech stack constraint. The end-to-end time was on the order of half an hour, and it produced a directly accessible project URL, which is clearly better than interactions that only return code snippets.
The login page performed close to expectations: the form structure, basic validation, and submission feedback were all present, at a level that could go live after minor tweaks.
Problems began to surface on the list page. Multiple filter options explicitly written in the document were not implemented, and this was not an isolated single-page incident but a common omission across multiple list pages. The page skeleton and table column structure were basically correct, but at the level of “functional semantics” there was clear loss: the model reproduced the shape of the interface but not the business rules.
The form page had finer-grained issues: fields were mostly complete, but field linkage, required and format validation, and the timing of error messages deviated from the document. Such deviations are hard to notice in a demo but directly determine usability in real business.
Visually, the output was better than most prototypes but still short of the standards of a mature styling system, leaning toward engineering and lacking design memorability. In short: engineering usability is greater than product expressiveness.
For comparison, a similar task had been run once on another route of large models: login page completeness was close, the list page showed a more complete understanding of filters and field structure, and the form page had a clearer advantage in reproducing field relationships and validation logic, with end-to-end time compressed to a few minutes. The core gap is not “can it write code” but “depth of understanding”: whether natural language requirements can be mapped into an accurate data model and state machine.
4. Root Cause Analysis: Semantic Decay in Long Contexts
Abstracting the above phenomena one level up yields three general causes.
First, the mapping from requirements to the model is a lossy compression. The longer the document, the more easily later and detail-level constraints are diluted, showing up as “structure correct, rules lost.”
Second, models tend to generate a “runnable skeleton” rather than “complete business rules.” A skeleton brings immediate runnable positive feedback, while completing rules is costly and hard to capture through visual acceptance.
Third, there is no external validation loop. Without type constraints, test cases, or an acceptance checklist, the model cannot self-check for omissions.
The corresponding improvements follow naturally: structure the requirements (field tables, rule tables), automate acceptance (test cases for critical paths), split generation into smaller steps (generate page by page and accept page by page), and externalize constraints (use type definitions and configuration to describe validation rules), so the model works within clear boundaries.
5. Why Open Weights Matter: From Usable to Governable
When a class of model capabilities approaches the state of the art, whether weights are open and to what degree significantly changes its industrial significance. The value of open weights can be summarized in four points:
- Private deployment: sensitive data stays within your domain, meeting compliance and audit requirements;
- Fine-tuning and alignment: adapt to your domain using your own code repositories and standards, mitigating the general model’s shallow rule understanding;
- Cost control: plan inference resources and call volume autonomously, making capacity and budget design easier;
- Ecosystem evolution: the community keeps iterating around evaluation sets, toolchains, and best practices, forming a positive feedback loop.
The costs should also be viewed objectively: self-hosted inference requires ongoing investment in compute, operations, security hardening, and version upgrades. A common engineering practice is to layer capabilities: use general model services in the cloud for rapid validation and peak load, use private deployment for highly sensitive and highly customized scenarios, and route and fall back through a unified model access layer to avoid strong coupling with a single implementation.
In terms of deployment architecture, generative capabilities usually need to work with several general cloud capabilities: object storage for static artifacts and assets, container platforms for inference and preview environments, message queues for asynchronous long-running tasks, logging services and monitoring alerts for observability, and key and configuration management to hold the security baseline. These are general categories; selection should be based on your own compliance and cost model.
6. Practical Recommendations
For teams preparing to introduce code generation into their development workflow, here are directly actionable steps:
- Build an internal evaluation set: 20–30 real requirements covering high-frequency scenarios such as lists, forms, permissions, and charts, forming a regression baseline;
- Templatize requirements documents: separate field tables from rule tables, describe rules with decidable statements to reduce ambiguity;
- Split the generation process: first produce the information architecture and data model, then the page skeleton, and finally interactions and validation;
- Automate acceptance: add a minimal test case set for critical paths, turning “not implemented” into an observable failure signal;
- Clarify human-machine division of labor: the model handles first drafts and repetitive work, while humans own architecture decisions, boundaries, and security;
- Build an access abstraction layer: unify the model invocation interface, keep the ability to switch among multiple implementations, and reduce lock-in risk.
7. Conclusion
One end-to-end test shows that current general-purpose LLMs with code generation capabilities can already stably produce a “runnable, deliverable first draft” front-end project, but there is still clear room for improvement in complex business semantics, detail restoration in long documents, and generation efficiency. The real dividing line is depth of understanding, not syntactic correctness. For the industry, approaching the state of the art is only the starting point; openness and governability are what turn technology into productivity: they determine whether data can stay within your domain, whether the model can fit the business, whether costs can be planned, and whether the ecosystem can keep evolving. Doing the evaluation solidly, breaking the process into fine steps, and automating acceptance is the realistic path from “usable in a demo” to “reliable in engineering.”
