Evaluating LLM Instruction Following in Complex Natural Language Tasks

    Complex natural language tasks test whether large language models can turn ambiguous requirements into consistent, executable results. Using a regular heptagon construction with a two-mark ruler as an example, this article examines semantic understanding, geometric constraint solving, animation design, and validation. It also outlines evaluation criteria that distinguish a visually convincing prototype from an implementation that follows the requested construction process.

    When evaluating a large language model for development, design, or engineering work, people often focus on parameter count, response speed, or the amount of code it generates. In practice, a more important question is whether the model can accurately interpret incomplete, loosely specified natural language with implicit conditions—and translate it into the intended result.

    This capability is broadly described as instruction following. It is not simply repeating a user’s requirements or checking off a list. It requires semantic understanding, constraint reasoning, object tracking, task decomposition, code generation, and result validation. For complex visual programming tasks, instruction following often reveals more about practical usability than code completion alone.

    1. What Does Instruction Following Actually Test?

    A simple prompt usually asks a model to perform a local action: draw a button, implement a form, or calculate a set of values. Even when these tasks contain some ambiguity, familiar templates may be enough to resolve it.

    Complex prompts are different. They often combine several kinds of information:

    1. Target outcome: What the final result should be, such as a regular heptagon, an interactive webpage, or an animated demonstration.
    2. Process constraints: Which steps must be performed and which cannot be skipped.
    3. Object relationships: How points, lines, circles, or controls relate spatially to other objects.
    4. Implicit conventions: Conditions that are not stated explicitly but are normally assumed within the domain.
    5. Output requirements: Whether the task requires animation, image export, a particular file format, or retained construction traces.
    6. Boundary conditions: Which parts of the process must be visible and which should leave traces only where necessary.

    The model’s job is therefore not to translate each sentence directly into code. It must first turn the language into an internally consistent task model. Only then can the generated webpage reliably meet the requirements.

    2. Why Constructing a Regular Heptagon with a Two-Mark Ruler Is a Difficult Test

    Consider the request: “Create a webpage that demonstrates the construction of a regular heptagon using a two-mark ruler.” This is not an ordinary drawing task. It tests several capabilities at once.

    First, a two-mark ruler is a relatively specialized geometric construction tool. It is not an ordinary straightedge or simply a tool for connecting two points. It has two fixed marks and must be positioned and oriented to satisfy specific geometric conditions. A model that does not understand these constraints may incorrectly represent it as a line segment or an arbitrarily movable ruler.

    Second, the construction involves many relationships among objects. For example:

    • A particular vertex must serve as the center of a circle.
    • A diagonal must determine the circle’s radius.
    • The ruler must remain in contact with a specified vertex.
    • The first mark must lie on a designated circle.
    • The second mark must lie on a particular perpendicular bisector.
    • Some intersections become reference points for later steps.

    References such as “it,” “that point,” “the second mark,” and “the perpendicular bisector of the base” must be bound to the correct previously defined objects. A single mix-up can produce a drawing that looks complete but no longer follows the intended construction.

    Third, the prompt may omit numerical conditions. The square’s side length may not be specified, and the distance between the ruler’s marks may be implied only by context. The model must infer appropriate dimensions from the construction method and the target geometry.

    In this situation, literal compliance alone can produce an incorrect result. A more effective approach is to establish a consistent coordinate system based on the geometric objective.

    3. From Natural Language to an Executable Geometry Model

    The most important step is to translate the natural language requirements into an executable geometric state.

    3.1 Establish a Consistent Coordinate System

    The initial square can be defined as a unit square:

    • D is the lower-left vertex.
    • E is the lower-right vertex.
    • The remaining vertices occupy the upper-right and upper-left corners.
    • The base lies along the horizontal axis.
    • The perpendicular line through the base’s midpoint serves as a fixed reference.

    Using unit lengths allows all subsequent coordinates to be normalized. Changes to the webpage’s canvas size then do not distort the geometric relationships.

    An implementation should not hard-code geometric logic in screen pixels. Instead, it should distinguish between:

    • Mathematical coordinates: Used to calculate points, lines, circles, and intersections.
    • Screen coordinates: Used to map those mathematical results onto the canvas.

    This separation supports scaling, animation export, and error checking.

    3.2 Represent Geometric Objects as Data Structures

    Points, lines, circles, and traces should be represented explicitly. For example:

    1. Point:
    2. name
    3. x
    4. y
    5. visible
    6. Line:
    7. startPoint
    8. endPoint
    9. infinite
    10. visible
    11. Circle:
    12. center
    13. radius
    14. visible
    15. showTrace

    The two-mark ruler needs additional state:

    1. Ruler:
    2. anchorPoint
    3. direction
    4. markOffset1
    5. markOffset2
    6. visible
    7. traceMode

    These structures distinguish the position of the tool from the positions of its marks. Treating the ruler as nothing more than a line cannot adequately express the requirement that its two marks satisfy different geometric constraints.

    3.3 Define How “Move Until the Conditions Are Met” Is Solved

    The instruction “move the first mark along the circle until the second mark lies on the perpendicular bisector of the base” describes a constraint-solving problem, not an ordinary dragging action.

    It can be broken down into the following steps:

    1. Maintain the required contact between the ruler and the lower-left vertex.
    2. Use the rotation angle or contact position as a variable.
    3. Calculate whether the first mark lies on the target circle.
    4. Calculate whether the second mark lies on the target perpendicular bisector.
    5. Find a ruler pose that satisfies both constraints.
    6. Record that pose as an animation keyframe.

    A numerical implementation can use parameter search, bisection, or error minimization. If the two constraint errors are e1 and e2, an objective can be expressed as:

    1. totalError = weight1 * abs(e1) + weight2 * abs(e2)

    The ruler’s pose is adjusted until totalError falls within the allowed tolerance. Only then should the pose be accepted as a valid construction position.

    Numerical convergence is not sufficient proof that the geometry is correct. The result must be checked independently, including:

    • The distance error between the first mark and the target circle.
    • The distance error between the second mark and the target line.
    • Whether the ruler maintains its required relationship with the anchor point.
    • Whether the subsequently generated vertices have equal side lengths and equal central angles.

    4. A Web Implementation Must Do More Than Display the Shape

    Generated code may successfully display a figure without completing the actual task. A sound interactive geometry webpage should include several distinct layers.

    4.1 Geometry Computation Layer

    This layer calculates points, lines, circles, intersections, perpendiculars, and rotations. It should be independent of interface state so that it can be tested separately.

    4.2 Rendering Layer

    This layer draws the geometric objects on the canvas, including:

    • Active construction lines.
    • Auxiliary circles.
    • The two-mark ruler.
    • Established vertices.
    • The regular heptagon’s boundary.
    • Necessary traces from earlier steps.

    4.3 Animation Sequencing Layer

    This layer plays the construction in the required order. Each step should have a starting state, an intermediate process, and an ending state, rather than jumping directly from an empty canvas to the finished figure.

    4.4 Interaction Layer

    Useful controls include play, pause, reset, single-step execution, and speed adjustment. Single-step mode is particularly important for a complex construction because users need to inspect how each constraint is satisfied.

    4.5 Export Layer

    If an animated image is required, the implementation must first define what the export contains: only the final figure or the entire construction process.

    A practical approach is to save each animation frame as an image and encode the frames at a consistent frame rate. The export should also ensure that:

    • Frame dimensions remain consistent.
    • The background color is fixed.
    • Trace visibility follows a consistent policy.
    • Exporting does not interfere with page interaction.
    • Large frame sequences are compressed to avoid oversized files.

    5. “Necessary Traces” Must Be Formalized

    A requirement such as “the compass produces a trace as the point moves, but leaves marks only where necessary” is inherently ambiguous.

    Without a clearer definition, a model might interpret it in three ways:

    1. Draw the complete path traced by the compass’s drawing point.
    2. Draw the entire resulting circle.
    3. Retain only the arcs needed for subsequent intersection constructions.

    In the context of geometric construction diagrams, the third interpretation is often more appropriate: display only the arcs or auxiliary segments that contribute to the result.

    A trace policy can make the requirement explicit:

    • none: Display no trace.
    • full: Display the complete circle or movement path.
    • segment: Display only an arc within a specified angular range.
    • construction: Retain only the portions needed for subsequent intersections.

    This illustrates why instruction following is not only a language problem. It also involves requirements clarification and product design. A model that identifies ambiguity and proposes a reasonable default is generally more useful than one that silently assumes an interpretation.

    6. How to Evaluate Whether the Model Understood the Task

    Evaluation should not stop at checking whether a seven-sided shape appears on the page. More reliable criteria include the following.

    6.1 Result Correctness

    Is the final figure a regular heptagon within the numerical tolerance, rather than an arbitrary seven-sided polygon that merely looks close?

    Check differences among side lengths and errors in the angles between adjacent sides.

    6.2 Process Completeness

    Does the implementation construct the square, perpendicular bisector, auxiliary circles, ruler position, and subsequent geometry in the specified order?

    A model should not bypass essential steps and draw the final polygon directly.

    6.3 Semantic Correspondence

    Does each displayed object correspond to the object described in the prompt?

    For example, verify that the anchor point is correct, the two ruler marks are distinguished, and the specified circle center and radius are used.

    6.4 Animation Explainability

    Does the animation help users understand why the ruler moves in a particular way, or does it merely present a visual effect?

    6.5 Engineering Maintainability

    Does the code use clear data structures, independent calculation functions, and extensible rendering logic?

    A one-off implementation that places everything inside a single function may produce a successful demonstration, but it is a weak foundation for a long-term project.

    7. Vibe Coding Versus Wish Coding

    This type of test is closer to vibe coding or rapid prototyping: a user describes an objective in natural language, and the model quickly produces a runnable first version. It can effectively test understanding, solution design, and interactive implementation.

    However, describing a desired outcome and receiving a working demo is not the same as requirements-driven development. Real projects also raise questions such as:

    • Can the requirements be tested and accepted?
    • Are boundary conditions clearly defined?
    • Is data persistent?
    • Are performance and compatibility adequate?
    • Can the system recover from errors?
    • Is the code easy to modify?
    • Has it passed testing and review?

    A successful webpage generation demonstrates initial understanding and implementation ability. It does not establish that the model can independently deliver a complex software project.

    Conclusion

    The value of a complex prompt does not come from its length. It comes from how effectively it tests the model’s combined understanding of specialized concepts, spatial relationships, implicit conditions, process constraints, and output requirements.

    Constructing a regular heptagon with a two-mark ruler requires the model to recognize an uncommon tool, track multiple geometric objects, infer unstated scale conventions, translate language into a constraint system, and implement animation, traces, and animated-image export.

    The result must do more than look plausible. Its mathematical relationships, construction sequence, and interaction logic must remain consistent with the task.

    For developers, the most effective workflow is not to expect a finished solution in one attempt. Instead, ask the model to decompose the task, establish the geometry model, implement the core algorithm, add visualization, and then refine the result through automated validation and human review.

    The stronger a model’s instruction-following ability, the more closely this natural-language-driven workflow can align with real engineering requirements—and the more useful AI coding tools become in complex practical tasks.