How to Evaluate Prompt Compliance in Large Language Models
Prompt compliance measures whether a model can turn incomplete, colloquial instructions into a correct, executable result. This article explains why the metric matters, how to design a verifiable neusis construction task, which abilities it tests, how to score outputs, and how to automate checks in a regression pipeline.
Why Prompt Compliance Deserves Its Own Evaluation
On long-chain-of-thought, high-parameter models, reasoning length and knowledge breadth are often no longer the main bottlenecks. What separates models is the ability to recover the user’s intent from natural language. In real work, people rarely describe requirements in formal language: sentences are colloquial, references are omitted, constraints are implicit, and terms may be obscure. A model that merely continues the literal wording is only a language model. It becomes practically useful only when it turns those vague statements into a clear, consistent, and executable target state.
Prompt compliance is therefore not a question of “whether the model obeys.” It is a composite of semantic parsing, constraint solving, and delivery of a working result. It is closer to day-to-day engineering experience than ordinary question-answering accuracy, and it better reflects the quality of output inside intelligent coding tools.
Sample Design: A Counterintuitive Geometry Construction
A high-quality compliance case must be both verifiable and hard to understand. The task used here is an HTML page that dynamically demonstrates constructing a unit square with a two-mark ruler (neusis) and then constructing a regular heptagon. The model must fill in every omitted straightedge-and-compass step, leave compass marks only where they are necessary, and support GIF export.
The requirement is deliberately colloquial and incomplete:
- Take a square and construct the perpendicular bisector of its base.
- With the lower-right vertex E as the center and the diagonal as the radius, draw circle E.
- Keep the two-mark ruler tight against the lower-left vertex D, move the first mark along circle E, and stop when the second mark passes through the perpendicular bisector of the base.
- Then determine the center in the usual way and complete the regular heptagon.
The text gives no side length, no distance between the two marks, and no definition of “necessary marks.” The model must infer that only a unit square combined with a unit mark spacing can close into a regular heptagon, and that the drawing should retain only the points, lines, and arcs required for the construction.
What This Prompt Actually Tests
1. Grounding an obscure term. Neusis, the two-mark ruler, is not part of everyday geometry vocabulary. Many models can only paraphrase the word. They cannot turn it into an operational model: a rigid ruler that slides and carries two marks at a fixed distance. This tests the mapping from terminology to operational meaning.
2. Dense multi-object reference. A single passage mentions the square, the base, the perpendicular bisector, the center, the diagonal, the circle, the marked ruler, vertices D and E, and the first and second marks, all under mutual constraints. One wrong reference collapses the whole construction chain.
3. Reverse inference of implicit constraints. The goal (a regular heptagon) and the initial condition (a square) are tightly coupled. The model must work backward from the endpoint to the initial parameters. That is constraint satisfaction, not text generation.
4. Physical and geometric feasibility. “Tight against the vertex” is a rigid-body constraint, and “moving on the circle” is a trajectory constraint. Together they yield a unique solution. If the model ignores rigidity, it draws an arbitrarily placed segment.
5. Completeness of the output form. Animation, minimal marks, and GIF export are engineering requirements. They test whether the model can turn mathematical correctness into a runnable front-end implementation.
Scoring: Turning Judgment into Measurable Criteria
Use a five-dimension weighted score, with 0–5 points on each dimension:
| Dimension | What to check |
|---|---|
| Geometric correctness | Whether the final polygon is a regular heptagon and its vertices fall in the correct positions |
| Constraint satisfaction | Whether the unit side length, unit mark spacing, and rigid fit all hold |
| Step completeness | Whether omitted perpendicular bisectors, intersections, and arcs are filled in |
| Visuals and interaction | Whether marks are minimized, the animation is continuous, and export works |
| Semantic fidelity | Whether the model changes the requirement or adds unrelated features on its own |
Semantic fidelity is the core criterion. If the model cleverly substitutes another construction method, it should still lose points even when the result is correct, because it did not follow the path the user specified.
Automating the Checks
Manual inspection of drawings does not scale. Geometric assertions should be pushed down into code. The page should expose vertex coordinates; a headless browser then reads them and asserts the expected properties:
// Pseudocode: read geometry exposed by the page and assert numericallyconst pts = await page.evaluate(() => window.__geometry.vertices);const n = pts.length;const side = dist(pts[0], pts[1]);const isRegular =pts.every((p, i) => Math.abs(dist(p, pts[(i + 1) % n]) - side) < 1e-6) &&pts.every((p, i) => {const a = angle(pts[(i - 1 + n) % n], p, pts[(i + 1) % n]);return Math.abs(a - (n - 2) * Math.PI / n) < 1e-6;});
Three engineering constraints should accompany this check: sample the same case multiple times (five or more is a reasonable default) and report a pass rate rather than a single result; fix the random seed and rendering environment to avoid jitter; and put the case set into a regression pipeline so scores run automatically when the model or the prompt template changes.
Common Failure Modes
- Term downgrade: silently replacing the two-mark ruler with an ordinary ruler or a compass approximation, so the result only looks right.
- Reference drift: swapping the roles of E and D, which produces the wrong arc radius.
- Lost constraints: ignoring “minimal marks” and drawing a screen full of auxiliary lines.
- Goal substitution: giving an approximate regular-heptagon construction and bypassing the specified procedure.
- Missing engineering: producing only a static figure, with no animation or export.
Conclusions and How to Apply the Method
Evaluating prompt compliance is evaluating whether a model can reconstruct intent when information is incomplete. Cases should deliberately keep colloquial wording, omissions, and obscure terms, but the result must remain numerically verifiable.
In practice, split the case set into layers: a small number of hard “understanding” cases for model selection, and a large number of lightweight cases for routine regression. Also separate rapid, vibe-coding trial and error from stricter specification-driven development. The former is judged by interaction fluency; the latter by zero deviation from constraints. They should not be measured with the same ruler.
The same method applies when assessing access to cloud model services: compare model versions side by side on a shared case set, and drive the decision with pass rate and semantic fidelity. That is more reliable than relying on subjective impression.
