Testing Chinese LLMs for Code Generation: A Three-Tier Evaluation to Find Their Real Limits
Chinese large language models are iterating fast, but vendor capability claims stay abstract while real business scenarios stay specific. This article lays out a three-tier test set that mirrors actual development work: tier one covers syntax and algorithms, tier two covers engineering practice such as multi-file work, interface design and debugging, and tier three covers front-end generation and design quality. Each tier includes test design ideas and scoring criteria, plus a section on API cost as a hard gate for large-scale adoption and a simple selection workflow: tier screening, cost accounting, then a small pilot.
1. Why run a tiered test
As Chinese large language models improve quickly, developers face the same problem when choosing one: official capability descriptions are abstract, while their own business scenarios are highly specific. Instead of arguing over leaderboard scores, build a test set that is close to your real workflow and verify code generation quality yourself.
The core idea of a tiered test is progressive pressure: start by checking the fundamentals, then examine engineering capability, and finally push into complex, creative high-level tasks. This approach has three advantages:
- Low cost: a dozen prompts are enough to get a clear conclusion from one evaluation round;
- High discrimination: performance gaps between model tiers are amplified noticeably;
- Transferable conclusions: the tasks resemble daily development work, so results feed directly into real selection decisions.
The three tiers below each come with test design notes and scoring criteria.
2. Tier 1: syntax and algorithm fundamentals
This is the foundation for everything else, focused on how well a model handles language conventions, data structures and basic algorithms.
Test design
Prepare a few categories of problems:
- Data structure operations: implement a stack that returns the minimum value in O(1); write a generic linked-list reversal by hand.
- Classic algorithms: dynamic programming (longest common subsequence); boundary variants of binary search (find the first position greater than or equal to a target).
- Boundary and error handling: require the code to explicitly handle empty input, out-of-range access and type errors.
Scoring criteria
Do not stop at “does it run”. Score across four dimensions:
- Correctness: does it pass unit tests on the first attempt;
- Complexity awareness: does it state time/space complexity proactively;
- Code style: are names clear and are the necessary comments present;
- Robustness: are boundary conditions considered.
Sample test case (finding the first position greater than or equal to the target):
def lower_bound(arr, target):"""Return the index of the first element >= target, or len(arr) if none exists"""left, right = 0, len(arr)while left < right:mid = (left + right) // 2if arr[mid] < target:left = mid + 1else:right = midreturn left
A strong model not only writes this code but also points out easy-to-miss details such as “note that right starts at len(arr), not len(arr)-1“.
3. Tier 2: engineering practice
Writing a single algorithm well does not mean a model can handle real projects. This tier looks at combined performance in multi-file collaboration, interface design and debugging.
Test design
- Requirements to code: give a vague product requirement (for example, “build an HTTP client wrapper with rate limiting and retries”) and see whether the model asks clarifying questions and breaks the task down.
- Code review and bug fixing: deliberately supply code with a concurrency defect or a resource leak, and have the model locate the problem and propose a fix.
- Refactoring: hand over procedural spaghetti code, ask for a clearly layered structure, and require behavior to stay unchanged.
- Test completion: have the model write unit tests for a piece of business logic and check how thoroughly the cases cover boundaries.
Scoring criteria
- Does it follow common engineering conventions (configuration separated from code, layered logging and exception handling);
- Does the fix explain why it was wrong, rather than only returning correct code;
- After refactoring, is the original interface contract preserved, and are regression tests suggested.
This tier separates models that “can write code” from models that “can join a project”. In practice, weaker models tend to patch surface symptoms during bug fixing, while stronger ones trace the issue back to its root cause.
4. Tier 3: front-end generation and design ceiling
The most overlooked tier, and the one that best reflects overall model quality. Front-end page generation tests not only code correctness but also a model’s sense of layout, color and interaction rhythm.
Test design
- Generate a landing page from a theme: for example, “build a landing page for a data visualization product with a hero section, feature highlights and a footer”, then check whether the layout is balanced and the whitespace reasonable.
- Style constraint test: ask for a specified style such as “dark tech” or “minimal magazine” to check how well the model handles a design language.
- Interaction details: add micro-interactions such as hover feedback and scroll-triggered fade-in, and see whether the implementation feels natural and performs reasonably.
Scoring criteria
- Visual hierarchy: is there a clear hierarchy in font size and contrast across headings, body text and secondary information;
- Consistency: do colors, corner radii and spacing follow a unified set of design variables;
- Usability: does the responsive layout still hold on narrow screens, and are accessibility basics (contrast, semantic tags) met.
A sample way to organize design variables:
:root {--color-primary: #2563eb;--color-bg: #0f172a;--color-text: #e2e8f0;--space-unit: 8px;--radius-md: 8px;}
A model that proactively uses design variables instead of scattering magic numbers is usually more mature at front-end engineering too.
5. A practical factor that is easy to ignore: API cost
Beyond technical capability, cost is a hard gate for large-scale adoption and must be part of the evaluation:
- Pricing and currency factors: APIs priced in local currency are more direct and transparent to account for than USD-priced overseas model services, and they are not exposed to exchange-rate swings, which is friendlier to budget planning.
- Amplification in high-frequency scenarios: code completion, batch refactoring and automated test generation can require thousands upon thousands of calls, so a small per-call price difference becomes a significant monthly cost difference and can decide whether a solution can be rolled out at all.
- Hidden costs: also weigh how inference speed affects developer productivity, the extra consumption caused by failed retries, and whether multi-turn correction is needed — a strong model that succeeds in one pass may cost less overall than a cheaper option that needs repeated adjustment.
A practical formula is: total cost = unit price × estimated call volume × (1 + retry rate), plus the converted cost of human review time, to arrive at the real cost of use.
6. Selection advice and summary
After the three tiers, record each model’s performance and cost per dimension in a simple table to form a reusable evaluation baseline:
| Tier | Focus | Key metrics |
|---|---|---|
| Tier 1 | Syntax and algorithms | Correctness rate, complexity awareness |
| Tier 2 | Engineering practice | Bug localization accuracy, refactoring quality |
| Tier 3 | Front end and design | Visual hierarchy, style consistency |
In practice, follow the path of tier screening first, cost accounting second, small-traffic pilot last: use the test set to eliminate obviously unqualified candidates, compare total cost among those that pass, then connect to real business traffic on a small scale.
Overall, there is no silver bullet in model selection, but there is a methodology. The three-tier test provides a low-cost, high-discrimination evaluation framework, and factoring API cost into the decision ensures the technical choice is not only workable but also affordable and scalable.
