Evaluating Model Adherence to Complex Natural Language Instructions
This article explains how to evaluate an AI model's ability to follow complex, natural language instructions, using the example of constructing a regular heptagon with a marked ruler (two-scale ruler) in an interactive web page. It outlines why simple code generation is insufficient, how to model implicit constraints, and what criteria should be used to verify genuine understanding and reliable implementation.
When assessing an intelligent model designed for complex tasks, many people first focus on parameter count, response speed, code length, or whether the final page runs. In real development, however, the more meaningful metric is often whether the model can accurately understand the implicit constraints embedded in natural language and transform those constraints into verifiable program behaviors.
This is especially true in scenarios involving web page generation, interactive visualization, and assisted programming. Users rarely provide a fully formal specification. Instead, they describe requirements in an everyday way: drawing a geometric shape, supplementing necessary steps, preserving key trajectories, or adding animation export. On the surface, such requests are just “generate a web page,” but they actually test the model’s semantic understanding, geometric reasoning, state management, animation design, and code organization ability.
Shifting the Evaluation Focus: From “Can It Generate Code?” to “Can It Restore the Intent?”
For ordinary code generation tasks, the prompt usually contains explicit inputs, outputs, and interfaces. The user specifies data structures, function names, parameter types, and return values. The model only needs to convert explicit requirements into code.
Complex natural language tasks are different. The user may omit units, initial dimensions, relationships between objects, and the precise scope of “necessary operations.” The model must first build an internal problem model before starting implementation.
Take the web page task “construct a regular heptagon using a two-scale ruler.” The prompt contains at least the following categories of information:
- Geometric objects: a square, a perpendicular bisector of a side, a circle, vertices, scale lines, and the regular heptagon to be constructed.
- Spatial relationships: a point as the center, a line as the perpendicular bisector, scale lines that must simultaneously lie “on the circle” and “pass through a given line.”
- Operation order: establish the base figure first, then perform auxiliary constructions, and finally determine the polygon’s vertices.
- Physical or geometric constraints: the ruler must align with specified vertices, the movement of scale lines must follow rigid-body logic, and the compass trajectory cannot arbitrarily cover the entire canvas.
- Output requirements: the page must be interactive, the process observable, the trajectories distinguishable, and animation export supported.
If the model only latches onto the phrase “draw a regular heptagon,” it could directly use a polygon formula to produce the result, but that does not mean it followed the user’s request. The real difficulty is that the model must demonstrate the construction process and establish an explainable link between each auxiliary object and each operation step.
Why This Task Effectively Tests Prompt Adherence?
1. Uncommon Terms Cannot Rely on Surface Matching
“Two-scale ruler” is not a common web development object. The model cannot treat it as an ordinary straightedge, nor can it mistake the two scale lines for separate line segments. A more reasonable abstraction is to view it as a rigid geometric tool with fixed interval spacing.
In code, the two-scale ruler can be represented as:
- a base point;
- a direction vector;
- two parallel scale lines with fixed spacing;
- a pose parameter that can be dragged or continuously varied.
If the distance between the first and second scale lines is not explicitly stated, the model must make a reasonable assumption based on the task goal. Usually, that distance can be treated as one unit, and this assumption should be clearly stated on the page to avoid the user assuming hidden parameters are in use.
2. Multi-Object Anaphora Magnifies Misunderstanding
The original description simultaneously references multiple vertices of the square, a circle, the perpendicular bisector, the two scale lines of the ruler, and the final polygon. Pronouns like “it,” “that line,” or “the second scale line” may refer to different objects depending on context.
Therefore, it is best to establish an object table before implementation, for example:
| Object | Program Representation | Main Purpose |
|---|---|---|
| Square | Four vertex coordinates | Provide the initial construction reference |
| Points D and E | Fixed coordinate points | Serve as reference points for ruler-and-compass operations |
| Perpendicular bisector | Line parameters | Provide intersection constraints |
| Circle E | Center and radius | Limit the range of scale-line movement |
| Two-scale ruler | Position, angle, spacing | Enforce the two-scale constraint |
| Trajectories | Point sequences or line segments | Show the construction process |
This kind of object modeling aids manual inspection and reduces the likelihood of variable confusion during code generation.
3. “Necessary Traces” Must Be Converted into Display Rules
The phrase “produce traces only where necessary” is not a directly executable program instruction. It can be interpreted in at least three ways:
- Only show the auxiliary lines that are retained in the final result;
- Show the local trajectories where the compass or ruler is actually used;
- Show all operations but hide temporary objects that do not contribute to the final vertices.
To avoid ambiguity, the web implementation can categorize traces into three types:
- Permanent geometric elements: the square, the perpendicular bisector, and the final regular heptagon.
- Construction auxiliary elements: circles, intersection points, the ruler, and temporary connecting lines.
- Dynamic trajectory elements: the movement path of the compass tip, the movement path of the ruler, and the intersection points generated at each step.
Then, using color, opacity, and layer controls, the user can toggle between “full process” and “simplified result” views. This is more suitable for teaching and debugging than drawing every line on a single canvas.
The Web Implementation Should Use a Layered Design
A maintainable interactive geometry page should not cram all logic into a single drawing function. A more reasonable structure can be divided into four layers.
1. Geometric Computation Layer
This layer handles vector, point, line, circle, and intersection calculations. For example:
function distance(a, b) {return Math.hypot(a.x - b.x, a.y - b.y);}function midpoint(a, b) {return {x: (a.x + b.x) / 2,y: (a.y + b.y) / 2};}function rotate(point, center, angle) {const x = point.x - center.x;const y = point.y - center.y;return {x: center.x + x * Math.cos(angle) - y * Math.sin(angle),y: center.y + x * Math.sin(angle) + y * Math.cos(angle)};}
This layer should not depend on canvas or UI controls, making it easy to unit test and reuse.
2. Construction State Layer
This layer stores the current step, ruler position, compass radius, intersection set, and trajectory information. Each completed construction step creates a new state snapshot:
const states = [{ step: 0, objects: initialObjects },{ step: 1, objects: squareAndBisector },{ step: 2, objects: circleEAndRuler },{ step: 3, objects: intersections },{ step: 4, objects: finalPolygon }];
The benefit of using state snapshots is the ability to pause, step back, play step-by-step, and re-export animation, rather than only drawing the final result once.
3. Rendering Layer
This layer draws geometric objects onto the canvas. It should distinguish between coordinate systems, scaling ratios, and viewport offsets, avoiding direct mapping of geometric unit coordinates to screen pixels.
Text labels, auxiliary lines, dynamic tools, and the final result should ideally be drawn on separate layers to control visibility and hiding.
4. Interaction and Export Layer
This layer handles buttons, sliders, dragging, playback speed, and animation export. The export feature should not just capture the final screen; it should render frame by frame according to the state sequence and then encode each frame into an animation file.
If the runtime environment does not support direct export of the target format, the page can first generate a sequence of image frames and clearly inform the user about the browser-supported download method or subsequent conversion process. The implementation should avoid promising encoding capabilities that are not available.
How to Determine Whether the Model Truly Understands, Rather Than “Happens to Draw Correctly”
When evaluating such a task, it is not enough to check whether the page opens or the final shape looks similar. Consider the following verification dimensions.
1. The Target Result Is Correct
The final shape should satisfy the basic geometric properties of a regular heptagon: seven sides of approximately equal length, seven interior angles close to equal, and vertices lying on the same circumcircle.
2. The Construction Process Is Explainable
The page should be able to describe what object is generated at each step, what constraints are used, and how that object participates in subsequent calculations. If the model only generates a function that directly draws a heptagon without implementing the required ruler-and-compass process, the task is still only partially complete.
3. Constraint Relationships Remain Stable
During dragging or playback, the spacing between the two scale lines must remain constant; the ruler’s alignment with specified points must not drift due to animation; intersection changes must follow geometric relationships rather than being manually hard-coded frame by frame.
4. Ambiguous Requirements Have Reasonable Defaults
For unspecified details such as unit square, unit scale spacing, and trajectory display range, the model should make consistent assumptions and inform the user on the interface or in explanatory text. Actively exposing assumptions is an important quality of high-level intelligent programming.
5. Code Is Maintainable
Variable naming, function responsibilities, data structures, and error handling should all be clear. Geometric code is particularly prone to numerical errors, so tolerance checks should be included to avoid disappearing intersections, flickering segments, or failure to close the polygon due to floating-point inaccuracies.
Moving from “Vibe Coding” to More Reliable Intelligent Development
This type of task is well suited to observing a model’s natural language adherence ability, but note that it primarily reflects the model’s ability to quickly implement a given goal. The user describes a direction, and the model fills in the solution—this can be called “intent-driven” programming.
However, truly complex enterprise development often requires additional engineering constraints, including:
- compatibility with existing code structures;
- compliance with team coding standards;
- handling edge inputs and abnormal flows;
- providing test cases;
- considering performance, accessibility, and security;
- remaining stable under requirement changes.
Therefore, a single successful page generation does not prove that the model has equal capability in all software engineering scenarios. A more scientific evaluation approach is to split the task into five stages—understanding, planning, implementation, verification, and modification—and observe whether the model maintains contextual consistency at each stage.
Conclusion
The core of complex prompt adherence is not whether the model is “obedient,” but whether it can convert incomplete, colloquial, and implicitly prefaced requirements into explicit objects, constraints, states, and verifiable results.
The “regular heptagon with a two-scale ruler” task is representative because it simultaneously presents uncommon terms, multi-object anaphora, spatial relationships, geometric reasoning, vague descriptions, and animation output. If a model can correctly complete this task, it indicates that it can generate code and also possesses a degree of intent recovery and cross-domain modeling ability.
For developers, the most important criterion for evaluating intelligent programming models should not be merely whether the code runs. It should further ask: Does the model understand the problem? Does it preserve key constraints? Does it explain its default assumptions? Can it be tested, modified, and maintained? Only when these conditions are met does the model’s output have real engineering value.
