Complex Instruction Adherence: A Case Study on Constructing a Regular Heptagon with a Neusis Ruler
This article explores how large language models handle complex natural language instructions using the neusis construction of a regular heptagon as a test case. It outlines the process of translating implicit premises, resolving multi-object references, and handling ambiguous constraints into verifiable geometric steps. By establishing a layered evaluation framework alongside Python-based numerical validation, the article provides practical guidelines for assessing and quantifying a model's instruction adherence in multi-step tasks.
I. Problem Background
In daily work, people rarely describe requirements using strict programming languages. Most instructions contain omitted premises, colloquial expressions, and terms that require inference. Whether a model can correctly execute such instructions directly determines its usability in real-world scenarios.
An effective testing method is to select niche, step-intensive, and verifiable tasks. The neusis construction of a regular heptagon meets these conditions. A neusis ruler (or marked ruler) is a classical geometry tool with two marks that allows for a “sliding and passing through a point” operation beyond basic compass-and-straightedge constructions. The vertex coordinates of a regular heptagon are determined by a cubic equation, meaning it cannot be constructed using only a straightedge and compass, whereas a neusis ruler can solve such cubic equations. The difficulty of this task stems from two aspects: first, the tool itself is uncommon; second, each step involves more than three geometric objects simultaneously, making the reference relationships complex.
II. From Natural Language to Verifiable Steps
2.1 Making Implicit Premises Explicit
The original description does not specify the side length of the square. Given the ultimate goal of “constructing a regular heptagon,” a reasonable inference is to use a unit side length. Otherwise, the positions of subsequent circles, marks, and intersections cannot be determined. Therefore, testers should first check whether the model can deduce this premise from the goal, rather than merely evaluating if it followed surface-level instructions.
Another implicit premise is the spacing between the two marks on the neusis ruler. The text assumes this is a unit length. If the model fails to make this assumption, or if its assumption is inconsistent with subsequent steps, the construction will fail.
2.2 Resolution of Multi-Object References
The description frequently uses pronouns like “it,” “this line,” and “the second mark.” The model must accurately map these to specific objects: the vertices of the square, the perpendicular bisector of the base, circle E, the two marks on the neusis ruler, and the intersections they produce. Referential errors often do not trigger immediate warnings but accumulate into noticeable geometric deviations in later steps.
2.3 Terminology and Constraints
The term “necessary traces” is not explicitly defined. A reasonable interpretation is to retain the auxiliary lines, arcs, and intersections that determine the final result, while deleting intermediate elements used only for temporary positioning. The model needs to provide its own interpretation and demonstrate consistency in the final output.
III. Layered Evaluation Dimensions
It is recommended to evaluate the output across four dimensions, with each conclusion supported by evidence:
- Step Coverage: Check whether all omitted steps are completed, including locating centers, drawing perpendicular bisectors, and finding intersections.
- Geometric Correctness: Verify if the final shape is a regular heptagon, whether all sides are equal in length, and if the central angles between adjacent sides are all 360°/7, approximately 51.43°.
- Process Expression: Check whether only necessary traces are retained and whether dynamic points move along the correct trajectories.
- Output Integrity: Ensure the HTML page is runnable, the GIF export includes all key steps, and the frame order aligns with the geometric steps.
Among these, geometric correctness is best suited for automated verification. As long as the vertex coordinates can be obtained, numerical methods can be used to determine if the shape is correct.
IV. Numerical Verification Example
The following code uses a unit circumscribed circle as an example to check whether a set of vertices forms a regular heptagon. The vertices from the tested output can be extracted from the page script or exported data.
import mathdef regular_polygon(n, r=1.0):return [(r * math.cos(2 * math.pi * k / n),r * math.sin(2 * math.pi * k / n)) for k in range(n)]def check_regular(points, tol=1e-6):n = len(points)sides = [math.dist(points[i], points[(i + 1) % n]) for i in range(n)]center = (sum(p[0] for p in points) / n, sum(p[1] for p in points) / n)radii = [math.dist(p, center) for p in points]side_ok = max(sides) - min(sides) < tolradius_ok = max(radii) - min(radii) < tolreturn side_ok and radius_okvertices = regular_polygon(7)print(check_regular(vertices)) # Outputs True
This code only checks the geometric characteristics of the result, not the construction process. The correctness of the process still requires frame-by-frame comparison: whether the points, lines, and circles in each frame correspond to the respective steps.
V. Practical Recommendations
First, when designing tests, list all implicit premises before deciding which ones the model should infer on its own and which should be explicitly stated in the instructions.
Second, break complex tasks into checkable sub-steps, defining the expected objects and criteria for each step. This helps distinguish between “did not understand” and “understood but made a calculation error.”
Third, use a combination of automated verification and manual review for the results. Numerical checks can quickly identify deviations, while manual review is necessary to judge the retention of traces and the reasonableness of the expression.
Fourth, record how the model handles ambiguity. A good output should state the assumptions it adopted, such as unit side length or mark spacing, rather than silently choosing one interpretation.
Fifth, instruction adherence is a quantifiable capability. By using a fixed set of tasks, unified scoring standards, and repeated testing, you can compare the performance of different versions or configurations on the same task, providing a basis for actual model selection and workflow design.
