Evaluating LLM Code Generation in Frontend Engineering: Strengths and Limitations
While large language models (LLMs) are often benchmarked for their code generation capabilities, a gap frequently exists between lab scores and real-world engineering. This article uses a real-world frontend requirement document to evaluate how models perform when generating login, list, and form pages. By comparing open-source and closed-source models, we explore their practical delivery quality, the value of the open-source ecosystem, deployment risks, and best practices for developers.
The code generation capabilities of large language models (LLMs) are frequently used as a metric to measure their reasoning and generalization levels. However, a gap often exists between laboratory benchmarks and real-world engineering. This article uses a real-world frontend requirement document as input to observe the actual delivery quality of two types of models on login pages, list pages, and form pages, and discusses the significance of the open-source ecosystem for these tools.
1. Scope and Criteria of the Evaluation
This evaluation used only a single requirement document without specifying a programming language. The models defaulted to a mainstream frontend framework. The specific model versions, full prompts, execution environments, and iteration counts were not disclosed. Therefore, the time consumption and completion rates mentioned below are based on single observations and are not directly reproducible. The following sections will distinguish between conclusions supported by direct observation and those that are merely speculative.
2. Login Page: Basic Usability Achieved
When first accessing the open-source model, it frequently prompted that there were too many users, requiring queuing or payment. After several retries, access was successful, and it took about half an hour from the start of generation to outputting the complete project. The output was a directly accessible project link, eliminating the need to manually stitch together scattered code snippets, which provides practical help for integration work.
The carousel requirement in the login page was accurately implemented, with no obvious functional omissions. If evaluated against the standard of “modifiable with minor tweaks before going live,” this page reached a passing level. For standard pages with relatively simple structures and linear logic, the model demonstrated high usability.
3. List Page: Filter Conditions Not Implemented
The list page requirements included multiple filter options and their linkage rules. In the generated page, the filter options were not implemented. While the DOM structure of the page was correct, the functional logic was missing. This same issue repeated across multiple list pages, indicating a systemic problem. This phenomenon suggests that under long-context and multi-constraint instructions, models are prone to omitting functional conditions specified in the requirements.
4. Form Page: Field Mapping and Validation Deviate from the Document
The form page did not strictly adhere to the document in terms of field mapping, mandatory validation, regex matching, and linked interactions. From the output, the model seemed to apply a generic form template rather than restoring the specific business rules. For forms that require precise restoration of business rules, current models are not yet suitable for direct delivery; teams need to manually verify them item by item.
5. Visual Style
The overall interface was mediocre—more complete than a hand-drawn prototype but lacking in design aesthetics compared to mature UI component libraries. In this evaluation, engineering usability was prioritized over visual effects.
6. Comparison Between Open-Source and Closed-Source Models
The same set of requirements was previously implemented by a leading international closed-source model. The comparison results are as follows:
On the login page, both models achieved similar completion levels and met usability standards. On the list page, the closed-source model was able to fully understand the filter conditions and field structures, correctly implementing the interaction logic. On the form page, the closed-source model was more accurate in field association, validation rules, and interaction details. Regarding time consumption, the closed-source model completed the entire project in about 3 minutes, whereas the open-source model took about half an hour.
These gaps may be related to model scale and training data, but since these factors were not controlled in this evaluation, causality cannot be confirmed. A more accurate statement is: on this set of requirements, there is a performance gap between the two models, and the cause of this gap remains to be verified.
7. Value and Usage Risks of Open-Source Models
The primary value of open-source models lies in the fact that their weights can be publicly inspected, downloaded, and fine-tuned. Teams can deploy models in private environments, reducing the risk of code and requirement documents being transmitted externally. The community can also focus on improving failure cases, such as designing evaluation sets for long-context constraints or adding more multi-condition interaction examples to fine-tuning data.
Deployment methods generally fall into three categories: building a custom GPU cluster, using managed inference services provided by cloud vendors, or running them on a small scale on local workstations. Each approach involves trade-offs in cost, operational investment, and elastic scaling capabilities. Teams should choose based on their concurrency needs and data sensitivity.
When using them, the following risks must be noted:
First, open-source license terms vary and should be verified one by one before commercial use.
Second, privatized deployment requires continuous investment in GPU resources and operational personnel. The total cost should be calculated alongside pay-as-you-go API costs.
Third, generated code may contain logical errors or insecure practices, requiring manual review and automated testing before merging.
Fourth, for requirements involving user data, data compliance requirements must be confirmed beforehand.
8. Recommendations for Developers
First, break down requirements into checkable items. Each filter option and validation rule should correspond to an acceptance test case, making it easier to determine if the generated results meet the standard.
Second, for list and form pages, validate with a small range of examples before rolling out to the complete project.
Third, record the model versions, prompts, time consumed, and passed items so that every comparison can be reproduced by others.
9. Conclusion
Current LLMs can already generate usable initial drafts for basic pages, but complex business logic still requires manual verification. The more clearly the evaluation criteria are defined, the more reference value the comparison between open-source and closed-source models will hold.
