Evaluating Prompt Following in LLMs Through a Geometric Construction Task

    A runnable page is not the same as a correctly implemented requirement. This article uses a two-mark ruler construction of a regular heptagon to show how prompt following should be judged at the levels of form, operation, and semantics, and how informal requests should be turned into named objects, explicit constraints, a complete dependency chain, and verifiable delivery.

    1. Evaluating Intelligent Coding Starts by Defining “Done”

    In intelligent coding, a model that generates a runnable page has not necessarily executed the user’s request accurately. A page can have attractive colors, smooth animation, and complete controls while still departing from the intended algorithms, object relationships, or interaction rules.

    Prompt following should therefore be judged on at least three levels:

    • Formal completion. The user asked for a web page, animation, and download, and the result contains those elements.
    • Operational completion. Objects move as described, buttons trigger the corresponding steps, and exported files open correctly.
    • Semantic completion. The implementation does not merely look similar. It faithfully expresses the mathematical relationships, physical limits, and business intent in the task.

    The capability that matters is mainly the third level. It determines whether an intelligent coding tool can move from “generate a demo” to “implement a verifiable requirement.”

    Take the task of constructing a regular heptagon with the aid of a two-mark ruler. The difficulty is not drawing seven sides. It is understanding the ruler’s motion constraints, the relationship between the marked points and the circle, and why the later construction yields the target figure.

    2. Turn Informal Requirements into an Executable Specification

    Tasks of this kind are usually stated in natural language:

    First construct a square and draw the perpendicular bisector of the base. With the lower-right vertex as center and the square’s diagonal as radius, draw a circle. Then pass a ruler with two fixed marks through the lower-left vertex so that one mark lies on the circle and the other lies on the perpendicular bisector of the base. Finally, complete the remaining construction and provide an animation export.

    That description already contains a great deal of information, but it is not yet a rigorous implementation specification.

    2.1 Name the objects

    Start with a single table of geometric objects. For example:

    • The lower-left vertex is D.
    • The lower-right vertex is E.
    • The side length of the square is s, with s greater than zero.
    • The perpendicular bisector of the base is l.
    • The auxiliary circle centered at E is C.
    • The two marks on the two-mark ruler are P and Q.
    • The fixed distance between the marks is d.

    This reduces ambiguity among multiple objects. “The first mark” and “the second mark” are no longer only positions in a sentence; they are geometric marks with definite identities.

    2.2 Separate facts, assumptions, and open questions

    The original description does not state the side length of the square or the spacing of the marks. A model should not treat parameters it supplies as facts the user already provided.

    Unit coordinates with s set to 1 are acceptable, but that choice must be described as computational normalization, not as a claim that only the unit square can support the construction.

    Geometric relationships are usually preserved under uniform scaling. What often matters is the ratio of d to s, not an absolute length. If the construction being used requires d = s, that condition should be written explicitly and its source checked.

    This is more reliable than “the model happened to guess the missing condition,” and it is better suited to engineering delivery.

    2.3 Clarify what “touching the vertex” means

    “The ruler touches D” may mean that the working edge of the ruler passes through D, or that one endpoint of the ruler is fixed at D. The two readings give different degrees of freedom.

    For an insertion-style construction, a reasonable model is usually that the ruler’s working line passes through D while the ruler may still translate along that line so the marks meet the other constraints.

    That interpretation should still be written into the specification, not hidden in the code. If the task works only under a different reading, clarification should be requested first.

    3. A Two-Mark Ruler Is Not an Ordinary Straightedge: Constraint Modeling Is the Core

    A two-mark ruler can be understood as a straightedge with two marks a fixed distance apart. It supplies a line direction and also lets that known distance constrain a position.

    This is different from classical unmarked straightedge-and-compass construction. A regular heptagon cannot be constructed exactly with only an unmarked straightedge and compass, so the whole task should not be described loosely as ordinary compass-and-straightedge work.

    A more accurate statement is: use the marked ruler for the critical placement, then complete later steps with ordinary lines, circles, and perpendicular bisectors. Whether that particular placement is sufficient to produce a regular heptagon still requires a mathematical proof. Animation appearance alone is not enough.

    3.1 Express the geometric conditions in coordinates

    Use the coordinate system:

    D = (0, 0), E = (s, 0).

    The perpendicular bisector of the base is then:

    x = s/2.

    The radius of the auxiliary circle C is the length of the square’s diagonal, √2 s, so the circle equation is:

    (x − s)² + y² = 2s².

    If the ruler’s working line passes through D, its unit direction vector can be written:

    u = (cos θ, sin θ).

    If P lies on that line:

    P = t · u.

    If Q lies a distance d from P in the positive direction of the ruler:

    Q = (t + d) · u.

    The critical placement must then satisfy at least:

    • P lies on circle C;
    • Q lies on line l;
    • P, Q, and D are collinear;
    • the distance between P and Q is d.

    The two main equations are:

    (t cos θ − s)² + (t sin θ)² = 2s²;

    (t + d) cos θ = s/2.

    If the direction relationship of the two marks is the opposite of this convention, a different sign convention is required. The implementation should record the convention clearly and enumerate or reject solutions that do not match the intended configuration.

    3.2 A numerical solution is not a mathematical proof

    An interactive page may use numerical methods to find θ and t that satisfy the conditions, but “a low-error solution was found” only shows that the numerical conditions hold approximately.

    If an article or page claims that the final construction is an exact regular heptagon, it must also prove the link between that placement and the target central angle, chord length, or related algebraic relations.

    In particular, stating the constraints above does not automatically prove that the original construction is complete and correct. If key later steps are missing, a reasonable output should say that the construction chain is still incomplete, rather than drawing a standard regular heptagon to hide the gap.

    4. Filling in Omitted Steps Means Filling in Dependencies

    Phrases such as “then draw a perpendicular bisector to locate the center” look like ordinary steps left out for brevity. They may hide the most important links in the construction chain.

    A developer needs to ask:

    • Which points are vertices of the target polygon?
    • Which segment represents the target side length?
    • Which perpendicular bisectors locate the center of the circumcircle?
    • Why do those segments correspond to equal chords of the target circle?
    • After repeatedly cutting off the same chord length, why does the figure close after exactly seven steps?

    Without that information, generating seven vertices by dividing the circle equally only shows that the page can draw a regular heptagon. It does not show that the page reproduced the specified construction.

    The distinction matters. A verification formula may independently compute an ideal regular heptagon and be used to check the result. It must not replace the construction process the user requested.

    In engineering terms, build an object-dependency graph. For every new point, line, or circle, record its input objects and generation rule. For example, a perpendicular bisector depends on an existing segment; an intersection depends on two already defined curves; the circumcenter depends on intersecting perpendicular bisectors. Only a complete dependency chain makes the steps on the page explainable.

    5. Make Animation Serve the Geometry

    A common failure in animation is that the visual effect separates from the true geometric state. The ruler may rotate to a position that looks right while a mark does not actually lie on the circle. A compass point may move during the animation and still be described as a fixed center.

    The remedy is to separate geometric computation, step control, and rendering.

    5.1 Geometry layer

    This layer computes points, lines, circles, intersections, and errors. It does not handle colors or button state. Every on-screen coordinate is derived from geometric state. There should not be a second set of “close enough” animation positions.

    5.2 Step layer

    Organize the flow into explicit states, such as initialization, auxiliary construction, ruler placement, later construction, and final display.

    Each step should have an entry condition, an action, and a completion condition. That supports pause, rewind, and single-step inspection, and it prevents an exported animation from skipping intermediate states.

    5.3 Presentation layer

    This layer handles line weight, opacity, tool appearance, and text. It may emphasize the current object, but it must not change the geometric meaning.

    “Keep only the necessary traces” should also be a rule: retain the arcs and intersections required by the current placement; hide paths that only show a tool moving; use different visual layers for the final result and auxiliary objects. When needed, offer both a full-construction mode and a simplified demonstration mode.

    6. Animation Export Is a Separate Engineering Deliverable

    Adding an animated-image export is not the same as adding a download button. A complete implementation includes at least:

    • generating frames at a fixed time step;
    • restoring a consistent geometric and step state on every frame;
    • setting inter-frame delay and loop policy;
    • handling color quantization;
    • encoding the animation;
    • handing the result to the user for download.

    The export should use a deterministic timeline as far as possible. The same input and the same export settings should produce the same frame sequence, rather than depending on whatever the page happens to be playing at that moment.

    Resource use also needs an estimate. If each frame stores four-channel raw pixels, the uncompressed frame buffer is roughly:

    width × height × 4 × frame count.

    That is only a rough estimate of frame pixels. It does not include encoder workspace or other object overhead. When resolution or frame count is high, consider batching, limit the export duration, and show the user progress and failure reasons.

    Acceptance of the export should also check that the file really contains multiple frames, that dimensions are consistent, that playback speed is reasonable, and that the last frame fully presents the final construction.

    7. A Reusable Method for Evaluating Prompt Following

    One complex case can expose problems, but it does not represent a model’s behavior on every development task. A more reliable evaluation should cover the following dimensions.

    7.1 Requirement coverage

    List each user requirement and check whether it was implemented. The web page, ruler motion, auxiliary construction, trajectory control, and animation export should be accepted separately. A page that runs is not, by itself, an overall pass.

    7.2 Constraint correctness

    Check that the mark spacing is fixed, that P lies on the specified circle, that Q lies on the specified perpendicular bisector, and that the ruler’s working line passes through D.

    Tolerances can be set relative to the scale of the figure. For example, judging distance error after dividing by s helps prevent scaling from changing the acceptance result.

    7.3 Result correctness

    For the final seven vertices, check that they are concyclic, that adjacent side lengths agree, that adjacent central angles are close to 2π/7, and that the boundary closes in the correct order.

    These checks must run in parallel with process checks. A correct result produced by a substituted process is still not strict compliance.

    7.4 Handling of uncertainty

    Observe whether the model states missing conditions, distinguishes an approximate demonstration from an exact construction, and acknowledges limits when it cannot prove the result.

    For technical tasks, stating uncertainty accurately is a capability, not a defect.

    7.5 Repeatability and robustness

    Repeat the test with semantically equivalent requests worded differently. Change figure scale, playback speed, and canvas size, and check whether the constraints still hold. Record failure types, not only a vague pass rate.

    8. Conclusion: Understanding, Verification, and Delivery Are All Required

    A complex geometric construction shows a central fact about evaluating intelligent coding: real prompt following is not turning natural language sentence by sentence into a picture. It is turning that language into explicit objects, computable constraints, a complete dependency chain, and a result that can be checked.

    Developers should require a generation system to answer three questions at once: how it understood the request, why it believes the implementation is correct, and how it shows that the deliverable actually meets the requirement.

    Only by combining semantic interpretation, mathematical verification, and engineering acceptance can “it looks finished” be separated from “it is finished.” The same method applies not only to geometric animation, but also to report calculations, process automation, business forms, and other intelligent coding tasks that involve constraints among many objects.