Evaluating Complex Instruction Following in Lightweight LLMs: A Geometry Construction Test Method

    Lightweight LLMs are fast and cheap to run, but how reliably do they follow multi-step, tightly constrained instructions? This article presents a geometry-based evaluation method that turns complex drawing instructions into verifiable constraints, defines five scoring dimensions, and shows how to detect "pseudo-compliance"—outputs that look correct but deviate from the required process. Includes a reusable audit workflow with sample checking code.

    1. Background

    Lightweight models have a clear positioning: fast responses, low inference cost, and suitability for high-concurrency and latency-sensitive scenarios. They typically perform steadily on everyday Q&A, text rewriting, and simple code completion. But for multi-step, heavily constrained tasks, whether they execute each step as specified requires stricter testing.

    Common evaluation approaches rely on single-turn questions or short code snippets. These tasks have a large answer space, and human judges can easily rate a response as “looking correct.” Such evaluations rarely expose a typical failure: the final output may be correct, but the implementation path does not match the instructions.

    Geometry construction tasks fill this gap well. Geometric rules are explicit, every intermediate state can be computed and verified, and the final result can be inspected visually. Using such tasks as an example, this article discusses how to design test cases, decompose constraints, identify pseudo-compliance, and provides a reusable evaluation workflow.

    2. Task Decomposition: Turning Instructions into Verifiable Constraints

    A complex instruction usually contains three types of information: the object to construct, the order of operations, and additional output requirements. Take constructing a regular polygon with a marked ruler (neusis) as an example. The instruction can be broken down as follows:

    1. Initial construction: draw a square and construct the perpendicular bisector of one side.
    2. Auxiliary circle: draw a circle centered at a specified vertex with a radius equal to the diagonal length.
    3. Constrained movement: use a marked ruler so that one marked point slides along the circle, another marked point passes along the perpendicular bisector, and the ruler always stays against the specified vertex.
    4. Subsequent compass-and-straightedge steps: from the point obtained above, continue with standard operations such as locating the center and marking off side lengths.
    5. Output requirement: export the entire construction process as an animation.

    Note that a regular heptagon cannot be constructed with a compass and unmarked straightedge alone. The Gauss–Wantzel theorem gives the conditions for constructible regular polygons, and the heptagon is not among them. However, neusis construction with a marked ruler can achieve it. This is precisely the mathematical value of the task: it requires the model to understand the boundary of its construction tools, not merely produce a visually approximate figure.

    After decomposition, each step should map to a verifiable constraint. The table below shows a common formulation:

    Constraint ID Constraint Verification Method
    C1 The four vertices of the square have correct coordinates and all four sides are equal Compute inter-vertex distances and check right angles
    C2 The perpendicular bisector passes through the midpoint of the base and is perpendicular to it Check the bisector’s equation
    C3 The auxiliary circle’s radius equals the diagonal length Compute distances from the center to points on the circle
    C4 The ruler’s marked point always lies on the circle Check the point-to-center distance frame by frame
    C5 No auxiliary lines or points beyond the instruction appear Compare the set of drawing commands against the allowed set
    C6 Animation export works correctly Check the output file’s frame count and content

    3. Evaluation Dimensions

    Looking at the final image alone is not enough for a reliable conclusion. Score the output across five dimensions:

    • Process consistency: whether the step order matches the instruction and whether unrequested operations appear.
    • Result correctness: whether the positional error of key points is within an acceptable range.
    • Runnability: whether the output code runs in a standard browser environment without errors.
    • Requirement completeness: whether all additional requirements (such as animation export) are fulfilled.
    • Transparency: whether the output explains how each step corresponds to the instruction.

    Process consistency should carry the highest weight. The reason: if the model deviates from the specified procedure, the result— even if coincidentally correct—cannot be reused for similar problems. For example, if a model introduces extra geometric constructions just to force the correct figure, such shortcuts tend to break once parameters change.

    4. Detecting Pseudo-Compliance: Correct Result, Deviated Process

    Pseudo-compliance is the most easily overlooked failure mode in this kind of testing. It has three typical signatures:

    1. The final figure meets the visual requirements, but intermediate steps cannot be mapped one-to-one to the instruction.
    2. The code contains points, lines, or computation branches not mentioned in the instruction.
    3. The explanation text is inconsistent with the code—for example, the text describes a construction step, but the code simply hard-codes coordinates.

    One detection method is to assert on intermediate states. For each key step, record the geometric objects that should appear and verify their positions at runtime. Below is a sample checking routine that validates step order and flags extra operations:

    1. function onCircle(point, center, radius, tol):
    2. d = distance(point, center)
    3. return abs(d - radius) <= tol
    4. function auditSteps(trace, expected):
    5. unexpected = [s for s in trace if s not in expected]
    6. orderOk = [s for s in trace if s in expected] == expected
    7. return { unexpected: unexpected, orderOk: orderOk }
    8. expected = ["square", "perp_bisector", "circle_E", "ruler_slide", "perp_bisector_center", "export_gif"]
    9. trace = ["square", "perp_bisector", "circle_E", "extra_helper_line", "ruler_slide", "perp_bisector_center", "export_gif"]
    10. result = auditSteps(trace, expected)
    11. # result