Evaluating Lightweight Flagship Models: From Complex Instructions to Web Generation
A practical framework for evaluating lightweight AI models through complex browser-based tasks, using animated geometric construction as a benchmark. The article examines instruction following, mathematical-to-code translation, animation, interaction, self-checking, development efficiency, and the trade-offs between speed and deliverable quality.
Lightweight large language models have advanced rapidly in recent years. Compared with early lightweight models that were mainly limited to simple question answering and code completion, newer models are beginning to handle complex, multi-step tasks such as generating complete webpages, implementing interactive animations, performing geometric reasoning, writing executable programs, and maintaining stable objectives across longer contexts.
However, a model’s capabilities cannot be judged by a few conventional questions alone. Many models perform similarly on basic code generation, summarization, and general knowledge tasks. The differences become much clearer when they face tasks with complex rules, strict procedures, and visual outputs.
Web generation is a particularly useful example. A model must understand natural language, translate mathematical concepts into geometric constructions, map those constructions to executable browser code, and then handle animation, trajectories, and export functions. This is closer to real software development than to simple code completion.
1. Why Complex Web Tasks Are Useful for Model Evaluation
A high-quality web generation task often combines several requirements:
Understanding the objective
The model must understand what the page is ultimately expected to show, rather than focusing only on keywords such as “draw a shape” or “create an animation.”Following prescribed steps
If the task specifies a particular construction order, auxiliary lines, or movement path, the model should not replace the process with a different algorithm simply to obtain the final shape.Converting mathematics into code
Geometric constructions must be represented as computable objects such as coordinates, vectors, arcs, intersections, and line segments.Handling dynamic processes
The animation should show more than the final result. It should demonstrate how key points move, when certain lines appear, and which trajectories should remain visible.Implementing interactive features
Typical requirements include play, pause, reset, speed control, and exporting the animation as an animated image.
These tasks can evaluate a model’s reasoning, instruction-following, programming, and self-checking abilities at the same time. Compared with checking whether a code snippet runs, they provide a more realistic indication of whether the model understands the problem.
2. Benchmark Task: Simulating Complex Geometric Construction in a Webpage
A benchmark can use the following requirements:
Create a webpage that runs directly in a browser and demonstrates the construction of a regular heptagon using a two-mark ruler.
First draw a square and construct the perpendicular bisector of its bottom edge. Then draw a circle centered at a specified vertex, using the square’s diagonal as the radius. Next, simulate moving the two-mark ruler from the specified vertex so that its first mark lies on the circle and its second mark passes through the perpendicular bisector of the bottom edge. Complete the remaining straightedge-and-compass construction steps to determine the vertices of a regular heptagon.
The page must display the construction as an animation, preserve the compass trajectory only during the necessary stages, and provide controls for playing, pausing, resetting, and exporting the animation as an animated image.
The challenge is not simply to draw a heptagon. The final shape must result from the specified geometric procedure, and the webpage must make the intermediate process visible.
If a model directly calculates the seven vertices with a regular-polygon formula and then draws the heptagon, the visual result may look correct. However, the implementation does not satisfy the task because it bypasses the required construction process, including the two-mark ruler movement, auxiliary lines, and necessary trajectory recording.
3. Evaluation Focus: A Correct Result Does Not Guarantee a Correct Process
One of the most common failures in practical testing is a result that appears correct even though the method completely violates the requirements.
For example, a model might use the following approach:
const sides = 7;const radius = 160;const centerX = 300;const centerY = 240;for (let i = 0; i < sides; i++) {const angle = -Math.PI / 2 + i * 2 * Math.PI / sides;points.push({x: centerX + radius * Math.cos(angle),y: centerY + radius * Math.sin(angle)});}
This code can directly generate a regular heptagon, but it does not represent:
- The initial construction of the square;
- The perpendicular bisector of the bottom edge;
- The specified circle;
- The movement of the two-mark ruler;
- The determination of auxiliary points;
- The selective preservation of the compass trajectory;
- The derivation of the heptagon from the construction process.
If the goal is only to “generate a regular heptagon,” this approach may be sufficient. If the goal is to “implement the construction according to a specified geometric procedure,” it is a task deviation.
Evaluation should therefore separate the result into two dimensions.
1. Geometric correctness
Check whether the final figure has:
- The correct number of sides;
- Reasonable vertex distribution;
- Approximately equal side lengths;
- Generally consistent interior angles;
- No obvious breaks or unintended overlaps.
2. Process compliance
Check whether the page actually performs the required procedure:
- Are the construction steps shown in the specified order?
- Are the necessary auxiliary lines present?
- Is the ruler movement simulated correctly?
- Is the trajectory displayed only during the required stages?
- Does the implementation avoid unauthorized shortcuts?
- Does it explain the geometric purpose of each step?
A task should be considered complete only when both dimensions pass.
4. Evaluation Focus: Stability Across a Long Task Chain
Complex web generation typically involves multiple stages:
- Interpreting the geometric problem;
- Defining the coordinate system;
- Designing data structures;
- Writing drawing functions;
- Implementing the animation state machine;
- Adding interaction controls;
- Implementing export functionality;
- Checking browser compatibility;
- Refining the visual presentation;
- Fixing runtime errors.
An error at any stage can affect the final result. For example, a model may calculate the geometric points correctly but fail to update the state during animation. It may draw the static figure successfully but fail to record the trajectory, or implement an export button that produces an empty canvas.
Strong lightweight models generally divide the task into independent modules instead of generating one large, difficult-to-maintain block of code. A more practical structure could be:
geometry/point calculationline intersectioncircle constructionrenderer/draw pointsdraw linesdraw arcsdraw labelsanimation/timelinestate transitiontrajectory recordinginteraction/playpauseresetspeed controlexport
This layered design has two advantages. First, errors are easier to locate. Second, the model can validate each module incrementally instead of discovering after code generation that the entire page does not work.
5. Core Strengths of Lightweight Models
Complex tasks of this kind can reveal several potential strengths of lightweight flagship models.
1. Detailed instruction following
Many models can understand the final objective but overlook constraints. If a lightweight model consistently remembers that the task must follow a specified construction sequence, it demonstrates stronger context management and instruction prioritization.
This is particularly important in enterprise development. Real requirements often contain many constraints, such as compatibility with existing interfaces, restrictions on data-structure changes, preservation of log formats, or the use of a specific rendering method. Respecting these constraints can matter more than generating code in isolation.
2. Cross-domain translation
The task combines geometry, frontend development, animation design, and file export. The model must convert an abstract description into executable logic. This is closer to practical engineering work than ordinary code completion.
3. Handling longer reasoning chains
A longer processing time does not necessarily mean poor efficiency in a complex task. If a model can continue progressing, inspect intermediate results, and correct problems when they are found, the additional time may result in a more complete deliverable.
4. Self-checking
High-quality output often includes checks such as:
- Whether the page can be opened directly;
- Whether any variables are undefined;
- Whether animation controls work;
- Whether trajectories appear at the correct stages;
- Whether the drawing exceeds the canvas;
- Whether the exported file contains complete frames;
- Whether there are obvious compatibility issues across browsers.
If a model only generates code without validating it, the result is likely to remain at the level of a demonstration rather than a reliable implementation.
6. Performance Should Not Be Judged by Output Speed Alone
Lightweight models typically emphasize response speed and resource efficiency. However, speed is not the only metric for complex tasks. At least five dimensions should be considered:
| Evaluation dimension | What to examine |
|---|---|
| Correctness | Whether the final result meets the task objective |
| Compliance | Whether the prescribed steps are followed precisely |
| Completeness | Whether all required features are implemented |
| Stability | Whether the model can continue producing output without frequent interruptions |
| Maintainability | Whether the code is clear and easy to modify |
In development practice, a model that finishes in a few minutes but frequently omits critical features may be less valuable than one that takes longer but delivers a complete result. For complex requirements, the cost of rework is often much higher than the time saved during initial generation.
At the same time, remaining in a reasoning phase for a long period without producing useful output may indicate weak planning. The ideal behavior is not simply to be fast or slow, but to:
- Present an implementation plan first;
- Complete the code in stages;
- Provide verifiable intermediate results;
- Clearly identify uncertain points;
- Finish with instructions for running and testing the implementation.
7. Building a More Reliable Model Testing Process
To reduce the impact of any single example, organizations can establish a standardized evaluation process.
Step 1: Prepare multiple task categories
Do not test only webpage animation. Other useful categories include:
- Multi-step data processing;
- Complex form validation;
- Interactive charts;
- Algorithm visualization;
- File parsing and export;
- Multi-module frontend pages;
- Constrained API calls.
Step 2: Standardize input conditions
Use a consistent browser environment, screen size, execution time, and prompt whenever possible. This reduces the influence of environmental differences.
Step 3: Record the complete process
In addition to saving the final code, record:
- Time to the first response;
- Total generation time;
- Whether interruptions occurred;
- Whether empty output was produced;
- Whether manual fixes were required;
- The time required for fixes;
- Whether the final code ran directly.
Step 4: Separate automated and human evaluation
Automated checks are suitable for determining whether the page runs, controls exist, and files are generated. Human evaluation is more appropriate for judging whether the process meets the requirements, whether the visual result is reasonable, and whether the code structure is clear.
Step 5: Calculate the total cost
Model evaluation should account not only for invocation costs but also for human review, debugging, and maintenance. An initial result may appear impressive but still be inefficient if developers must spend significant time correcting hidden logic problems.
8. Practical Implications for Developers
When using a lightweight model to generate complex code, developers should avoid submitting every requirement at once and simply waiting for the final result. A more effective collaboration pattern is:
- Ask the model to interpret the requirements and produce an implementation plan;
- Confirm the mathematical or business logic separately;
- Generate the core algorithm;
- Build the static page;
- Add animation, interaction, and export features;
- Request a validation method at every stage.
Prompts should also clearly distinguish mandatory constraints from implementation details that the model may decide independently. For example:
The implementation must follow the specified construction order;do not replace the construction process with a regular-polygon vertex formula;each animation stage must have an explicit state;preserve only the necessary trajectories;the code must run directly in a browser;if a mathematical definition is unclear, state the assumptions first.
This reduces unnecessary improvisation and makes the output easier to review.
Conclusion
Complex web generation tasks show that the competition among lightweight models is shifting from “Can the model write code?” to “Can it understand complex requirements and deliver a complete, stable, and verifiable result?”
A valuable lightweight model should not focus only on fast responses. It should also provide strong task decomposition, constraint following, cross-domain translation, and self-checking capabilities.
For developers and enterprise users, model evaluation should go beyond whether the final page looks attractive. It should also examine whether the implementation process follows the requirements, whether the code is maintainable, and how much manual rework is needed afterward.
A comprehensive evaluation framework that includes correctness, completeness, compliance, stability, and maintenance cost provides a more accurate way to determine whether a model is suitable for real-world development.
