Building a quick LLM answer-monitoring system

29 Sep 2025

Problem

A chatbot built on an LLM, with or without RAG, can fall for a user's provocation, answer from outdated knowledge, ignore the retrieved documents or break the expected tone. In legal or medical topics almost any such answer is costly. Business metrics and user ratings arrive slowly, and few users rate answers. Public benchmarks are mostly English and do not test the product's own tasks.

Example from the article: a model trained when the male retirement age was 60 still answers that way after it became 63.

Solution in brief

Define three criteria: the answer matches the question, the answer matches the context, and the tone is acceptable. For each, train a lightweight validator that scores answers on the fly in production, and build an offline benchmark from cheap domain data (support chats, FAQ, school self-check questions, Telegram posts, GPT labels). The context criterion is solved as token-level fact tagging, which yields precision and recall.

Questions this case answers
  • How to monitor the answers of a generative model in production with cheap per-answer scores when business metrics and user ratings arrive too slowly
  • How to measure how much a generated answer relies on supplied context, in precision and recall terms, without human grading of every answer
  • How to check LLM answers in a RAG chatbot before they reach the user?
  • How to measure whether an answer sticks to the retrieved context and how much of it is hallucinated?

Tools and methods

  • NLI-style question-answer classifier — binary "is this an answer to this question" score for answer-to-question match
  • Multilabel tone-of-voice classifier — red flags such as profanity, politics, toxicity, structure
  • Token-span fact tagger (NER) — marks answer tokens that carry each context fact
  • FactScore and FacTool ideas — atomic-fact checks the context criterion builds on
  • Benchmark data — FAQ, chats and articles, labels made by GPT, a part checked by annotators
Continue reading — it's free

Google or a one-time email code. No password.