Evaluating Instruction Following in Lightweight LLMs: A Geometric Construction Case
When testing how well large language models write code, many teams only check whether the rendered page displays correctly. This article uses a geometric construction task—a heptagon built with a marked straightedge—to show why visual correctness is not enough, and how to detect "shortcut implementations" where a model produces the right result while bypassing the required steps. It covers test constraints, evaluation dimensions, observed model behavior, and practical recommendations for reproducible testing.
Evaluating Instruction Following in Lightweight LLMs: A Geometric Construction Case
When evaluating a large language model’s coding ability, many teams only check whether the resulting page renders correctly. This approach has a blind spot: a page that looks correct does not prove the model followed the required steps. This article uses a geometric construction task to show how to verify whether a lightweight model truly follows multi-step constraints.
1. The Test Task and Its Constraints
The task asks the model to generate an HTML page demonstrating the construction of a regular heptagon using a “marked ruler” (a straightedge with two marked points). The required steps are:
- Draw a square and construct the perpendicular bisector of its bottom edge.
- With the bottom-right vertex E as the center, draw circle E with a radius equal to the diagonal length.
- Fix one end of the marked ruler at the bottom-left vertex D, slide the first mark along circle E until the second mark intersects the perpendicular bisector of the bottom edge.
- Determine the center of the heptagon using a standard perpendicular bisector construction, then complete the drawing.
- The page must show the movement trajectories of points, retain construction marks only where necessary, and provide GIF export.
The “marked ruler” refers to a straightedge carrying two tick marks. Only lines, circles, and sliding the ruler along constraints are permitted. The following approaches do not qualify: computing vertex coordinates directly with the regular polygon formula, or drawing the figure from preset angles without going through the intersections described above.
2. Evaluation Dimensions
To judge whether a generation passes, check at least four aspects:
- Instruction following: Does every required step have a corresponding implementation in the code?
- Traceable process: Are the circles, lines, and intersection points computed, rather than hardcoded coordinates?
- Runnability: Does the page open in a browser, and do the animation and GIF export work?
- Manual rework: How much code must be modified to reach a usable state?
3. Observed Results
We ran the same task on two models. One model had a longer reasoning phase and took noticeably more time to generate; the other responded faster. Both produced pages displaying a regular heptagon.
Source code review led to different conclusions. The slower model computed the diagonal length, the radius of circle E, and the intersections of the ruler with the circle and the perpendicular bisector, step by step; manual review found no obvious logical deviation. The faster model produced a visually identical page, but its core computation generated coordinates directly from the regular polygon vertex formula, without implementing the marked-ruler intersection process. This can be called a “shortcut implementation”: the result is correct, but the process bypasses the task requirements.
A caveat: this article covers only one test case. Hardware environment, inference parameters, and queueing time were not uniformly recorded, so no specific timings are given and no model ranking is made. The exact model versions are not disclosed here.
4. How to Detect Shortcut Implementations
When reviewing code, watch for these signals. If the source contains expressions like cos(2πk/7) or sin(2πk/7) that generate vertices directly, while circle-line intersection or ruler-sliding constraint calculations are missing, further verification is needed. Another signal is animation where point movement does not match the geometric constraints—for example, an intersection point that does not lie on the arc.
5. Recommendations for Evaluation
First, record speed and quality separately; do not measure a model with a single latency metric.
Second, define explicit pass criteria and failure conditions for each task, such as “the polygon vertex formula must not be used.”
Third, preserve the full prompt, model version, inference parameters, and raw output so others can reproduce the test.
Fourth, manually review geometry tasks; correct page rendering alone should not count as a pass.
Fifth, a single case does not represent a model’s overall capability. Prepare multiple tasks of the same type and base conclusions on pass-rate statistics.
6. Conclusion
In this single case, the slower model followed the required process more closely. This suggests that instruction following should be a focus of code generation evaluation. Developers can run such tests on their own cloud platforms, public cloud services, or local deployments—what matters is consistent test criteria and complete records.
