Evaluating LLM Instruction Following: A Case Study in Two-Mark Ruler Construction
This article presents a practical method for evaluating how well large language models follow complex instructions, using a two-mark ruler construction of a regular heptagon as a test case. It explains why the task exposes implicit assumptions, derives a verifiable mathematical reference, proposes a five-dimensional scoring rubric, and outlines a reproducible evaluation workflow with common failure modes.
1. Why Use Two-Mark Ruler Construction as a Test Sample
A common way to evaluate a large language model’s instruction-following ability is to provide a requirement description and then check whether the output meets that requirement. The difficulty is that real requirements are rarely as complete as textbook exercises. Descriptions are often conversational, contain omissions, rely on contextual references, and include terminology familiar only to domain experts. Two-mark ruler construction has all of these characteristics, making it a suitable test sample.
A two-mark ruler is a straightedge with two tick marks. It belongs to a class of construction methods in ancient Greek geometry known as neusis constructions. A regular heptagon cannot be constructed exactly with only a compass and an unmarked straightedge, but a construction scheme can be given with the help of a two-mark ruler. This makes it ideal material for testing a model’s geometric knowledge and spatial reasoning. Most everyday training data rarely covers this type of operation. If a model can execute it correctly, this usually indicates that it truly understands the dependencies between the steps.
2. Decomposing Implicit Conditions in Natural-Language Descriptions
The most error-prone parts of such instructions are often the parts that are not explicitly stated. A typical construction description usually contains the following categories of implicit information.
First, size information is missing. The description only says “take a square” without giving the side length. Combined with the goal of “finally constructing a regular heptagon,” a reasonable interpretation is to take a unit-length square. If the side length takes another value, the proportional relationships in the subsequent construction will change accordingly, and the correct heptagon cannot be obtained.
Second, a unit convention is missing. The distance between the two tick marks on the two-mark ruler is implicitly treated as unit length, but this is not explicitly written. The model needs to apply this implicit convention simultaneously to the radius of the circle, the positions of intersection points, and the mark spacing.
Third, the scope of output traces is unclear. The requirement to “produce traces only in the necessary parts” requires the model to judge which auxiliary lines, auxiliary points, and motion trajectories belong to the necessary process and which are redundant decoration. This judgment tests both the model’s understanding of the construction logic and its control over the output format.
3. Deriving a Standard Answer from Mathematical Relationships
The key to evaluation is having a standard answer that can be independently verified. For this construction, the entire process can be reconstructed in a coordinate system. Let the lower-left corner of the unit square be D(0,0), the lower-right corner be E(1,0), and the perpendicular bisector of the bottom edge be the line x=1/2. Draw a circle centered at E with radius equal to the diagonal length √2.
The two-mark ruler rotates about D. Let the distance from its intersection with the circle to D be s, the distance from the second tick mark to D be s+1, and the unit vector of the rotation direction be (cosθ, sinθ). The two conditions are:
- The first tick mark lies on the circle: s² − 2s·cosθ − 1 = 0
- The second tick mark lies on the perpendicular bisector: (s+1)·cosθ = 1/2
Eliminating θ yields s³ + s² − 2s − 1 = 0. The positive root of this cubic equation is s = 2cos(2π/7), approximately 1.247. A correct result must satisfy this relationship. The following code can numerically verify this root and check whether the geometric data in the model output is consistent with the theoretical value.
import mathdef newton(f, df, x0=1.0, eps=1e-12, max_iter=100):x = x0for _ in range(max_iter):step = f(x) / df(x)x -= stepif abs(step) < eps:breakreturn xf = lambda s: s**3 + s**2 - 2*s - 1df = lambda s: 3*s**2 + 2*s - 2s_num = newton(f, df)s_ref = 2 * math.cos(2 * math.pi / 7)print(f"Numerical solution: {s_num:.10f}, theoretical value: {s_ref:.10f}, error: {abs(s_num - s_ref):.2e}")
The value of this step is that evaluators can confirm whether the key numerical values are correct without relying on subjective judgment.
4. Establishing a Multi-Dimensional Scoring Rubric
Looking only at whether the final image “looks like a heptagon” is not enough to judge instruction following. It is recommended to score the following five dimensions separately, each with explicit pass conditions.
- Condition restoration: Whether the model correctly fills in implicit conditions such as the unit square and unit mark spacing, and states the assumptions it made in the output.
- Numerical correctness: Whether key intersection points and radii satisfy the equations derived above, and whether the error is within an acceptable range.
- Step completeness: Whether every omitted step that the prompt requires to be completed has a corresponding implementation, such as the perpendicular bisector, center determination, angle bisection, and subsequent operations.
- Output compliance: Whether the display of auxiliary lines and trajectories meets the requirement to “produce traces only in the necessary parts,” and whether redundant elements interfere with the conclusion.
- Functional completeness: Whether additional requirements, such as exporting an animation, are actually usable. The animation should present the construction step by step frame by frame, rather than generating only a static image.
For each dimension, it is recommended to use three grades: pass, partial pass, and fail, and to record the specific location of the failure. This shows where the model deviated from the instruction, rather than producing only an overall score.
5. Recommended Evaluation Workflow
A reproducible evaluation workflow usually includes the following steps.
Step 1: Prepare the test set. In addition to the original instruction, construct variants of the same type, such as changing the number of sides of the polygon or changing the convention for the square’s side length, to observe whether the model has merely memorized a fixed answer.
Step 2: Fix the evaluation conditions. Use the same prompt, the same output-format requirements, and the same scoring rubric for each model. If multi-turn dialogue is allowed, record each round of corrections.
Step 3: Combine automated checks with manual review. Numerical results can be verified automatically with scripts. The visual quality of graphics and animations, as well as whether the steps are reasonable, require manual review by someone familiar with straightedge-and-compass construction.
Step 4: Record failure modes. Common failures include ignoring implicit units, mistaking the two-mark ruler for an ordinary unmarked ruler, choosing the wrong quadrant for an intersection, omitting intermediate steps and presenting only the conclusion, or producing graphical output that contradicts the numerical description. Classifying these failure modes is more useful than simply counting the pass rate.
6. How to Interpret Test Results
Conclusions from this type of test need to be interpreted cautiously. A single sample cannot represent a model’s overall capability. Good performance on two-mark ruler construction does not mean that the model is equally reliable on other complex spatial tasks.
A more reasonable approach is to treat the results as a set of signals. If a model can explicitly state its assumptions, produce correct numerical values, and implement the complete sequence of steps, this indicates a strong ability to reconstruct professional constraints from natural language. If the model only generates a figure that visually resembles a heptagon but fails numerical verification, this suggests that it may be better at generating plausible-looking content than at strictly executing instructions.
For everyday work, this distinction is practical. Implicit conditions in requirement documents often determine whether the final deliverable can be used. Evaluating instruction following is essentially checking whether the model can act like a careful engineer: first identify uncertainties in the requirements, then provide a verifiable result.
7. Practical Recommendations
When using this type of evaluation method in real projects, the following principles can be followed.
- Explicitly write key parameters such as units, side length, and precision in the prompt to reduce the model’s room for guessing.
- Ask the model to list its assumptions before performing the construction, making it easier for evaluators to locate the source of errors.
- Set error thresholds for numerical results and recompute them with an independent script rather than relying on the model’s self-check.
- For animation or interactive outputs, check frame by frame or step by step to confirm that the process is consistent with the final conclusion.
With this method, testers can turn vague judgments such as “is the model useful” into a set of concrete metrics that can be recorded, compared, and reproduced.
