How to Evaluate Complex Reasoning in Lightweight Models: Lessons from Interactive Geometry Web Tests

    Lightweight models are no longer limited to simple question answering or template-based code generation. This article examines how to evaluate their ability to understand constraints, follow multi-step geometric procedures, generate maintainable front-end code, and build verifiable interactive demonstrations through an HTML-based dynamic compass-and-straightedge construction task. It also highlights common “pseudo-correct” implementations and proposes a layered evaluation framework.

    In large-model applications, “lightweight” usually refers to lower deployment costs, faster response times, or higher concurrency. Lightweight does not necessarily mean limited to simple questions. As model training, reasoning strategies, and coding capabilities continue to improve, some relatively small models can now complete complex tasks that previously required much larger systems.

    However, simply checking whether an answer is fluent or whether a web page opens successfully is not enough to determine a model’s real capability. In front-end code generation, geometric construction, and multi-step instruction execution, a model may produce a result that looks correct without following the method specified by the user. Evaluating lightweight models therefore requires more than inspecting the final visual output. It also requires checking whether the model understood the constraints, followed the required steps, and generated code that is verifiable and maintainable.

    This article uses dynamic compass-and-straightedge construction in an HTML page as an example to discuss how to design this type of test and what model capabilities can be observed from the results.

    1. Why Simple Web Generation Does Not Represent Real Capability

    A conventional web-generation task may only ask a model to create a button, draw a shape, or implement a simple animation. These tasks primarily test syntax completion and the combination of familiar components. A model that understands the basic structure of HTML, CSS, and JavaScript may be able to generate a page that runs successfully.

    Complex interactive geometry tasks are different. They often require the model to handle several types of requirements at the same time:

    1. Understand geometric objects and spatial relationships described in natural language;
    2. Break a continuous description into executable steps;
    3. Translate mathematical constructions into coordinate calculations or graphics operations;
    4. Preserve only the required construction traces rather than drawing everything indiscriminately;
    5. Manage animation timing, state transitions, and interaction feedback;
    6. Generate complete code that can run directly;
    7. Export the animation as a dynamic image when required.

    The challenge is therefore not simply whether the model can draw a regular polygon. The real question is whether it can construct that polygon step by step, visually and verifiably, using the specified geometric method.

    If a model uses precomputed vertex coordinates, the final shape may be completely correct. That does not show that the model understood the requested construction process. By contrast, if it first creates auxiliary lines and circles, simulates a movable ruler, identifies intersections and perpendiculars, and then completes the polygon construction, it demonstrates stronger instruction following and program design capabilities.

    2. An HTML Geometry Test with Strong Discriminative Value

    A test can be designed around the following task:

    Create an HTML page that dynamically demonstrates the construction of a regular heptagon using a two-marked ruler.
    First, draw a square and construct the perpendicular bisector of its bottom edge. Then draw an auxiliary circle centered at the lower-right vertex of the square, using the square’s diagonal as the radius. Next, simulate moving the two-marked ruler through the specified vertex so that its first mark passes through the auxiliary circle and its second mark passes through the perpendicular bisector of the bottom edge. After completing this step, continue with the necessary compass-and-straightedge construction to determine the vertices and edges of the regular heptagon. The compass should leave traces only where they are required. The page must provide animation controls and support exporting the demonstration as a GIF.

    The value of this task is that it tests two levels of capability: understanding and implementation.

    At the understanding level, the model must identify the relationships among the square, diagonal, perpendicular line, circle center, radius, two-marked ruler, intersections, and subsequent construction steps.

    At the implementation level, it must design a coordinate system and manage animation states, path rendering, layers, and export logic. The requirement to leave traces only in necessary locations is particularly important. It means the model cannot simply draw continuously while the tool is moving; it must distinguish between auxiliary motion and actual construction.

    3. Four Dimensions That Matter Most in Evaluation

    1. Is the Final Result Correct?

    The first check is whether the page runs properly and produces the target shape. Evaluation should include the following points:

    • Whether the final figure has seven sides and the expected shape;
    • Whether its vertices lie approximately on the same circle;
    • Whether the edges are continuous;
    • Whether the figure contains obvious distortion;
    • Whether the proportions remain reasonable when the page is resized;
    • Whether the animation ends in a stable state.

    This is the most basic level, but it is not the only criterion. A model can quickly obtain a correct figure by hard-coding the vertex coordinates without implementing the required construction process.

    2. Do the Geometric Steps Follow the Requirements?

    The second level concerns procedural consistency. The evaluator should verify each required step:

    • Was the square created first?
    • Was the perpendicular bisector of the bottom edge drawn?
    • Was the specified vertex used as the circle center?
    • Was the correct radius used?
    • Do the two marks on the ruler satisfy their respective constraints?
    • Were intersections and auxiliary lines used to complete the subsequent construction?
    • Did the model avoid adding alternative steps that were not requested?

    This level often exposes the problem of superficial completion. Some models choose a simpler mathematical formula, calculate the vertices of a regular heptagon directly, and then add decorative lines. Although the visual result may look successful, the implementation does not satisfy the task because it bypasses the required method.

    3. Is the Code Structure Verifiable?

    Complex tasks should not be evaluated from screenshots alone. The code should also be inspected. A strong implementation will usually divide the drawing logic into clear modules, such as:

    1. function drawBaseSquare() {}
    2. function drawPerpendicular() {}
    3. function drawAuxiliaryCircle() {}
    4. function updateRuler(position) {}
    5. function drawConstructionStep(step) {}
    6. function renderPolygon() {}
    7. function exportAnimation() {}

    This structure provides several benefits:

    • Each geometric construction step can be checked independently;
    • Animation state and static drawing logic are less likely to interfere with each other;
    • Individual steps can be modified without rewriting the entire program;
    • It is easier to determine whether the model actually implemented the requested method;
    • Pause, resume, reset, and frame-by-frame playback features can be added more easily.

    If all logic is placed in one very long function, the page may still run, but it becomes difficult to determine whether the model truly understood the task.

    4. Can the Model Execute a Long Task Reliably?

    A common issue in such tests is that a model may continue reasoning for a long time without producing the final code. This shows that complex tasks evaluate not only reasoning ability, but also task scheduling and output control.

    For practical development, a long period without visible output creates several problems:

    • The user cannot tell whether the model is still working;
    • Generation may be interrupted by a timeout;
    • The final response may omit necessary explanations;
    • The model may repeatedly revise its approach, resulting in unstable code.

    A better execution strategy is to work in stages: present the implementation plan first, generate the basic static figure next, add animation afterward, and implement export functionality last. This makes the work easier to inspect and reduces the risk of generating an entire project unsuccessfully in one attempt.

    4. Why Some Lightweight Models Perform Better Than Expected

    Strong performance by a lightweight model on this type of task may be related to several factors.

    First, the model may have received substantial joint training on code and mathematical text. A geometry task is neither purely mathematical nor purely front-end oriented. It requires mapping mathematical concepts to program states. A model that understands both domains is more likely to build an appropriate intermediate representation.

    Second, the model may have effective step-by-step planning capabilities. Instead of jumping directly to the final figure, it can define the canvas coordinate system, graphical objects, animation stages, and trace states before rendering each stage. This approach may be slower, but it can significantly reduce omissions in complex tasks.

    Third, sensitivity to constraints is essential. Many generated results fail not because the model cannot write JavaScript, but because it ignores requirements such as using a specified method or leaving traces only in necessary locations. A model that consistently retains these constraints demonstrates stronger instruction retention.

    Finally, the advantage of a lightweight model may not be absolute speed. It may instead be the balance between cost and capability. For large-scale code generation, interactive prototyping, and internal tool development, users are often more concerned with effective output per unit cost than with the theoretical peak quality of a single response.

    5. Common Types of “Pseudo-Correct” Implementations

    To improve evaluation accuracy, several patterns should receive particular attention.

    Directly Calculating the Vertices

    The model may use trigonometric functions to calculate seven vertices and then connect them in sequence. This produces a standard regular heptagon but bypasses the required compass-and-straightedge construction process.

    Adding Hidden Extra Steps

    The model may introduce unrequested auxiliary points, additional circles, or special correction logic, then force the final figure into the target shape. This can make the result look more stable, but it violates the geometric constraints of the task.

    Using a Static Image to Pretend to Animate

    The page may display a pre-generated image or simulate the process by rapidly switching between several images. This is not a genuine geometric animation because the user cannot observe the dynamic relationships between the objects.

    Drawing Too Much of the Tool’s Path

    The model may leave traces along the entire movement path of the compass or ruler, making the visualization cluttered. This indicates that it has failed to distinguish between tool movement and effective construction traces.

    Providing a Nonfunctional Export Feature

    The page may contain an “Export GIF” button that has no event handler or can only export a static frame. The evaluator must click the button and inspect the generated file rather than assuming the feature works because the button is visible.

    6. A Layered Scoring System

    To make the results more objective, the test can use the following scoring structure:

    • Final geometric result: 25%;
    • Compliance with the specified steps: 30%;
    • Animation and trace behavior: 20%;
    • Code readability and modularity: 15%;
    • Export and interaction features: 10%.

    This structure prevents the overly simplistic conclusion that an implementation passes as long as the final shape is correct.

    Both automated and manual checks can be used. Automated checks can confirm that the page runs, required elements exist, buttons respond, and the figure reaches the expected state. Manual checks are still needed to determine whether the geometric steps are genuine, whether the traces are reasonable, and whether the code uses an alternative method to evade the requirements.

    7. Practical Lessons for Developers

    For developers, this type of test is useful for more than comparing models. It also illustrates several basic principles for using generative models in software development.

    First, requirements must be explicit. The more complex the task, the more clearly the inputs, steps, constraints, outputs, and acceptance criteria should be described.

    Second, the final interface should not be the only acceptance criterion. For systems involving calculations, data processing, or business rules, the intermediate process and code structure must also be reviewed.

    Third, complex tasks should be executed incrementally. Building a runnable minimum version first and then adding animation, interaction, and export capabilities is generally more reliable than generating all the code at once.

    Fourth, model output must be validated by actually running it. Whether the code executes, whether the animation is smooth, and whether the exported file is valid cannot be determined from the model’s explanation alone.

    Overall, lightweight models are no longer limited to simple question answering or template completion. With appropriate task decomposition and verification, they can also handle combined tasks involving mathematical reasoning, front-end implementation, and dynamic interaction. However, these models should not be evaluated solely by whether a page opens or whether the final figure looks correct. The more valuable capabilities are understanding complex constraints, following a specified procedure, completing long tasks reliably, and producing maintainable, verifiable engineering code.