Loading
Skip to case study

LLM evaluation case study

Telecom Email Classification & Evaluation

Two LLMs sorted 100 synthetic customer emails into the right category every time. They differed on the harder call: which customers a person should see before anything happens. That’s where the engineering lessons are.

Type
Independent project
Data
100 synthetic emails
Prototype
Python, 31 offline tests
100%category accuracy for both models, on these 100 synthetic emails
2 of 21escalations missed by GPT-6 Luna
0 of 21missed by Claude Haiku 5.5, which raised 2 unnecessary ones
$0.022for all 200 API calls, with 0 invalid answers

The problem

Customer emails arrive as unstructured text and need to reach the right team: billing, technical support or general enquiries. Some shouldn’t be handled automatically at all. The model has to escalate an email to a person if any of five written rules applies:

  1. Financial hardship
  2. Legal, credit or privacy risk
  3. A complaint about staff
  4. A customer about to leave
  5. A dispute over $100

The two decisions have different stakes. A wrong category costs a transfer between teams. A missed escalation sends a vulnerable or angry customer an automated reply, so for escalation recall matters most.

The approach

A hundred labelled synthetic emails, the original 60 and 40 harder ones, and one shared prompt and JSON schema go to two models, an OpenAI model and an Anthropic model, which are the only thing that differs. Every response is checked twice, by the provider’s schema and again locally. Valid answers and errors are both saved, one results file per dataset, then scored for category accuracy, precision and recall, escalation precision and recall, latency and cost per 1,000 emails.
The model is the only thing that changes between the two runs. Open full size
Datasets
The original 60 emails, 20 per category, plus 40 harder ones, each labelled with its category and whether to escalate.
Shared prompt
Category definitions, a tie-break rule for mixed requests and the five escalation rules.
Validation
Each provider’s structured-output feature constrains the answer to the schema; my code then checks it again.
Metrics
Category accuracy, escalation precision and recall, latency, and cost from measured tokens.

Example input and expected output

Email 3 Roaming charges from Bali trip

I was in Bali for a week and came home to a bill with $240 in international roaming charges. Before I left I added the $10/day travel pass in the app, so I don’t understand why I’ve been charged per MB. Please review these charges.

{
  "category": "billing",
  "escalate_to_human": true,
  "reasoning": "Customer disputes $240 in roaming charges, over the $100 threshold."
}

The answer this email’s labels expect, not a model’s output. Every answer must match this shape, or it’s recorded as an error.

Key decisions

The model is the only variable

Both models get the same prompt, emails and schema, and list at the same price per token. The trade-off: neither prompt is tuned to its model.

Checked twice, never guessed

Invalid output is saved as an error and counted wrong, not repaired. The trade-off: an answer can be valid and still wrong, as email 63 shows.

Labels before results

The 40 harder emails and their labels were committed to git before any model saw them, so the labels couldn’t be bent to fit the results.

The results

Each model ran once on the original 60 emails, then on 40 harder ones: indirect wording, several requests in one email, forwarded threads, slang, all caps, non-native English, amounts either side of $100 and three prompt-injection attempts. All of it is synthetic.

All 100 emails, one run per model
MetricGPT-6 LunaClaude Haiku 5.5
Category accuracy100% (100/100)100% (100/100)
Escalation recall90.5% (19/21)100% (21/21)
Escalation precision95.0% (19/20)91.3% (21/23)
Missed escalations20
Unnecessary escalations12
Invalid responses00
Median latency1.66 s1.48 s
Cost per 1,000 emails$0.081$0.141
Results by dataset
Each dataset, one run per model
MetricGPT-6 LunaClaude Haiku 5.5
Original 60 emails · 8 should escalate
Category accuracy100%100%
Escalation recall87.5%100%
Escalation precision100%88.9%
Median latency1.63 s1.55 s
Cost per 1,000 emails$0.080$0.141
Harder 40 emails · 13 should escalate
Category accuracy100%100%
Escalation recall92.3%100%
Escalation precision92.3%92.9%
Median latency1.74 s1.39 s
Cost per 1,000 emails$0.083$0.141

