Week 9 Self-Paced Module: RAG Evaluation in Depth — RAGAS and Production Monitoring
CSIC30216 · Fall 2026
Overview
This week's lab measured a small RAG system by hand: 21 questions, retrieval scores you could compute yourself, and faithfulness checked by reading the answers. That works for a class exercise. This module is about what happens at a different scale — thousands of questions, no time to read every answer, and a system that keeps changing after you ship it. It covers how retrieval and generation checks are automated (RAGAS-style metrics), what those automated checks get wrong, and how to keep watching a RAG system once it is live.
Why This Matters
Every automated check in this module exists to avoid reading every answer yourself, and every one of them has a catch — learning the catches is the point. Splitting retrieval from generation tells you which half of the pipeline to fix when an answer is wrong. An LLM-as-a-judge score can agree with humans most of the time on one benchmark and still carry known biases, so it has to be calibrated against a labelled sample before you trust it — the same instinct behind the lab's faithfulness spot-check. And because a RAG system can break without a single line of code changing — a document gets added, removed, or superseded — the habit of re-running your test set after the corpus changes matters as much as the first check you ever wrote.
Format and Timing
- Framing video (posted on E3).
- Required reading — three items: the RAGAS paper, three RAGAS documentation pages, and a practitioner FAQ on AI evals. Linked below.
- Multiple choice questions (單一選擇題) — four questions on E3.
- Total estimated time: ~60 minutes
- Complete by Sunday, November 8, 23:59.
What You'll Learn
- Two evaluation layers: retrieval and generation — did the system fetch the right passages, and did the model use them faithfully? Keeping the two apart tells you whether to fix the chunker/retriever or the prompt when an answer is wrong.
- Context precision, and how it differs from the lab — RAGAS's context precision is rank-aware (it averages precision@k over the ranked list, so position matters), while the lab's precision@k was unranked. The lab also decided relevance with a gold evidence phrase; some RAGAS variants ask a language model to judge each chunk instead.
- Faithfulness is not correctness — faithfulness is the share of claims in a response that can be inferred from the retrieved context. An answer that accurately quotes a superseded or wrong chunk still scores a perfect faithfulness, which is exactly the kind of failure the lab caught by checking a chunk's status and date.
- Answer (response) relevancy — whether the response addresses the question that was asked, computed by generating candidate questions from the answer and comparing them with the original by embedding similarity. It does not check factual accuracy, so a faithful answer can still be irrelevant, and a relevant answer can still be unfaithful.
- LLM-as-a-judge: useful, but not free of bias — one well-known study found about 85% agreement with human experts on a chat benchmark, alongside position, verbosity and self-enhancement biases. A judge is a measuring instrument: calibrate it against human labels on your own task before you trust its scores.
- Building a good test set — grow the lab's 21 designed questions with real queries users actually asked, especially ones the system got wrong, and keep deliberately awkward cases (out-of-corpus, outdated documents, adversarial text) on purpose. Keep a fixed core for comparable scores over time, plus a held-out part you don't tune on.
- Offline checks vs. online monitoring — a fixed test set run on every change catches regressions in cases you already thought of; monitoring live traffic is how the failure modes nobody anticipated reach that test set in the first place. Both are needed.
- What to log and watch in production — one trace per request (question, retrieved chunk ids and scores, prompt version, model, answer, citations, latency, cost, feedback), sampled with some random traces alongside targeted ones, and a re-check of your test set whenever the corpus, embedding model, or model itself changes.
Required Materials
- Framing video: posted on E3 under Week 9 Self-Paced Modules.
- Reading: Es, James, Espinosa-Anke and Schockaert (2023), “Ragas: Automated Evaluation of Retrieval Augmented Generation” — read the abstract, the introduction, and the sections that define the metrics. You can skim the experiments.
- Reading: RAGAS documentation, three metric pages — “Faithfulness”, “Context Precision”, and “Response (Answer) Relevancy”. For each, read the definition, how the score is computed, the required inputs, and the worked examples.
- Reading: Hamel Husain, “Frequently Asked Questions (And Answers) About AI Evals” — read: How do I know if I can trust my automated eval?; What should I do when I can't get my LLM judge to agree with human reviewers?; How are evaluations used differently in CI/CD vs. monitoring production?; How can I efficiently sample production traces for review?; and Should I use “ready-to-use” evaluation metrics?
- Multiple choice questions: posted on E3 under Week 9 Self-Paced Module Response.
Optional Materials
If you want to go deeper on any of these topics (not required, but helpful if you're curious):
- Zheng et al. (2023), “Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena” — the study behind the LLM-as-a-judge discussion. Read the abstract and the section on limitations of LLM-as-a-judge.
- Langfuse, “RAG observability and evals” (October 2025) — tracing a RAG pipeline and an offline experiment on chunk size, using a model to score retrieved chunks. Focuses on offline experiments, not live monitoring.
- RAGAS documentation, “Monitor Your RAG in Production” — an older page that lists the aspects worth watching in production. Read it as a checklist of ideas.
- Barnett et al. (2024), “Seven Failure Points When Engineering a Retrieval Augmented Generation System” — a catalogue of where RAG systems fail. Useful when deciding what to monitor.