Evaluating LLM Prompt-Following Ability Through Geometric Construction Tasks
This article argues that evaluating an LLM's coding ability should shift from judging generated output to verifying constraint satisfaction. Using the task of constructing a regular heptagon with a marked (two-notch) ruler as a case study, it breaks prompt-following into three layers—expression, process, and semantic compliance—and shows how geometric construction exposes the gap between "visually complete" and "constraint-complete." It covers disambiguating terminology, normalizing the square's side length, translating natural language into checkable constraints, distinguishing proven steps from unproven assumptions, separating the implementation into geometry, workflow, and rendering layers, making "keep only necessary marks" an explicit rule, reusing a deterministic state sequence for animation export, and building a reproducible evaluation matrix. The takeaway: reliable prompt-following turns informal requirements into a self-consistent, verifiable technical solution rather than a convincing demo.
1. Evaluating Coding Ability: From “Generated Output” to “Constraint Satisfaction”
A common way to assess an LLM’s coding ability is to look at whether the generated page looks polished, whether the code runs, and whether the interactions feel smooth. These signals matter, but they do not prove the model actually understood the requirement.
In complex tasks, a page can look complete while quietly substituting a method the user never approved. For example, if a user asks for a regular heptagon produced through geometric construction, the model may simply generate seven vertices from the formula that divides a circle into equal arcs. The final figure may be correct, yet the process never followed the requirement.
Prompt-following ability should therefore be split into at least three layers:
- Expression compliance — whether the output format, page structure, and functional entry points match the request.
- Process compliance — whether the specified objects, order of operations, and construction method are actually used.
- Semantic compliance — whether the model can recognize implicit conditions in natural language, resolve ambiguity, and avoid inventing a plausible-looking but unproven solution when the requirement has gaps.
The third layer matters most for developers and enterprise users. Real requirements are rarely formal specifications; they are natural language mixed with business context, domain terminology, and omitted details. Reliable coding ability should turn those descriptions into verifiable implementations, not just a demo that feels right.
2. Why Geometric Construction Makes a Hard Test Task
Consider this task:
Build a web page that demonstrates constructing a regular heptagon with the aid of a two-notch (marked) ruler. First construct a square and draw the perpendicular bisector of its base. Then draw a circle centered at the bottom-right vertex with a radius equal to the square’s diagonal. Let the ruler’s body pass through the bottom-left vertex, and adjust its position so that the first notch lands on the circle and the second notch lands on the perpendicular bisector of the base. Complete the remaining necessary construction steps, and finally provide animation playback and animated-image (GIF) export.
This requirement spans three dimensions at once—mathematics, interaction, and engineering.
- The mathematical dimension demands explicit points, lines, circles, and length relationships.
- The interaction dimension requires organizing continuous movement together with discrete construction steps.
- The engineering dimension requires maintaining state, controlling animation, generating files, and handling failures such as an unsolvable configuration.
The task has another valuable property: errors often do not surface immediately. A model can draw something that “looks like a regular heptagon” and make the ruler appear to pass through the specified points, yet on closer inspection the notch spacing may have changed, the ruler’s body may not truly pass through the fixed point, or the later circle center may not actually come from the perpendicular bisector that was shown.
Tasks like this can distinguish “visual completion” from “constraint completion.”
3. Disambiguate the Terminology First, Then Build the Geometric Model
3.1 Clarify What the Marked Ruler Does
For this task, model the two-notch ruler as a straightedge with two fixed marks: the distance between the marks stays constant, the body can translate and rotate, and it must satisfy several incidence conditions simultaneously.
Here you must separate “the ruler’s body passes through a fixed point” from “a specific notch is fixed at that point.” These are different constraints. If you treat the bottom-left vertex directly as the first notch, the problem you solve afterward has already changed.
Likewise, a marked-ruler construction is not the same as classical straightedge-and-compass construction with an unmarked ruler. A regular heptagon cannot be constructed exactly with classical straightedge and compass alone, but that does not mean it stays impossible once other operations are added. Whether a specific scheme works must be judged from the definition of the added operation and the complete mathematical relationships—not from the final figure.
3.2 The Square’s Side Length Can Be Normalized, Not Assumed Away
Let the square’s side length be (a>0), with the bottom-left corner at (D=(0,0)) and the bottom-right corner at (E=(a,0)). The perpendicular bisector of the base is:
[
x=\frac{a}{2}
]
The circle centered at (E) with radius equal to the diagonal is:
[
(x-a)^2+y^2=2a^2
]
To simplify the calculation, you may set (a=1). This is a scale normalization, not a claim that “only a unit square can produce a regular heptagon.” Geometric relationships usually stay invariant under uniform scaling.
What genuinely needs confirmation is the ratio between the marked-ruler notch spacing (s) and the side length (a):
[
\rho=\frac{s}{a}
]
If the original requirement does not specify this ratio, you cannot treat an arbitrary ratio as valid. The model should state the assumption it adopts, request more information when necessary, and verify that the assumption supports the target construction.
This is an important boundary for evaluating prompt-following: filling in routine details is reasonable; fabricating a key mathematical condition is not.
4. Turn Natural Language into Checkable Constraints
Let the first notch point be (P=(p_x,p_y)), the second notch point be (Q=(q_x,q_y)), and the notch spacing be (s). Under one explicit interpretation, the requirement maps to these constraints:
[
(p_x-a)^2+p_y^2=2a^2
]
[
q_x=\frac{a}{2}
]
[
|P-Q|=s
]
[
(P-D)\times(Q-D)=0
]
Here a zero 2D cross product means (D), (P), and (Q) are collinear. Beyond these, you may also need to constrain the order of the notches, the region the points lie in, and whether the ruler’s extension line is allowed to satisfy the conditions.
A convenient parameterization is:
[
P=D+t(\cos\theta,\sin\theta)
]
[
Q=D+(t+s)(\cos\theta,\sin\theta)
]
This way, collinearity and the fixed notch spacing are guaranteed automatically, and the remaining conditions reduce to equations in (t) and (\theta). Note, though, that this expression implies a notch order; if the actual construction uses the reverse order, you must adjust the sign or handle that branch separately.
A web implementation can solve numerically, but numerical solving carries two extra responsibilities:
- Check the residual. Do not equate “iteration stopped” with “constraint satisfied.”
- Check the solution branch. Multiple mathematical solutions may correspond to different ruler positions, and only some of them match the construction path the user asked for.
If no feasible solution exists, the interface should report a constraint conflict or invalid parameters, rather than faking success by moving endpoints or changing the notch distance.
5. Completing the Construction Steps Is Not the Same as Proving an Unproven Conclusion
Descriptions like “draw the perpendicular bisector afterward to locate the center” often skip the key logic. The center of which circle? Perpendicular bisectors of which segments? How do the previously obtained points determine the heptagon’s side length or central angle?
These questions must be answered before a complete construction flow can exist.
If the circumscribed circle is determined from several known points, you can show the perpendicular bisectors of the corresponding chords and obtain the center from their intersection. But this does not automatically prove that some chord on that circle is the side length of a regular heptagon. A complete scheme still has to explain why the length or angle produced by the marked-ruler step matches the geometric relationship a regular heptagon requires.
Therefore, both the technical article and the implementation should distinguish three states:
- Construction steps that are defined and verified;
- Candidate steps that depend on explicit assumptions;
- Steps that cannot yet be determined because a proof or input condition is missing.
Do not pass off precomputed seven-way division vertices as the result of a marked-ruler construction. Directly computing a regular heptagon can serve as an independent check, but it should not replace the construction process the user specified.
The same distinction applies to everyday development: validation data can help check a business implementation, but it must not quietly bypass the business rules.
6. A Web Implementation Should Separate Math, State, and Rendering
For better reliability, split the implementation into three layers.
6.1 Geometry Layer
The geometry layer stores points, lines, circles, and constraints, and handles intersection computation, residual verification, solution-branch filtering, and degenerate cases.
This layer does not depend on screen pixels. All coordinates live first in a unified mathematical coordinate system and are converted to display coordinates only afterward, so window resizing never changes the geometric relationships.
6.2 Workflow Layer
The workflow layer maintains the current step, completed objects, ruler position, playback progress, and export state.
Every step should have a clear input, output, and completion condition. For example, “the ruler has moved to the target position” is complete only after all residuals fall within the threshold—not automatically once the animation time elapses.
6.3 Rendering Layer
The rendering layer only draws existing state, including line styles, labels, traces, auxiliary arcs, and highlight effects.
This separation keeps the math solver out of the drawing code and makes testing easier: even without opening the page, you can verify that the geometry layer’s output satisfies the constraints.
7. “Keep Only the Necessary Marks” Should Be an Explicit Rule
The compass’s movement, auxiliary arcs, and the lines finally retained should not be lumped together.
You can classify graphic objects into three types:
- Permanent objects: the final figure and the key segments needed to understand the construction;
- Auxiliary objects: arcs used to find intersections, draw perpendicular bisectors, or locate the center;
- Transient objects: preview lines, candidate positions, and operation hints shown while the ruler moves.
For instance, when drawing a segment’s perpendicular bisector, if only the two arc intersections are needed, you can show just the effective arc segments near those intersections instead of two full circles. But the arc segments must still cover the actual intersections—do not sacrifice the basis of the construction for the sake of brevity.
During animation you can temporarily highlight auxiliary objects, lower their opacity once a step is done, and offer a toggle to show or hide auxiliary lines. This satisfies the need for a clean image while preserving reviewability.
Also distinguish “an arc formed by a compass that keeps a fixed center but changes orientation” from “a trace formed by moving the whole compass.” The former is a construction object; the latter does not necessarily need to leave a mark. If the model fails to recognize this difference, it easily turns the entire operation into a cluttered set of traces.
8. Animated Export Should Reuse a Deterministic State Sequence
Smooth playback does not guarantee a correct export. If the export depends directly on real-time playback, page scheduling delays can cause dropped frames, duplicated frames, or inconsistent total duration.
A more robust approach uses fixed-time sampling:
Verify the geometric resultBuild a complete step timelineFor each sample time:Compute the state from the timelineRender on an independent canvasCollect image frames and durationsEncode the animation fileProvide the download result
Online playback and export should share the same state-computation logic. The only difference is that the former requests frames by actual time, while the latter generates frames at fixed time points.
You also need to control resolution, frame count, color quantization, and memory usage. When an export fails, report the reason clearly—for example, geometric verification failed, the canvas is too large, or available memory is insufficient—instead of producing an empty file.
9. Building a Reproducible Prompt-Following Evaluation
Evaluation should not rely on a single demo, nor should it infer a model’s overall ability from one case. Build a test matrix that covers different dimensions:
| Evaluation dimension | What to check |
|---|---|
| Semantic understanding | Whether it distinguishes the ruler body, notches, fixed points, and extension lines |
| Assumption management | Whether it states the missing length ratio and branch conditions explicitly |
| Mathematical correctness | Whether it satisfies collinearity, fixed length, point-on-circle, and other constraints |
| Process compliance | Whether it truly uses the specified construction instead of substituting direct generation |
| Interaction completeness | Whether it supports step-by-step playback, reset, and necessary auxiliary-line control |
| Export consistency | Whether the exported frames match the page state and timeline |
| Exception handling | Whether it gives a valid explanation for no-solution, degenerate, or export-failure cases |
The final heptagon should also be checked independently, including side-length consistency, consistency of vertex-to-center distances, angular spacing, and the absence of self-intersection. Numerical error should use thresholds tied to the geometric scale, not treat pixel error as mathematical error.
To observe stability, you can also express the same task in different but semantically equivalent ways, add a little colloquial omission, and repeat the tests. Recording whether the code runs, whether constraints are met, how many manual fixes were needed, and the failure types is more valuable for engineering than simply judging whether the result is “impressive.”
10. True Compliance Makes Assumptions, Process, and Results Verifiable
Improving complex prompt-following ability is valuable not because the model becomes more willing to obey instructions, but because it can turn informal requirements into a self-consistent, checkable technical solution.
Take the marked-ruler construction task: a reliable implementation must, all at once, recognize the terminology, clarify the ratio, establish the constraints, verify the construction, organize the animation, and keep the export consistent. If any one of these is masked by visual effects, “completing the task” degrades into “simulating task completion.”
For real development, the ability that matters most is not whether a model can generate a large amount of code in one shot, but whether it can clearly separate known conditions from assumptions, spot critical gaps, stick to the specified process, and prove the result with reproducible checks. That kind of prompt-following ability is what brings a model closer to being a reliable collaborator that can enter an engineering workflow.
