Evaluating Complex Reasoning in Lightweight LLMs: A Practical Guide with a Geometric Construction Stress Test

    This article examines why lightweight flagship models must be evaluated with more than standard benchmarks. Using a geometric construction prompt that requires a runnable HTML animation with step constraints, sliding constraint solving, and GIF export, it breaks down the four capabilities needed to pass: constraint solving and state machine modeling, instruction following, numerical stability, and engineering completeness. It also offers practical prompt and workflow recommendations for closing lightweight model gaps through structured generation, self-checks, staged validation, and internal regression sets.

    1. Why Lightweight Models Need Rigorous Evaluation

    In the model tier hierarchy, a “lightweight flagship” usually refers to a model with a smaller parameter footprint and more favorable inference cost and latency, while approaching flagship-tier capability. The value of this tier is clear: in cost-sensitive scenarios such as batch generation, real-time interaction, and on-device or near-device deployment, it trades a lower compute budget for acceptable quality.

    The risks are equally clear. On short question answering or copy rewriting tasks, lightweight models differ only slightly from flagship models. But once the task becomes a reasoning-heavy one with multiple constraints, long dependency chains, and mid-course self-correction, the capability gap widens rapidly. Evaluating lightweight models therefore requires more than routine leaderboards; it requires stress tests designed to expose weak points.

    This article uses a typical stress test: given a geometric construction description with strict step constraints, the model must output a runnable web page with process animation and animated GIF export. This type of task examines several dimensions at once:

    • Instruction following: whether the model implements the given steps strictly instead of inventing shortcuts;
    • Long-horizon planning: whether it can decompose a complex construction into an executable state machine and geometric operations;
    • Numerical stability: whether intersection solving and constraint switching produce jumps or infinite loops;
    • Engineering completeness: whether interaction controls, rendering performance, and the export flow form a closed loop.

    2. Task Design: A Geometric Prompt That Produces Verifiable Failure

    The key to evaluation is not difficulty but decidability. Geometric constructions are naturally verifiable: whether the final figure meets the requirements and whether the steps match the description can both be checked manually or by script.

    A usable prompt skeleton is shown below (illustrative, not tied to any specific product interface):

    1. Implement a geometric construction animation in a single HTML file:
    2. 1. Construct a square and the perpendicular bisector of its base;
    3. 2. Draw a circle centered at the bottom-right vertex with the diagonal length as radius;
    4. 3. Introduce a "two-mark ruler" constraint: the ruler body stays flush against the bottom-left vertex,
    5. the first mark slides along the circle, and the second mark passes through the perpendicular bisector of the base;
    6. 4. Complete all omitted compass-and-straightedge construction steps;
    7. 5. Keep only necessary compass traces and avoid a continuous trail throughout;
    8. 6. Provide play/pause/step controls and an "Export GIF" feature.

    The trap in this prompt is step 3. It is a constrained sliding solve. If the model does not understand the constraint, it often forces a result by “directly computing an approximate angle” or “adding auxiliary steps that do not exist.” This is the dividing line between understanding a constraint and fitting an answer.

    3. Capability Breakdown: Four Abilities a Lightweight Model Needs to Pass

    3.1 Constraint Solving and State Machine Modeling

    The model must turn continuous geometric constraints into a computable solving flow: parameterize the central angle, find intersections, determine switching conditions, and lock the final position. A strong implementation explicitly defines states (constructing / constraint search / complete) and transition conditions, rather than cramming all logic into a single rendered frame.

    3.2 Instruction Following Without Overstepping

    A common failure mode in evaluation is “the result looks correct, but the process is completely off track”: the model adds steps that do not exist in the original description or skips key constraints. From an engineering perspective, a “step log” can constrain the model to output the geometric objects and dependencies of each step, making verification easier.

    3.3 Numerical Stability and Interaction Quality

    Sliding constraints are prone to no-solution cases, dual solutions, and jumps. A robust approach is to add tolerance and search interval limits:

    1. const EPS = 1e-6;
    2. function findSlidePosition(targetLine, circle) {
    3. // Binary search/scan within a limited angle interval to avoid jumps from a global search
    4. let lo = 0, hi = Math.PI / 2;
    5. for (let i = 0; i < 60; i++) {
    6. const mid = (lo + hi) / 2;
    7. const p = intersect(circle, ray(mid));
    8. if (signedDist(p, targetLine) > EPS) hi = mid; else lo = mid;
    9. }
    10. return (lo + hi) / 2;
    11. }

    3.4 Engineering Closure: Rendering, Controls, and Export

    Animation tasks also require attention to frame rate control with requestAnimationFrame, frame-by-frame capture via an offscreen canvas, and the feasibility of encoding frames into an animated image. If a lightweight model proactively fills in these “non-mathematical” details, it indicates higher engineering completeness.

    4. Abstracting the Results: From “Who Is Stronger” to a Capability Profile

    In the original material, models from different tiers showed clear divergence: some took longer but followed steps strictly; others were faster but deviated from constraints. For developers, a more useful conclusion than a ranking is a capability profile:

    • High constraint adherence: suitable for process-driven generation and auditable scenarios;
    • High speed: suitable for drafts, brainstorming, and loosely coupled copy;
    • Middle tier: gaps can be compensated through prompt engineering and tool orchestration.

    5. Engineering Recommendations: Closing Lightweight Model Gaps with Prompts and Workflows

    1. Structure first, then generate: ask the model to output a step list and data structures before writing code, which significantly reduces the chance of going off track.
    2. Enforce self-checks: at the end of the prompt, require the model to list “unimplemented items / approximated items” to make implicit failures explicit.
    3. Validate in stages: split a long task into geometry, interaction, and export layers and accept each separately.
    4. Combine with general cloud capabilities: host generated results in object storage, use log services and monitoring alerts to track failure rate and latency, and use a container platform to run batch evaluation tasks.
    5. Build an internal regression set: turn prompts with “verifiable failure” into regression cases and run them automatically when models iterate.

    6. Conclusion

    Whether a lightweight flagship model is usable depends on whether the task can be strictly verified. Using process-verifiable tasks such as geometric construction and animation export as a yardstick, developers can more objectively assess instruction following, long-horizon planning, and engineering completeness, and make more reasonable selection and tuning decisions among cost, latency, and quality.