LLM Code Generation for Real Projects: Evaluating From "Runnable" to "Actually Usable"
A model's benchmark score tells you which model is stronger, but rarely tells you whether it can be used reliably on your actual pipeline. This article reframes the evaluation of LLM-generated front-end projects around task success rate rather than model scores, and shows how to move from "the page runs" to "the requirement is actually met." It explains why constraint coverage matters more than visual similarity, how to rewrite requirement documents into machine-decidable structured specs, how to break one large generation task into independently verifiable stages, how to reason about end-to-end latency, and how to build a reproducible scoring framework. A practical checklist and a discussion of the structural value of open weights round out the guide.
1. Background: After the Benchmarks, What Is the Real Question?
Every time a new LLM version ships, “on par with the leading models” has become almost a fixed line, and community reactions heat up quickly. But this kind of horizontal comparison answers a question of perception, not of engineering: it tells you “who is stronger” and rarely tells you “can this be used reliably on my specific pipeline.”
To think this through clearly, you need to swap the object of evaluation from “model score” to “task success rate.” A front-end requirement, from document to a runnable project, actually contains several subtasks with very different natures:
- Requirement parsing: mapping a natural-language description into page structure, component boundaries, and data contracts;
- Feature implementation: whether state logic like filtering, pagination, interlinking, and validation is actually implemented;
- Engineering standards: directory organization, type definitions, styling approach, maintainability;
- Deliverable form: whether it produces a project that can be directly accessed and reused, rather than isolated code snippets;
- Service experience: queuing, streaming output, total elapsed time, and the cost of failure and retries.
The first two determine usability; the last three determine the cost of adoption. Only by separating these three layers can you explain why “the login page looks good” and “the whole thing is hard to use” show up at the same time.
2. “The Page Runs” Does Not Mean “The Requirement Is Implemented”
A typical observation: pages with correct structure but discounted functionality. Reviewed at page granularity, it looks “basically as expected”; reviewed at requirement-item granularity, you find the missing pieces are exactly those scattered across different parts of the document that hold constraints on each other.
Missing items concentrate in two kinds of logic, and the reasons can be analyzed.
The first kind is cross-section constraints. Rules for filter conditions, default values, query parameters, and synchronization of URL state are usually written in different sections of the document. The model needs to do retrieval-style integration across a long context and introduce unified state management during implementation. This kind of requirement has no visual cue; a screenshot looks completely normal, and once missed it is hard to spot with the naked eye. It is not quite “the model can’t remember,” but more like “constraint priority was never expressed explicitly.”
The second kind is conditional branches. Form validation timing, error message placement, show/hide and dependencies between fields, and the scope of interlinked resets are essentially a state transition graph. “When…” and “if… then” in natural-language descriptions are discrete statements, and the model tends to treat them as parallel descriptions rather than as guarded transition rules. The result: every field renders and every button is clickable, but behavior is wrong when the trigger condition doesn’t hold.
Therefore, when evaluating this kind of task, visual similarity is almost the weakest signal. A more discriminating metric is constraint coverage: break the requirement document into decidable items and mark each one as “implemented / partially implemented / not implemented.” The value of this method is that it is simultaneously an evaluation tool and an acceptance checklist.
3. Rewriting Requirement Documents Into Machine-Decidable Structures
The most effective step to improve fidelity is not switching models but changing how the requirement document is organized. Natural language is good at expressing intent and poor at expressing constraint priority. Making the key contracts explicit compresses the model’s degrees of freedom, and the probability of missing items drops accordingly.
In addition to the natural-language description, it helps to attach a structured spec. For a list page, for example:
{"page": "product-list","dataSource": { "method": "GET", "path": "/products", "paging": "server" },"filters": [{ "field": "category", "type": "select", "multi": true },{ "field": "price", "type": "range", "default": [0, 5000] },{ "field": "keyword", "type": "text", "debounceMs": 300 }],"transitions": [{ "when": "filter.change", "then": ["reset.page(1)", "refetch()"] },{ "when": "route.query", "then": ["hydrate.filters()", "refetch()"] },{ "when": "page.change", "then": ["refetch()", "sync.route()"] }],"acceptance": ["page resets to page 1 after a filter changes","filter state is restored from the URL after refresh","switching filters leaves no leftover empty-state message from the previous query"]}
Three writing practices are worth noting. First, constraints should be written as decidable sentences: each item in acceptance can be answered “yes/no” by a person or an automated script. Second, declare the reset scope explicitly: in interlinked relationships, “what gets reset” is more easily overlooked than “what gets triggered.” Third, distinguish default values from inherited values to avoid the model inventing parameters.
The same applies to form pages: express conditional branches as rules with premises rather than scattered adjectives:
def resolve_field(field, values, state):"""Return a field's visibility and validation result; rules are spec-driven, not scattered inside components."""if field.depends_on and not truthy(values.get(field.depends_on)):return FieldState(visible=False, errors=[])if not visible_any_parent(field, values):return FieldState(visible=False, errors=[])errors = [r.message for r in field.rules if not r.check(values)]if field.unique and state.exists(values[field.key]):errors.append("this value already exists")return FieldState(visible=True, errors=errors, touched=values.get(field.key) is not None)
The point of this code is not the implementation itself but the way it expresses things: it writes “when to validate, when to hide, and under what conditions to report an error” as criteria the model can check item by item. By contrast, descriptions like “the form should be friendly and validation thorough” impose almost no constraint on the generated result.
4. Staged Generation: Breaking One Large Task Into Verifiable Small Tasks
Generating the entire project in one shot looks efficient but actually packs all the complexity into a single call, making errors costly to locate and expensive to rework. Staged generation turns a long task into several short tasks that can be accepted independently:
- Contract stage: first produce only the data models, type definitions, interface contracts, and directory skeleton, with no business logic. This stage’s output is the easiest to review by hand and best at exposing misunderstandings.
- Skeleton stage: page routes and layouts take shape, placeholder data drives the rendering pipeline, and the structure is confirmed against the document.
- Logic stage: implement interactions item by item per
transitions, delivering the complete state logic of one page at a time. - Polish stage: styling, empty and error states, responsive adaptation, accessibility.
At the end of each step, run the acceptance checklist once. Problems stay confined within a single stage, avoiding “fix one thing, break three.”
Supporting regression measures fall into roughly three types: component-level tests covering pure logic (filter merging, validation, pagination boundaries); interface contract tests ensuring data structures match the spec; and visual regression to catch styling regressions. Note that generating the first two types of tests is itself well suited to handing off to a model, but assertions need human review, or you will harden wrong expectations into “passing.”
5. End-to-End Latency: Queuing Is Only the Surface
Task time is usually attributed wholesale to “the model is slow,” but what users perceive is end-to-end time, which can be decomposed into:
- Queue time to get connected: resources are tight at peak, retries often don’t help, and gains come from off-peak scheduling and backoff strategies;
- Time to first byte: it determines the feeling of “is anything happening,” and streaming output feels better than returning the whole thing at once;
- Total generation time: roughly positively correlated with output length and context length;
- Rework time: the rounds of modification caused by misunderstanding, often the bulk of the total cost.
An easily overlooked quantitative view: if generation takes ten minutes and there are three rounds of rework, then a 20% improvement in “average generation speed” yields far less than reducing one round of rework by structuring the requirement document. The leverage of comprehension accuracy on total cost is greater than that of throughput.
On the engineering side, the optimization is asynchrony: put long tasks into a task queue, have the front end poll or subscribe to progress to avoid request timeouts and duplicate submissions; cache idempotent query-type generation results; and cap concurrency when exploring multiple approaches to the same requirement to avoid resource contention.
submit(spec) -> taskIdworker: poll queue -> generate(staged=true) -> verify(acceptance) -> publish(artifact)client: subscribe(taskId) -> progress events / failure reason / accessible URL
It should be clear that latency varies greatly across different quotas, time windows, and regions, and the time from any single test is not representative. To evaluate service capability, look at percentile latency (such as P50/P95) and failure rate, not the stopwatch reading of a single demo.
6. Evaluation Framework: Making Comparisons Reproducible
The biggest problem with scattered, ad-hoc evaluations is that they cannot be compared. A reusable scoring table looks roughly like this, with each item scored independently and evidence recorded:
| Dimension | What to observe | Suggested weight |
|---|---|---|
| Requirement understanding | Constraint-item coverage, fidelity of fields and dependencies | 35% |
| Feature completeness | Actual behavior of filtering/pagination/validation/interlinking | 30% |
| Engineering usability | Runnable, complete types, clear structure, maintainable | 20% |
| Experience and delivery | Visual completeness, empty and error states, deliverable form | 10% |
| Service and cost | End-to-end latency, failure rate, cost per task | 5% |
Three disciplines for using it: fix the same requirement spec and the same acceptance checklist before comparing horizontally; record failure modes rather than just scores, since “the whole filter set is missing” and “validation timing is wrong” point to completely different improvement directions; and keep a minimal reproducible sample for each conclusion, or the discussion cannot converge.
7. The Significance of Open Weights for AI Development
Setting aside the hype around any specific product, the trend itself of “high-performance models going open” has several structural layers of value worth seeing from a technical angle.
Reproducibility. Open weights mean evaluation no longer depends on the behavior of a single endpoint; third parties can rerun on their own hardware with a fixed version and fixed configuration, gradually replacing “community reputation” with “verifiable data.” This is the prerequisite for building benchmarks.
Freedom of deployment form. Private deployment is a hard requirement in industries where data cannot leave the domain, involving the combined use of general capabilities like logging, monitoring and alerting, container orchestration, and model serving gateways. Whether weights are open directly determines whether this path is viable.
Cost and controllability. When weights are available, you can make trade-offs per task using quantization, distillation, routing, and caching, using an expensive model only for the truly hard subtasks and handing the rest to lightweight models. The impact of this layered design on cost structure is usually more significant than swapping the main model.
A positive ecosystem loop. Open weights lower the barrier to research and secondary development, and feedback for corrections and improvements comes faster; but it also brings supporting problems that must be faced: the commercial and distribution boundaries of license terms, compliance review of output content, and security review of generated code (dependency sources, hardcoded keys, unauthorized interfaces). Open does not mean exempt; governance responsibility still lies with the integrator.
8. Implementation Checklist
- Add structured specs and decidable acceptance items to requirement documents, making constraint priority and reset scope explicit;
- Adopt staged generation, contracts first, accepting each stage independently before moving to the next;
- Evaluate fidelity from a coverage perspective, avoiding visual similarity as the main conclusion;
- Make long tasks asynchronous, and measure service capability by percentile latency and failure rate rather than single-run time;
- If sensitive to data leaving the domain, evaluate the open-weights route first, and design supporting capabilities such as model serving, logging, and monitoring/alerting at the same time;
- Generated results must enter the code review and security scanning process, with test assertions confirmed by a human.
Conclusion: “On par with a given leading model” is a valuable signal but not a basis for selection. What really determines success is three controllable things — writing requirements into a decidable form, splitting the generation process into verifiable stages, and making evaluation a reproducible method. Once these three are done well, every improvement in model capability can be stably converted into delivery efficiency; otherwise, no matter how high the leaderboard score, it will only stay at the demo stage.
