Benchmarking High-Intensity Code Generation in Chinese LLMs

    This article presents a practical benchmark for evaluating the code generation capabilities of Chinese large language models under high-intensity conditions. Instead of subjective tasks like poetry or chat, it uses an executable deliverable: an interactive mechanical structure visualization page, with a second-turn follow-up requesting a switch from 2D to 3D. The article details the evaluation setup, hard and soft metrics, and cost indicators, then shares three key observations: the 2D-to-3D follow-up as a capability watershed, three typical delivery styles (full, mechanism-focused, and skeleton) with their use cases, and output limits plus reasoning budget as hidden ceilings. It closes with a reproducible evaluation and selection checklist, covering layered delivery strategies and non-blocking fallbacks.

    1. Why Poetry and Chat No Longer Reveal Model Differences

    In the past, models were often evaluated with poetry writing, casual conversation, and a few logic puzzles. The problem with these tasks is that the answer space is small, fault tolerance is high, and there are no executable acceptance criteria. A response that “looks correct” counts as a pass, the evaluator’s subjectivity is high, and the differences between models are compressed to the point where they cannot be distinguished.

    Tasks with real discriminating power need three characteristics:

    1. Executable output: the output is not text but engineering files that a browser can load and run directly.
    2. Objective acceptance: whether the page opens, whether the console reports errors, and whether interactions respond can all be judged automatically.
    3. Observable process: elapsed time, token consumption, and context retention across turns can all be quantified.

    Based on this, this article narrows the evaluation scenario to a single-sentence task: generate a detail-rich, interactive 3D mechanical structure visualization page, and in a second-turn follow-up require changing from a 2D form to a 3D form. The key to this design is the “follow-up” — it simultaneously tests context inheritance, self-correction of the technical approach, and one-shot delivery capability.

    2. Evaluation Method and Metric Design

    Unified experimental constraints matter more than model selection; otherwise the data is not comparable.

    • Same prompt, launched simultaneously: avoids differences from service fluctuations over time windows.
    • Fixed two turns: the first turn is a 2D schematic, the second adds “change to a 3D form.”
    • Hard metrics: whether the page loads, whether the console is error-free, and whether interactive controls actually work.
    • Soft metrics: structural fidelity, annotation completeness, and visual and engineering reasonableness.
    • Cost metrics: end-to-end elapsed time, output token volume, and whether the single-output limit is hit.

    A sample acceptance script can be very lightweight — just load the output with a headless browser and capture exceptions:

    1. // Pseudocode: batch acceptance of outputs
    2. const errors = [];
    3. page.on('console', msg => { if (msg.type() === 'error') errors.push(msg.text()); });
    4. page.on('pageerror', err => errors.push(err.message));
    5. await page.goto(url, { waitUntil: 'networkidle' });
    6. const canvasCount = await page.$eval('canvas', els => els.length);
    7. console.log({ canvasCount, errors });

    The pass rule should be written explicitly: only errors.length === 0 && canvasCount > 0 counts as a pass. By setting the standard up front, evaluation shifts from “scoring based on photos” to “running tests.”

    3. Observation One: The 2D-to-3D Follow-Up Is a Capability Watershed

    In the first turn with a 2D schematic, most models can deliver usable results; once “change to a 3D form” is added, the gap appears immediately. The reason is that a 3D scene requires the model to complete a whole set of technical decisions on its own: which rendering paradigm to use, how to organize the scene graph, how to build surfaces and solids of revolution, how to map 2D annotations into labels in 3D space, and how to design the camera and orbit controls.

    More difficult is that the linkage between the connecting rod and the crankshaft is constraint-based geometry: the piston displacement and crankshaft angle must satisfy a kinematic relationship, and any “looks about right” approximation will be exposed in frame-by-frame animation. Whether the model can hold this layer of logic is the key to distinguishing “can write a page” from “understands engineering.”

    A minimal slider-crank displacement relationship illustrates the rigidity of such constraints:

    1. // r: crank radius, l: connecting rod length, theta: crankshaft angle
    2. const x = r * Math.cos(theta) + Math.sqrt(l * l - Math.pow(r * Math.sin(theta), 2));

    If a model just stacks parts without writing this kind of relationship, parts will clip through each other and proportions will distort during interaction.

    4. Observation Two: Three Typical Delivery Styles and Their Use Cases

    In similar tasks, models usually fall into three delivery styles, each with clear engineering applicability.

    Full type: the most complete parts coverage, including the valve train, intake and exhaust manifolds, and crankshaft flywheel, with Chinese annotations and exploded views. The cost is the longest elapsed time and highest token consumption, often tens of minutes and tens of thousands of tokens. Suited to solution reviews, presentations, and other settings sensitive to completeness where time is loose.

    Mechanism type: does not pursue a complete shell but makes the kinematics solid — a standard cross-plane crankshaft, four-stroke color coding, frame-by-frame observation stepping at fixed angles, a half-transparent cylinder block that can be toggled, and even synthesized sound that varies with rotation speed using the Web Audio API. This type of output has the highest teaching value and is suited to training, popular science, and principle verification.

    Skeleton type: deliverable in minutes with low token volume, with an industrial blocky appearance but key proportions that do not distort, and complete controls for part toggling, explosion, transparency, and reset. It is the first choice for daily crunch work: get a runnable skeleton first, then gradually thicken the details.

    The engineering recommendation is to advance in layers: use the skeleton type to quickly establish a runnable baseline, then deepen high-value modules with the mechanism type, and finally complete the full-type appearance as needed.

    5. Observation Three: Output Limits and Reasoning Budget Are Hidden Ceilings

    A typical failure is not “can’t do it” but didn’t finish. There is a token limit on single outputs; when the reasoning process fills the budget, the space left for the actual code is squeezed to zero and the output is blank; as turns lengthen, generation may even fail outright due to being too long.

    Another type of failure is poor fallback logic design: after a load check fails, the error message is placed directly over the center of the already-rendered canvas, which destroys a result that was actually usable. The correct approach is graded degradation — if rendering succeeds, keep the image, and present the message in a non-blocking way.

    1. // Counter-example: blocking message
    2. // errorEl.style.cssText = 'position:absolute;inset:0;display:grid;place-items:center';
    3. // Recommended: non-blocking, dismissible light message
    4. errorEl.style.cssText = 'position:absolute;right:12px;bottom:12px;opacity:.8';

    In practice, reasoning redundancy should be controlled through prompt constraints, for example by requiring “give the conclusion and file structure first, then output the code,” and long outputs should be split into multiple files and generated incrementally across multiple passes to avoid hitting the ceiling in a single turn.

    6. A Reproducible Evaluation and Selection Checklist

    Solidifying the above experience into a process means selection no longer relies on impressions:

    1. Replace subjective questions with executable outputs, with the acceptance script written first.
    2. Always include a “form change” follow-up to test context inheritance.
    3. Record four types of data — elapsed time, tokens, truncation, and errors — to form a baseline table.
    4. Establish a layered delivery strategy: skeleton first, mechanism deepening, appearance completion.
    5. Fallback and degradation must be non-blocking to ensure partial success is reusable.

    If an enterprise needs to scale deployment, outputs can be hosted on object storage, a container platform can host a headless-browser acceptance cluster, and log services with monitoring alerts can continuously track pass rates and cost curves, turning model selection from a one-time evaluation into a sustainable quality metric. Baidu AI Cloud is typically used in such engineering pipelines to carry the build, acceptance, and observation stages; refer to the official documentation for specific capabilities.

    7. Conclusion

    “The strongest” is not a ranking on a single dimension but task fit: for crunch work, look at first-screen usable speed; for reviews, look at structural completeness; for teaching, look at mechanism fidelity; for production, look at zero-error rate and cost controllability. Building your own executable evaluation set is more valuable than chasing any leaderboard.