Evaluating LLM Prompt-Following Ability: A Geometric Construction Test Case
Prompt-following (instruction following) is a more revealing measure of an LLM's practical value than leaderboard scores. This article explains why, using a challenging test case: animating the neusis (marked-ruler) construction of a regular heptagon as an HTML page. It breaks down what makes this task discriminative—obscure terminology, dense multi-object references, and deliberately ambiguous semantics—and analyzes the engineering difficulty from geometric solving to animation rendering and GIF export. It also distills a methodology for systematically evaluating prompt-following ability: four principles for designing test cases, a layered evaluation framework, and how this maps to real-world coding assistant scenarios, concluding with practical recommendations for developers and technical decision-makers.
Evaluating LLM Prompt-Following Ability: A Geometric Construction Test Case
1. Why Prompt-Following Matters More Than Leaderboard Scores
When evaluating a large language model’s real capability, the first things that come to mind are standardized benchmarks: mathematical reasoning, code generation, knowledge Q&A. But in real-world development and business scenarios, there is one often-underestimated metric that better reflects a model’s practical value—prompt following (instruction following).
Prompt following is not merely “did the model output an answer in the requested format.” It refers to whether the model, after understanding the true intent behind the prompt, faithfully restores the implied spatial operations, physical constraints, technical terminology, and ambiguous semantics into the final output.
Take an everyday development example: you ask the model to “refactor this API to support idempotent retries, and don’t break existing callers.” That single sentence contains at least three implicit constraints:
- The semantic constraint of idempotency (repeated calls produce identical results);
- The architectural constraint of backward compatibility (callers don’t change);
- The workload constraint of modification, not rewrite.
A low-compliance model will often “helpfully” rename the interface, change the return structure, or produce a seemingly elegant solution that breaks compatibility. A high-compliance model infers the boundary of every constraint before acting and strictly stays within those boundaries in its output.
For models with large parameter counts and long chains of thought, improved compliance actually reflects deeper understanding: the model is not mechanically matching keywords but building a complete mental model of the problem described in the prompt. This is also where the difference is most palpable in everyday vibe coding—driving development with natural language.
It should be noted that this kind of test primarily reflects a model’s performance in “programming assistance” scenarios. For higher-level “wish coding”—where you only describe a goal and leave planning and implementation entirely to the model—a single test may not reach the ceiling of its capabilities. But it is a highly discriminative touchstone.
2. A Highly Discriminative Test Case: Constructing a Regular Heptagon with a Neusis Ruler
To build a sufficiently challenging compliance test, we can pick a geometric construction task that is obscure, multi-step, and involves complex object relationships. Here is a structured restatement of the test prompt:
Create an HTML page that animates the process of constructing a regular heptagon using a “neusis” (marked ruler). The steps are:
- Take a square and construct the perpendicular bisector of its bottom edge;
- With the bottom-right vertex E as center and the diagonal length as radius, draw circle E;
- Using the neusis ruler, keep the ruler against the bottom-left vertex D, let the first mark on the ruler slide along circle E, until the second mark happens to pass through the perpendicular bisector of the bottom edge;
- Then complete the rest with standard straightedge-and-compass construction: construct perpendicular bisectors, locate the center, and draw the regular heptagon;
- Fill in all omitted straightedge-and-compass steps; the compass leaves traces of point motion, but only where necessary;
- Finally, add the ability to export as a GIF.
This task is classic because it simultaneously tests multiple dimensions of capability.
2.1 Understanding an Obscure Term: What Is a “Neusis”?
The “neusis” (marked-ruler construction) is a construction tool from ancient Greek geometry: a straightedge bearing two marks, which can be slid so that both marks simultaneously satisfy specific constraints. Unlike classical straightedge-and-compass construction, it can solve problems impossible with compass and straightedge alone—such as angle trisection and doubling the cube—and the construction of the regular heptagon is one of its classic applications.
The vast majority of models do not “know” this term—it appears extremely rarely in training corpora. This forces the model not to rely on memory retrieval, but to infer the tool’s behavioral model on the fly from the textual description: the ruler pivots and slides through fixed point D, the spacing between the two marks is fixed, one mark moves along the circle, and the other aligns with the perpendicular bisector. This is a typical “from description to mechanism” reverse-understanding ability.
2.2 High-Density Multi-Object References
Almost every step of the process involves at least three objects at once. Take step 3 as an example:
- The neusis ruler (a rigid body, constrained through point D);
- The first mark (a moving point, constrained to circle E);
- The second mark (a moving point, constrained to the perpendicular bisector);
- Circle E (defined by the square and its diagonal);
- The perpendicular bisector of the bottom edge (defined by the square).
The model must correctly maintain the dependency topology among these objects. Any referential slip—such as swapping the “first mark” and “second mark,” or misassigning the circle’s center to another vertex—causes the entire construction to fail. This is an extreme test of the model’s “working memory” and coreference resolution.
2.3 Restoring Ambiguous Semantics
The prompt uses very colloquial, imprecise natural language, with several implicit conditions buried in it that the model must fill in itself:
- The square’s side length is not given. The model must reason on its own: given the goal of “ultimately constructing a regular heptagon,” the square must have unit side length. Otherwise, the relationship between the neusis mark spacing (assumed to be unit length) and the radius of circle E breaks down, and the subsequent derivation cannot converge to a regular heptagon.
- The neusis mark spacing is not stated. The default convention that the two marks are one unit apart must be supplied from mathematical background knowledge.
- “Necessary traces” is undefined. The model must weigh on its own which arc segments of the compass-trace animation to keep and which auxiliary traces to erase, so that the construction logic is visible without cluttering the canvas.
In other words, only by genuinely understanding the spatial operations, physical constraints, terminology, and ambiguities behind the natural language can the model strictly follow the prompt and complete the correct construction. This is the true purpose of a “natural-language compliance” test—it doesn’t measure obedience, but consistent execution after understanding.
3. Deconstructing the Task’s Difficulty from an Engineering Perspective
If we handed the above prompt to a development team, what technical components would a qualified implementation require? This helps us appreciate the real workload facing the model.
3.1 The Geometric Solving Layer
First, one must analytically solve for the neusis locking angle. Let the square be a unit square, with D at the origin, E at (1, 0), and circle E having radius √2. Let the first mark be P (on circle E) and the second mark be Q (on the extension of DP with |PQ| = 1), requiring Q to lie on the perpendicular bisector x = 0.5. This is equivalent to solving a transcendental system; in engineering practice, one typically approximates the critical sliding position with numerical iteration (e.g., bisection or Newton’s method):
import mathdef solve_neusis():# D=(0,0), E=(1,0), radius of circle E: r=sqrt(2)r = math.sqrt(2)lo, hi = 0.0, math.pi # search range for the ruler's swing anglefor _ in range(200):theta = (lo + hi) / 2# First mark P lies on the ray from D at angle theta with |EP| = r# Solve |E - t*(cosθ, sinθ)| = r for tdx, dy = math.cos(theta), math.sin(theta)# |t*d - E|^2 = r^2 => t^2 - 2t*dx + 1 - r^2 = 0disc = 4*dx*dx - 4*(1 - r*r)if disc < 0:lo = thetacontinuet = dx + math.sqrt(disc) / 2# Second mark Q = (t+1) * d (mark spacing is 1)qx = (t + 1) * dxif qx > 0.5:hi = thetaelse:lo = thetareturn (lo + hi) / 2
Once the locking angle is found, the construction chain for the regular heptagon formally begins: using the key segment length determined by the neusis, the seven-fold division of the circle is completed through classical straightedge-and-compass steps such as perpendicular bisectors and center location.
3.2 The Animation Rendering Layer
Implementing a construction animation in a single HTML page is commonly done with Canvas or SVG plus requestAnimationFrame for frame-by-frame drawing. Key design points include:
- State-machine driving: Model “draw square → draw perpendicular bisector → draw circle E → slide the neusis → lock position → complete the heptagon” as a staged state machine, where each frame advances the interpolation parameters of geometric entities according to the current stage;
- Trace management: Compass traces are accumulated on an offscreen canvas and composited onto the main canvas only during “necessary” stages, fading out otherwise—this directly corresponds to the prompt’s ambiguous requirement of “traces only where necessary”;
- GIF export: This can be achieved through the common approach of capturing canvas pixels frame by frame and encoding them into a GIF on the browser side, without depending on any specific third-party service.
3.3 Where Models Commonly Fail
In actual testing, typical failure modes of models on this task include:
- Terminology amnesia: Not recognizing the neusis and arbitrarily substituting an ordinary straightedge, making the whole construction logic wrong;
- Reference drift: As steps accumulate, confusing the roles of vertices E and D, or misattributing the perpendicular bisector;
- Over-improvisation: Not strictly executing the steps in order, adding “optimizations” the prompt never asked for;
- Strong start, weak finish: A refined animation in the early stages but a perfunctory later half, with the GIF export missing or broken;
- Missed implicit conditions: Choosing an arbitrary side length for the square, causing all subsequent proportional relationships to collapse.
A high-compliance model should hold the line on all of these, and proactively confirm with the user—or reasonably explain—how each ambiguous point was handled.
4. How to Systematically Evaluate a Model’s Compliance Ability
From this single case, we can distill a methodology applicable to enterprise model selection and routine evaluation.
4.1 Four Principles for Designing Test Cases
- Obscurity: Choose terms or procedures that are scarce in training corpora, preventing the model from reciting memorized answers and forcing on-the-spot reasoning;
- Multi-object density: Each operation should involve three or more interrelated entities, testing coreference resolution and state maintenance;
- Deliberate ambiguity: Intentionally omit key parameters and observe whether the model can back out the uniquely reasonable completion from the global goal;
- Verifiability: The final result must have objective pass/fail criteria (e.g., whether geometric constraints are satisfied, whether the page functions), not subjective scoring.
4.2 Layered Evaluation Dimensions
| Dimension | What It Tests | Typical Failure |
|---|---|---|
| Terminology understanding | Can an obscure concept be reconstructed from context | Substituting a familiar concept |
| Step compliance | Order and completeness | Skipping, merging, adding or removing steps |
| Constraint consistency | Implicit physical/spatial constraints | Broken proportions, conflicting constraints |
| Intent restoration | Reasonable interpretation of vague phrasing | Ignoring it or improvising arbitrarily |
| Engineering completeness | Whether附加 functional requirements are delivered | Missing export or interaction features |
4.3 Mapping to Everyday Development Scenarios
This methodology transfers directly to enterprise application scenarios. For example, when selecting an intelligent coding assistant, one can construct a similar “modification task with implicit constraints”: provide a piece of legacy code and ask to “refactor it without changing external behavior, and add handling for a certain class of exceptions.” Whether the model understands the full boundary of “not changing external behavior” (interface signatures, exception types, performance characteristics, side effects) is essentially the same capability as understanding the implicit “unit square” constraint in the neusis task.
5. Conclusion: Compliance Is the Ticket to a Trustworthy AI Assistant
The neusis heptagon test shows that prompt following is by no means a superficial metric. Behind it lies a chain of core capabilities: terminology understanding, spatial reasoning, multi-object state maintenance, ambiguous-semantics restoration, and stability across long execution chains. Only a model that performs stably on such tasks can become a partner that “understands what you say and gets things done” in real R&D collaboration.
For developers and technical decision-makers, the recommended path forward is:
- Build your own domain-specific test sets of “obscure + ambiguous + multi-constraint” cases rather than relying solely on public leaderboards;
- Pay attention to the model’s consistency decay curve over long prompts and multi-step tasks;
- In engineering practice, establish automated constraint validation for model outputs (e.g., geometric constraint checks, contract tests for code), replacing manual eyeballing with machine verification.
As model capabilities continue to evolve, evaluation methods must evolve in tandem—only when the tests themselves are demanding enough can we truly see where a model’s boundary of understanding lies.
