Evaluating Lightweight LLMs with a Compass-and-Straightedge Geometry Task
Evaluating lightweight AI models requires methods beyond standard benchmarks. This article introduces a compass-and-straightedge geometry task designed to test strict instruction following in lightweight models. It details how to write a reproducible specification, common failure types, evaluation metrics, and practical engineering recommendations for implementing these assessments in real-world workflows.
1. Why Evaluate Lightweight Models Separately?
The large language model (LLM) industry is currently divided into two tracks. One consists of flagship models with high parameter scales and inference costs, while the other focuses on lightweight, “flash” tier models characterized by low latency and low cost. For most engineering teams, daily high-frequency calls rely on the latter. Tasks such as customer service Q&A, code completion, content summarization, and AI agent tool calls fall into this category and are highly sensitive to cost and response speed.
The capability boundaries of lightweight models are typically more ambiguous than those of flagship models. Score gaps on public leaderboards might be small, but differences in actual usage can be significant. Relying solely on benchmark scores makes it difficult to determine if a model can handle specific business tasks; teams need an evaluation method closely aligned with real-world tasks.
This article demonstrates this method using a compass-and-straightedge geometry problem. The task has fixed steps, a checkable process, and an easily verifiable result, making it ideal for testing a model’s instruction-following capabilities.
2. Writing the Test as a Reproducible Specification
The original problem requires using an HTML animation to demonstrate constructing a regular heptagon using a “two-marked straightedge” (neusis construction). If this single sentence is handed to the model, different prompt interpretations will lead to inconsistencies, making evaluation results incomparable. Therefore, the problem must be reformulated into a specification before evaluation.
1. Coordinates and Initial Figure
Let square ABCD have a side length of 1, with A at the bottom-left, B at the bottom-right, C at the top-right, and D at the top-left. The perpendicular bisector of the bottom edge AB is the line x = 0.5.
2. Construction Steps (Execute in order, do not substitute)
- Construct square ABCD.
- Construct the perpendicular bisector of edge AB.
- Draw a circle centered at B with a radius equal to the diagonal BD (√2).
- Place one end of the two-marked straightedge against A so that the first marked line P falls on the circle, while the second marked line Q falls on the line x = 0.5.
- Complete the remaining steps using standard compass and straightedge construction, keeping only the necessary compass trajectories.
3. Numerical Convention for the Two-Marked Straightedge
The original problem does not specify the distance between the two marked lines. This article assumes the distance is 1, meaning the length of PQ equals the side length of the square. This is an assumption that the prompt author must confirm.
Under this assumption, let the angle between line AP and the horizontal be θ, and let c = cosθ. The distance from P to A is t = c + √(c² + 1), the distance from Q to A is u = 0.5 / c, and we require u − t = 1. Solving this gives c ≈ 0.2225 and an angle of approximately 77 degrees. If a different spacing is used, it must be re-solved.
4. Allowed Tools and Output
Native HTML, Canvas, or SVG are allowed. Directly calculating the coordinates of the heptagon vertices using trigonometric functions and drawing them is prohibited, as this bypasses the construction process. GIF export functionality must specify resolution and frame rate, such as 800 × 800 pixels at 20 frames per second. These parameters are suggestions, and teams can adjust them, but they should remain consistent across each evaluation.
5. Acceptable vs. Unacceptable Outputs
| Category | Page Behavior | Verdict |
|---|---|---|
| Acceptable Output | Center, radius, movement of marked lines, and intersection with the perpendicular bisector are all visible in the animation; the code reflects these geometric objects | Compliant Process |
| Shortcut Output | The page directly draws seven points and the heptagon; source code contains coordinate formulas like cos(2π/7) | Correct Result, Non-compliant Process |
| Unauthorized Steps Added | Adds auxiliary lines or intermediate steps not requested by the problem | Violates the constraint of not adding steps |
This task tests whether the model strictly executes the given steps. Many models will take shortcuts. Visually, the heptagon may be entirely correct, but the method does not match the problem’s requirements. This type of output—correct result but incorrect process—is exactly the basis for evaluating instruction-following ability.
3. Common Failure Types and Verification Methods
The original author tested several lightweight models in AI coding tools and observed three types of phenomena. Since model versions, parameters, and runtime environments were not recorded at the time, these observations only serve as qualitative clues and should not be taken as statistical conclusions. The table below lists observable signals and verification methods for each type of failure. Teams can verify these in their own environments.
| Failure Type | Observable Signal | Verification Method |
|---|---|---|
| Shortcut Implementation | Page lacks circles, marked lines, and other intermediate objects; source code directly calculates coordinates | Check source code for coordinate formulas; check if geometric objects appear in the animation |
| Intermittent Reasoning | Thinking output pauses intermittently, or long periods of thinking with no main text | Record time to first token and the longest output interval pause; flag if it exceeds threshold |
| Long Task Stall | Generation time significantly increases, no output midway, or falls into a loop | Set a timeout limit; record the number of timeouts and retries |
The original author also observed another scenario: some models completely reproduced every step with a clean animation, but the output speed was slightly slow. Such models need to be differentiated using speed metrics, not just correctness.
The final page might look fine, so verification must check both the result and the process logs.
4. Evaluation Metrics and Scoring Rubric
The table below provides ready-to-use metric definitions. Weights and thresholds are just starting points; teams should adjust them based on business needs.
| Metric | Definition | Weight | Pass Threshold | Record Fields |
|---|---|---|---|---|
| Process Compliance | Scored step-by-step based on the checklist; points deducted for missing steps; shortcut implementation scores 0 | 40% | No less than 85 points | Step number, pass/fail, remarks |
| Instruction Following | Whether steps are unauthorizedly added or replaced | 20% | 0 violations | Violation type, location |
| Result Correctness | Error of center, marked points, and intersections relative to specs in the animation | 15% | Error ≤ 0.5% | Individual error values |
| Reasoning Stability | Longest output pause duration, presence of loops | 15% | Pause ≤ 10 seconds, no loops | Pause duration, loop flag |
| Speed | Time to first token, total time, throughput | 10% | Set by business SLA | Three metric values |
Automated assertions can cover some checks:
- Static Check: Source code should not contain trigonometric expressions that directly generate heptagon vertices. This check only catches obvious shortcuts and cannot cover all bypass methods, so manual spot-checks are still required.
- Geometric Check: Read the center coordinates from animation keyframes; it should be close to point B (1, 0), and the radius should be close to 1.414, with an error not exceeding 0.5%.
- Marked Line Check: The x-coordinate of the second marked point should be 0.5, with an error not exceeding 0.5%.
- Distance Check: The distance between P and Q should be 1, with an error not exceeding 0.5%.
When the numerical conventions of the problem change, assertion parameters must be updated accordingly.
Each model should be tested on at least 5 different problems, repeating each problem 3 times and taking the median. Sampling has randomness, so a single result is insufficient to reflect a model’s level. Each evaluation must record the model name and version, temperature, maximum output length, prompt version, runtime environment, and evaluation date.
To compare quality and cost, you can use the following normalized formula:
UCQ = (Q / Q_ref) ÷ [(C / C_ref + L / L_ref) / 2]
Where Q is the comprehensive quality score, C is the cost per call, L is the end-to-end latency, and the subscript ref indicates the baseline model (it is recommended to choose the flagship model currently used by the team). A UCQ greater than 1 indicates that the model outperforms the baseline in the combined ratio of quality, cost, and latency. This formula assumes equal weight for cost and latency; teams can adjust this based on business needs.
5. Engineering Implementation Recommendations
Scenario matching over leaderboard ranking. High-concurrency, short-context online services are suitable for lightweight models. Complex reasoning and long-chain planning should retain flagship models, with requests distributed via a routing layer. Routing rules can reference the process compliance scores and timeout rates from this evaluation.
Build reusable evaluation assets. Save prompts, raw model outputs, generated HTML files, GIF files, call logs, and scoring rubrics for each evaluation. It is recommended to create directories by “model name/version/date”, store them uniformly in object storage, and integrate call logs into monitoring for easy comparison between new and old versions.
Regularly update evaluation questions. Whenever a primary model is upgraded, or every quarter, replace at least one question that has already been passed by most models. Models iterate quickly, and past trap questions may no longer be effective.
Record all three speed metrics simultaneously. Time to first token determines interactive responsiveness, total time determines task completion time, and throughput determines concurrency capacity. All three should have defined business SLAs and be included as hard metrics for selection.
Risk warning. The test problem in this article only covers the category of geometric construction tasks. A high score does not represent a model’s performance in other domains, nor does it constitute a performance or quality guarantee. Before procurement or deployment, stress testing and gray release verification should be conducted combined with business data.
6. Conclusion
Under this problem and limited sample size, some lightweight models performed close to flagship models in process compliance, but still showed gaps in output speed and long-task stability. This article used only one problem and lacked version and parameter records, so the conclusions should not be directly extrapolated to other tasks. A more reliable approach is to establish continuous evaluation records on your own business tasks using the specifications and metrics provided in this article.
