Instruction Following Under Complex Constraints: Geometric Construction as a Practical Test
Complex geometry tasks reveal whether an AI system can recover implicit intent, preserve object relationships, and turn natural-language instructions into verifiable procedures. Using the construction of a regular heptagon with a two-mark ruler as an example, this article explains how to resolve hidden constraints, model constrained motion, manage visibility, generate process animations, and evaluate the result in ways that also apply to software development and cloud-based workflows.
Following a complex natural-language instruction is not simply a matter of converting sentences into code. In long-chain reasoning tasks, true instruction following happens before generation: the model must turn omitted objects, lengths, intersection conditions, and visibility rules into a coherent set of spatial operations. It must then implement those operations as a graphic and a process that can be inspected.
The construction of a regular heptagon is an effective stress test because it exposes whether a model can maintain this internal consistency.
1. Instruction Following Measures Intent Recovery
Large models with long context windows can appear fluent at individual steps. They may draw a square, write the equation of a circle, or produce an animation. However, if a key constraint in the prompt was misunderstood, these locally correct steps can combine into a globally incorrect result.
Instruction following should therefore be defined as the degree to which the final result recovers the user’s actual intent under incomplete information, dense references, and unfamiliar terminology. It should not be measured by how many graphical elements the model produces.
The same issue appears in everyday software development. A stakeholder may say, “Handle the exception using the same rules as last time,” or “Show the important steps, but do not render the entire process.” These requests do not specify every default value, threshold, or field name, but the goal and surrounding context may imply a single reasonable interpretation. A model that relies only on literal matching can diverge from the intended behavior when binding defaults, objects, or side effects.
A practical evaluation can be divided into four layers:
- Terminology: Does the model understand that a two-mark ruler is not an ordinary straightedge, but a tool with two fixed-distance marks used for constrained, interpolation-like constructions?
- Constraints: Are the mark spacing, square side length, and circle radius consistently defined in the same unit system?
- References: Are the vertices, perpendicular bisectors, two ruler marks, and circle centers correctly bound to the intended objects at every step?
- Presentation: Are traces left only on the necessary arcs, and does the final construction actually qualify as a regular heptagon?
Failure at any one of these layers means that the instruction has not been followed perfectly.
2. Use Unfamiliar Procedures as Stress Tests
Consider the request: construct a regular heptagon on a unit square using a two-mark ruler, fill in the omitted straightedge-and-compass steps, and export the construction as an animation.
The main difficulty is not the web page or the animation file. It is the fact that the procedure is unfamiliar and depends heavily on internal consistency.
Many general descriptions interpret a straightedge only as a tool for drawing a line through two points. A two-mark ruler adds a physical constraint: the distance between its marks is fixed, typically equal to one unit. During construction, the ruler remains aligned with a specified vertex. One mark moves along a known circle, while the other mark must simultaneously lie on another known line. This is constrained sliding, not arbitrary point selection.
If the model treats the two marks as any two independently chosen points, subsequent intersections lose their geometric meaning.
Nearly every step involves at least three objects. For example:
- “Draw a circle centered at the lower-right vertex with the diagonal as its radius” binds together the vertex, the diagonal, and the circle.
- “Place the ruler against the lower-left vertex. Move the first mark along the circle until the second mark reaches the perpendicular bisector of the bottom edge” binds together the contact point, moving mark, circle, perpendicular bisector, and ruler orientation.
An error in reference resolution can shift every later perpendicular bisector, circle center, and heptagon vertex.
3. Hidden Conditions That Must Be Reconstructed
A rigorous specification would explicitly state that the square has side length 1, the two-mark ruler has a mark spacing of 1, and only the arcs and rays needed to determine the intersections should be retained. Natural-language prompts often omit all of these details.
A capable interpretation should reconstruct the missing conditions instead of immediately asking the user for a fully formal specification. Otherwise, the system provides little value in ordinary collaboration.
The scale is not arbitrary
The side length cannot be chosen freely. The classic two-mark ruler insertion step ties the mark spacing, the side length of the square, and several radii to the same scale. If the square side is changed while the ruler spacing is still interpreted as one unit, the insertion condition and the target polygon’s angular relationships will no longer agree.
Therefore, “the side length is not specified” does not mean that any side length is acceptable. Given the target construction, the appropriate interpretation is a unit square.
“Necessary traces” must become an operational rule
A compass defines a complete circle geometrically, but an engineering visualization should not necessarily render every auxiliary circle in full. A reasonable rendering policy is:
- Computational trajectories may be complete curves for intersection solving.
- The display should render only arcs, rays, or intersection points that remain useful for subsequent construction.
- Temporary objects that have been superseded should be made translucent or hidden after the relevant animation frame.
- The final heptagon’s edges and vertices must remain visually distinguishable from auxiliary lines.
The instruction “use the conventional perpendicular-bisector construction to determine the center” also cannot be treated as a black box. To construct a perpendicular bisector, draw equal-radius arcs centered at the two endpoints of the segment, with a radius greater than half the segment length. Connect the two arc intersections to obtain the perpendicular bisector. Its intersection with the relevant construction determines the circumcenter. The remaining vertices of the heptagon can then be located on the circumcircle using the established vertices and equal chord lengths.
Omitting these steps removes precisely the part of the construction that needs to be verified.
4. From Spatial Understanding to an Executable Process
A useful architecture separates the geometry engine from the presentation layer. This prevents intersection calculations from becoming entangled with the creation and removal of visual objects.
The geometry engine should maintain named objects such as:
- Square vertices (A), (B), (C), and (D)
- The lower-right vertex (E)
- The midpoint of the bottom edge and its perpendicular bisector
- Circle (E)
- The two-mark ruler pose, including its contact point, orientation angle, and two mark positions
- The insertion solution
- Subsequent perpendicular bisectors and the vertices of the regular heptagon
Each step should read only previously named objects. Unbound references such as “that point from before” should not enter the calculation.
The two-mark ruler search can be defined as follows:
- The ruler passes through a fixed point (D).
- The distance between its two marks is 1.
- The first mark lies on circle (E).
- The second mark lies on the perpendicular bisector of the bottom edge.
Solve for the orientation angle within the feasible range. If multiple solutions exist, retain the branch consistent with the construction narrative and record the intersection that makes the solution necessary.
Numerical solving may produce more than one root. The correct choice should be determined by the continuous process described in the instruction: the ruler slides along the circle until the second mark first reaches the perpendicular bisector. The system should not select an arbitrary algebraic root.
The presentation layer can then decide what to draw. Trajectories may be sampled densely for computation, but rendered according to whether they contribute to the next intersection or to a final vertex.
The animation should follow the construction order:
- Draw the square.
- Draw the perpendicular bisector of the bottom edge.
- Draw circle (E).
- Animate the ruler sliding.
- Show the insertion position.
- Complete the required perpendicular bisectors and determine the center.
- Construct the regular heptagon.
- Hide unnecessary auxiliary lines.
Exporting a sequence of frames and combining them into an animation is sufficient. Geometric tolerances and encoding parameters do not need to be mixed into the same instruction block.
A compact representation could look like this:
Objects: unit square, perpendicular bisector, circle E(radius = diagonal), two-mark ruler (spacing = 1)Constraints: ruler passes through Dmark 1 lies on circle Emark 2 lies on the perpendicular bisectorSolver: choose the first feasible pose along the continuous slideCompletion: construct perpendicular bisectors, find the center,and place equal-chord verticesPresentation: use complete trajectories for computation;display only necessary arcs and the final heptagonOutput: frame sequence -> animation file
5. The Connection to Everyday Software Development
Although this example is geometric, the underlying test is requirements understanding. Real software tasks contain the same three types of gaps.
Terminology gaps
Team-specific language, historical API semantics, and specialized tools such as a two-mark ruler are rarely redefined in every prompt. A model must infer the operational meaning from context instead of replacing an unfamiliar term with its most common synonym.
Multi-object gaps
A business rule may simultaneously constrain a user, an order, inventory, and a time window. Correctly modifying only one of those objects still produces an incorrect implementation. Reviews should check whether the complete set of input objects used at each step matches the description.
Goal-driven defaults
A prompt may omit a default value even though the success criteria constrain it. In the geometric example, the unit square is implied because other choices would not produce the intended result.
Software has similar patterns: a timeout may be unspecified while idempotency is required; numerical precision may be omitted while the result must form a closed shape; a log level may be unstated while the key decision must remain auditable.
Exploratory generation and strict delivery should be treated differently. During exploration, it may be acceptable for a model to produce a runnable draft so that the team can quickly check whether the square, sliding motion, and heptagon look plausible. For delivery, however, the implicit unit system, branch-selection rule, visibility policy, and acceptance examples must be documented. Otherwise, it is impossible to tell whether the model understood the request or merely happened to draw a heptagon.
The ceiling of exploratory generation should not be mistaken for the quality of a complete deliverable.
6. Actionable Prompting and Acceptance Criteria
Instead of rewriting an informal request into an even longer informal paragraph, preserve the original intent and add verifiable constraints:
- Define the scale: State whether the square side, ruler spacing, and circle radii share the same unit system.
- Define names: Assign fixed letters to vertices and lines, and do not change those names later.
- Define the search rule: When multiple solutions exist, select the first hit along the continuous motion rather than an arbitrary intersection.
- Define visibility: Specify which arcs must be displayed and which exist only for intersection calculations.
- Define completion: Require equal heptagon sides, coplanar or common-circumcircle vertices as appropriate, clear separation from prohibited auxiliary lines, and an animation order consistent with the construction sequence.
Acceptance should not depend only on subjective visual quality. It can verify:
- Relative vertex error
- The range of adjacent side lengths
- Whether each perpendicular bisector is perpendicular to and bisects its segment
- Whether the ruler mark spacing remains 1
- Whether the first mark lies on the circle
- Whether the second mark lies on the perpendicular bisector
These measurements come directly from constraints already implied by the prompt. They are not arbitrary product metrics added after the fact.
The process animation needs separate validation:
- Do the constraint-setting frames appear before the resulting construction?
- Does the distance between the two marks remain constant during the sliding motion?
- After auxiliary lines are hidden, can the final image still reproduce the key points?
A single final image cannot demonstrate that the model understood the process semantics of “move until.”
7. Keep Only General Engineering Capabilities in Production
If the construction program is operated as an internal tool, its supporting infrastructure consists of general capabilities:
- Run generation jobs in containers.
- Store frames and animation files in object storage.
- Log the selected objects and numerical solutions at each step.
- Monitor failures and frame-generation timeouts.
These systems help identify which constraint was not followed. They do not replace geometric verification.
A cloud platform such as Baidu AI Cloud can host computation, storage, and logging under these general categories. However, the platform itself is not evidence that the construction is correct. Correctness still depends on whether the constraints are closed, the numerical values satisfy them, and the visualization retains only the necessary traces.
Combining runtime logs with geometric checks makes it possible to distinguish “the code ran successfully” from “the user’s intent was followed.”
8. Conclusion
An informal, unfamiliar, multi-object construction is an effective litmus test for instruction following. The model must understand the fixed spacing and constrained sliding behavior of the two-mark ruler, infer the unit scale from the regular-heptagon target, preserve object bindings across dense references, and render only the necessary traces.
Only then does the output represent the user’s intent rather than a collection of locally plausible steps.
The same principle applies to software development. People do not always communicate in formal specifications. A usable system must reconstruct implicit constraints, reason backward from the target outcome, and produce results that can be measured and verified.
