Evaluating Complex Instruction Following in Large Language Models
Complex geometric construction tasks provide a practical way to evaluate how well large language models interpret natural-language instructions and maintain constraints. This article examines a marked-ruler construction test, common failure modes, measurable checkpoints, and prompting practices that help assess spatial reasoning, reference resolution, animation delivery, and consistency across long workflows.
Why Instruction Following Matters
In LLM-assisted programming and content generation, adherence to a prompt can matter more to practical usability than code correctness alone. Users rarely express their requirements in a formal, unambiguous language. Instead, they use conversational descriptions containing omissions and implicit constraints. If a model fails to recover those constraints, its output can diverge from the intended result.
Tasks that combine spatial understanding, references to multiple objects, and ambiguous language therefore offer a useful way to evaluate instruction following.
Geometry as an Evaluation Task
Geometric construction tasks are particularly well suited to this purpose. They require a model to manage points, lines, circles, and paths while interpreting dynamic constraints such as “keep the ruler against this vertex” or “move one mark along the circle until the other mark reaches this line.”
These descriptions often omit precise measurements. A square’s side length, for example, may be implicitly treated as one unit. Yet those unstated assumptions can determine whether the subsequent construction works. The model must infer them correctly to produce a faithful interactive web page.
A representative test asks the model to create an HTML page demonstrating the construction of a regular heptagon with a ruler bearing two marks. The requested sequence is:
- Start with a square.
- Construct the perpendicular bisector of its bottom side.
- Draw a circle centered at the lower-right vertex, using the square’s diagonal as the radius.
- Simulate a ruler kept against the lower-left vertex. Move its first mark along the circle until its second mark reaches the perpendicular bisector.
- Complete the remaining ruler-and-compass construction steps.
- Add a feature that exports the construction process as an animation.
The prompt also specifies that the compass should leave visible traces only where necessary.
This is an uncommon procedure described in conversational language, with a high density of geometric objects. Almost every step involves at least three entities, placing substantial demands on reference resolution and constraint consistency.
Evaluate the Process, Not Just the Final Shape
Success should not be judged solely by whether the final drawing resembles a regular heptagon. Each intermediate step must faithfully reproduce the spatial operations specified in the prompt.
Important checks include:
- Implicit scale: Does the model infer that the square has unit side length, as required by the intended construction?
- Mark spacing: Does it treat the distance between the ruler’s two marks as one unit?
- Selective traces: Does it leave only the necessary compass traces rather than drawing the tool’s entire movement path?
These details reveal whether the model understands the construction’s physical constraints or merely applies a familiar ruler-and-compass template.
Common Failure Modes
Several recurring failures expose weaknesses in semantic interpretation and constraint propagation:
- Missing implicit unit assumptions: The model ignores the intended scale, producing incorrect proportions.
- Misinterpreting contact: It treats “keep the ruler against the vertex” as a fixed overlap, removing the freedom needed for the ruler to slide.
- Substituting the wrong tool: It fails to model a ruler with two marks and replaces it with an ordinary straightedge.
- Adding unnecessary construction lines: It introduces extra auxiliary lines when filling in omitted steps, violating the requirement to leave only necessary traces.
Although these problems appear in generated code, their underlying cause is often a failure to understand the instructions or carry constraints through the workflow.
Build Reproducible Evaluation Checkpoints
For repeatable evaluation, divide the task into independently verifiable checkpoints:
- Object initialization: Are the initial geometric objects and their relationships correct?
- Dynamic constraints: Are the movement rules encoded as interactive state?
- Trace behavior: Does the drawing logic follow the requirement to preserve only necessary traces?
- Animation completeness: Does the exported animation reproduce the full construction process?
Assigning weights to these checkpoints produces a quantitative score that supports comparisons between models or between versions of the same model.
This approach also makes it easier to distinguish a visually plausible result from an implementation that actually follows the requested procedure.
Improve Prompts Without Removing the Challenge
In practical use, a few prompting adjustments can improve adherence and help identify model limitations.
First, make essential implicit assumptions explicit where appropriate—for example, “use a square with side length 1.” Avoid formalizing every detail, however, because doing so removes much of the test’s value as an assessment of natural-language understanding.
Second, clarify references among multiple objects. Numbered labels or relative-position descriptions can reduce ambiguity without replacing the task with a fully formal specification.
Third, divide a complex workflow into stages. Ask the model to confirm its understanding before generating code. This can reduce failures and help developers locate the boundary between correct interpretation and faulty implementation.
Test Constraint Retention Across Long Workflows
Instruction-following evaluation should also examine consistency over long contexts. A geometric construction may involve dozens of operations, and the model must continue to respect previously defined points, lines, circles, and relationships.
If it forgets an earlier constraint or reinterprets an existing object, the final construction may fail to close correctly. Evaluation should therefore cover not only single-response generation but also the model’s ability to preserve constraints across multiple conversation turns.
Treat the Deliverable as Part of the Instructions
Output format is another component of adherence. If the prompt asks for animation export, the generated code should provide that capability. A static image or console logs do not satisfy the request.
This distinction matters because the user’s goal is a completed deliverable, not merely correct intermediate calculations. A model can get the geometry right and still fail the task by omitting the required output functionality.
Conclusion
Complex geometric construction tasks are useful instruction-following tests because they combine spatial reasoning, multi-object management, ambiguity resolution, and long-range constraint retention.
Developers can incorporate these tasks into routine regression testing to track model behavior in realistic workflows. Evaluating intermediate operations, retained constraints, and final deliverables provides a clearer picture of practical reliability—and helps guide more targeted prompting and post-processing strategies.
