Evaluating Front-End Code Generation in Chinese Open-Source LLMs: Benchmarks and Why Open Source Matters

    This article evaluates how Chinese large language models generate front-end code from a complete requirements document, using login, list, and form pages as test cases. It shows a clear capability gradient: template-driven UI is nearly production-ready, while constraint-heavy logic such as filters, permissions, and validation degrades. The analysis breaks the gap into syntax, structure, and intent layers, and explains the practical value of open weights for auditing, private deployment, and fine-tuning. It closes with actionable advice for developers on specifications, task splitting, and automated acceptance.

    1. Why “Matching Flagship Models” Needs a Sober Look

    Claims that Chinese large language models now match international flagship models in overall capability have been appearing frequently, and community discussion is intense. This kind of news has emotional value for developers, but emotion is not a substitute for engineering judgment. Whether a model is usable depends on whether it can deliver reliably in your real business scenario, not on its relative position on a leaderboard.

    A more pragmatic approach is to take a project you know well, with a complete requirements document and clear acceptance criteria, run it end to end through the model, and then verify it page by page and feature by feature. This article uses exactly that kind of “real requirements-driven” evaluation. The requirements cover three typical page types: login, list, and form. These three map to three different capability demands in front-end development: visual fidelity, structured understanding, and state and validation management.

    One caveat up front: results are affected by model version, account type, concurrent queueing, random sampling, and other factors. The conclusions here represent a single specific observation and are not a definitive performance verdict on any product.

    2. Method: Turning “Feel” into a Checkable List

    To make the conclusions reproducible, three things were fixed before the evaluation.

    First, the input was a structured requirements document containing a page inventory, field definitions, interaction descriptions, and validation rules, not a vague “build me an admin dashboard.”

    Second, the tech stack was not constrained. The model chose it freely, which made it possible to observe its default tendencies in framework selection, directory organization, and dependency management.

    Third, acceptance was fixed at four dimensions: functional completeness, requirements fidelity, visual and interaction quality, and end-to-end time.

    A sample acceptance checklist can be written as follows so each item can be ticked off:

    1. Page-level acceptance items:
    2. - Login page: carousel area, form validation, submit feedback, error messages
    3. - List page: filter conditions, pagination, empty state, loading state, column definitions
    4. - Form page: field types, field dependencies, required-field validation, pre-submit confirmation
    5. Global acceptance items:
    6. - Whether a complete, runnable, and accessible project is produced rather than code fragments
    7. - Whether the directory structure and naming are clear and extensible

    3. Observations: A Capability Gradient Across Three Pages

    3.1 Login Page: Close to Usable

    The login page performed best. The carousel area required by the document was implemented correctly, and basic form validation, submit feedback, and error messages were largely complete, with no obvious structural gaps. This level of capability can be summarized as “visual and conventional component reproduction,” which is the model’s strongest zone, because page patterns of this kind are highly standardized in training data and the model only needs template matching plus local adaptation.

    The takeaway: this page is close to “tweak it a little and ship,” though engineering details such as analytics tracking, CAPTCHA, and login-state persistence still need human work.

    3.2 List Page: Understanding Starts to Decay

    Problems appeared on the list page. The filter conditions and linked interactions explicitly written in the document were not implemented, and this was not a one-off: the same omission showed up across multiple list pages. The page skeleton was correct, with table, pagination, and action columns all present, but the “functional semantics” were dropped.

    This points to a key judgment: when generating long-context projects, models tend to retain structural information and lose constraint information. Filter conditions are constraints, field visibility is a constraint, and permission differences are constraints too, and these are exactly where most business value concentrates.

    3.3 Form Page: Weak on Complex Constraints

    The form page ran overall, but field types, dependency rules, and validation logic deviated from the document. Forms are the most state-heavy scenario in front-end work, involving field dependencies, asynchronous validation, submit-state locking, and error localization. The model’s ability to reproduce requirements with multiple overlapping constraints was clearly insufficient.

    3.4 Visual Style and Time

    The visual style follows “engineering-usable over product-stunning”: cleaner than a typical prototype, but still short of the consistency of a mature design system, with an engineering-leaning design language. End-to-end time was on the order of about half an hour, clearly higher than the minute-level performance of comparable flagship models. This may relate to account type and queueing policy, and may also reflect the inherent cost of generating a complete runnable project.

    4. The Real Gap: From Generating Code to Understanding Intent

    Placing the three pages side by side reveals a clear capability curve: the closer a task is to templating, the better the result; the more it depends on constraint reasoning, the faster it decays.

    In engineering terms, this difference splits into three layers of capability:

    1. Syntax and API layer: whether the model can write correct, runnable code. Current mainstream models basically pass.
    2. Structure layer: whether it can organize a reasonable project skeleton and component breakdown. Most models can handle this.
    3. Intent layer: whether it can fully map implicit constraints, field relationships, and boundary conditions from the document into code. This is the main current weakness.

    A practical way to raise intent-layer hit rate is to reshape the requirements document into a “machine-checkable specification,” for example by adding a field table, state machine, and acceptance cases for each page:

    1. Filter section specification example:
    2. Field: status (enum: all/active/closed), default value = all
    3. Interaction: switching status resets pagination to page 1 and triggers one request
    4. Acceptance: initial render sends status=all; after switching, request sends status=active and page=1

    When requirements are given in this form, model output can be compared automatically against acceptance criteria, and manual rework drops significantly.

    5. What Open Source Actually Means: Auditable, Private, Fine-Tunable

    Back to the original question: if Chinese models are approaching international flagships, what does that mean for open-source attributes and AI development? The significance is not “catching up” itself, but three engineering values.

    First, auditability. When weights and inference processes are obtainable, enterprises can perform security assessment, compliance review, and behavior-boundary testing instead of only accepting black-box output.

    Second, private deployment. For scenarios where data must not leave the domain, local inference is a hard requirement. Combined with general cloud capabilities such as container platforms, object storage, logging services, and monitoring and alerting, a fully controllable pipeline can be built.

    Third, further training and distillation. Enterprises can run incremental training on their own codebases and “teach” the model internal framework conventions and component-library conventions, which helps mitigate the intent-layer weakness.

    In related practice at Baidu AI Cloud, such needs are typically met by combining model services, containerized inference, and data governance capabilities. The focus is embedding model capability into the existing R&D workflow rather than using it in isolation.

    6. Practical Advice for Developers

    • Position the model as a “senior implementer”; requirements specifications and acceptance criteria remain human responsibilities.
    • Adopt a small-step generation strategy, splitting tasks by page to avoid constraint loss from a single long context.
    • Build automated acceptance, judging completeness with test cases rather than visual comparison.
    • Keep human review for constraint-dense modules such as filtering, permissions, and validation.
    • When selecting a model, evaluate effectiveness, time, cost, and data compliance together instead of relying on a single leaderboard.

    Overall, Chinese models already deliver practical value on templated front-end tasks, while complex constraint understanding still has room to improve. The controllability and customizability brought by open source are what matter more for enterprise AI adoption in the long run.