Evaluating LLM Prompt-Following Ability on Complex Geometric Constructions

    How well do large language models actually follow complex natural-language instructions? Using the task of constructing a regular heptagon with a two-marked ruler in an HTML page, this article breaks prompt compliance into measurable layers—terminology recognition, spatial constraints, process observability, and output fidelity—and offers a reproducible evaluation methodology with practical engineering insights.

    Evaluating LLM Prompt-Following Ability on Complex Geometric Constructions

    From “Can Generate” to “Can Comply”: Shifting the Evaluation Goal

    When evaluating large language models in assisted development and content generation, early benchmarks often focused on whether the model produced a plausible result. Given a page requirement, a model that outputs HTML, CSS, and scripts—or draws a basic shape—is easily judged as usable. In real engineering collaboration, however, what actually matters is not whether there is output, but whether the output fully satisfies the constraints embedded in the natural-language requirement: Are object references correct? Is the step order executable? Are implicit parameters reasonably inferred? Is the final artifact verifiable?

    Prompt compliance should therefore be understood as a multi-dimensional metric. A model must not only recognize keywords but also understand the spatial operations, physical constraints, domain terminology, and ambiguous semantics behind them, then faithfully reproduce the user’s true intent in the final result. For large-parameter, long-chain reasoning models, this improvement looks superficially like “being more obedient,” but it is fundamentally an improved ability to translate natural-language requirements into executable solutions. This article uses the task of “constructing a regular heptagon with a two-marked ruler” as a web-based evaluation task, discusses how to design a reproducible compliance benchmark, and offers practical engineering recommendations.

    The Evaluation Task: Constructing a Regular Heptagon with a Two-Marked Ruler

    The task requires the model to generate an HTML page that implements the construction of a regular heptagon with a two-marked ruler (a marked ruler with two fixed graduations) via interaction or animation. The core steps are:

    1. Take a square and construct the perpendicular bisector of its bottom edge;
    2. With vertex E (bottom-right corner of the square) as the center and the diagonal as the radius, draw circle E;
    3. Using the two-marked ruler, keep it against vertex D (bottom-left corner) while sliding the ruler so that its first graduation moves along circle E until the second graduation passes through the perpendicular bisector of the bottom edge;
    4. Once the key position is found, complete the standard straightedge-and-compass construction, including perpendicular bisectors and locating the center;
    5. Compass arcs should only leave traces on the necessary portions, avoiding unrelated auxiliary lines that clutter the drawing;
    6. The final page must support export as a GIF animation.

    The value of this task lies in the fact that it is not simply “draw a heptagon.” It requires the model to understand an obscure construction that depends on internal logical consistency. A regular heptagon cannot be constructed exactly with traditional straightedge and compass, so extended tools like the two-marked ruler are required—essentially a ruler with two fixed graduation marks, whose key operation is “slide until two simultaneous constraints are satisfied.” A model that only recognizes words like “heptagon,” “square,” and “circle” may produce an approximate figure without reproducing the underlying construction logic.

    Breaking Down the Key Difficulties

    1. Understanding Uncommon Terminology

    “Two-marked ruler” is not a high-frequency everyday term. The model needs to know that it is not an ordinary ruler but a tool with two graduation marks that satisfies specific geometric relationships through sliding. If the model mistakes it for a regular ruler, the constraint “first graduation on the circle while the second graduation passes through the bisector” becomes meaningless. The evaluation should check whether the model reflects semantics such as “fixed spacing between two marks” and “sliding search for a position satisfying dual constraints” in its code or explanation.

    2. Multi-Object Spatial Relationships

    Almost every step involves at least three objects simultaneously: the square, the perpendicular bisector of the bottom edge, circle E, vertex D, and the ruler’s two graduations. Natural-language descriptions contain frequent references like “it,” “that line,” and “the second graduation.” The model must maintain an object registry and express object identities through explicit variables in the code. If intermediate artifacts confuse objects, the final figure may look close but the construction order will be wrong.

    3. Inferring Implicit Parameters

    The prompt does not specify the square’s side length, yet the target is a regular heptagon, and the ruler’s graduation spacing is implicitly a unit length. The model must infer that a unit square can be used and the two-marked ruler’s spacing set to a unit length—otherwise the subsequent geometric relationships cannot close. Such implicit parameters are the norm in natural-language requirements. The evaluation should observe whether the model actively declares its assumptions rather than silently picking arbitrary values.

    4. Interpreting Ambiguous Semantics

    “Necessary traces” has no precise definition. A reasonable interpretation: keep the final figure, key construction lines, and the critical points that make the construction valid, while hiding the search process, temporary intersections, and repeated paths. The model needs to maintain separate “auxiliary layers” and a “final trace layer” rather than drawing every intermediate path. During evaluation, check whether layer toggling is supported and whether only necessary paths are committed.

    5. Output Format and Process Verifiability

    The GIF output requirement means the model must not only compute a static result but also organize a keyframe sequence. The evaluation cannot rely on the final screenshot alone: it must check whether the animation progresses in construction order, whether each frame corresponds to an explainable step, and whether GIF export is driven by the frame sequence.

    A Reproducible Evaluation Method

    The evaluation can be organized into four layers:

    • Terminology layer: Does the model recognize the two-marked ruler, circle E, perpendicular bisector, diagonal, and other objects?
    • Constraint layer: Are both constraints satisfied simultaneously—“first graduation on circle E” and “second graduation on the perpendicular bisector”?
    • Process layer: Is the step order correct, and are intermediate intersections traceable?
    • Output layer: Are traces necessary, is the GIF exportable, and can the page reproduce the construction interactively?

    For implementation, use a structure of “object registry + constraint solving + frame recording.” A code sketch:

    1. <svg id="stage" viewBox="-2 -2 6 6"></svg>
    2. <script>
    3. const S = 1; // inferred unit square
    4. const D = {x:0, y:0};
    5. const E = {x:S, y:S};
    6. const midX = S / 2;
    7. function circle(cx, cy, r, layer) { /* draw a circle on the given layer */ }
    8. function line(a, b, layer) { /* draw a segment on the given layer */ }
    9. function point(p, layer) { /* draw a key point */ }
    10. // Two-marked ruler sliding: parameter t represents the position of the
    11. // first graduation on circle E
    12. // Constraints: distance from first graduation point to E is r;
    13. // second graduation point lies on x = midX
    14. function solveTickRule() {
    15. // Build equations from geometric relations, use stable numerical search for t
    16. // Return ruler pose, two graduation points, and necessary auxiliary lines
    17. }
    18. const frames = [];
    19. function snapshot(label) {
    20. frames.push({label, svg: document.getElementById('stage').innerHTML});
    21. }
    22. // Advance step by step: square, bisector, circle E, ruler sliding, completion
    23. // Call snapshot after each step, then feed frames to an encoder to export GIF
    24. </script>

    The evaluation should also include comparison experiments: run the same task with a “colloquial natural-language prompt” and a “structured step-by-step prompt,” and observe differences in terminology recognition, implicit-parameter declaration, and layer management. Failure modes can be categorized as: tool misidentification, object reference confusion, satisfying only one of two constraints, trace pollution, and GIFs that merely repeat a static image. For each failure type, record the reproducible minimal prompt and intermediate screenshots to build a regression set.

    Engineering Takeaways

    First, natural-language interfaces need “acceptance checkers.” In everyday work, people do not always describe requirements in rigorous programming languages, so models must convert fuzzy expressions into inspectable intermediate artifacts. Second, evaluation should shift from final results to process observability: object registries, constraint satisfaction status, and layer commit records are far more diagnostic than a single screenshot. Third, prompt compliance is not single-turn Q&A accuracy, but a combined measure of constraint satisfaction and intent restoration. Fourth, for complex spatial tasks, encourage models to declare assumptions explicitly—for example, “use a unit square” or “the ruler’s graduation spacing is a unit length”—so humans can review them.

    In short, constructing a regular heptagon with a two-marked ruler is only an entry point. It reveals the critical gap between complex natural-language requirements and executable artifacts: models must understand terminology, maintain objects, infer implicit constraints, and respect trace and format requirements at the output layer. Only by building reproducible evaluations around these dimensions can we objectively assess a model’s prompt-following ability in real development collaboration.