Benchmarking Lightweight LLMs: A Neusis Heptagon Construction Test for Code Generation
Lightweight large language models (LLMs) — often named with suffixes like Flash, Mini, or Lite — have long been assumed to trade reasoning quality for speed and cost. This article challenges that assumption through a hands-on evaluation using a high-discrimination test task: generating a web animation that reproduces a neusis (marked-ruler) construction of a regular heptagon. We explain why geometric construction tasks are effective evaluation probes, compare a new-generation lightweight model against a previous-generation flagship model, and derive a practical methodology for LLM selection — including instruction-following as a scoring dimension, latency-versus-quality trade-offs, and layered test suites for production adoption.
Rethinking What Lightweight LLMs Can Do
In most LLM product lineups, there is a clear split between “full-size flagship” models and “lightweight, high-speed” variants. The traditional assumption is that lightweight models make significant compromises in parameter count, reasoning ability, and output quality in exchange for faster responses and lower costs. However, as training data quality, post-training alignment, and reasoning enhancement techniques continue to improve, this assumption is being challenged.
Recent real-world tests in the industry are telling: some new-generation lightweight models not only consistently outperform peer lightweight models on complex code generation tasks, but in certain high-difficulty scenarios approach or even surpass the previous generation’s full-size flagship models. The takeaway for engineering teams is that model selection can no longer rely on the old “lightweight means weak” stereotype. Instead, teams need an evaluation framework built around actual task performance.
This article uses a concrete, high-discrimination test task — generating a web animation of a neusis construction of a regular heptagon — to walk through how to design, execute, and interpret this kind of capability evaluation.
Why Geometric Construction Animations Make a Good Test
The “Toy Test” Problem with Simple Prompts
In early LLM evaluations, prompts like “make a web animation of a bird riding a bicycle” were widely used. But such tests have an obvious flaw: they only measure whether the model can produce a moving picture, with almost no demand for logical rigor. As general model capability improved, these tests lost their discriminating power and became “toy tests.”
What a Geometric Construction Task Actually Measures
By contrast, “reproducing a compass-and-straightedge construction in code” is an excellent capability probe. It simultaneously tests:
- Mathematical understanding: The model must know that a regular heptagon cannot be constructed precisely with a standard compass and straightedge, and understand the principle of a neusis — a ruler with two marks at a fixed distance used as an extended construction tool.
- Instruction following: The task specifies the exact order and constraints of construction steps. The model must reproduce them strictly, not substitute a method that merely “looks more correct.”
- Code engineering: The model must generate complete page structure, animation timing control, and trajectory rendering logic.
- Handling of fine-grained constraints: For example, “the compass should leave traces of a point’s motion, but only where necessary” — an implicit state-management requirement.
- Feature extension: The task also requires a GIF export feature, testing whether the model can integrate a third-party general-purpose solution or implement the encoding itself.
How to Design the Test Prompt
A typical test instruction might look like this:
Build a web page that animates the complete neusis construction of a regular heptagon:1. Start with a square and construct the perpendicular bisector of its bottom edge;2. Using the bottom-right vertex as the center and the diagonal as the radius,draw an auxiliary circle;3. Using a marked ruler (neusis), keep it pivoting at the bottom-left vertex,slide the first mark along the auxiliary circle until the second marklands on the perpendicular bisector;4. Complete all the remaining standard compass-and-straightedge steps(e.g., constructing perpendicular bisectors to locate the circumcenter);5. Compass operations should show the moving point's trajectory,but leave marks only where required;6. Finally, provide a function to export the animation as a GIF.
The key characteristics of this kind of prompt are that the steps cannot be freely substituted, the constraints can be objectively verified, and the result has a clear right-or-wrong boundary — eliminating the noise introduced by subjective scoring.
Experiment Design: Treatment and Control Groups
Evaluation Environment and Method
To ensure comparability, both models were tested under similar conditions: the treatment model was invoked through an AI coding assistant, and the control model through its official conversational coding platform. Both received exactly the same prompt text, with no extra hints or step-by-step guidance, and we observed the complete result from a single generation.
Treatment Group: The New Lightweight Model
The lightweight model in the treatment group showed two notable behaviors during its thinking phase:
First, a “stuttering” reasoning output. Unlike the usual smooth streaming output, its reasoning appeared in segmented, intermittent bursts — at one point it spent a long stretch thinking without producing any code. The whole task took roughly thirty minutes. This suggests the model may adopt a more aggressive deep-reasoning strategy internally, trading latency for quality.
Second, extremely high instruction fidelity. The generated animation strictly followed the construction order described in the prompt: first building the square and perpendicular bisector, then the auxiliary circle, then simulating the sliding of the marked ruler, and finally completing the standard steps to locate the circumcenter. Each step’s geometric logic mapped one-to-one to the prompt. The “trace only where required” behavior and the GIF export feature were both implemented.
Control Group: How the Flagship Model Quietly Failed
The previous-generation flagship model in the control group took nearly twenty minutes and produced a page that appeared to satisfy the requirements — a regular heptagon was indeed visible on screen. But a deeper look at the implementation logic revealed the problem: the model did not use the prescribed neusis method. It added steps that were not in the prompt and “forced” the final result into place.
This is a classic and dangerous failure mode: the output “looks right” visually, but the process completely deviates from the instructions. If an evaluator only checks the final figure, they will wrongly conclude the test passed. This is exactly why geometric construction tasks are more valuable for evaluation than “draw an animation” prompts — they force evaluators to open the code and verify the process, exposing the “superficially correct, substantively wrong” problem.
From Observations to a General Evaluation Methodology
Instruction Following Should Be an Independent Scoring Dimension
Many evaluations only ask “was the task completed” and ignore “was it completed in the prescribed way.” In real engineering, instruction following often matters more than the final result — for example, in business code generation that must comply with regulatory processes or security standards, a model that takes unauthorized shortcuts can introduce serious risks. It is advisable to split scoring into three independent dimensions: correctness of the result, compliance of the process, and coverage of constraints.
Beware the “Longer Thinking Means Better Quality” Misjudgment
In this experiment, the lightweight model took longer but produced higher quality. This suggests that on new reasoning-enhanced models, inference latency and output quality may be positively correlated. When selecting a model, first define the latency budget for your business scenario, then pick the highest-quality model within that budget — rather than defaulting to “the fastest one.”
Build a Tiered Test Suite
Engineering teams should build a test suite with tiers of increasing difficulty:
- Foundation tier: routine page and script generation, verifying basic coding ability;
- Intermediate tier: tasks with explicit algorithmic constraints, verifying logical reasoning;
- Discriminating tier: tasks like the geometric construction in this article, with non-substitutable step constraints and objectively verifiable intermediate states, used to separate top-tier models.
Putting It Into Practice
For teams looking to bring this kind of model capability into production, consider the following practices:
- Run gray-scale validation via cloud model services: Use mainstream model inference platforms to call multiple candidate models in parallel through standard APIs and batch-score them on a unified test set, reducing the cost of building your own inference infrastructure.
- Retain and audit results: Store generated code, intermediate reasoning traces, and evaluation conclusions in object storage, combined with logging and alerting, to form a traceable evaluation pipeline.
- Route models by scenario: Use lightweight models for latency-sensitive simple Q&A, and route high-difficulty tasks such as code generation and mathematical reasoning to stronger models, balancing cost and quality.
Conclusion
The era of “lightweight always means weak” is ending. As this geometric construction test shows, new-generation lightweight models are now capable of challenging older flagships in instruction following and long-chain reasoning — with the main trade-off being longer inference latency. For engineering teams, what matters more than chasing a single leaderboard is establishing an evaluation methodology centered on process compliance, validating models against real business tasks, and building scenario-based, cost-aware model routing strategies accordingly. Only then can teams make sound engineering decisions amid the rapid iteration of model capabilities.
