Evaluating LLM Prompt Adherence: From Complex Natural Language to Executable Web Pages
This article explains why runnable code is not enough when evaluating large language models in intelligent programming scenarios. Using the task of building a web page that simulates constructing a regular heptagon with a two-mark ruler and compass, it examines implicit constraints in natural language, multi-object geometry, animation, state management, verification, and the difference between “vibe coding” and “wish coding.” Readers will learn how to assess whether a model truly understands objects, order, constraints, hidden assumptions, and final intent, rather than merely generating a page that displays.
1. Evaluating LLMs Requires More Than Runnable Code
In intelligent programming scenarios, many evaluations still stop at whether a model can generate a piece of runnable code. But for complex tasks, code that opens and a page that displays do not mean the model has accurately understood the requirements.
This is especially true for tasks where output quality depends on whether the model can turn natural language into a set of internally consistent constraints:
- The user description is informal and contains many omissions.
- A single step involves multiple geometric objects.
- Instructions include technical terms, spatial relationships, and motion processes.
- The final result requires interaction, animation, or export capability.
- The task requires not only “drawing it” but also preserving the necessary construction traces.
- The user does not specify all parameters, so the model must infer reasonable settings from the goal.
Therefore, evaluating whether a model has strong prompt adherence should not focus only on whether a page is generated. It should further determine whether the model understands the objects, order, constraints, implicit conditions, and final intent in the instructions.
“Using a web page to simulate constructing a regular heptagon with a two-mark ruler” is a representative test case. On the surface, it is a front-end drawing task. In practice, it tests natural language understanding, plane geometry, animation design, state management, and code organization at the same time.
2. Core Content of the Test Task
The test requires generating an HTML page that simulates constructing a regular heptagon with a two-mark ruler and a compass. The overall process can be abstracted into the following stages.
1. Establish the Initial Geometric Objects
First, draw a square and construct the perpendicular bisector of its bottom edge. For the later geometric relationships to hold, the square should usually be understood as a unit square, or at least the page should set a clear uniform side length scale.
Let the endpoints of the square’s bottom edge be D and E, with E as the bottom-right vertex. Draw a circle centered at E with the square’s diagonal as the radius. This circle is not the final result; it is an important auxiliary object for positioning the two-mark ruler later.
2. Simulate the Positioning Process of the Two-Mark Ruler
A two-mark ruler can be understood as a straightedge with two equally spaced mark lines. The construction must satisfy several conditions:
- The two-mark ruler always passes through or stays close to the lower-left vertex D.
- The first mark line touches or intersects the auxiliary circle.
- The second mark line passes through the perpendicular bisector of the square’s bottom edge.
- The two-mark ruler moves continuously while satisfying these conditions.
- Only after reaching the target pose does the construction proceed to later steps.
The difficulty here is not drawing a line. It is maintaining multiple geometric constraints at the same time. The model needs to understand that “the first mark line moves on the circle” and “the second mark line passes through the perpendicular bisector” describe the same dynamic positioning process, not two unrelated static actions.
If the model simply generates a rotating rectangle based on keywords, the following problems often appear:
- The two-mark ruler does not actually pass through the specified vertex.
- The distance between the two mark lines is inconsistent.
- The first mark line does not lie on the circle.
- The second mark line only appears visually close to the perpendicular bisector.
- The animation process does not match the final pose.
These problems indicate that the model may understand “drawing a ruler” but not “why the ruler moves this way.”
3. Fill In the Complete Straightedge-and-Compass Construction Steps
After the two-mark ruler is positioned, the vertices of the regular heptagon still need to be determined using intersections, perpendicular bisectors, circles, and auxiliary lines. The original description does not list every step, so the model must fill in a reasonable construction process based on the goal of “constructing a regular heptagon.”
This involves a very important capability: when information is incomplete, the model should not add steps arbitrarily. It should build a minimal and self-consistent construction chain around the goal.
For example, the model should at least clarify:
- Which points are known points.
- Which lines are auxiliary lines.
- Which intersections become vertices of the regular heptagon.
- Which circle is used to determine vertex positions.
- How to verify the distances between adjacent vertices and the central angle relationships.
- Which auxiliary traces should be preserved and which should appear only during the animation stage.
If the page only generates a shape that looks like a heptagon without showing the construction logic, it is closer to “result drawing” than “straightedge-and-compass construction simulation.”
3. Implicit Conditions in Natural Language
This type of task best reflects a model’s real understanding ability, because the prompt does not use strict mathematical formal language.
1. The Square Side Length Is Not Explicitly Given
If the user only says “take a square” without giving the side length, the model needs to choose a uniform scale. Usually the side length can be set to one unit, or represented by a variable in the program:
const side = 240;
The numerical value itself is not important. What matters is that all subsequent lengths must be calculated from the same proportional relationship. The diagonal, mark spacing, circle radius, and vertex coordinates cannot be set independently; otherwise the page may display, but geometric consistency will be broken.
2. The Mark Spacing of the Two-Mark Ruler Needs a Uniform Interpretation
The term “two-mark ruler” is not a concept ordinary users use every day. The model needs to infer from context that it contains at least two parallel mark lines with a fixed spacing.
In the implementation, the mark spacing should be an explicit parameter, for example:
const markDistance = side;
The actual value can be adjusted according to the composition scale, but it must remain unchanged throughout the construction. If the model implicitly changes the mark spacing in different steps, it cannot be called a correct simulation of a two-mark ruler.
3. “Necessary Traces” Are Not All Traces
The user requires that compass traces be displayed only in necessary parts. This means the page needs to distinguish different types of graphic elements:
- Temporary auxiliary lines in the current action.
- Valid arcs used to determine intersections.
- Completed construction traces.
- The final figure.
- Traces used only for animation explanation and hidden after completion.
A better implementation is not to simply draw all elements permanently on the canvas. Instead, each object should have a state, for example:
{type: "arc",visible: true,persistent: false,stage: 3}
This allows the object visibility to be determined by the construction stage and makes “step-by-step demonstration” and “replay” easier to implement.
4. Technical Problems the Model Really Needs to Solve
1. Multi-Object Reference Relationships
The original description includes a square, vertex D, vertex E, the bottom edge, the perpendicular bisector, the auxiliary circle, the two-mark ruler, two mark lines, and later intersections.
The model must continuously maintain the relationships among these objects, not just remember their names. Ideally, it can first build a geometric object table:
| Object | Type | Key Relationship |
|---|---|---|
| Square | Base figure | Provides the initial scale |
| D, E | Vertices | Used to position the two-mark ruler and auxiliary circle |
| Perpendicular bisector of bottom edge | Line | Constraint for the second mark line |
| Circle E | Auxiliary circle | Constrains the first mark line |
| Two-mark ruler | Rigid object | Satisfies two positioning conditions at the same time |
| Construction arcs | Auxiliary traces | Used to determine later vertices |
This structured understanding can reduce “object drift” and prevent the model from confusing vertex names when generating code.
2. Separate Geometric Calculation from Visual Drawing
When implementing the web page, it is recommended to divide the program into three layers:
- Geometry layer: responsible for points, lines, circles, intersections, and angle calculations.
- State layer: responsible for recording the current construction stage and animation progress.
- Rendering layer: responsible for drawing geometric objects to the canvas.
For example, the geometry layer only returns point coordinates:
function rotatePoint(point, center, angle) {const dx = point.x - center.x;const dy = point.y - center.y;return {x: center.x + dx * Math.cos(angle) - dy * Math.sin(angle),y: center.y + dx * Math.sin(angle) + dy * Math.cos(angle)};}
The rendering layer then decides whether to draw axes, auxiliary circles, the two-mark ruler, and the final polygon. The benefit is that geometric results can be verified independently, and animation will not反过来 affect the mathematical calculations.
3. Animation Cannot Be Just Frame-by-Frame Image Replacement
A high-quality construction demonstration should show “why the action happens.” For example, when the two-mark ruler moves, the page should display in sync:
- The current position of the ruler.
- The relationship between the first mark line and the circle.
- The relationship between the second mark line and the perpendicular bisector.
- Text explanation of the current step.
- Points that have been determined and points that are still changing.
This is more explanatory than simply moving a line from left to right, and it makes it easier for users to judge whether the construction is correct.
5. How to Judge Whether the Output Truly Meets the Requirements
Evaluation criteria can be established from five dimensions.
1. Semantic Adherence
Does the model correctly interpret concepts such as “two-mark ruler,” “perpendicular bisector,” “circle center,” and “necessary traces”? Does it convert colloquial descriptions into explicit geometric operations?
2. Geometric Consistency
Check:
- Whether the square is truly a square.
- Whether the circle center and radius are correct.
- Whether the mark line spacing is fixed.
- Whether the two-mark ruler satisfies both constraints at the same time.
- Whether the final figure has seven vertices.
- Whether all vertices lie on the same circle.
- Whether adjacent side lengths are approximately equal.
For a regular heptagon, coordinate calculations can also verify whether adjacent central angles are close to:
const expected = 2 * Math.PI / 7;
Floating-point error is allowed in actual angles, but there should be no obvious deviation.
3. Process Completeness
The page should not show only the final figure. It should also replay key steps. Users need to know how the figure is generated, not just see a static answer.
4. Interaction Usability
At minimum, consider:
- Start or pause the animation.
- Reset the construction.
- Execute step by step.
- Show or hide auxiliary lines.
- Export the animation.
- Maintain readability at different window sizes.
5. Output Verifiability
If the page provides GIF export, the exported content should include the complete process rather than only the final frame. In implementation, canvas frames usually need to be captured at time intervals and then encoded into an animation file. If the browser environment does not support direct encoding, a clear message should be provided rather than failing silently.
6. From “Vibe Coding” to “Wish Coding”
This type of task also reveals two different approaches to intelligent programming.
“Vibe coding” usually means the user states a goal in natural language and the model quickly generates a page that appears runnable. It is suitable for prototype validation, interface sketches, and low-risk experiments.
“Wish coding” is closer to the user directly describing a wish. The model needs to fill in specifications, constraints, boundary conditions, and verification mechanisms by itself. For example, in this case, the user does not write a complete algorithm but expects the model to understand the geometric process, fill in omitted steps, and generate an interactive demonstration.
To achieve the latter, the model needs at least three capabilities:
- Restore natural language into formal constraints.
- Make explainable and reasonable assumptions when information is incomplete.
- Proactively check consistency after generating the result.
Therefore, prompt adherence is not “executing what the user says.” It is understanding what the user wants and supplementing the information needed for implementation without violating the original intent.
7. Conclusion
Complex natural language tasks are an important way to test the capabilities of large models. If a model can only draw a page based on keywords, it has some code generation ability. Only when it can handle multi-object relationships, implicit parameters, technical concepts, dynamic constraints, and result verification can it be considered to have strong prompt understanding and adherence.
The value of the web page task “constructing a regular heptagon with a two-mark ruler” is not limited to the geometric demonstration itself. It combines natural language understanding, mathematical modeling, front-end drawing, animation control, and file export, effectively exposing a model’s weak points in complex tasks.
For developers, evaluating a model should not stop at “does the code run?” It should continue to ask:
- Does it understand the role of each object?
- Does it maintain consistent geometric constraints throughout?
- Does it fill in the steps the user omitted?
- Does it distinguish temporary traces from the final result?
- Does it provide a complete process that can be replayed, verified, and exported?
These questions truly determine whether a model can move from “generating code” to “understanding requirements and completing tasks.”
