Skip to main content

Building an LLM Customer Service Evaluation System: From Eval Sets to Bad Case Regression

· 5 min read
Jack Ning
Maintainer of Bytedesk

An LLM-powered customer service bot without an evaluation system is like a patient who never gets checkups — feeling fine does not mean healthy. Worse, every model swap, prompt tweak, or retrieval parameter change leaves nobody sure whether quality improved or regressed. Launching on gut feeling and rolling back on luck is the real state of many teams.

This post is part of an experience-sharing series for AI customer service product managers and developers, drawn from hands-on practice as an intelligent service product manager at a large general e-commerce platform. In this post I want to share how to build an evaluation system for an LLM customer service bot — covering intent recognition, knowledge recall, factual accuracy, multi-turn dialogue, tool calls, task completion, and safety — with offline evaluation, online experiments, and a Bad Case regression mechanism so model quality keeps improving.

The crux is the completeness of the Eval infrastructure and the design of the offline—online—regression loop.

Illustration: Eval sets, bad case regression, and improvement

Two Key Points in Evaluation System Design​

  • Completeness of the evaluation system: capability domains fully covered, with eval sets, methods, and gating standards forming a system.
  • Offline—online—regression loop design: evaluation as a continuously running quality machine, not a one-off exercise.

The Overall Design​

Step 1: Build the eval set (by capability domain)​

CapabilityWhat is evaluatedData source
Intent recognitionClassification accuracy, multi-intent splitting, vague phrasingReal-session annotation + boundary cases
Knowledge recallHit rate, ranking quality, freshness filteringQuestion-canonical knowledge pairs
Factual accuracyAnswer consistency with knowledge/APIs, numeric correctnessQA pairs with ground truth
Multi-turn dialogueSlot filling, topic switching, context correction, interruption recoveryScripted multi-turn cases
Tool callsParameter extraction accuracy, call timing, idempotency and confirmationTool-level cases (sandbox environment)
Task completionEnd-to-end success rate, turns to completionFull-chain scenario cases
SafetyRefusal boundaries, sensitive content, unauthorized operations, prompt-injection attacksRed-team case sets

The eval set combines real online sampling (covering the main scenario distribution) with manually constructed boundary/adversarial cases, and is continuously supplemented from Bad Cases with version management. Real samples alone miss boundaries; constructed cases alone drift from distribution — you need both.

Step 2: Evaluation methods​

  • Cases with standard answers use automated comparison; open-ended answers use a three-layer structure: rule checks + LLM-as-Judge + human sampling to calibrate the judge.
  • Critical business numbers always go through rule checks, never the judge model — judges err, but rules never mis-multiply 19.9 by 3.

Step 3: Offline evaluation + online experiments​

  • Offline: every change to model, prompt, or retrieval runs the full eval set; core metrics below bar means no release.
  • Online: small-traffic A/B observing real resolution rate, repeat-contact rate, human transfer rate, and complaint rate. Offline metrics gate entry, never final conclusions — every team has war stories of offline gains and online regressions.

Step 4: Bad Case regression mechanism​

  • Online Bad Cases are auto-attributed (retrieval/generation/tool/process) → after the fix, the case and its variants join the regression set → every change verifies historical Bad Cases do not recur. A fixed bug that returns damages trust more than the first occurrence.
  • Build a Bad Case dashboard: trend statistics by scenario, attribution, and severity to guide optimization priorities. The dashboard turns "how many pits remain" from a feeling into a number.

Two insights worth keeping​

The eval set is an "asset", not a one-time task: versioned, continuously growing, and looped with online Bad Cases. Looking back a year later, the scale and quality of the eval set almost cap the team's iteration speed.

"Offline evaluation is the admission gate; online experiments are the final judge" — neither can be omitted. Trusting only offline invites score-gaming; trusting only online sacrifices iteration efficiency.

How This Maps to Bytedesk​

Bytedesk, the open-source AI customer service system (GitHub, site), provides the data and engineering foundation for this loop: session statistics and quality inspection modules support real-session sampling and manual review; AI and human sessions are counted separately for effect comparison; knowledge base and RAG QA pairs serve as eval-set material; and multi-model access makes "swap the model, rerun the eval" a configuration-level operation. Bad Case dashboards and automated attribution are advanced builds extendable on Bytedesk's open statistics APIs and quality-inspection workflows.

Key Takeaways​

  • Build the eval set across seven capability domains: intent, recall, facts, multi-turn, tools, task completion, and safety — mixing real sampling with adversarial cases.
  • Three evaluation layers: rule checks, LLM judge, human calibration; critical numbers always via rules.
  • Offline is the gate; online is the judge — both are indispensable.
  • Bad Cases flow through attribute → fix → regression set → no recurrence, with a dashboard for prioritization.
  • The eval set is a growing asset whose quality caps the team's iteration speed.