Testing LLM Reasoning and Coding Skills with Geometric Construction Tasks

    Geometric construction problems offer a rigorous way to evaluate large language models beyond typical code generation benchmarks. This article explains why construction tasks resist memorization, how to break down instructions into executable constraints, and how to design a five-dimension scoring rubric. It also covers common failure modes, numerical methods for automated validation, test design best practices, and how to integrate such evaluations into engineering workflows for model selection and regression testing.

    1. Why Geometric Construction Makes a Good Test

    When evaluating the code generation capabilities of large language models, common practice is to ask the model to build a small utility, implement an algorithm, or generate a web animation. These tasks are easy to understand and quick to score, but they have two problems. First, they often have abundant public examples, so the model may have seen similar content in its training data, making it hard to distinguish genuine ability from memorization. Second, as long as the final page runs correctly, the result looks acceptable—whether the underlying process was correct remains unknown.

    Geometric construction tasks satisfy three conditions that make them a strong supplementary test: the rules are explicit, the steps have a required order, and the results can be verified numerically. The model must first understand the spatial relationships in the figure, then convert each step into executable drawing instructions, and finally check that the output satisfies all constraints.

    2. Task Decomposition: From Natural Language Instructions to Executable Constraints

    A complete construction instruction typically contains four types of information.

    1. Initial conditions: the base figure (e.g., a square) and vertex naming.
    2. Construction order: for example, first draw the perpendicular bisector of a given edge, then draw a circle centered at a specific point with a specific segment length as the radius.
    3. Tool restrictions: which tools are allowed—straightedge, compass, or a marked ruler with刻度 (graduation marks)—and how the marks may be placed and moved.
    4. Output requirements: dynamic demonstration, trace retention rules, export formats, and so on.

    Tool restrictions are the easiest to overlook. Take a ruler with two marked points as an example: the operation means one mark slides along a designated curve while the other mark must pass through an auxiliary line, thereby determining a new point. If the model instead computes the target point directly with coordinate formulas and draws it, the figure may be perfectly correct—but it has already violated the tool constraints of the problem.

    Trace rules also require careful handling. If a dynamic demonstration retains every intermediate circle and auxiliary line, the screen becomes cluttered; if nothing is retained, viewers cannot follow the derivation. A requirement such as “leave traces only where necessary” is really testing whether the model can judge which elements belong to the key steps.

    3. Designing the Evaluation Dimensions

    It is recommended to split scoring into five independent dimensions, each scored separately, so that a single aggregate score does not mask specific problems.

    Dimension What It Tests How to Verify
    Step consistency Whether specified tools are used in the specified order Check item by item against the step list
    Geometric correctness Whether the final figure satisfies the target properties Numerical validation of vertex coordinates
    Process visualization Whether the animation shows key steps and traces are appropriate Manual review with notes
    Functional completeness Whether the required export features are implemented Run the output and inspect the files
    Code runnability Whether the generated content runs directly No errors, no manual fixes needed

    Recording each dimension separately makes the model’s weaknesses visible. For example, if geometric correctness passes fully but step consistency is low, the model’s mathematical judgment is reliable, while its understanding of constraints has gaps.

    4. Common Failure Modes

    In practice, failures cluster into the following categories.

    • Correct result, deviating process. The final figure meets the requirements, but the construction uses shortcuts not permitted by the problem—for example, calling trigonometric functions to compute vertex coordinates directly. This is hard to detect from a screenshot alone.
    • Adding unauthorized steps. The model inserts auxiliary lines or conditional checks not present in the original problem to make the figure close properly.
    • Omitting key steps. The problem asks for all omitted construction steps to be filled in, but the model only presents the final result.
    • Animation detached from results. The figure shown after the animation finishes differs from the computed result, indicating the demonstration logic and numerical logic are not aligned.
    • Incomplete output. Generation stalls for a long time, or only reasoning content is produced without usable code.

    The fifth category is especially common in multi-step reasoning tasks. Long generation time does not necessarily mean poor quality, but latency and mid-generation interruptions should be recorded as part of the reliability metrics.

    5. Automated Validation: Replacing Eyeballing with Numbers

    For results such as regular polygons, numerical methods can replace full reliance on manual observation. The core idea: extract the vertex coordinates recorded by the generated program, check that all edge lengths are equal, that the angles between adjacent edges are consistent, and that the vertex count is correct. For a convex polygon, equal edges plus equal angles are sufficient to confirm a regular polygon.

    Below is illustrative pseudocode:

    1. Input: vertex list P[0..n-1], expected vertex count n, tolerance eps
    2. 1. Check len(P) == n
    3. 2. For each i, compute edge length d_i = |P[i] - P[(i+1) mod n]|
    4. 3. If max(d_i) - min(d_i) < eps, edge lengths are consistent
    5. 4. For each i, compute the angle θ_i between adjacent edges
    6. 5. If max(θ_i) - min(θ_i) < eps, angles are consistent
    7. 6. If both checks pass, the geometric result is correct

    This kind of validation only shows that the result satisfies the properties of a regular polygon—it says nothing about whether the construction process was compliant. Process compliance requires a separate check. One feasible approach is to require the generated program to output a comment before each construction step, such as “Step 3: draw a circle centered at point X,” and then compare these comments against the step list item by item to verify the order and detect any operations outside the list.

    Therefore, result validation and process validation should be recorded separately. Only when both pass is the task considered complete.

    6. Considerations in Test Design

    1. Limited conclusions from a single task. One problem only reflects the model’s performance on this type of task and should not be generalized into an overall capability ranking.
    2. Multiple sampling. Running the same prompt multiple times and computing the success rate is more reliable than a single result.
    3. Fixed evaluation conditions. Record the model version, runtime environment, timeout settings, and whether extra tools were enabled, so comparisons are not contaminated by other variables.
    4. Blind evaluation. Scorers should not know which model produced a result, reducing the influence of subjective preference.
    5. Preventing data contamination. Publicly available problems should be rephrased regularly, or replaced with new problems of identical structure.

    7. Implications for Engineering Practice

    Incorporating this type of test into model selection or regression testing workflows brings three direct benefits.

    First, it exposes reasoning flaws that are hard to detect when only looking at demo results. Second, process checking pushes teams to standardize output formats—for example, requiring generated code to include step comments that facilitate automated parsing. Third, evaluation results can be logged alongside the model version, creating a traceable quality record.

    When building an internal evaluation environment, test tasks can run in a containerized batch-processing environment, with results written to a logging service and monitoring alerts configured for drops in success rate. These are general engineering practices applicable to all kinds of evaluation tasks.

    8. Summary

    Geometric construction problems look simple, yet they simultaneously test comprehension, rule compliance, and code implementation. If an evaluation only looks at the final page, it is easy to mistake “looks correct” for “completed as required.” Separating result validation from process validation—and scoring each dimension independently—gives a far more accurate picture of a model’s true reasoning and coding abilities.