Evaluating Small Models in Context › Worked example: comparing two small systems on a classification task

Michael BrenndoerferDecember 1, 20263 min read
Language AI HandbookAll chapters
Part 43 of 67Small and On-Device Language Models
Chapter 331Evaluating Small Models in Context › Worked example: comparing two small systems on a classification task
Reading section 4 of 8 · Worked example: comparing two small systems on a classification task · 3 minSection 4 of 8 · 3 min

Section 4 of 8 · 3 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

Let us make this concrete with a task that is common in on-device deployments: classifying short support messages into a small set of intent categories. We will compare two hypothetical systems and compute the cost-aware objective by hand, so the mechanics are transparent. (The numbers below are illustrative and constructed to expose tradeoffs; in a real evaluation they would be measured.)

The task is deliberately mundane. Intent classification over a fixed label set is exactly the kind of high-volume, latency-sensitive workload where on-device deployment is attractive, and it is simple enough that the arithmetic of the objective stays visible. The point of the worked example is not the specific numbers but the shape of the reasoning: two systems that are each "good" on some dimensions, a set of constraints that rules one out, and a minimum bar that judges the other on its weakest slice.

The task. Classify each customer message into one of four intents: refund, shipping, technical, or billing. Evaluate two slices, short (up to 60 characters) and long (more than 60). Length is a useful stress variable if the deployment serves both short and long messages.

The two systems:

  • System A: a 7B model, FP16, cloud-hosted, general tokenizer.
  • System B: a 3B model, 4-bit quantized, on-device, domain-adapted tokenizer.

Illustrative quality and cost assumptions:

Illustrative inputs for the hand calculation. Energy covers client inference only and excludes server energy.
MetricSystem A (7B cloud)System B (3B on-device)
Quality short0.910.89
Quality long0.880.79
p50 latency700 ms120 ms
p95 latency1400 ms260 ms
Client inference energy / request charged to the objective0 J (server energy excluded)0.8 J
Privacy posturecloud defaulton-device only
Worst-slice quality0.880.79

System B has lower latency and lower quality in both slices. The gap is 2 percentage points on short inputs (0.91 minus 0.89) and 9 on long inputs (0.88 minus 0.79). Equal weights average these two gaps to 5.5 points. The corresponding mean qualities are 0.895 for A and 0.840 for B. The client energy term charges B for local inference and excludes A's server energy. This boundary cannot establish which system uses less total energy.

  • With only a no-export requirement, A fails and B passes.
  • With only a long-slice quality floor of 0.85, A passes at 0.88 and B fails at 0.79. When both gates apply, neither passes. Improving B on long inputs is one way to try to make it eligible without relaxing the privacy requirement.
  • When both systems pass the declared requirements, compare objective values. At 0.10 per second of p95 latency and 0.05 per joule of client inference energy, the illustrative utility is 0.755 for A and 0.774 for B before gating.

Report each gate separately. If one system qualifies, there is no ranking to break. If no system qualifies, the failed checks tell you what needs to change before considering the objective.

The ranking depends on the requirements and weights. In the hand example, A gives higher quality and B has lower latency. With both deployment gates in place, neither system qualifies.

Comments

Add to the conversation

A question, a correction, or an example from your own work.

No comments yet. Be the first to share your thoughts!

Newsletter

Stay up to date

Get new articles, book updates, and notes on AI and technology.

Unsubscribe at any time. Privacy policy