AI EngineeringInterview preparation
Intermediate·Concept·2 min read

RAG evaluation and comparison with alternatives

Practice this question

Overview

  • RAG evaluation measures retrieval quality and answer quality independently and together.
  • Fine-tuning changes model behavior through training; long context supplies a large body of content directly; traditional search returns evidence without generating an answer.
  • These approaches solve different parts of the problem.

Why this matters

You need to know whether missing evidence or poor generation causes errors, and whether RAG adds value over simpler alternatives.

An everyday example

Check both whether an employee opened the correct pages and whether their explanation followed those pages.

A technical example

For a labeled policy question, measure recall@10, ranking quality, supported claims, correct citations, final correctness, latency, and cost.

How it works

  1. Create source-grounded cases
  2. Label eligible relevant evidence
  3. Run retrieval
  4. Run generation
  5. Score independently
  6. Inspect failure categories
  7. Compare baselines.

Architecture and flow

Golden questions + source labels → retrieval metrics + answer metrics → regression gate.

The insurance assistant example

Test two policy versions, absent answers, cross-tenant queries, and questions containing misleading premises.

When to use it

Before shipping or changing parsing, indexing, chunking, models, prompts, or rerankers.

When to avoid it

Do not optimize one aggregate score while hiding severe failures in exclusions, privacy, or source freshness.

Interview answer

“I evaluate retrieval recall and ranking separately from faithfulness and answer correctness, then compare the full system against search and long-context baselines.”

Benefits, trade-offs, and production considerations

  • RAG still needs an authoritative source; fine-tuning is usually for behavior, not a frequently changing knowledge database.
  • A model can faithfully repeat an outdated document, so faithfulness alone is insufficient.
ApproachWhat it changes/providesGood fitMain trade-off
RAGSelects external knowledge at request timeLarge/changing private corpus, citationsIngestion and retrieval maintenance
Fine-tuningLearns behavior/style/task patterns in weights or adaptersRepeated stable task failures with good training dataTraining cost, data governance, regression risk
Long contextPlaces supplied content directly in the requestA bounded set of documents already known for this taskRepeated input cost, attention limitations, eligibility filtering still needed
Traditional searchReturns source resultsUsers can read evidence directly or accuracy demands exact excerptsLess conversational synthesis, often lower generation risk/cost

Adapted from 13_AI.MD · “RAG evaluation and comparison with alternatives”. Code examples are study fragments. Difficulty and core labels are editorial estimates; version-specific behavior should be checked against your project.