WhoBuilt

Navigating RAG Optimization with an Evaluation Driven Compass

Nov 12, 2024· 18 min· 5.2K views·Watch on YouTube

Speakers

Atita Arora, a solution architect at Qdrant, and Deanna Emery, a founding AI researcher at Quo AI, explain how to improve RAG through evaluation and experimentation at an AI Engineer event.

RAG’s building blocks and challenges

Atita describes RAG as retrieving information from a knowledge source, often a vector database, and using it to generate answers with an LLM. She outlines a basic pipeline of chunking, embedding, retrieval, and answer generation, then notes that advanced systems may add query rewriting, reranking, or routing. Common problems include missing or poorly extracted data, weak retrieval, irrelevant context, hallucinations, scaling, and security.

Improvement starts with the data and retrieval

Atita recommends cleaning and extracting data carefully, choosing embeddings suited to domain terminology, and using metadata and deliberate chunking. She also points to context size, indexing choices, reranking, prompts, and hybrid dense and sparse search as possible tuning options. Because there are many possible changes, she argues that evaluation is needed to track progress and guide experiments.

Set goals and establish a baseline

Deanna explains that RAG evaluation should fit the domain and dataset, and that Qwotient can help developers build evaluation datasets and run experiments. Their demo uses Qdrant documentation question answering, with faithfulness as the priority to reduce misleading answers. They also measure context relevance, which checks whether retrieved documents contain needed information, and chunk relevance, which measures how much retrieved text is useful.

Use experiments to diagnose retrieval problems

The experiments compare chunk sizes, retrieval windows, embedding models, and LLMs. Larger chunks slightly improved text quality but lowered faithfulness, while smaller chunks with a larger retrieval window scored better on relevance and faithfulness. Switching to GPT-3.5 improved the measured metrics, and reranking with Mixedbread, Cohere, or Jina ColBERT generally improved context relevance and faithfulness, with Cohere performing best in those trials.

Hybrid search improves domain-specific retrieval

Atita notes that generic embeddings can struggle with specialized terminology, acronyms, and jargon in Qdrant documentation. Combining sparse and dense vectors with a Cohere reranker gave the best performance across the measured metrics except chunk relevance, and improved faithfulness on the examined examples. Across 10 experiments, faithfulness rose from 76 to just under 85; Deanna recommends keeping evaluation data current and avoiding added complexity without carefully chosen metrics.

Takeaways

  • Choose evaluation metrics that match the system’s risks; prioritize faithfulness when inaccurate answers could mislead users.
  • Treat chunk size and retrieval window as separate variables, and measure their effects rather than assuming larger chunks help.
  • Inspect poor examples and retrieved documents to identify whether failures come from missing context, noisy results, or domain terminology.
  • Consider reranking or hybrid dense and sparse search when generic retrieval misses specialized terms.
  • Keep the evaluation dataset current and use measured results to decide whether added RAG complexity is worthwhile.

Mentioned in this talk

Search inside this talk

What was claimed 8

  • role at
    Danna Emmery is founding AI researcher at Quo AI
    “I'm a founding AI researcher at Quo AI.”
    YouTube
    Unverified1 source· Talk
  • role at
    Atita Arora is solution architect at Qdrant
    “I work as a solution architect at Qdrant.”
    YouTube
    Unverified1 source· Talk
  • feature
    Qdrant: Open-source vector search database built on Rust
    “Qdrant is an open-source vector search database built on Rust.”
    YouTube
    Unverified1 source· Talk
  • feature
    Qwotient: Evaluation platform that helps developers measure LLM product effectiveness and iterate using evaluation datasets
    “Qwotient’s evaluation solution fills this need by enabling developers to measure the effectiveness of their LLM products accurately.”
    YouTube
    Unverified1 source· Talk
  • feature
    Qwotient: Orchestrates prompt formatting, LLM execution, and metric computations for an evaluation dataset
    “Qwotient, which handles the full orchestration, including prompt formatting, LLM execution, and metric computations.”
    YouTube
    Unverified1 source· Talk
  • integrates with
    Qwotient integrates with Qdrant
    “Once you have your Qdrant vector database set up, you can populate your evaluation dataset...”
    YouTube
    Unverified1 source· Talk
  • metric
    Cohere: Achieved the best relevance and faithfulness scores among the three reranking experiments
    “Cohere achieving the best relevance and faithfulness scores.”
    YouTube
    Unverified1 source· Talk
  • metric
    Vector RAG: Faithfulness score improved from 76 to just under 85 across 10 experiments
    “Starting from a faithfulness score of 76, we worked our way up to just under 85.”
    YouTube
    Unverified1 source· Talk

Related talks