Evaluating Code LLMs on Complex Requirement Fidelity and Engineering Practice
Code generation has moved from single-line completion to multi-page apps, but runnable output is not the same as faithful requirement coverage. This article describes an end-to-end evaluation using real specs, reports a capability drop from login pages to forms, analyzes why long context is not the same as understanding, and outlines engineering practices plus a hybrid open-weight and closed-model approach.
From generating code to delivering a project
Over the past two years, code generation has grown from completing a single line to producing runnable multi-page applications in one pass. When the bar rises from “does the code run” to “does it faithfully implement the requirements document,” the verdict often reverses: page shells are correct, routing works, and the build succeeds, yet filters, field coupling, and validation—the parts that carry business meaning—are systematically missing.
That gap is not a one-off hallucination. It is a repeatable capability boundary. Making it clear requires a reproducible evaluation method, not scattered impressions.
Evaluation: end-to-end stress tests with real requirements
A useful evaluation needs three properties: requirements from real projects rather than toy examples; a full, accessible application rather than a snippet; and scoring dimensions that can be checked item by item.
A minimal protocol:
- Input: a structured spec covering page list, field definitions, interaction logic, validation rules, and visual constraints.
- Constraint: no mandated stack; the model may choose framework and build approach.
- Output: a reachable URL plus source code.
- Scoring: function-point coverage, interaction fidelity, validation completeness, visual completeness, and end-to-end time.
How structured the spec is strongly affects results. Turning prose into checkable items cuts ambiguity:
page: product_listfilters:- name: category type: multi_select default: []- name: price_range type: range default: [0, null]- name: listed_at type: date_range default: last_30dinteraction:- debounce 300ms and query after any filter change- empty state plus a "clear filters" actionacceptance:- filters sync to URL query params and survive refresh
Each line can be verified automatically or semi-automatically, so omissions are obvious.
Observations: a clear decay curve
Login pages: near production-ready. Carousels, form layout, basic validation, and submit feedback are usually present—close to “tweak and ship.” These patterns are mature and well represented in training data.
List pages: understanding slows. Structure and data rendering are often correct, but documented filters are missing as a whole. The same pattern across multiple list pages points to a capability issue, not noise. Models tend to build a “looks complete” skeleton first and fill in details later; early constraints get diluted across turns.
Form pages: the steepest drop in fidelity. The page runs, but field sets, inter-field coupling, when validation fires, and where errors appear diverge from the spec. A complex form is a state machine: dependencies, conditional visibility, and async validation are deep constraints that cannot be inferred from surface layout.
Visual style: engineering-usable more than product-polished. Output beats typical wireframes—regular layout and spacing—but compared with a mature component library or atomic CSS, the look is conservative, with little hierarchy or brand expression.
Time and cost: generating a multi-page app end to end often takes tens of minutes; free tiers may queue. Leading closed models are generally faster on the same specs and more precise on filters, field structure, and validation. Speed partly reflects quotas and compute; depth of understanding is a real difference.
Root causes: long context is not the same as understanding
First, effective context is smaller than the window. Critical constraints are scattered; mid-document details are underused, and early constraints fall out of attention as generation continues.
Second, implicit rules are not inferred. If the doc says “filter by category and price” but not “sync filters to the URL,” the model can only guess. Rules not stated in the input should not be expected.
Third, there is no verifiable intermediate state. One-shot long generation has no execute–observe–correct loop, so errors propagate.
Fourth, training skews toward single files and short examples. Cross-file dependencies, state conventions, and directory norms are underrepresented.
Engineering recommendations
- Make requirements verifiable. Rewrite them as itemized specs with acceptance criteria; use structured formats for fields and interactions.
- Generate in layers. Data model and API contracts first, then page shells, then interactions and validation page by page, with review at each layer.
- Build a private eval set. Keep 20–50 real requirements as a regression baseline; re-run after model or prompt changes and use coverage numbers instead of gut feel.
- Split human and model work. Let the model handle scaffolding, boilerplate, and first-pass styles; keep state-machine design, edge cases, and performance-sensitive paths with people.
- Fit generation into the pipeline. Unify builds in containers, track production with logs and alerts, host static assets in object storage, and treat generated output as part of delivery rather than a side path.
Why open weights matter for technical progress
Closing the gap with leading models matters less as a single score than as three effects of open weights: reproducibility—labs and companies can repeat experiments in their own environments; privatization—sensitive code and data can stay on-prem for inference and fine-tuning; composability—teams can adapt models to their stack and turn general capability into vertical advantage.
The costs are also clear: deployment and tuning burden, compute cost, and selection friction without a shared benchmark. A practical path is mixed use—open-weight models for privatizable batch work, closed models for high-difficulty, low-tolerance steps, with a self-built eval set as the common judge.
Conclusion
Code LLMs are close to production-usable on stereotyped pages, but they still fall short on deep business-semantic fidelity. Closing the gap is less about waiting for the next model than about writing requirements clearly, splitting generation, and automating acceptance. When evaluation moves from demos to coverage, selection and investment become explainable.
