Using Token Log-Probabilities to Detect and Filter LLM Hallucinations in Customer Support
gusto · HR · 2025 · source Agentic: no · promotional bias: low · source-backed · extracted with prompt 0.5.6 (schema v2)
Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.
Problem
Domain: Customer support LLM quality control
Gusto needed a production confidence signal for free-form LLM FAQ answers so it could suppress or route hallucinated, vague, or low-quality customer-support responses.
Constraints:
- LLMs generate text rather than calibrated class labels.
- Incorrect payroll, HR, or benefits guidance can create compliance and customer-trust risk.
- The confidence signal had to work without training another model or adding extra inference passes.
- Thresholds need recalibration when prompts change.
- The approach reduces but does not eliminate bad outputs.
Architecture
Gusto records token log-probabilities from its LLM FAQ service and averages them into a Seq-Logprob confidence score for each generated response. Human support experts label outputs as good or bad, the team correlates those labels with confidence bins, builds precision-recall curves, and uses thresholds to reject poor answers, route low-confidence responses to humans, or collect more information before replying.
Diagram confidence: explicit (topology described by the source).
flowchart LR customer-support-faq-service["Customer support FAQ service"] --> llm-answer-generator["LLM answer generator"] llm-answer-generator --> seq-logprob-scorer["Seq-Logprob scorer"] seq-logprob-scorer --> confidence-monitoring["Confidence monitoring"] human-quality-labels["Human quality labels"] --> confidence-monitoring human-quality-labels --> precision-recall-calibration["Precision-recall calibration"] confidence-monitoring --> precision-recall-calibration precision-recall-calibration --> decision-router["Decision router"] decision-router --> customer-support-faq-service
Components
| Component | Role | Interacts with |
|---|---|---|
Customer support FAQ service |
Receives customer support questions and invokes the LLM answer generator. | LLM answer generator |
LLM answer generator |
Produces support answers and token log-probabilities from internal documentation. | Customer support FAQ service, Seq-Logprob scorer |
Seq-Logprob scorer |
Averages token log-probabilities into a response confidence score. | LLM answer generator, Confidence monitoring |
Human quality labels |
Customer support experts label generated answers as good or bad for calibration. | Confidence monitoring, Precision-recall calibration |
Confidence monitoring |
Tracks confidence distributions and bins response quality. | Seq-Logprob scorer, Human quality labels, Precision-recall calibration |
Precision-recall calibration |
Chooses decision thresholds based on quality and coverage tradeoffs. | Confidence monitoring, Decision router |
Decision router |
Shows high-confidence answers, rejects poor ones, or sends low-confidence outputs to humans. | Precision-recall calibration, Customer support FAQ service |
Data flow
A customer asks a support question, the FAQ LLM generates an answer from internal documentation, and the API returns token log-probabilities. Gusto averages token logprobs into a sequence score, logs it with the response, calibrates confidence against human quality labels, and applies decision boundaries to show, reject, route, or enrich the response.
3 supporting quotes
Why this architecture
Gusto reused token log-probabilities already produced during generation to create a traditional ML-style confidence threshold for LLM text. That made quality gating cheap enough for production and let the team reason about precision/recall instead of treating hallucination risk as unmeasurable.
Models used: OpenAI-style GPT model with token logprobs · Seq-Logprob confidence heuristic
Scale
- The validation experiment used 1,000 support questions.“Gusto conducted an experiment with 1,000 support questions processed through their LLM-based FAQ service.”summary, stated
- The top confidence bin reached 76% accuracy.“the top confidence bin achieved 76% accuracy while the bottom confidence bin achieved only 45% accuracy”summary, stated
- The bottom confidence bin reached 45% accuracy.“the top confidence bin achieved 76% accuracy while the bottom confidence bin achieved only 45% accuracy”summary, stated
- The relative accuracy difference between top and bottom confidence bins was 69%.“a 69% relative difference in accuracy between the most confident and least confident responses”summary, stated
Alternatives considered (roads not taken)
Treat every generated answer as equally trustworthy
Rejected because: Low-confidence responses were substantially more likely to be vague, fabricated, or guideline-breaking.
Use a separate model for confidence estimation
Rejected because: Seq-Logprob is available from generation itself and needs no extra model.
Set thresholds once and leave them fixed
Rejected because: Confidence distributions shift when prompts change.
Patterns
confidence-thresholding (quality control)
Gusto thresholds Seq-Logprob confidence to reject, route, or show generated support responses.
human-in-the-loop-gate (support safety)
Low-confidence responses can be routed to human experts for verification.
eval-driven-development (calibration)
Human labels calibrate confidence bins and precision-recall curves for LLM response quality.
observability-tracing (monitoring)
The system records confidence distributions during normal operation to detect threshold and prompt changes.
Tradeoffs
Precision-recall thresholding
Chose Reject or route some answers based on confidence over Maximize answer coverage at any quality level.
Rationale: Customer support can trade recall for safer, more precise responses.
Use generation by-product as quality signal
Chose Seq-Logprob from existing API outputs over Additional evaluation model calls.
Rationale: It adds quality control with minimal infrastructure and latency overhead.
Gotchas (what bit them)
High-confidence does not mean correct.
Root cause: The best confidence bin still had a substantial residual error rate.
Resolution: Use Seq-Logprob as a filter/routing mechanism, not a guarantee of truth.
Prompt changes invalidate confidence thresholds.
Root cause: Confidence distributions are prompt-sensitive.
Resolution: Recalibrate thresholds whenever prompts evolve.
Logprob access is provider-dependent.
Root cause: Not all LLM providers expose token log-probabilities.
Resolution: Teams without logprob access need semantic entropy, multi-sample, or other confidence methods.
Evaluation
Gusto evaluated Seq-Logprob against 1,000 manually labeled support answers, compared quality by confidence bins, and used the score to build precision-recall curves.
Metrics: 1,000 support questions · 76% top-bin accuracy · 45% bottom-bin accuracy · 69% relative accuracy difference · Precision-recall curves
Outcomes
- Seq-Logprob separated high- and low-quality outputs meaningfully.
- Top confidence-bin answers reached 76% accuracy versus 45% for bottom-bin answers.
- The method enables poor-output rejection, human routing, or information-gathering before response.
- The approach requires ongoing prompt-specific calibration.
The validation experiment used 1,000 generated support answers labeled by customer support experts.