Evaluating Prompt Compliance in Long Chain-of-Thought Models: A Practical Test Case

    When large language models take on complex, multi-step tasks, simply producing a plausible answer is not enough—models must consistently honor user constraints throughout long reasoning chains. This article uses a challenging geometric construction task (constructing a regular heptagon with a two-mark ruler in HTML) to explore what prompt compliance really means, which dimensions to evaluate, and how to build the page and GIF export. It also offers practical guidance for designing evaluations that reflect real-world workflows.

    Why “Prompt Compliance” Is Harder Than “Giving an Answer”

    As LLM applications move into the era of complex tasks, evaluating a model should not stop at whether it produces a seemingly reasonable answer. The real question is whether the model continuously adheres to user constraints across long reasoning chains. For high-parameter, long chain-of-thought models, when faced with natural language containing multiple steps, multiple object references, implicit physical constraints, and colloquial descriptions, the common failure mode is not “complete incomprehension” but “locally correct understanding with global execution drift”: skipping a step, misinterpreting an object, simplifying the process without authorization, or losing the user’s true intent in the final output.

    Prompt compliance, at its core, is the model’s ability to translate the goals, constraints, steps, terminology, and ambiguous semantics in natural language into an internally executable task representation, and then faithfully restore the user’s intent in the final result. It is not merely “obedience”—it is “understanding, then executing under constraints.” For developers, this directly affects the reliability of complex task delivery: if every requirement must be written as precisely as a programming language specification, the efficiency advantage of natural language interaction largely disappears.

    A High-Density Constraint Test Case: Constructing a Regular Heptagon with a Two-Mark Ruler

    The original test asked the model to generate an HTML page that constructs a regular heptagon using a two-mark ruler. The process roughly involves: take a square and construct the perpendicular bisector of its bottom edge; draw a circle centered at the bottom-right vertex with the diagonal as radius; position the “two-mark ruler” flush against the bottom-left vertex so that the first mark slides along the circle until the second mark falls on the perpendicular bisector; then supplement standard steps such as constructing perpendicular bisectors and locating the center; draw only the necessary construction traces; finally, add GIF export functionality.

    The value of this task is that it is not an ordinary geometry problem but a niche construction procedure that depends on internal logical consistency. A two-mark ruler is not a common tool: the model must understand that it is a straightedge with two marks at a fixed spacing, and must interpret spatial operation constraints such as “flush against the vertex,” “the first mark slides along the circle,” and “the second mark passes through the perpendicular bisector.” Nearly every step involves at least three objects simultaneously—vertices, circles, perpendicular bisectors, marks, ruler orientation—and this high density of multi-object references puts the model’s comprehension and compliance to a serious test.

    More importantly, the description is colloquial and loosely specified: the square’s side length is not given, so the model must infer from the goal (“construct a regular heptagon”) that a unit side length should be used; the spacing between the two marks is implicitly assumed to be the unit length; and “necessary traces” is left undefined. Only a model that genuinely understands the spatial operations, physical constraints, terminology, and ambiguities can strictly comply and complete the construction correctly.

    Which Dimensions Should the Evaluation Cover

    For tasks like this, it is advisable to break prompt compliance into observable dimensions rather than judging only the correctness of the final result.

    1. Task completion: Does the model produce a runnable page, complete the heptagon construction, and enable GIF export?
    2. Step consistency: Does it follow the given order, without skipping, altering, or substituting tools?
    3. Constraint satisfaction: Does it respect constraints such as “draw only necessary traces,” “the ruler stays flush against the vertex,” and “the mark-sliding condition”?
    4. Terminology comprehension: Does it correctly handle concepts like two-mark ruler, perpendicular bisector, diagonal, and scale marks?
    5. Ambiguity resolution: Does it reasonably infer the unit square, unit mark spacing, and the scope of necessary traces?
    6. Output traceability: Does it preserve intermediate states, key frames, and auxiliary explanations for human review?
    7. Failure explainability: When it fails, can it identify whether the cause is a terminology misunderstanding, a spatial-relation error, or a missing output format?

    Graded scoring works well in evaluation: fully compliant, minor simplification, critical step error, tool misuse, or non-runnable. Compared with a single pass rate, graded scoring better reflects a model’s usability in real workflows.

    Engineering Notes for the HTML Implementation and GIF Export

    On the frontend, it is recommended to split the construction into three layers: a geometry model layer, a rendering layer, and an animation recording layer. The geometry model layer maintains points, lines, circles, ruler state, and constraint relationships; the rendering layer draws trajectories using canvas or vector graphics; the animation recording layer captures key frames step by step. “Draw only the necessary traces” can be implemented through layer control: auxiliary construction lines fade out or are cleared once completed, leaving only the key arcs, intersection points, and edges that define the figure.

    Illustrative pseudocode:

    1. Initialize the unit square and its vertex set
    2. Construct the perpendicular bisector of the bottom edge
    3. Construct a circle centered at the bottom-right vertex with the diagonal as radius
    4. Maintain two-mark ruler state: contact point, ruler orientation, two mark points
    5. Adjust the ruler orientation iteratively until the second mark lands on the perpendicular bisector
    6. Record the intersection points that satisfy the constraints
    7. Supplement the perpendicular bisector and center-locating steps
    8. Add only the necessary arcs to the final layer
    9. Render step by step and record key frames
    10. Encode the key frame sequence as a GIF and trigger the download

    GIF export requires attention to frame rate, canvas size, palette quantization, and file size. In practice, you can record the canvas state frame by frame, normalize the dimensions, and then encode; for long procedures, record only the key steps and insert transitions between frames to keep the file size manageable. This kind of implementation does not depend on any particular platform—standard browser graphics capabilities and frontend encoding are sufficient.

    Lessons for Real-World Workflows

    Although this test looks mathematical, it mirrors complex requirements in everyday development: users rarely describe tasks in strict program language; they mix goals, constraints, terminology, and assumed common knowledge. A model that can only handle precise instructions cannot serve as the bridge between requirement understanding and solution implementation. Therefore, when evaluating and selecting models, prioritize tasks that include implicit constraints, multi-object references, niche terminology, and observable intermediate artifacts, and require the model to output a self-check list and key intermediate results.

    In engineering practice, you can break a prompt into six parts—goal, input, constraints, steps, output format, and acceptance criteria—but do not completely flatten the natural ambiguity of natural language. Keeping a moderate amount of colloquial phrasing is actually a better test of the model’s comprehension. At the same time, build a failure sample library that categorizes and accumulates issues such as skipped steps, wrong references, terminology misreads, and missing outputs, and use it to continuously refine prompts and acceptance scripts. Only then can prompt compliance evaluation evolve from a one-off experience test into a reusable engineering methodology.