How Lightweight Large Models Perform on a Geometric Code Generation Test
This article examines how lightweight large language models handle a complex geometric animation code generation task: creating an HTML page that demonstrates the construction of a regular heptagon using a marked ruler (neusis construction). It covers the test setup, single-run observations of a lightweight model versus a large-parameter model, a step-by-step verification methodology, and engineering practices for handling reasoning stalls, deployment, and evaluation reproducibility.
Why Use a Geometric Animation Task for Testing
Lightweight models (such as various Flash-tier models) are increasingly used by teams for everyday development. Their inference costs are low, but the real question teams care about is: how far can they go on complex reasoning and code generation? Common prompts like “write a sorting algorithm” or “generate a simple webpage” no longer differentiate models effectively. This article uses a multi-step geometric animation task as a test, records the observed behavior, and clarifies which conclusions hold and which require more data.
What the Test Task Consists Of
The task requires the model to generate an HTML page that animates the construction of a regular heptagon using a marked ruler. A marked ruler is a straightedge with two marks on it. A regular heptagon cannot be constructed exactly with only a compass and unmarked straightedge; this type of construction requires a marked ruler, known as neusis construction. The model must understand this premise and convert the textual description of geometric steps into coordinate calculations and animation code.
The task has six steps in sequence: take a square and construct the perpendicular bisector of its base; draw circle E centered at the bottom-right vertex E with the diagonal as radius; keep one end of the marked ruler against the bottom-left vertex D and slide the ruler so that the first mark falls on circle E, until the second mark passes through the perpendicular bisector of the base; determine the circle center using standard compass-and-straightedge methods; fill in the omitted construction steps while preserving the motion trajectories of compass-generated points; and finally export a GIF file.
The difficulty is that an error in any single step invalidates the final figure. Evaluation therefore cannot stop at checking whether the page loads; the geometric relationships must be verified step by step.
The original test did not record the square’s side length, coordinate system setup, mark spacing on the ruler, animation frame rate, GIF export library, or browser version. All of these parameters affect the results and should be fixed and documented before reproduction.
How the Two Models Performed
The lightweight model took about 34 minutes for a single run. During the run, its reasoning stalled intermittently, and there was a period with no visible output at all—the model was reasoning internally while appearing silent externally. The final HTML page showed no steps that clearly contradicted the prompt in this inspection, and the GIF export feature worked.
The large-parameter model took about 20 minutes for a single run and produced a page that appeared to work correctly on the surface. After inspecting the rendering and code, we found that some construction steps did not match the prompt. In steps that were hard to implement precisely, the model inserted auxiliary steps not present in the prompt, making the final figure look correct. This “looks right” outcome can mask deficiencies in the model’s geometric reasoning.
These are single-run observations, not statistical conclusions. The versions, parameter sizes, temperature settings, full prompts, and runtime environments of both models still need to be documented. In addition, the criteria for judging “deviation” should be defined in advance.
How to Verify Whether a Model Actually Follows the Steps
The verification process works as follows. First, break the prompt into numbered steps. Second, locate the corresponding code segment for each step in the generated code; steps with no matching code are marked as missing. Third, render the page and capture screenshots or screen recordings, then check the geometric relationships frame by frame. Fourth, classify deviations into three categories—missing, extraneous, and out-of-order—and record them separately. Fifth, run the same prompt at least several times (no fewer than 5 runs recommended), have two scorers grade independently, and jointly review results when their scores diverge significantly.
The goal of this process is to make conclusions verifiable by others, rather than relying on the evaluator’s impressions.
How to Handle Reasoning Stalls in Lightweight Models
First, split the task. Break “construct a regular heptagon with a marked ruler” into three subtasks: compute the key coordinates and output a numerical table; design the animation trajectories based on the coordinates; and implement GIF export. Each subtask should specify its inputs, outputs, and acceptance criteria. For example, the acceptance criterion for the first stage could be: the difference between each key point’s distance to its corresponding circle center and the radius falls within a pre-agreed error tolerance.
Second, monitor streaming output. Use streaming when calling the API, and record the latency of the first token and the time of the last valid output. When no new token arrives for longer than a threshold, abort the request and retry. The threshold should be determined from your own benchmarks rather than copied from others. Retries should be limited to no more than 2 attempts, and the reason for each interruption should be logged for later analysis.
Third, require intermediate state output. Ask the model to list key coordinates, angles, and other intermediate variables in its output. This makes manual verification easier and helps determine whether the model is stuck in a reasoning loop. It increases output length and cost, so there is a trade-off between quality and expense.
Metrics to Watch During Deployment and Scheduling
Complex reasoning tasks consume significant compute resources. For deployment, the inference service can be containerized and run on GPU instances, with elastic scaling based on request queue duration. CPU or GPU utilization alone often fails to reflect real pressure; queue duration and timeout rates are more telling.
Logs should record per-request latency, input and output token counts, retry counts, and interruption reasons. Alerts can be configured on this data—for example, notifying the owner when the timeout rate rises continuously. When choosing a platform, compare GPU models, cold start times, billing methods, and data compliance requirements. This article does not recommend any specific cloud provider.
What This Test Can and Cannot Show
This test can show that, on this particular problem, a certain lightweight model’s single-run result was largely consistent with the prompt. It can also show that a large-parameter model may use extra steps to mask deviations in geometric reasoning—something that requires dedicated checking during evaluation.
This test cannot establish an overall capability ranking between the two model classes, nor can its findings be generalized to other geometry problems or other programming tasks. Results are affected by model version, temperature settings, prompt wording, and runtime environment; the same model may produce different results at different times.
Conclusion
Complex geometric animation tests can expose a model’s weaknesses in multi-step reasoning. In this single-case test, the lightweight model showed good instruction following but took a long time, and its reasoning process was opaque—requiring task decomposition, timeout retries, and intermediate state output to manage. When selecting models, teams should adopt a reproducible evaluation process: record key parameters, run multiple times, and rely on step-by-step manual verification rather than parameter counts or generation speed alone.
