How to Evaluate Prompt Adherence in Large Language Models

    This article explores why the ability to generate content does not guarantee that a large language model will follow user instructions. It introduces a reproducible evaluation framework built around a deliberately counterintuitive drawing task: generating an animated webpage that constructs a regular heptagon using only two specific tools. The article breaks down the four types of pressure this task applies, defines observable scoring dimensions, and maps common failure modes such as term degradation and constraint drift. It also outlines the boundaries of this methodology and offers practical guidance for integrating prompt adherence evaluation into CI workflows as a sustainable quality baseline.

    1. Background: Why “Being Able to Generate” Does Not Mean “Being Able to Follow”

    Once intelligent coding tools and LLM applications became part of everyday development workflows, a recurring gap emerged: models can generate structurally complete code and pages, yet they do not always do things the way the user described. The original evaluation pointed to exactly this. The most noticeable change after a version upgrade was not generation speed or code length, but improved prompt adherence: natural-language instructions that previously could not be parsed or executed can now be understood and implemented fairly completely.

    It is important to stress that adherence is not the same as blind obedience. For high-parameter, long-chain-of-thought models, one successful act of adherence means the model has completed three layers of internal work: parsing spatial operations and action sequences in natural language; identifying implicit physical and geometric constraints; and restoring technical terms and vague expressions into executable, deterministic semantics that reflect the user’s true intent in the final output. If any of these three layers is missing, the output will “look right but actually be wrong.”

    This article uses a niche drawing task that relies heavily on internal logical consistency as an evaluation sample, and abstracts a transferable evaluation framework from it. No specific product is involved; the discussion focuses on general LLM capabilities and evaluation methods.

    2. Sample Design: Stress-Testing Comprehension with a Counterintuitive Task

    The core instruction of the sample can be summarized as: generate a webpage that demonstrates how to construct a regular heptagon using only two types of tools (an unmarked straightedge and a ruler that can be set to a fixed interval), and output it as an animation.

    The rough steps are: start with a square and construct the perpendicular bisector of its base; using the bottom-right vertex as the center and the diagonal length as the radius, draw a circle; then place the tool with two fixed-interval markings flush against the bottom-left vertex, moving the first marking along the circle until the second marking passes through the perpendicular bisector of the base; after that, construct the perpendicular bisector in the conventional way to locate the center and complete the regular heptagon. All omitted construction steps must be filled in, construction traces should be retained only where necessary, and the ability to export an animation should be added at the end.

    The value of this sample lies in the fact that it applies four kinds of pressure simultaneously.

    First, the terminology is niche. A ruler with fixed-interval markings is an obscure tool, and most models lack a stable prior for it. They tend to degrade it into an ordinary straightedge or a regular compass, deviating from the task at the very first step.

    Second, there are dense references to multiple objects. Almost every step involves at least three objects at once: vertices, circles, perpendicular bisectors, and markings constantly switch between subject and object. Once reference resolution goes wrong, subsequent steps collapse in a chain reaction.

    Third, constraints are implicit. The instruction never specifies the side length of the square, so the model must infer a unit square on its own. Once combined with the goal of “ultimately constructing a regular heptagon,” the side length can only be the unit value; otherwise the scale relationships will not close. The interval between the two markings is likewise assumed to be one unit.

    Fourth, the semantics are vague. “Necessary traces” is never defined. The model must decide on its own which auxiliary lines and intersection points must be kept and which should be removed. This is effectively testing the model’s grasp of the implicit aesthetic of “drawing readability.”

    3. Scoring Dimensions: Breaking “Adherence” into Observable Metrics

    To make the evaluation reproducible, subjective impressions must be converted into observable items. At a minimum, the following dimensions should be covered:

    • Term correctness: whether the niche tool is used as defined rather than silently replaced;
    • Constraint satisfaction rate: whether implicit conditions such as unit scale, radius value, and interval setting all hold;
    • Reference consistency: whether subject and object remain correct throughout multi-object steps;
    • Step completeness: whether omitted steps are filled in rather than skipped;
    • Result correctness: whether the final figure is a regular heptagon and whether the error can be quantified;
    • Trace restraint: whether auxiliary traces appear only where necessary;
    • Intent restoration: whether additional requirements such as animation export are implemented and whether interactions are usable.

    A schematic evaluation record can be written as:

    1. {
    2. "case": "two-ruler-heptagon",
    3. "scores": {
    4. "term_fidelity": 0,
    5. "constraint_satisfaction": 0,
    6. "reference_consistency": 0,
    7. "step_completeness": 0,
    8. "result_correctness": 0,
    9. "trace_restraint": 0,
    10. "intent_restoration": 0
    11. },
    12. "failure_stage": "first-construction",
    13. "notes": "Degrades the fixed-interval ruler into an ordinary straightedge"
    14. }

    The failure_stage field is especially critical: pinpointing at which step the failure occurs is more useful for guiding further optimization than producing a single overall score.

    4. Common Failure Modes and Root Causes

    In practice, frequent failures fall into four categories. The first is term degradation, where the model replaces an unfamiliar concept with a familiar one; it looks fluent on the surface, but the logical starting point is already wrong. The second is constraint drift, where the model sets the side length or interval on its own, causing the scale relationships to fail to close. The third is reference loss, where the object of a later step in a long chain is bound incorrectly. The fourth is process simplification, where the model directly produces a conclusive figure and omits the construction steps that the instruction explicitly required to be filled in.

    When attributing causes, it is necessary to distinguish “insufficient capability” from “ambiguous phrasing.” If the model immediately gets it right after a more rigorous rephrasing, the problem lies on the instruction side; only when multiple phrasings all fail should it be judged as insufficient comprehension or reasoning capability. This distinction directly determines whether the evaluation conclusion has engineering value.

    5. Boundaries of the Evaluation Methodology

    It should be stated objectively that such constructed tasks mainly stress-test instruction following and constraint reasoning, leaning toward the ability to “implement as described.” They are not equivalent to open-ended, vaguely targeted end-to-end generation tasks, so they should not be used to infer the upper limit of model capability. A more robust approach is to build a layered evaluation set: hard term-and-constraint questions at the bottom layer, multi-step reference and state-tracking questions in the middle layer, and open-ended design questions at the top layer, with separate statistics and cross-analysis.

    Evaluation noise should also be controlled: fix randomness settings, unify the runtime environment, and sample the same case multiple times to avoid a single result being amplified by chance.

    6. Engineering Recommendations

    To use this evaluation within a team over the long term, it can be integrated into a continuous integration pipeline: cases are maintained as configuration files, automatically executed during the build stage, and scored; for failed cases, intermediate states and trace snapshots are retained for review; score trends are connected to monitoring, alerting, and logging services to form a quality dashboard. Outputs and snapshots can be stored in object storage, and task scheduling can be handled by a container platform, turning the evaluation from a one-off validation into a sustainable quality baseline.

    Going further, vague instructions from real development can be desensitized and accumulated as cases, gradually covering four types of scenarios: spatial operations, physical constraints, technical terminology, and omitted semantics, keeping the evaluation set aligned with the business distribution.

    7. Conclusion

    The essence of prompt adherence is whether a model can restore the user’s true intent amid the imprecision of natural language. Using a niche, implicitly constrained, reference-dense drawing task as a probe makes it possible to break this capability down into quantifiable, attributable, and regression-testable metrics. For developers, this is more instructive than simply comparing generation speed or code volume: only when implicit constraints are stably satisfied do intelligent coding tools truly qualify to enter everyday development workflows.