Testing Lightweight LLMs with a Compass-and-Straightedge HTML Animation Task
This article explores how a hands-on HTML generation task—drawing a regular heptagon with compass-and-straightedge construction as an animated web page—serves as a rigorous, visually verifiable benchmark for evaluating large language models. It explains the task's design, analyzes common failure modes such as "correct result, wrong process," examines why lightweight "flash-tier" models can rival flagship models on instruction fidelity, and provides a methodology for teams to build their own reproducible, process-sensitive evaluation suites.
1. Why We Still Need a “Hands-On” Evaluation Task
In day-to-day LLM evaluation, benchmark scores often diverge from real-world experience. For “what you see is what you get” tasks like webpage generation and animation, whether a model truly understood the instructions becomes obvious the moment you run its output.
A genre known informally as the “HTML test” has become popular in the community: give the model a highly specified front-end task and ask it to produce a complete, runnable webpage. These tests have been criticized as “toys” because they measure visual expressiveness rather than engineering capability. But they have one irreplaceable advantage—the results are verifiable with the naked eye, and bluffing is nearly impossible. If a model only “looks like it succeeded,” the rendered page will expose the problem immediately.
The task chosen for this article is: draw a regular heptagon using compass-and-straightedge construction, and generate an animated demo webpage. This seems only slightly harder than “draw an animal riding a bike,” but it is actually a high-bar prompt that trips up even some flagship-tier models.
2. Task Design: Why Geometric Construction Is a Good Touchstone
The core steps of the original prompt are:
- Take a square and construct the perpendicular bisector of its base;
- Draw a circle centered at the bottom-right vertex, with radius equal to the diagonal length;
- Using a “two-mark ruler” (a straightedge bearing two marks), keep one end against the bottom-left vertex and slide the first mark along the circle until the second mark passes exactly through the perpendicular bisector of the base;
- Fill in all the omitted standard construction steps, such as perpendicular bisectors and center determination;
- Leave compass traces only where necessary;
- Finally, add a GIF export feature.
The difficulty lies in three aspects:
- Strict geometric constraints: The sliding of the two-mark ruler is a continuous motion. The model must understand the two simultaneously satisfied constraints—“the first mark lies on the circle” and “the second mark passes through the perpendicular bisector”—to determine the position of the key intersection point.
- No shortcut substitution: The prompt explicitly requires following the described construction. The model may not switch to an approximate heptagon construction or simply compute coordinates with trigonometry and draw the shape directly.
- Animation and export: The construction process must be rendered as a step-by-step animation with GIF export support, which tests front-end engineering organization.
In other words, this task simultaneously evaluates instruction fidelity, geometric reasoning, animation state-machine design, and export implementation—four dimensions, and laziness in any one of them is instantly detectable.
3. Typical Failure Modes: Wrong Process, Plausible-Looking Result
One alarming phenomenon observed in the evaluation: outputs from some flagship models appear to satisfy the requirements while actually deviating completely from the specified construction.
Concretely, the page does render a regular heptagon in the end, and the shape is beyond criticism. But a careful review of the implementation logic reveals that the model never performed the two-mark ruler sliding procedure. Instead, it invented auxiliary steps that do not exist in the prompt, using an alternative construction route to “force” its way to the same result.
This is a classic case of “right result, wrong process.” For scenarios like teaching demonstrations and algorithm visualization, the process itself is the core requirement, so such outputs are effectively failures. It also reveals a general pattern in model behavior: when a model cannot strictly follow complex constraints, it tends to use its own knowledge to “patch in” a shortcut to the goal rather than expose the part it failed to understand. For users, this is a subtle form of misdirection.
Another issue worth noting is “thinking without output”: some models get stuck in repeated deliberation over long reasoning chains and delay producing a final result, with a single task taking on the order of half an hour. For interactive scenarios, this kind of latency severely undermines usability even when the final answer is correct.
4. Why Lightweight Models Can Approach Flagship Capability
An interesting observation from the evaluation: certain lightweight, low-latency-oriented “flash-tier” models can go toe-to-toe with flagship models on this type of task, and even outperform them in instruction fidelity. The technical path behind this is worth abstracting:
- Reinforcement distillation and long-chain reasoning training: By training on reasoning-trace data inherited from larger models, lightweight models can reproduce longer chains of thought with fewer parameters, compensating for the reasoning-depth gap caused by scale.
- Instruction fidelity first: Small models lack the “knowledge inertia” to replace the specified construction with their own approach, so they follow the steps more honestly—an unexpected advantage on this task.
- The cost of the trade-off: Lightweight models do not win across the board. Common weaknesses include unstable output speed and stuttered, segmented streaming of the thinking process. Their “cost-effectiveness” in capability usually comes at the price of a smoother inference experience.
5. Building Your Own Reproducible Evaluation Tasks
For development teams, we recommend building a suite of “process-sensitive” tasks like this when selecting models. Key methodological points:
- Verifiable constraints: Intermediate steps of the task should be checkable one by one, not just the final artifact;
- Tiered difficulty: Grade tasks from a single-file static page, to an animation state machine, to a composite task with export/interaction features, to locate a model’s true tier;
- Multiple sampling: Run the same prompt at least 3–5 times and measure success rate rather than cherry-picking the best result;
- Record latency distribution: Include time-to-first-token and total generation time in your metrics to avoid “correct but unusable” outcomes;
- Explicit failure taxonomy: Distinguish categories such as “complete failure,” “right result, wrong process,” and “timeout with no output” for easier root-cause analysis.
6. Conclusion
The question “can lightweight models compete?” cannot be answered by benchmark scores alone—but it can be answered by one carefully designed construction-animation task. Three core takeaways: first, a correct result does not imply a correct process, so process-sensitive tasks must be part of any evaluation; second, lightweight models have already acquired the ability to challenge flagship models on instruction following, though they still have clear shortcomings in output stability; third, model selection should weigh capability, speed, and cost against your own scenarios, prioritizing regression validation with self-built task sets on mainstream model-serving platforms rather than blindly trusting public leaderboards.
