Evaluating Front-End Code Generation in LLMs: Benchmarks and the Value of Open Weights

    This article evaluates how well large language models generate front-end applications from a requirements document, focusing on constraint fidelity rather than visual appeal. Using a sample spec with a login page, a product listing page, and a form page, it breaks the assessment into four layers—structure, functionality, semantics, and engineering—and reports page-by-page findings: pattern-heavy pages are nearly production-ready, while multi-condition filtering, field dependencies, and validation timing expose systematic weaknesses. It also compares the results against a stronger model, explains why open-weight releases matter for private deployment, fine-tuning, and auditability, and offers practical recommendations for a generate–verify–patch workflow.

    1. Background: Why “Being Able to Generate” Is Not the Same as “Being Able to Deliver”

    Over the past year, code generation capabilities have evolved rapidly—from completing a single line of code, to generating an entire function, to producing a runnable front-end project in one shot. Social media is full of heavily emotional claims such as “matching top-tier closed-source models” or “the next-generation UI generation tool.” From an engineering perspective, however, leaderboard rankings are not what matters. What matters are three more down-to-earth questions: Are all the constraints in the requirements document fully implemented? How maintainable is the generated result? And is the pipeline from requirements to a runnable artifact stable?

    A more reasonable approach is therefore to take a real project’s front-end requirements document, have the model implement it in full, and then verify the output page by page. The sample requirements used in this article cover three core pages—a login page, a product listing page, and a form page. The document explicitly specifies a carousel, filtering conditions, field structures, and validation rules. It is worth emphasizing that the focus of this evaluation is not whether the pages look good, but how faithfully the document’s constraints are reproduced.

    2. Evaluation Method and Criteria

    To make the conclusions reproducible, it is better to split the assessment into four layers rather than assign an overall score:

    • Structure layer: Whether routing, page skeletons, and component decomposition are reasonable and whether the result runs directly.
    • Functionality layer: Whether every feature explicitly stated in the document is implemented, such as filtering, pagination, and the carousel.
    • Semantic layer: Whether relationships between fields, validation trigger timing, and error and empty state handling match the description.
    • Engineering layer: Whether the artifact is directly accessible, whether the code is clearly organized, and whether the styling approach is extensible.

    The functionality and semantic layers are the easiest places to expose gaps. The reason is that the structure and visual layers can be filled in quickly with generic templates, whereas the semantic layer requires the model to genuinely “understand” the implicit constraints in the document.

    3. Page-by-Page Findings

    1. Login Page: Close to Usable

    The login page is a typical high-frequency pattern page, and the model performed consistently. The carousel required by the document was implemented correctly, and the form elements, button states, and basic layout were all complete—the result is at a “tweak it and ship it” level. This shows that for highly patterned pages, current models are already capable enough.

    2. Listing Page: Comprehension Starts to Degrade

    Problems appear on the listing page: the filter options explicitly stated in the document were not implemented. Notably, this was not an isolated omission—the same issue appeared across multiple listing pages, indicating a systematic capability gap rather than random variance. The page skeleton was correct and the visual structure reasonable, but “functional understanding” fell short. The engineering takeaway is that pages involving multi-condition linkage, query parameters, and state synchronization must be reviewed manually.

    3. Form Page: Insufficient Reproduction of Complex Constraints

    The form page runs overall, but the number of fields, validation logic, and interaction details deviate from the document. The core difficulty of complex forms lies in field dependencies (whether a field is shown depends on another field’s value), validation timing (on blur or on submit), and aggregated display of error messages. These are typical deep semantic constraints. Models often reproduce only that “the fields exist” while ignoring “how the fields interact.”

    4. Overall Style: Engineering Usability First

    The visual style is unremarkable—better than a typical prototype, but still behind mature component library templates, with an engineering-oriented design feel. It can be summarized as: engineering usability over product aesthetics. For teams, this is actually acceptable, since the styling layer can be covered by a unified design system.

    4. Positioning Against Higher-Capability Models

    The same requirements had previously been implemented with a more capable model, and the comparison is informative: the login page completion was comparable; the listing page was noticeably more complete in filtering and field structure understanding; the form page had a clearer advantage in reproducing field relationships, validation logic, and interaction details; and generation time was also significantly shorter. The conclusion is that the gap lies not mainly in “whether it can write code,” but in “depth of understanding” and “stability of constraint adherence.”

    5. The Real Significance of Open Weights

    If such capabilities are provided as open weights, their value is not merely being “free to use,” but shows in three ways:

    • Private deployment: Sensitive code and business documents stay within the internal network, meeting compliance requirements.
    • Fine-tuning and distillation: Adapt to the domain using the team’s own codebase, baking internal component conventions into the model’s behavior.
    • Reproducibility and auditability: Weights and the inference pipeline are controllable, making version regression and performance tracking easier.

    Example: Using document constraints for automated checks is more stable than manually verifying page by page.

    1. checks = {
    2. "login": ["carousel", "form_validation"],
    3. "list": ["filter_panel", "pagination"],
    4. "form": ["field_dependency", "submit_validation"],
    5. }
    6. def verify(page, implemented):
    7. missing = [c for c in checks[page] if c not in implemented]
    8. return {"page": page, "missing": missing}

    6. Recommendations for Engineering Adoption

    1. Structure the requirements document and list feature points explicitly for item-by-item verification.
    2. Adopt a “generate + verify + patch” loop instead of accepting the result in one pass.
    3. For complex interactions, design the state machine manually first, then let the model fill in the implementation.
    4. Let the component library and design specifications own styling, reducing reliance on the model’s aesthetic judgment.
    5. Build an internal regression set that uses fixed requirements to measure the impact of each model or prompt change.

    Overall, this class of models already provides practical value on patterned pages, with weaknesses concentrated in deep semantic understanding and generation efficiency. Meanwhile, the deployment freedom and customizability brought by open weights are what matter more for AI engineering in the long run.