Can Lightweight LLMs Rival Flagship Models? An HTML Drawing Task Investigation

    As traditional LLM benchmarks saturate, composite generation tasks like HTML animation generation better reveal true model capabilities. This article explores whether lightweight LLMs can rival flagship models by testing them on a complex HTML geometric drawing task (constructing a regular heptagon using a marked ruler). The results indicate that while new lightweight models exhibit instruction-following and reasoning capabilities approaching those of flagship models, they still fall short in inference speed and output stability. We propose a dual-dimensional evaluation methodology that distinguishes "capability" from "experience" and provide practical recommendations for model selection, deployment, and automated validation.

    1. Why Use HTML Generation Tasks to Evaluate LLM Capabilities?

    In recent years, the benchmark scores of large language models have increasingly converged, making it difficult to differentiate performance through traditional Q&A or code completion tasks. In this context, “composite generation tasks” are much better at exposing a model’s true capabilities, with HTML animation generation being one of the most representative examples.

    The value of such tasks lies in their simultaneous evaluation of multiple capability dimensions:

    1. Semantic Understanding and Instruction Following: Task descriptions often contain multi-step procedures. The model must break down and strictly execute these steps without taking creative liberties.
    2. Geometric and Spatial Reasoning: These tasks involve coordinate systems, angles, and trajectory calculations, testing the model’s internal modeling of mathematical concepts.
    3. Frontend Engineering Skills: The model must output structurally complete HTML/CSS/JavaScript code, including animation timing control and the use of drawing APIs.
    4. Verifiability of Visual Results: Whether the generated output is correct can be judged with the naked eye, avoiding the ambiguity of subjective scoring.

    A typical “high-threshold” test prompt looks like this:

    1. Draw an HTML webpage that implements the construction of a regular heptagon using a marked ruler (neusis construction):
    2. 1. Take a square and draw the perpendicular bisector of its base;
    3. 2. Draw circle E centered at the bottom-right vertex E, with the diagonal as the radius;
    4. 3. Using the marked ruler, keep it flush against the bottom-left vertex D, move the first mark along circle E,
    5. until the second mark passes through the perpendicular bisector of the base;
    6. 4. Complete all omitted compass-and-straightedge construction steps to finish the regular heptagon;
    7. 5. Using a compass will generate the trajectory of the moving point, but traces should only be left where necessary;
    8. 6. Finally, add a feature to export the animation as a GIF.

    This task may seem like a toy-level requirement to “draw an animation,” but it actually hides multiple traps. Constructing a heptagon with a marked ruler is a non-trivial, classic geometric construction with strict dependencies between steps. In practical tests, many models positioned as flagships also fail here. The most typical failure mode is that the model abandons the construction method specified in the prompt, invents non-existent steps, and forcefully pieces together a “seemingly correct regular heptagon.” The result might be correct, but the process is entirely wrong—a classic sign of weak instruction-following capability.

    2. The “Unexpected” Performance of Lightweight Models

    According to conventional industry wisdom, lightweight models should be significantly weaker than flagship models in complex reasoning tasks. However, in the above test, the performance of some new-generation lightweight models broke this assumption. By comparing the results of the experimental group (a certain lightweight model) with the control models one by one, we can summarize the following observations:

    1. Completeness of Instruction Following

    The page generated by the experimental model completely followed all the constraints of the prompt: the construction sequence, trace-leaving rules, and GIF export function were all correctly implemented. More importantly, its drawing logic corresponded exactly to the steps described in the prompt, without secretly swapping methods. This shows that lightweight models already possess capabilities approaching those of flagship models when it comes to “reading and strictly executing procedures.”

    2. Stability Issues in the Thinking Process

    However, the test also exposed common shortcomings of lightweight models:

    • Choppy Thinking Output: The reasoning phase exhibits a noticeable stuttering sensation, rather than the common continuous streaming output.
    • “Thinking Without Outputting” Phenomenon: The model stays in the internal reasoning stage for a long time, delaying the production of the final result.
    • Long End-to-End Latency: A single generation takes tens of minutes, whereas some flagship models complete the same task in about twenty minutes.

    In other words, lightweight models can already wrestle with flagships regarding their “capability ceiling,” but there is still a significant gap in “engineering experience” (inference speed, streaming stability).

    3. Deducing Model Evaluation Methodology from Test Results

    The value of this comparative experiment lies not in a single result itself, but in the reusable evaluation framework it provides:

    1. Replace “Result-Verifiable” Tasks with “Process-Verifiable” Tasks

    Traditional evaluations only look at the final answer, making it easy for models to scrape by through “guessing the result.” A better approach is to require the model to output complete intermediate steps and verify whether each step aligns with the prompt’s constraints. Automated validation can be organized using pseudo-code like the following:

    1. def evaluate(model_output, spec):
    2. steps = parse_steps(model_output) # Extract construction steps
    3. if not match_sequence(steps, spec.steps):
    4. return "FAIL: Steps deviate from prompt requirements"
    5. if not geometry_consistent(steps, spec.target):
    6. return "FAIL: Geometric result is incorrect"
    7. return "PASS"

    2. Distinguish “Capability Score” from “Experience Score”

    It is recommended to split the evaluation into two independent dimensions:

    • Capability Score: Correctness, degree of instruction following, success rate of complex reasoning.
    • Experience Score: First-token latency, streaming stability, end-to-end latency, failure retry rate.

    Lightweight models often score close to flagships in capability but lag in experience. Hybrid deployment (routing simple requests to lightweight models and complex requests to flagship models) is a common architectural practice based on this understanding.

    3. Beware of “Pseudo-Passes” that Appear to Meet Requirements

    The page provided by the control model was visually flawless, but its implementation path deviated from the prompt’s settings. This serves as a reminder for all teams relying on model-generated code: automated acceptance must include process validation. Approving based solely on passing end-to-end test cases can bury hidden risks.

    4. Recommendations for Model Selection and Deployment

    Based on the above test observations, here are a few pragmatic suggestions for developers and enterprise users:

    1. Do not presuppose capability ceilings based on parameter count or model tier. Lightweight models may exceed expectations on specific complex tasks. You should test them on your own task sets.
    2. Build your own “high-threshold” test sets. Borrowing from composite tasks like HTML drawing, designing test cases that contain multi-step constraints and are process-verifiable better reflects true performance than running generic leaderboards.
    3. Include inference latency in your selection metrics. When capabilities are similar, streaming stability and response speed are often the key factors determining the online experience.
    4. Adopt a tiered routing strategy. Assign high-frequency, simple requests to lightweight models to control costs, and assign low-frequency, complex tasks to flagship models to maintain a high quality ceiling.
    5. If using cloud-based model services, you can leverage object storage to host generated static pages and GIF artifacts, and use logging services with monitoring alerts to track the latency distribution of generation tasks, forming a complete evaluation loop.

    5. Conclusion

    The boundary between lightweight models and flagship models is becoming blurred. In terms of “hard capabilities” like instruction following and complex reasoning, new-generation lightweight models can already compete head-to-head with flagships. The gap is mainly reflected in “soft experiences” such as inference speed and output stability. For developers, rather than chasing model tiers, it is better to establish an evaluation system centered on process validation and featuring parallel capability and experience dimensions—this is the correct approach for the engineering deployment of large language models.