Evaluating Large Language Model Code Generation: What "It Runs" Misses and Why Open Weights Matter

    This article examines why a successful code generation demo does not equal usable software, based on a hands-on test that asked an open-weight model to build login, list, and form pages from a requirements document. It introduces a four-level evaluation model (syntax, structure, semantics, experience), shows where capability degrades across page types, and explains how to run controlled comparisons using structured requirements and automated acceptance checks. It closes with the implications for open-weight ecosystems and practical recommendations for teams moving from "it runs" to "it is usable."

    1. The Problem: “It Runs” Is Not “It Is Usable”

    Over the past year, the capability curve of large language models in code generation has steepened noticeably. Community discussions often claim that a domestic open-weight model now matches an overseas closed-source flagship. High visibility, however, is not a conclusion. For developers, only one test matters: hand the model a real requirements document and see whether it can produce an engineering artifact in one pass that is runnable, maintainable, and extensible.

    The source material records a typical experiment. The author gave an open-weight model a frontend requirements document covering three page types—login, list, and form—without specifying a tech stack. The model chose a component-based frontend framework on its own and ultimately produced a project that could be accessed directly. The value of this experiment is not a score. It is a key finding: models are already quite mature at generating page skeletons, but still have systematic weaknesses in restoring requirement semantics.

    The evaluation criteria therefore need to move from “can it generate” to “how deeply does it understand.” This article groups the criteria into four levels:

    • Syntax: does the code compile and start;
    • Structure: are directory organization, component decomposition, and routing reasonable;
    • Semantics: are business rules such as fields, validation, linkage, and filtering fully restored;
    • Experience: do visual style, interaction feedback, and accessibility reach a product level.

    Most evaluations cover only the first two levels. That is the root cause of results that “look impressive but fall short in use.”

    2. Hands-On Process and Observations: A Capability Gradient Across Three Page Types

    2.1 Prerequisites: Availability and Latency

    The experiment immediately hit two practical problems: during peak hours, access required queuing or a subscription, and end-to-end generation took a long time—more than half an hour to complete a multipage project. This suggests that service availability and generation latency must be recorded as independent metrics when evaluating model capability; otherwise, conclusions are not reproducible.

    It is recommended to fix the following fields in the evaluation table:

    1. case_id | requirements_doc_version | tech_stack | queue_wait(s) | time_to_first_token(s) | total_time(s) | runnability | semantic_restoration_rate

    The semantic restoration rate can be defined as the proportion of verifiable functional points in the requirements document that are correctly implemented. This is the key step in turning subjective impressions into comparable data.

    2.2 Login Page: Close to the Usability Line

    The login page performed best. The carousel required in the document was implemented correctly, and form elements, button states, and basic validation were all present, with no obvious missing functionality. The conclusion was “a few tweaks away from release.” The reason is that the business semantics of a login page are relatively standard, and the density of such patterns in training data is extremely high, so the model can almost complete the task through pattern matching.

    2.3 List Page: Understanding Starts to Slow Down

    Problems appeared on the list page: filter options explicitly written in the document were not implemented. More notably, this was not an occasional omission but a phenomenon shared across multiple list pages, indicating a systematic capability-level defect rather than random variation.

    A reasonable explanation is that list pages have higher semantic density, involving multiple constraints such as filter condition combinations, pagination, sorting, empty states, loading states, and field structure mapping. When compressing requirements over a long context, the model tends to keep the “page skeleton” and discard “constraint details.” The engineering response is to structure the requirements rather than write them as prose:

    1. {
    2. "page": "product_list",
    3. "filters": [
    4. {"key": "category", "type": "enum", "multiple": true},
    5. {"key": "priceRange", "type": "range"}
    6. ],
    7. "behaviors": ["filter_change_triggers_request", "reset_clears_all"],
    8. "states": ["loading", "empty", "error"]
    9. }

    Structured input significantly improves the visibility of constraints and makes it easier to automatically validate the implementation.

    2.4 Form Page: Insufficient Restoration of Field Relationships and Validation Logic

    The form page was runnable overall, but fields, validation rules, and interaction details were not fully implemented according to the document. Forms are the scenario that most tests “depth of understanding,” because they contain implicit rules such as field dependencies, conditional display, linked disabling, and asynchronous uniqueness validation. The model often implemented the field shells but lost the causal relationships between rules.

    2.5 Visual Style: Engineering Usability Over Product Polish

    The UI style was average: better than a generic prototype, but still short of directly applying a mature design system. The design felt engineering-oriented and lacked memorable elements. This matches the capability distribution of current generative approaches—layout and spacing can be approximated through statistical patterns, while brand tone and visual innovation are hard to generate automatically.

    3. The Right Way to Compare Horizontally: Control Variables, Not Total Scores

    The source material mentions a comparison with an overseas closed-source flagship model: login page completeness was similar, the list and form pages were more complete on the other side, and generation took about a few minutes, clearly faster. To make such comparisons produce engineering value, variables must be controlled:

    1. The same requirements document and the same version number;
    2. The same tech stack and dependency versions;
    3. The same acceptance script and manual review checklist;
    4. Separate recording of four metrics: runnability, semantic restoration rate, rework rounds, and end-to-end latency.

    Automated acceptance is recommended as a safeguard to avoid bias from manual visual inspection:

    1. // Example: use an acceptance checklist to drive implementation checks
    2. const checklist = [
    3. { id: 'login.carousel', ok: hasCarousel('.login') },
    4. { id: 'list.filter.category', ok: hasFilter('category') },
    5. { id: 'form.validate.email', ok: hasRule('email', 'required') },
    6. ];
    7. const passed = checklist.filter(i => i.ok).length;
    8. console.log(`Semantic restoration rate: ${(passed / checklist.length * 100).toFixed(1)}%`);

    The conclusion usually shows a clear gradient: small gaps on standardized pages, large gaps on complex business pages, with the gap concentrated in “depth of understanding” rather than “generation ability.”

    4. What This Means for Open Weights and AI Development

    Taking a broader view, the real significance of this kind of evaluation lies in three points.

    First, open weights turn the capability gap into a quantifiable public issue. Closed-source solutions can only be judged by experience, while open-weight solutions can be deployed locally, tested in batches, and analyzed item by item. The community can therefore accumulate reusable evaluation assets and raise the overall baseline.

    Second, the focus of competition is shifting from “parameters and leaderboards” to “semantic restoration and engineering usability.” Once skeleton generation is no longer the bottleneck, investment from vendors and the community will naturally flow toward harder directions such as long-context constraint retention, structured requirement understanding, and verifiable generation.

    Third, enterprise selection logic is becoming more rational. Scenarios with sensitive data, a need for private deployment, and controllable cost can prioritize self-deployable open-weight solutions. Scenarios with extremely high demands on latency and complex semantic restoration can be paired with cloud-based general model services, and a stable generation and evaluation pipeline can be built using common cloud capabilities such as container platforms, object storage, message queues, logging services, and monitoring and alerting.

    5. Reusable Implementation Recommendations

    • Structure requirements: describe pages, fields, states, and behaviors with JSON/YAML to reduce prose ambiguity;
    • Generate in layers: produce the data model and API contracts first, then generate pages, and finally add interaction details;
    • Automate acceptance: script the acceptance checklist and make it part of regression testing;
    • Iterate in small steps: generate and validate one page at a time to avoid constraint loss in a one-shot large project;
    • Keep metrics on record: log latency, rework rounds, and restoration rate to form your team’s own model capability baseline.

    Overall judgment: current open-weight models are already close to usable for standardized page generation, but still have a clear gap in restoring complex business semantics. Making evaluation more granular, requirements more structured, and acceptance more automated is the realistic path from “it runs” to “it is usable.”