Prompt Adherence in Large Language Models: A Complex Geometric Construction Test Case
This article examines how reliably large language models follow complex prompts. It uses a web-based task that asks a model to draw a regular heptagon with a two-mark ruler and export the process as a GIF. The article explains why such prompts are hard to follow, how adherence can be checked beyond the final image, and what developers and enterprises can take from this kind of test.
1. Why Prompt Adherence Matters More Than Coding Ability
In each new round of general-purpose large language model releases, parameter counts, benchmark scores, and code generation remain common talking points. A metric closer to real development work is how well a model follows the prompt. Prompt adherence does not mean simple step-by-step execution, where the user states one step and the model carries out one step. It means whether the model can keep the goal, constraints, process, and output format consistent across a long chain of reasoning, and ultimately recover the user’s actual intent.
Real-world requirements are rarely precise. Product managers do not write requirements in programming language, and business stakeholders do not spell out every implicit assumption. Requirements often refer to several objects at once, use technical terms, and include physical or business constraints and vague acceptance criteria. A model that only performs surface-level matching tends to produce results that look correct but do not work. A model that understands the spatial relationships, constraints, and ambiguities behind natural language can reduce repeated clarification and rework. For this reason, prompt adherence can be treated as one of the key indicators of a model’s engineering usability.
Prompt adherence has at least three levels. The first is literal coverage: whether every explicit step in the instructions is carried out. The second is constraint understanding: whether the model understands terminology, spatial operations, physical limits, and the state of multiple objects. The third is intent recovery: when a description is incomplete or ambiguous, whether the model can infer the necessary assumptions from the goal and produce verifiable results. The most notable recent progress in general-purpose models on complex tasks is the move from the first level toward the second and third.
2. Test Case: Drawing a Regular Heptagon with a Two-Mark Ruler on a Web Page
A representative test case asks a model to build a web page that draws a regular heptagon with a two-mark ruler and outputs an animation of the process. This is not ordinary geometric drawing. It is an uncommon construction procedure that depends on internally consistent logic. First, take a square and draw the perpendicular bisector of its bottom edge. Then, using the lower-right vertex as the center, draw a circle whose radius equals the diagonal. Next, place the two-mark ruler so that it touches the lower-left vertex, and move its first mark along the circle until its second mark passes through the perpendicular bisector of the bottom edge. After that, add the standard compass-and-straightedge steps to determine the center and complete the regular heptagon. The task also requires the compass to leave only the necessary traces, without showing meaningless point movement paths. Finally, it asks for a GIF export feature.
The value of this case lies in how it binds natural language understanding to an executable output. The model must generate HTML and JavaScript, and implement geometric construction, constraint solving, process visualization, and animation export in the code. An error at any step of understanding shows up in the final figure, the construction traces, or the output format. For this reason, the case tests adherence to complex requirements more accurately than a request such as writing a sorting algorithm.
3. Breaking Down the Difficulty: Why This Prompt Is Not Simple
1. Terminology from an Uncommon Tool
The two-mark ruler is not a frequently used concept. A model that only performs pattern matching may treat it as an ordinary straightedge or compass. The key to the tool lies in the fixed spacing between its two marks and the joint constraint that the first mark moves along a circle while the second mark passes through a given line. The model must understand how this tool operates so that it can convert the natural language steps into geometric constraints, rather than drawing an approximate figure.
2. Dense References to Multiple Objects and State Tracking
The procedure involves many objects at once: the square, the perpendicular bisector of the bottom edge, the lower-right vertex, the diagonal, the circle centered on that vertex, the lower-left vertex, the first and second marks of the ruler, and the bisector again. Almost every step operates on at least three of these objects, and their positions change as the steps proceed. The model must keep track of the state of these objects throughout a long chain of reasoning and avoid mixing up references midway. This is a test of context consistency, spatial reasoning, and step planning.
3. Implicit Constraints and Backward Inference
The prompt does not give the side length of the square or the spacing between the two marks on the ruler. Given the goal of constructing a regular heptagon, the model must infer that the square should have unit side length and that the mark spacing should default to one unit. Without these assumptions, the later construction cannot produce the correct result. Other implicit constraints include what “necessary traces” means: which compass arcs should remain visible and which point movement paths should be hidden. The model can follow the prompt and complete a correct construction only if it understands these ambiguities.
4. Physical Constraints and Spatial Operations
Phrases such as “rests against the lower-left vertex,” “the first mark moves along the circle,” and “until the second mark passes through the bisector” describe dynamic operations with physical constraints. The model cannot produce only a static result. It must express movement, contact, and passing-through conditions in code, and solve for the key positions based on those conditions. This requires converting spatial operations described in natural language into computable geometric constraints, rather than relying on visual approximation.
5. Output Format and Process Explainability
The task also requires a GIF output, with compass traces shown only where necessary. The model must therefore ensure that the final figure is correct, and also manage the animation frames, annotate key steps, and filter traces. Process explainability becomes part of acceptance: users should be able to see the construction logic in the animation, not just receive a figure that is correct but whose process cannot be trusted.
4. Capability Assessment: From Instruction Matching to Constraint Solving
This case shows that improved prompt adherence in newer general-purpose models means more than following instructions more obediently. It means the model can solve constraints within complex natural language. The model must break a conversational description into goals, objects, relationships, operations, and acceptance criteria, and keep these conditions consistent while generating code. This type of task involves geometric construction logic, front-end rendering, animation frame management, and output format control. It is a multi-stage planning task. That the model can understand and execute it suggests a stronger ability to keep constraints consistent over a long chain of reasoning.
When evaluating this capability, the final screenshot alone is not enough to judge whether the heptagon looks right. A multi-dimensional acceptance check is needed: whether the geometric precision meets the requirement, whether the construction steps match the description, whether the two-mark ruler constraints actually take effect, whether compass traces appear only where necessary, whether the GIF includes the key steps, and whether the code runs and can be reproduced. A single case cannot represent the upper limit for all open-ended tasks. However, it is a strong example of “intent-based programming,” in which a user describes a complex process in natural language and the model turns it into an executable, verifiable output. More open-ended “wishful programming” tasks, where the goal is less clearly defined, still require evaluation across a wider range of tasks.
5. Engineering an Acceptance Approach, with a Code Example
To apply this capability in real development, natural language requirements must be converted into verifiable constraints. The following pseudocode shows which dimensions an acceptance checker should verify. It does not represent any specific product interface. It only illustrates the engineering approach:
const spec = {canvas: { size: 800 },square: { side: 1, position: "unit" },construction: {heptagon: { vertices: 7, regular: true, epsilon: 1e-6 },tools: ["straightedge", "compass", "marked-ruler-two-marks"],markedRuler: {firstMarkOnCircleE: true,secondMarkOnPerpendicularBisector: true,edgePassesD: true},traces: { compass: "only-necessary", pointMotion: "hidden" }},output: { format: "gif", keyFrames: true }};function verify(scene) {// 1. Geometric correctnessassert(scene.square.isUnit());assert(scene.heptagon.regularWithin(spec.construction.heptagon.epsilon));// 2. Process constraintsassert(scene.ruler.firstMarkOn(scene.circleE));assert(scene.ruler.secondMarkOn(scene.bisector));assert(scene.ruler.edgeTouches("D"));// 3. Trace constraintsassert(scene.traces.every(t => t.isNecessary()));// 4. Output constraintsassert(scene.gif.frames.length > 0 && scene.gif.containsKeySteps());}
In real projects, teams can also record prompt versions, snapshot generated outputs, and log automated acceptance results and manual review conclusions. When deploying general-purpose model services on Baidu AI Cloud, this information can be incorporated into its general logging and monitoring capabilities, forming a traceable quality loop. The goal is not to produce a perfect result on the first attempt. The goal is to bring model output into a verifiable, reversible, and improvable engineering workflow.
6. Takeaways for Developers and Enterprises
First, prompts should explicitly state the goal, implicit assumptions, and acceptance criteria. For complex tasks, the model can first list its constraints, then generate the code, and finally check its own work. Second, complex requirements should be broken into stages: confirm the geometric relationships first, then implement the static construction, and finally add animation and export. Third, acceptance should not look only at the final result. It should also examine construction traces and explainability. Fourth, better prompt adherence can lower clarification costs, but engineering responsibility still rests with a verification loop.
Overall, this complex geometric construction case points to a clear trend: prompt adherence in large language models is moving from literal execution toward intent recovery and constraint solving. For developers, this means natural language requirements can be turned into working outputs more efficiently. For enterprises, it means building prompt management, output verification, and manual review mechanisms in parallel. Improved prompt adherence becomes productive only when model capabilities are placed inside a verifiable engineering process.
