Evaluating LLM Prompt-Following Capability Under Complex Natural Language Instructions

    Prompt-following capability is a practical measure of LLM quality, especially when instructions are ambiguous, cross-domain, and constraint-heavy. This article outlines three levels of prompt adherence, uses an interactive regular-heptagon construction task as a representative test, and proposes criteria for evaluating correctness, process completeness, constraint consistency, output reliability, and maintainability. It also explains how ambiguous natural language can be converted into engineering rules and how to assess whether a model can move from generating plausible code to fulfilling a complex, verifiable technical request.

    When evaluating a new version of a large language model, many people first look at parameter count, response speed, context length, or scores on common benchmarks. In real development work, however, the factor that often determines whether a model is useful is not whether it can generate code that looks reasonable. It is whether the model can accurately understand a complex, ambiguous, cross-domain natural-language request with multiple constraints and reliably carry those requirements through to the final result.

    From this perspective, prompt adherence is an important indicator of a model’s practical value. It is not merely about producing output that matches a user’s wording. It includes instruction parsing, context linking, object tracking, inference of implicit conditions, understanding of domain concepts, execution of process constraints, and result validation. For tasks that require generating interactive web pages, data-processing scripts, engineering configurations, or visualization programs, whether the model can recover the user’s true intent is often more important than whether the code runs.

    Prompt Following Is Not Keyword Matching

    Low-complexity prompts usually ask the model to perform a single action, such as “generate a button,” “draw a circle,” or “write a sorting function.” Even with common templates and keyword matching, such tasks may produce results that appear acceptable.

    Complex prompts, by contrast, often have the following characteristics:

    1. They contain multiple operation steps at the same time.
    2. Different objects have spatial, temporal, or causal relationships.
    3. They use uncommon terminology.
    4. Parameters are not fully defined.
    5. Some conventional steps are omitted.
    6. The final result has additional interaction or export requirements.
    7. The model must supply constraints that are not explicitly stated in the context.

    Therefore, true prompt-following capability has at least three layers.

    The first layer is literal adherence: the model does not omit requirements that the user explicitly wrote. The second layer is semantic adherence: the model understands the relationships among those requirements instead of mechanically executing one sentence after another. The third layer is intent adherence: the model can use the task goal to fill in preconditions that the user did not state explicitly but that necessarily exist.

    For example, a user may ask the model to “create an interactive geometric construction web page based on the given steps.” The model must not only draw the final figure. It must also understand the construction process, preserve necessary auxiliary lines, control the display range of traces, and let the user observe changes between steps. If the model only generates a static final pattern, the instruction has not been fully followed even if the visual result looks similar.

    A Representative Test: Reproducing a Complex Ruler-and-Compass Construction on a Web Page

    To test a model’s ability to understand complex natural language, one can design a web task with a clear goal, multiple intermediate objects, and implicit constraints. For example:

    Create an interactive web page that simulates the process of constructing a regular heptagon with a ruler and compass.
    First construct a unit square and draw the perpendicular bisector of its bottom edge. Using the bottom-right vertex as the center and the square’s diagonal as the radius, draw an auxiliary circle. Then use a double-marked ruler with two equidistant marks. Keep one end of the ruler passing through the bottom-left vertex, and move the ruler so that the first mark line intersects the auxiliary circle while the second mark line passes through the perpendicular bisector of the bottom edge. Complete the relevant intersection and perpendicular constructions, fill in the remaining necessary ruler-and-compass steps, and obtain the regular heptagon. For compass movement, retain only necessary traces, and provide process animation and animated image export.

    On the surface, this is a front-end development task. In practice, it tests geometric reasoning, natural-language understanding, object management, animation design, and file export at the same time.

    1. Understanding Domain-Specific Terminology

    “Double-marked ruler” or “two-mark ruler” is not a common term in ordinary web development. The model must understand that it is not an ordinary ruler, but a construction tool with two marks separated by a fixed distance that can slide or rotate to achieve a specific geometric placement.

    If the model treats it simply as an ordinary line segment, later geometric relationships will fail. A more robust implementation should explicitly represent:

    • the position of the ruler body;
    • the ruler’s direction vector;
    • the fixed distance between the two mark lines;
    • constraints on the ruler endpoint or reference point;
    • intersections between the mark lines and circles or straight lines;
    • the legal range of poses during movement.

    This shows that whether the model understands a term cannot be judged only by whether the relevant text appears on the final page. It must be judged by whether the concept is actually used in the internal data structures and geometric calculations.

    2. Handling Object References

    Complex construction steps usually involve multiple points, lines, circles, and auxiliary objects. For example, “keep the ruler passing through the bottom-left vertex, move the first mark line onto the circle until the second mark line passes through the perpendicular bisector” contains at least:

    • a fixed vertex;
    • a movable ruler;
    • two parallel mark lines;
    • an auxiliary circle;
    • a perpendicular bisector;
    • multiple dynamic intersection points.

    If the model cannot track these objects correctly, errors are likely:

    • mistaking the circle center for an intersection point;
    • confusing the first mark line with the second mark line;
    • fixing the ruler endpoint at the wrong position;
    • satisfying only one of the geometric conditions;
    • calculating an intersection point that does not exist;
    • drawing a result that looks visually plausible but is mathematically invalid.

    Therefore, testing should not only check whether the page “has a drawing.” It should verify object relationships step by step.

    3. Inferring Implicit Parameters

    Original requirements usually do not specify every parameter strictly. For example, the user may not explicitly state the side length of the square, may not explain the distance between the two mark lines, and will not define exactly which contents count as “necessary traces.”

    The model must make reasonable inferences.

    If the goal is to construct a standard regular heptagon and the whole process is based on a square, the square’s side length should usually be normalized to unit length. This has two advantages: it avoids meaningless absolute dimensions and makes calculation and display scaling easier to unify.

    At the code level, normalized coordinates can be used:

    1. Bottom-left corner: D = (0, 0)
    2. Bottom-right corner: E = (1, 0)
    3. Top-right corner: F = (1, 1)
    4. Top-left corner: G = (0, 1)

    All circles, lines, and intersection points are then calculated in this coordinate system, and finally mapped to the web canvas through a viewport transformation.

    For the mark spacing, if the requirement does not specify it, the model should not arbitrarily hard-code an unexplained value. A better approach is to:

    • define the spacing as a configurable parameter;
    • display the current value in the interface;
    • document its geometric meaning;
    • let the model explain why the parameter satisfies the target construction.

    This is easier to verify and maintain than writing a mysterious constant directly into the code.

    How to Determine Whether the Model Truly Understood the Task

    A reliable evaluation cannot rely only on whether the final page runs. It should check at least the following aspects.

    1. Result Correctness

    Whether a regular heptagon is actually generated should be checked through side lengths and interior angles, not only through visual inspection. Coordinate calculations can be used to verify:

    • whether distances between adjacent vertices are approximately equal;
    • whether angles between adjacent sides match the characteristics of a regular polygon;
    • whether the first and last vertices close the shape;
    • whether distances from the figure center to each vertex are approximately equal.

    In floating-point calculations, a reasonable error tolerance should be set instead of requiring all results to be exactly equal.

    2. Process Completeness

    If the task requires showing the construction process, the model cannot output only the final result. It should include at least:

    • the initial figure;
    • construction of the perpendicular bisector;
    • drawing of the auxiliary circle;
    • movement of the marked ruler;
    • generation of key intersection points;
    • subsequent perpendicular or arc constructions;
    • connection of the regular heptagon.

    Each step should have a clear visual state. Ideally, the page should support pause, single-step execution, and replay.

    3. Constraint Consistency

    Dynamic construction is especially prone to the problem of “looking like it moves while the constraints have actually failed.” Testing should focus on:

    • whether the ruler always passes through the fixed point during movement;
    • whether the two mark lines maintain a fixed distance;
    • whether compass traces appear only during the specified stages;
    • whether auxiliary lines appear at the correct time;
    • whether intersection points update in real time as objects change.

    If the model only precomputes a set of coordinates and plays them as an animation without truly implementing geometric constraints, its interaction capability is limited.

    4. Output Capability

    When the user requests animated image export, the model also needs to handle animation frames, canvas rendering, dimension compression, and file generation. Here it is important to distinguish:

    • real-time animation on the page;
    • single-frame image export;
    • multi-frame animation export;
    • whether transparency is preserved after export;
    • whether the export process blocks the page;
    • whether a large number of frames causes excessive memory use.

    If the runtime environment cannot directly generate a certain file format, the model should clearly state the limitation and provide an executable alternative, such as exporting consecutive image frames first and then encoding them into an animated image with a subsequent program. It should not claim to have implemented a function that does not exist.

    How Ambiguity in Natural Language Becomes Engineering Rules

    Real requirements are rarely as complete as formal specifications. The model must convert ambiguous expressions into executable rules, and this is also a key measure of its engineering capability.

    For example, “produce traces only where necessary” can be concretized as:

    • show a trace when the compass moves from the start point to the end point;
    • do not show a trace when the compass is not involved in construction;
    • auxiliary circles may remain, but should not generate irrelevant continuous scanning marks;
    • traces should be associated with specific construction steps rather than permanently overlaid;
    • users can choose to show or hide auxiliary traces.

    Similarly, “supplement all omitted ruler-and-compass construction parts” cannot be understood simply as “draw a few more lines.” The model should be required to:

    1. clarify the purpose of each newly added object;
    2. explain the known points or lines on which it depends;
    3. ensure that new steps comply with ruler-and-compass construction rules;
    4. avoid using ordinary drawing tools to obtain the target point directly;
    5. make the final result derivable from preceding steps.

    Such rules help prevent the model from bypassing the real geometric process through visual shortcuts.

    A Comprehensive Evaluation Framework for Model Capability

    For tasks of this kind, a relatively objective scoring system can be established:

    • instruction coverage: whether all explicit requirements are implemented;
    • semantic understanding: whether terminology and object relationships are interpreted correctly;
    • geometric correctness: whether calculations for key points, lines, and circles hold;
    • process explainability: whether the reason for each step can be explained;
    • interaction completeness: whether playback, pause, single-step execution, and reset are supported;
    • code maintainability: whether the structure is clear and parameters are centrally managed;
    • exception handling: whether the page remains stable when there is no intersection, repeated clicking, or an illegal pose;
    • output reliability: whether export functions are genuinely usable;
    • visual communication quality: whether figures, labels, traces, and animations are easy to understand.

    Visual quality should carry only part of the weight. Even if a page is beautifully designed, it should not receive a high evaluation if the geometric relationships are wrong, steps are missing, or the interaction is only a pseudo-animation.

    From “Can Write Code” to “Can Fulfill a Wish”

    Many current models can quickly generate web pages, scripts, and components. But there is still a clear gap between “generating code” and “fulfilling a complex wish.”

    The former is closer to template composition: the model selects common structures based on keywords and assembles a runnable interface. The latter requires the model to understand the process, constraints, and acceptance criteria that the user actually wants, and to make reasonable completions when information is incomplete.

    Therefore, when evaluating a model, one should not rely only on low-threshold questions such as “can it generate a page.” Instead, one should design comprehensive tasks that include:

    • uncommon domain concepts;
    • cross-references among multiple objects;
    • continuous state changes;
    • implicit mathematical or physical constraints;
    • incomplete natural-language descriptions;
    • a verifiable final result;
    • additional requirements for interaction and output format.

    Such tests are closer to the real requirements developers face every day, and they better reflect the upper limit of a model in complex engineering scenarios.

    Overall, if a new version of a large language model shows stronger adherence under complex prompts, it usually means that it has not only improved text generation quality but also enhanced its ability to model task structure, context relationships, and implicit intent. However, a single web-generation test does not prove that the model performs equally well in all domains. A more rigorous approach is to combine multi-round revision, error fixing, boundary conditions, code explanation, and result verification in continuous testing.

    What truly deserves attention is not whether the model can generate a piece of code that “looks good” in one pass. It is whether, when requirements are ambiguous, steps are long, and constraints are numerous, the model can proactively clarify problems, fill in necessary conditions, maintain logical consistency, and ultimately deliver a technical result that is verifiable, maintainable, and open to further iteration.