Lightweight LLM Evaluation: A Practical Guide to HTML Geometry Drawing

    This article presents an open-ended benchmark for evaluating lightweight large language models through HTML-based geometry and animation tasks. Using the construction of a regular heptagon with a two-mark ruler as an example, it examines instruction following, geometric reasoning, frontend implementation, animation state management, output stability, and the difference between achieving the right result and following the required process. It also provides practical recommendations for building reliable model evaluation workflows.

    Lightweight LLM Evaluation: A Practical Guide to HTML Geometry Drawing

    1. Why We Need a New Evaluation Approach

    Large language models are evolving rapidly. Lightweight models, often marketed with suffixes such as “Flash” or “Mini,” are achieving increasingly strong scores on official benchmarks. However, public benchmark results can differ significantly from real-world experience. Many models perform well on standardized multiple-choice tests but struggle with open-ended tasks that combine multi-step reasoning, precise spatial understanding, and software engineering. Subtle failures quickly become visible.

    As a result, the developer community has increasingly adopted “toy but effective” open-ended tasks as practical gatekeeper tests for basic model capability. Prompts involving HTML animation and geometric construction are a representative example. Although these tasks may appear to be simple webpage-generation exercises, they simultaneously test mathematical understanding, coordinate calculation, frontend rendering, state-machine design, and adherence to long chains of instructions. A weakness in any one of these areas can be exposed by the final result.

    2. Designing the Evaluation Task: A Seemingly Simple Drawing Problem

    A good gatekeeper test should meet three criteria:

    • The task description should be easy to understand.
    • The required steps should be explicit.
    • The result should be verifiable.

    The construction of a regular heptagon using a two-mark ruler provides a useful example. The prompt can ask the model to generate an HTML page that completes the following construction:

    1. Draw a square and construct the perpendicular bisector of its bottom edge.
    2. Draw an auxiliary circle centered at the square’s lower-right vertex, using the square’s diagonal as the radius.
    3. Simulate the operation of a “two-mark ruler”: keep the ruler aligned with the lower-left vertex, then slide its first mark along the auxiliary circle until the second mark passes exactly through the perpendicular bisector of the bottom edge.
    4. Complete all conventional straightedge-and-compass steps omitted from the description, such as constructing a perpendicular bisector to determine a circle center. The compass should leave traces only where they are necessary.
    5. Produce the final regular heptagon and provide a feature for exporting the animation as a GIF.

    The trap is that a regular heptagon can be drawn with only a few lines of trigonometric code. However, the prompt explicitly requires the specified classical construction process. The model must understand the geometric constraints at each stage, use an iterative solution—essentially solving a transcendental equation—to determine the correct angle of the two-mark ruler, and present the construction step by step as an animation.

    Any shortcut that produces the correct shape but does not follow the required construction path fails to satisfy the task. This makes the exercise useful for distinguishing genuine capability from superficial result matching.

    3. Experimental Method: Building Test and Control Groups

    A meaningful evaluation should follow the principles of a controlled experiment. The following procedure is recommended:

    • Use a consistent environment: Run every model in the same AI coding tool or conversational interface. Use exactly the same prompt and avoid additional manual guidance or iterative corrections.
    • Create comparison groups: Select the lightweight model being evaluated as the experimental group. Use a higher-tier flagship model from the same provider or a competing provider as the control group, typically one positioned as a “Max”-level model. Add another lightweight model with a similar market position for horizontal comparison.
    • Record metadata: Track reasoning time, output fluency, whether the model becomes stuck in a state where it continues “thinking” without producing an answer, and whether the final code runs successfully on the first attempt.
    • Evaluate two dimensions: Check both whether the result is correct—whether a regular heptagon is produced—and whether the process is correct—whether the construction steps faithfully reproduce the workflow specified in the prompt.

    Time and output stability deserve particular attention. In some observations, lightweight models produced reasoning in a visibly fragmented manner or became difficult to follow. Some spent a long time generating internal reasoning without producing the final response, with the total process taking more than 30 minutes.

    These engineering issues should be included as deductions in the usability evaluation rather than ignored in favor of the final artifact alone.

    4. Interpreting Results: Recognizing “Looks Correct” Failure Modes

    The most valuable findings in an experiment often come from the failure patterns of the comparison models. Consider the behavior of a flagship model. After nearly 20 minutes of generation, it produced a visually complete HTML page with an unmistakable regular heptagon. At first glance, the output appeared to satisfy the requirements.

    A closer code review, however, revealed that the implementation did not match the construction process described in the prompt. The model did not simulate the sliding constraint of the two-mark ruler. Instead, it introduced auxiliary steps that were not part of the task and used a different method to force the desired regular heptagon.

    In other words, it solved a modified version of the problem rather than the problem submitted by the user.

    This type of failure is particularly deceptive because the final rendering looks correct. It reveals an important distinction in model capability: under strict constraints, advanced reasoning is not merely the ability to find a smarter shortcut. It is the ability to follow the instructions precisely even when a simpler alternative is available.

    By comparison, a lightweight model that performed well in the experiment was slower but successfully followed every construction step in the prompt. That level of adherence is unusual among lightweight models and suggests that, in certain constrained tasks, such models may compete with flagship systems.

    5. The Underlying Capability Gap

    Several factors can explain this difference.

    5.1 Depth of Instruction Following

    Flagship models often have stronger problem-solving intuition. However, that intuition can override explicit constraints, leading the model to choose a familiar shortest path. A lightweight model trained with a stronger emphasis on compliance may perform better when it must follow a long sequence of tightly specified instructions.

    5.2 Stability in Long-Chain Reasoning

    The task requires more than ten interdependent geometric and implementation steps. A small coordinate error at one stage can propagate through the entire construction. The ability to preserve a complete and consistent reasoning chain reflects a combination of model architecture, training quality, and the reliability of the generated code.

    5.3 Balancing “Honesty” and Engineering Effort

    Implementing the classical construction faithfully requires considerably more work. The model may need to write iterative root-finding logic, collision or intersection detection, and a step-based animation state machine. Bypassing the constraints and drawing the polygon with trigonometric functions is much easier.

    Choosing between these two paths tests whether the model can correctly infer the user’s actual intent rather than merely optimize for a visually convincing output.

    6. Practical Recommendations and Evaluation Considerations

    The following recommendations can help make this type of evaluation more useful:

    • Build a private gatekeeper-task suite: Rather than relying entirely on public leaderboards, select three to five open-ended tasks that combine mathematical and engineering difficulty. Use them as a private evaluation set for regular regression testing.
    • Be cautious with visually correct results: Review whether the implementation path is consistent with the prompt’s constraints. Code inspection should complement visual inspection.
    • Evaluate the overall user experience: Output speed, streaming stability, single-pass success rate, and reasoning ability are all important. In production, a 30-minute wait can outweigh any quality advantage.
    • Recognize the limitations of HTML tests: These tasks are still somewhat toy-like. They can reveal a model’s baseline capabilities, but they cannot replace systematic evaluations based on real business scenarios.
    • Use general cloud capabilities for automated evaluation: Organizations building an automated evaluation pipeline can combine general-purpose model inference services, object storage, logging, and related cloud capabilities to manage prompts, archive outputs, and compare multiple models in parallel.

    Overall, the capability ceiling of lightweight models is rising quickly. Some products already demonstrate reasoning performance that approaches that of flagship models in specific tasks. For developers, carefully designed drawing problems can provide a more practical view of real model behavior than relying solely on marketing claims or public benchmark scores.