Evaluating Large Language Models for Full Front-End Project Generation: Engineering Practices and Lessons
This article examines how to evaluate large language models when they are expected to generate complete, runnable front-end projects rather than isolated code snippets. It proposes an end-to-end evaluation framework covering deliverability, requirement coverage, interaction fidelity, engineering consistency, and generation efficiency. Based on testing scenarios involving login pages, list pages, and forms, it analyzes common defects such as missing cross-page state, lost implicit constraints, ambiguous form rules, and limited visual polish. It recommends structuring requirements as machine-executable specifications with acceptance criteria, generating projects in stages, and closing the loop with linting, type checking, unit tests, end-to-end smoke tests, and visual regression. It also discusses why reproducible evaluation, data compliance, domain adaptation, and cost control make open-weight models important for engineering use.
1. From Code Snippets to Runnable Projects
Over the past two years, evaluations of code-generation tools have mostly focused on function-level or algorithm-level tasks: given a signature and a comment, complete a piece of logic. This type of evaluation is now relatively mature, and top models have largely entered a plateau in accuracy. However, once the task becomes “input a product requirements document and output a complete, directly accessible multi-page application,” the original evaluation dimensions quickly become inadequate.
The reason is that the nature of the task has fundamentally changed:
- From local to global: Function-level tasks only need to satisfy local semantics, while project-level tasks require semantic consistency across files, pages, and states.
- From single-turn to multi-turn: Code completion is usually a one-shot task, while project generation must maintain consistent architectural decisions over a longer period.
- From compilable to acceptable: Passing compilation is only the lower bound. The real requirement is that each item in the requirements document is implemented.
- From plain text to multimodal expectations: UI generation also implies requirements for visual quality and interaction patterns.
Therefore, evaluating this kind of capability requires a new methodology. Old benchmark-style scoring approaches are no longer sufficient.
2. Building an Evaluation Framework: Five Quantifiable Dimensions
I recommend conducting end-to-end evaluation on real project requirements and breaking the results down into the following five dimensions. This avoids vague judgments such as “it feels good.”
| Dimension | Observation points | Evaluation method |
|---|---|---|
| Deliverability | Whether the output is a complete project rather than isolated code blocks; whether dependencies can be installed and the application started | Verify by accessing the running URL or starting it locally |
| Requirement coverage | Whether every feature listed in the document is implemented | Break requirements into a checklist and verify them one by one |
| Interaction fidelity | Whether field relationships, validation rules, interactions, and state transitions are accurate | Manually walk through state transition paths |
| Engineering consistency | Whether directory structure, naming, type constraints, and styling approaches are consistent | Static checks and code review |
| Generation efficiency | Queue wait time, generation time, and number of retries | Measure elapsed time and distinguish service-tier differences from model capability differences |
The fifth point is often misinterpreted. In practice, the same model can take several times longer end to end under different service tiers or load periods. A medium-sized multi-page project typically finishes somewhere between a few minutes and tens of minutes. Attributing wait time directly to weak model capability is one of the most common evaluation mistakes. The correct approach is to fix the service tier and time window, or at least record environmental conditions.
3. Typical Defects Observed in Testing and Their Root Causes
In testing with a realistic requirement involving a login page, a list page, and a form page, capability degradation showed a clear pattern: the more standardized a part is, the better it is completed; the more implicit state it contains, the faster the quality degrades.
3.1 Entry Pages: Mature Patterns and Near-Limit Completion
Pages such as login and registration are highly standardized in internet products, and training data coverage is extremely dense. In testing, these pages can usually implement major elements such as carousels, tab switching, and form submission. They often reach a level of “structurally complete, with only minor adjustments needed before release.”
This does not prove general engineering capability. It mainly shows that the model has strong pattern memory.
3.2 Lists and Filters: Shared Cross-Page State Is the Main Weakness
Problems often appear in filtering and querying modules. A typical case is: the page skeleton is correct, the table and pagination exist, but explicitly stated filters are missing, or filters are not connected to the list data. This is usually not an isolated incident but a systematic weakness across multiple pages.
There are three root causes:
- Incorrect state-scope judgment: Filter conditions are naturally shared state across pages. For example, if a user goes from the list page to a detail page and then returns, the filter conditions should remain. Models tend to implement local state inside each page, causing semantic disconnection.
- Loss of implicit constraints: A requirement such as “filter conditions are preserved after returning to the list page” is something human readers can infer. Models often treat it only literally.
- Requirement-density dilution: When the requirements document is long, later items are diluted in the effective context. This often appears as “the later the requirement, the more likely it is to be missed.”
3.3 Complex Forms: Constraint Formalization Determines Accuracy
The gap is even more obvious in form pages. The essence of a form is a set of constraints: field types, required rules, format validation, inter-field dependencies, and consistency checks before submission. When these constraints are described in natural language, ambiguity remains. For example, should “amount cannot exceed inventory” be validated immediately? Does a changed phone number need to be revalidated?
Where ambiguity exists, the model makes default choices, and these choices often differ from expectations.
The conclusion is clear: the degree to which requirements can be formalized directly determines reconstruction accuracy. This is not only a model problem. It reflects a lack of shared specifications between humans and models.
3.4 Visual Style: Engineering Usability Is Not Product Polish
At the UI level, generated interfaces are usually somewhat better than wireframes, but they still lag behind outputs built directly with mature component libraries or atomic CSS systems.
The positioning should be clear: at this stage, the output is more suitable for “engineering usability,” meaning it can quickly produce an interactive skeleton for later refinement. It is not yet ideal for directly producing a visual design ready for public release. Calibrating this expectation significantly reduces disappointment during evaluation.
4. Turning Requirements into Model-Executable Specifications
Since the bottleneck is ambiguity rather than capability, the most effective improvement direction is to change the input. I recommend upgrading free-text requirements into a two-layer structure: structured specifications plus verifiable acceptance items.
project: user-centerstack: {framework: "any mainstream front-end framework", ui: "mature component library", lang: "TypeScript"}pages:- id: product-listroute: /productsstate:filters: {scope: "global", persist: true} # Explicitly declare scopefeatures:- Keyword search with 300 ms input debounce- Three filters: category, price range, and listing status; multi-select- Return to page 1 after filter changes- Preserve all filters when returning from the detail pageacceptance:- "After selecting two categories, the list request includes categories=[id1,id2]"- "Filter conditions are preserved after page refresh"- id: product-formroute: /products/newfields:- {name: price, type: number, required: true, rule: "0 < price <= stock"}- {name: stock, type: integer, required: true}interactions:- "Validate price on blur; revalidate price when stock changes"acceptance:- "If price > stock, submission is blocked and focus moves to the price field"
Three points are critical:
- Explicitly declare state scope.
- List interaction rules one by one.
- Write acceptance items as assertable observations.
The third point is especially important. It turns “correct or not” from a subjective judgment into an automatically executable check.
5. Engineering Closed Loop: Divide-and-Conquer and Automated Validation
The success rate of generating an entire project in one shot is naturally low. A more robust approach is to split the work into stages and introduce automated validation at each stage:
# Pseudocode: spec-driven generation with stage-by-stage validationgenerate_scaffold(spec) # 1. Generate the project scaffold and routes onlyrun: lint && typecheck # 2. Run static analysis and type checksgenerate_page(spec, page_id) # 3. Implement one page at a time with a cleaner contextrun: unit_test && e2e_smoke # 4. Run unit tests and end-to-end smoke testsrun: spec_acceptance(spec) # 5. Assert acceptance criteria one by one# If a check fails, feed the error log back and regenerate that page instead of rebuilding the whole project
The value of this loop is that it converts the model’s misunderstanding into a locatable test failure, then uses the error log to drive correction. Compared with repeatedly regenerating the entire project, regenerating a single page converges much faster and uses quota more efficiently.
It is also useful to introduce visual regression as a supplementary UI check. Comparing screenshots of the design and the generated output can catch issues that superficially look “about right.”
6. Implications for Open-Weight Models and the Broader Ecosystem
At a broader level, progress in engineering-level code generation has implications for the open-weight model ecosystem—models that can be downloaded and self-hosted—that go far beyond a single benchmark result.
Reproducible evaluation. Proprietary API versions may change silently. Conclusions that cannot be reproduced today will be even harder to reproduce tomorrow. Open-weight models allow fixed versions, fixed inference parameters, and repeated experiments on the same hardware. This is a prerequisite for credible evaluation standards.
Data compliance and private deployment. Enterprise source code is often a core asset and cannot leave the organization. Self-hosted models make “code stays inside the internal network” an engineering constraint rather than a promise. In finance, manufacturing, and government scenarios, this is often an entry requirement rather than an optimization.
Room for domain adaptation. General-purpose models inevitably have limited knowledge of internal component libraries, private API conventions, and team coding standards. Open-weight models make continued pre-training or supervised fine-tuning based on proprietary codebases possible. Such adaptation usually brings greater benefits than simply switching to a model with more parameters.
Controllable cost structure. Unit inference cost is predictable and optimizable through quantization, distillation, caching, and batching. This is decisive for organizations that need large-scale deployment. Differences between service tiers and deployment forms must also be included in evaluation. Otherwise, engineering constraints may be mistaken for capability gaps.
Tiered ecosystem roles. A more realistic picture is layered collaboration: general-purpose models with strong capabilities handle architecture design and difficult reasoning, while adapted lightweight models handle high-concurrency routine generation and completion. In cloud environments, supporting services are usually available, such as container platforms for inference services, object storage for models and artifacts, and logging and monitoring for stability and observability. Together, these general capabilities form the foundation for deploying open-weight models.
7. Conclusions and Practical Recommendations
Based on testing and analysis, several practical conclusions can be drawn:
- Evaluation should be layered. Using templated pages to judge the lower bound has limited value. Focus more on cross-page shared state and field-level dependencies.
- Inputs determine the upper bound. Upgrading requirements into structured specifications with assertable acceptance criteria is currently the most cost-effective improvement.
- Closed loops beat blind retries. Establish multi-level checks using linting, type checking, unit tests, end-to-end tests, and visual regression. When a check fails, feed the failure information back and regenerate the relevant page.
- Attribution must be rigorous. Generation latency is affected by service tier, load period, and generation strategy. It should not be directly equated with model capability.
- Model selection should consider constraints, not just leaderboards. Data compliance, private deployment capability, unit cost, and fine-tuning support often matter more than general leaderboard rankings.
Engineering-level code generation is currently still at the stage of “high-quality drafts plus human acceptance.” The most pragmatic positioning is to treat it as a productivity tool for improving first drafts, not as a black box that replaces review and testing.