What the results show

  • Escalation was the only place the models differed. Both got every category right.
  • Their mistakes lean in opposite directions: GPT-6 Luna applied the rules literally and missed cases; Claude Haiku 5.5 was cautious and over-escalated.
  • Both followed their instructions on the three prompt-injection emails tested. Three cases don’t show general resistance.

What they don’t

  • Real-world accuracy. The emails are synthetic, cleaner than real mail, drafted with help from a Claude model (which could favour Claude) and labelled by one person: me.
  • Whether the escalation gap is real. With 21 escalations, one email moves recall by about 5 points.
  • Variation between runs. Each dataset ran once per model.

The surprising mistake

Email 63 disputes two charges totalling $100.50, just over the $100 rule. GPT-6 Luna’s answer passed every check, and still contradicted itself.

Email 63 Calls I never made

There are two charges on my bill for calls to premium 1900 numbers, one for $60.25 and one for $40.25. Nobody in my house made these calls. I’d like both charges refunded.

{
  "category": "billing",
  "escalate_to_human": false,
  "reasoning": "The customer wants $100.50 refunded for disputed call charges, so this is billing and exceeds the $100 escalation threshold."
}
GPT-6 Luna’s actual output. The decision says don’t escalate; the reasoning says the threshold is exceeded. Claude Haiku 5.5 escalated the same email.

Every mistake

Every mistake either model made, across both datasets
EmailThe caseGPT-6 LunaClaude Haiku 5.5
20$38 a month since June: over $100 is implied, never statedMissed escalationCorrect
13$4.99 a week in premium SMS chargesCorrectUnnecessary escalation: “may exceed $100 over time”
63Two charges totalling $100.50Missed escalation, against its own reasoningCorrect
93A bereaved customer closing a parent’s account; no rule appliesUnnecessary escalationUnnecessary escalation

Emails 13 and 20 trace back to the $100 rule itself: it doesn’t say whether it means the amount charged so far or what the total could grow to. Email 93 is a gap in the rules. Escalating it is arguably the right instinct, but it means behaviour isn’t fully governed by the written rules.

The model choice

Estimated API cost, from measured tokens at list prices
ModelTokens per email (in / out)Per million emails
GPT-6 Luna497 / 63about $81
Claude Haiku 5.5945 / 93about $141

Both models list at the same price per token, but Claude Haiku 5.5 used about 1.9 times the input tokens and wrote longer reasoning than asked. That makes it about $60 more per million emails. The figure is API spend extrapolated from this run, not the cost of a reviewer’s time or of a missed escalation; I haven’t put a value on either, and a real team would need to.

What it taught me

Rules need to be precise

One loosely worded rule, “a dispute over $100”, caused both mistakes on the original set. The model can only be as consistent as the policy it’s given.

Evaluation data must be representative

Synthetic emails labelled by one person found no category mistakes. That says more about the data than about the models.

Know which error costs more

The models failed in opposite directions. Choosing between them means deciding whether a false negative or a false positive hurts the business more.

Keep a person where mistakes matter

Valid output can still be wrong. Where a wrong answer reaches a vulnerable customer, a person should check before anything is automated.

Before real customers

Built: the evaluation

  • Python and the official OpenAI and Anthropic SDKs, no framework
  • 100 labelled synthetic emails in two datasets
  • One shared prompt and JSON schema, validated twice
  • Saved results, re-scored without new API calls
  • A report of every mistake and disagreement
  • 31 offline tests with mocked API responses

Proposed before production

  • Clarify the $100 rule, including how recurring charges add up
  • Re-test emails 13, 20, 63 and 93, and test prompt changes on fresh emails
  • Test reasoning-before-decision; adopt it only if it reduces contradictions
  • Evaluate on a few hundred real, anonymised emails labelled by support staff
  • Start in shadow mode: the model suggests, staff decide
  • Mask personal details, and monitor missed escalations, errors, latency and cost