RAG

Wiki chapters and blog posts about RAG.

Wiki

RAG in Practice: Chunking, Hybrid Retrieval, Reranking and Evaluation

How to build a retrieval-augmented generation system that works: clean and chunk documents, combine dense and BM25 retrieval with RRF, rerank with a cross-encoder, assemble the context, and measure every step with Hit@k and MRR on a small runnable corpus.

Intermediate 42 min read

Blog posts

Lost in the Middle: Models Use the Start and End of a Long Context Best

Liu et al. (2023) moved the answer around inside long inputs and found a U-shaped curve: accuracy is highest at the start or end and lowest in the middle. With 20 documents GPT-3.5-Turbo loses 22.0 points between its best and worst position. This post recomputes the results and discusses RAG.

Paper notes TACL 2023

Topics