How to Evaluate Natural-Language Prompt Compliance in LLM Coding Tasks
When judging a new large language model, parameter count, latency, and code volume are easy to notice. For real development work, a more important and often underestimated signal is whether the model can recover a complete task from informal natural language and turn it into a runnable, verifiable program. This article explains what prompt compliance means beyond surface features, why a two-mark ruler construction of a regular heptagon is a useful test, and how to convert a prompt into objects, constraints, and actions, then check geometry, animation, and maintainability.
When evaluating a new large language model, many people look first at parameter scale, response speed, or the amount of code produced. For practical development work, another more important and often underestimated measure is whether the model can accurately understand and carry out complex requirements written in natural language.
This matters especially when generating web pages, interactive animations, data-processing scripts, and helper tools. Users rarely write requirements as strict formal specifications. Real requests often mix technical terms, implicit conditions, an order of operations, visual requirements, and unstated default rules. The model must do more than “read the words.” It has to recover the full task structure from the text and turn that structure into a program that can run and be checked.
From this perspective, the most notable improvement in recent model versions is not simply how much code they generate, but how well they follow the prompt. Compliance here does not mean mechanically restating the request or assembling a page from keywords. It means understanding what the user actually wants to accomplish and keeping the constraints consistent throughout the implementation.
What Prompt Compliance Actually Means
On simple tasks, prompt compliance often shows up as surface features:
- The page includes the requested title.
- The layout follows the requested arrangement.
- The code uses the specified format.
- Buttons, animation, or export features are added as requested.
On complex tasks, compliance also includes several deeper layers.
1. Correct interpretation of technical terms
If the user uses terms such as “two-mark ruler,” “perpendicular bisector,” or “compass trajectory,” the model needs to understand how those concepts relate, rather than treating them as ordinary text labels.
A two-mark ruler, for example, is not a simple straightedge. It can be understood as an auxiliary construction tool with two fixed marks. Its key role is to constrain the positions of two points at the same time, enabling a location step that cannot be completed directly with a traditional straightedge and compass alone. If the model misunderstands the tool, every later animation and geometric calculation will drift away from the goal.
2. Continuous tracking of relationships among many objects
A complex prompt usually involves multiple points, lines, circles, and tools, and the same object reappears across several steps.
Using a square as the example, the request may involve all of the following at once:
- The lower-left vertex
- The lower-right vertex
- The base edge
- The perpendicular bisector of the base
- An auxiliary circle centered at a specified vertex
- The two marks on the two-mark ruler
- How those marks interact with the auxiliary circle and the perpendicular
The model must keep these objects distinct. It cannot confuse a vertex, an edge, or an intersection in a later step. For code generation, that means the data structures, coordinate system, and drawing order must stay consistent.
3. Completing implicit constraints
Natural-language requirements often omit details that a person would treat as obvious. For example:
- The side length of the square is not stated.
- The coordinate origin is not specified.
- The spacing between the two marks is not given.
- The animation speed is not specified.
- Which auxiliary lines should remain is not fully explained.
- It is unclear whether the exported animation should show the whole process or only the final result.
The model should not guess arbitrarily. It should form reasonable assumptions from the goal of the task and keep those assumptions explainable in the implementation.
If the goal is to construct a regular heptagon from a unit square, setting the square’s side length to one unit is usually the more reasonable choice. That choice supports normalized calculation and lets the mark spacing relate to the base geometry. Using an arbitrary length without adjusting the other parameters can make the final construction fail the geometric conditions of a regular heptagon.
Why a Two-Mark Ruler Heptagon Is a Good Test
The value of this task is not that it is common. It is that it tests several model capabilities at the same time.
1. The task knowledge is relatively uncommon
Most models have a stable understanding of an ordinary straightedge, compass, perpendicular, and circle. They may not be able to explain a specialized tool such as a two-mark ruler accurately from memory. The model therefore cannot finish the task by relying only on a familiar template. It has to infer the tool’s geometric role from the context.
2. The steps are strongly dependent
The process is not a set of independent drawing commands. Objects produced in one step become inputs to the next.
For example:
- Establish the square.
- Derive the perpendicular bisector from the base.
- Construct an auxiliary circle from a specified vertex and a diagonal.
- Move the two-mark ruler so the first mark satisfies the circle constraint.
- At the same time, make the second mark pass through the perpendicular bisector.
- Use the resulting key points to locate the center.
- Use circles and other auxiliary lines to determine the heptagon vertices.
- Connect the vertices step by step and export the animation.
An incorrect object definition at any stage removes the foundation for every later step.
3. The task requires both geometric understanding and interactive implementation
If the request asks only for a static image, a model can still hard-code coordinates and fake a result that looks correct. If it must show the ruler moving, the compass trajectory, and the necessary auxiliary lines, the program has to represent a reproducible change of state.
That requires the implementation to handle:
- Translation and rotation of the tool
- Intersections of lines and circles
- Motion of points along constrained paths
- Showing and hiding different stages of the construction
- Capture of animation frames
- Export of the final result
A task like this can therefore distinguish “generate a picture” from “understand and implement a geometric procedure.”
Turning Natural Language into an Executable Specification
Before generating code, it is best to split the original request into four kinds of information: objects, constraints, actions, and outputs.
1. Object list
Start by listing every geometric object:
- The square and its four vertices
- The perpendicular bisector of the base
- The auxiliary circle centered at a specified vertex
- The two-mark ruler and its two marks
- Auxiliary points created by intersections
- Auxiliary lines used to locate the center
- The circumscribed circle
- The seven vertices of the regular heptagon
- Trajectories produced during construction
This step keeps the model from inventing objects later in the code, which leads to confused names and broken references.
2. Constraint list
Then state the condition each object must satisfy:
- The square has equal sides and right angles.
- The perpendicular bisector is perpendicular to the base and passes through its midpoint.
- The auxiliary circle has a fixed center and radius.
- The two-mark ruler keeps a fixed distance between its two marks.
- The first mark has the specified positional relationship with the auxiliary circle.
- The second mark passes through the perpendicular bisector of the base.
- The seven vertices of the heptagon lie on the same circle.
- The central angles between adjacent vertices are equal.
If a condition cannot be uniquely determined from the original text, the interface should explain the parameter, or a code comment should record the assumption that was used.
3. Action list
Actions should be described in time order:
- Initialize the coordinate system.
- Draw the base square.
- Draw the perpendicular bisector of the base.
- Create the auxiliary circle.
- Move the two-mark ruler along the constrained direction.
- Record the key intersections.
- Add the necessary auxiliary construction.
- Determine the center and radius of the regular heptagon.
- Generate the seven vertices in order.
- Connect the sides and show the final result.
- Collect animation frames and export the animation.
An action list helps the model avoid drawing only the final result and skipping the process that was requested.
What to Verify When Implementing the Web Page
1. Whether the coordinate system is consistent
A web canvas usually uses the upper-left corner as the origin, while geometric derivation is more natural in a Cartesian system with the origin at the lower left. The conversion should be explicit:
screenX = originX + scale × xscreenY = originY - scale × y
If the coordinate direction is not unified, perpendiculars, rotations, and arcs can easily point the wrong way.
2. Whether geometry is independent of drawing logic
Keep the calculation layer separate from the rendering layer:
- The calculation layer handles points, lines, circles, and intersections.
- The state layer tracks animation progress.
- The rendering layer draws objects on the canvas.
- The export layer saves each frame.
This makes it possible to verify the geometry first and handle the visual presentation afterward, so a mathematical error is not mistaken for a drawing bug.
3. Whether the animation reflects real constraints
Moving the two-mark ruler should not be a simple translation from a start point to an end point. A more sound approach is to define a parameter for the tool, such as a position parameter t, and compute its pose from the constraint equations:
for t from 0 to 1:rulerState = solveRulerPose(t)intersection = calculateIntersection(rulerState, auxiliaryCircle)drawConstruction(rulerState, intersection)captureFrame()
solveRulerPose should keep a fixed distance between the two marks and satisfy the specified geometric relationships in the target state.
4. Whether traces match the idea of “necessary marks”
Asking to keep necessary traces does not mean every moving object should leave a complete path. Traces can be divided into three groups:
- Must be kept: traces used to determine a key point or the center
- Kept only for a stage: traces shown during one step
- Not kept: paths that exist only to demonstrate tool movement
Layered drawing can keep the result useful for explanation without making it unreadable through too many traces.
How to Judge the Generated Result, Not Just Whether the Page Runs
A web page that opens does not mean the task is complete. Evaluate it along the following dimensions.
1. Semantic correctness
Did the model understand the role of the two-mark ruler? Did it distinguish the points, lines, and circles correctly? Did it fill in the omitted construction steps as required?
2. Geometric correctness
Check the following:
- The square keeps its proportions.
- The perpendicular bisector actually passes through the midpoint.
- The auxiliary circle has the correct radius.
- The distance between the two marks stays constant.
- The heptagon vertices are concyclic.
- Adjacent side lengths and interior angles are approximately consistent.
Do not rely only on visual inspection. Add error checks in the program. For example, compute the distance from each of the seven vertices to a fitted center and compare the maximum error.
3. Process completeness
If animation is required, check that the animation shows the full process rather than only a final static image. Also confirm a clear sequence among tool movement, the appearance of intersections, the appearance of auxiliary lines, and the final connections.
4. Engineering maintainability
A strong generated result should have:
- Clear variable names
- Layered function structure
- A moderate amount of comments
- Adjustable canvas size and scale
- A repeatable animation flow
- A message or fallback when export fails
What This Implies for Generative Programming Practice
This kind of case shows that “natural-language programming” does not mean replacing a complete software design with one sentence. The stronger the model, the more the user needs to provide a clear goal, clear constraints, and clear acceptance criteria.
In day-to-day work, a useful collaboration pattern is “explain first, implement second, verify third”:
- Ask the model to restate its understanding of the requirement.
- Ask it to list every default assumption.
- Ask it to produce the objects, constraints, and execution steps.
- Then generate the code.
- Finally add automatic checks and visual debugging information.
This approach reveals misunderstandings more readily than asking directly to “generate the final page,” and it fits complex projects better.
Overall, the value of a complex prompt is not whether the model can solve an uncommon geometry problem. It is whether the model can recover the real intent from an incomplete, conversational description that contains implicit conditions, and turn that intent into a technical implementation that runs, can be inspected, and can be maintained. For developers, that ability is closer to real work than simply generating more code, and it better reflects the practical value of a new generation of intelligent programming systems.
