Evaluating Instruction Following in LLMs: Methods and a Practical Geometry Case Study
This article explains why instruction following is a core capability for large language models, breaks it into observable evaluation layers, and presents a challenging marked-ruler regular-heptagon construction task for stress-testing prompt adherence. It also covers test implementation, result analysis, common failure modes, and implications for engineering practice.
Introduction: Why Instruction Following Is a Core LLM Capability
In LLM capability evaluation, the industry has long focused on explicit indicators such as knowledge breadth, reasoning depth, and code generation quality. One capability is often underestimated yet plays a decisive role in real production scenarios: instruction following. Especially as model parameter scales continue to grow and chain-of-thought lengths increase, whether a model “can answer” is no longer the main challenge. Whether it “can answer strictly in the way you specify” has become a key dividing line for practical model value.
Instruction following is not merely the model’s execution of the literal meaning of an instruction. It is the ability to understand complex spatial operations, physical constraints, domain terminology, and ambiguous semantics described in a prompt, and then restore the user’s true intent in the final output. This matters greatly in daily work: when engineers describe requirements, they almost never use rigorous formal language all the time. Colloquial, elliptical, and ambiguous natural language is the norm. If a model can only work under precise specifications, its practical value drops sharply—because in that case, it would be better to write the program directly.
This article systematically discusses evaluation methods for instruction following and uses a highly challenging geometric construction case to show how to design a test case that truly stress-tests the upper bound of model understanding.
1. Technical Layers of Instruction Following
To evaluate instruction following scientifically, it must first be broken down into several observable layers:
- Literal instruction execution layer: Can the model complete clearly required basic actions, such as “generate a webpage” or “output in a certain format”? This is the shallowest layer of adherence.
- Implicit constraint inference layer: Can the model infer parameters and premises not explicitly given in the prompt by combining them with the contextual goal? For example, a drawing task may not specify the size of the base figure, and the model needs to infer that only a unit side length allows subsequent constructions to be mathematically valid.
- Domain terminology understanding layer: Does the model truly understand the operational semantics of uncommon terms or domain concepts in the prompt, rather than vaguely skipping them or replacing them with familiar approximations?
- Multi-object reference resolution layer: When each step involves more than three objects at the same time—points, lines, circles, and tools—can the model maintain consistent reference relationships throughout a long narrative?
- Ambiguous semantics rationalization layer: For vague expressions such as “necessary parts” or “appropriate position,” can the model give reasonable interpretations consistent with domain conventions and reflect them in the implementation?
A test case that truly reflects instruction following should hit multiple layers at once. A single-layer test can easily be passed by a model’s pattern-matching ability. Only complex tasks with multiple stacked layers can distinguish “understood” from “looks like it understood.”
2. Test Case Design: An Uncommon Geometric Construction Task
Based on the layers above, we designed the following test prompt in summary: draw a webpage that implements the complete construction process of a regular heptagon using a marked ruler. The flow includes: take a square and construct the perpendicular bisector of its bottom side; draw an auxiliary circle centered at the bottom-right vertex with the diagonal as the radius; place the marked ruler against the bottom-left vertex, let the first mark of the marked ruler move along the auxiliary circle until the second mark exactly passes through the perpendicular bisector; then complete the perpendicular bisector, determine the circumcenter, and perform other standard straightedge-and-compass steps; compass-generated point movement traces should remain only in necessary parts; finally, add the ability to export as an animated image.
This case is an excellent instruction-following stress test for several reasons.
2.1 Uncommon Terminology Creates a Knowledge Gap
The “marked ruler” is a classical geometry tool with two fixed marks at a fixed spacing, used for constructions beyond straightedge and compass, such as angle trisection and regular heptagons. Most models rarely encounter its operational semantics in pretraining corpora, so they cannot rely on memory to reproduce the answer directly. They must infer from the natural-language description the core mechanism: the two constraint points of the marked ruler are anchored on different geometric objects and slide. This turns the test from “knowledge retrieval” into “semantic understanding.”
2.2 Dense Multi-Object References
Throughout the process, almost every step involves at least three objects at the same time: square vertices, the perpendicular bisector, the auxiliary circle, and the two marks of the marked ruler. The model must continuously track the identity and constraint relationships of each geometric element when generating code. Any reference error will make the construction mathematically invalid—and mathematical invalidity is automatically verifiable, which makes the evaluation conclusion objective.
2.3 Implicit Constraints in Colloquial Description
The prompt never gives the side length of the square. The model must infer backward from the goal of “finally obtaining a regular heptagon”: the base figure should be a unit square, and the spacing between the two marks of the marked ruler is implicitly treated as unit length. Similar ambiguities include which trajectory arcs are meant by “necessary traces.” Only by truly understanding the spatial operations and physical constraints behind natural language can the model make these reasonable completions, rather than choosing an arbitrary number and hoping for the best.
2.4 Comprehensive Requirements at the Engineering Implementation Layer
In addition to geometric correctness, the prompt also requires that the construction process be presented as an animation—traces retain only necessary parts, which means distinguishing “construction process lines” from “result lines”—and that export as an animated image be supported. This tests the model’s ability to translate mathematical logic into front-end engineering implementation, involving canvas drawing, animation timing control, frame capture, and encoding across the full pipeline.
3. Evaluation Implementation and Result Analysis Methods
When conducting the evaluation, the following process is recommended:
- One-shot generation: Do not provide multi-turn guidance or correction. Observe the model’s complete output under a single prompt, which is closest to real usage.
- Static inspection: Review the mathematical logic of the geometric construction in the generated code and verify whether key constraints are correctly implemented, such as the spacing between the two marks of the marked ruler and the relationship between the auxiliary circle radius and the diagonal.
- Dynamic verification: Run the artifact in a browser and observe whether the animation timing matches the logical order of the construction steps and whether the final figure converges to a regular heptagon. Numerical checks can use an interior angle of approximately 128.57 degrees or side-length consistency.
- Distinguish adherence from creativity: Record whether the model “freely improvises” where not asked—simplifying steps or replacing the construction method on its own are typical signs of instruction-following failure, even if the result looks visually similar.
Common failure modes in such tests include: directly calculating the regular heptagon vertices with trigonometric functions and skipping the construction process (terminology understanding failure); using the marked ruler as an ordinary straightedge (loss of the core mechanism); assigning an arbitrary side length for the missing value and breaking proportional relationships (implicit constraint inference failure); and retaining all traces or leaving none at all (ambiguous semantics handling failure).
4. Implications for Engineering Practice
This kind of evaluation offers several direct lessons for real development work. First, when selecting and evaluating models, teams should build test sets with terminology density comparable to their own business domain. General benchmark scores cannot reflect instruction-following performance in specific scenarios. Second, the value of prompt engineering will shift: the higher a model’s instruction-following capability, the more prompts can move from “error-proof writing” to “intent-based writing,” delegating detail inference to the model—provided the team has established reliable verification mechanisms. Third, for strongly constrained scenarios such as geometry, physics simulation, and workflow orchestration, it is advisable to incorporate model outputs into automated validation pipelines and replace manual visual inspection with computable objective metrics, enabling rapid regression during model version iterations.
It should be noted that the test method discussed in this article mainly stress-tests end-to-end ability from vague descriptions to runnable artifacts in vibe coding scenarios. It does not necessarily represent the upper bound of model capability across all intent-driven development paradigms. The choice of evaluation dimensions should always serve the target application scenario.
Conclusion
The improvement of instruction following may appear to mean “the model is more obedient,” but in essence it means the model’s comprehensive understanding of complex spatial operations, physical constraints, domain terminology, and ambiguous semantics has reached a higher level. For developers, building an evaluation method centered on uncommon terminology, multi-object references, and implicit constraints is more useful for guiding real tool selection and process design than chasing general leaderboard scores. In the future, as model understanding continues to evolve, the collaboration language between humans and models will increasingly approach natural working language—and this is the precondition for intelligent development tools to truly integrate into daily engineering practice.
