Skip to content

< CollectionsPaper

Retrieval-Augmented Generation.

Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks

Lewis et al. · 2020 · arXiv 2005.11401

Read the paper (opens in a new tab)

Give a generator a retriever over a document index, and let it condition on what comes back.

3 sections · 7 problems

0 of 7 done

Start Next: 01 Generate Embeddings with Hugging Face

Fig. 1. The query is a beam. Cosine similarity is the angle between it and each document: the ones it lights up most are the top five the model reads.

Section 01

A dense index

0 of 3

The paper: Documents are stored as dense vectors, and a query finds its neighbours by similarity.

  1. 01Generate Embeddings with Hugging Faceimplement · medium
  2. 02Calculate Embedding Similarityimplement · easy
  3. 03Build Top-K Semantic Searchimplement · easy

Section 02

Retrieve, then generate

0 of 2

The paper: The generator conditions on the passages the retriever returns, not only on what it memorised.

  1. 04Build a Document Chunkerimplement · easy
  2. 05Build Your First RAG Pipelineharness · medium

Section 03

Provenance

0 of 2

The paper: Knowledge kept outside the model can be shown and updated, so an answer can point at where it came from.

  1. 06Answer With Citations, or Say You Can'timplement · medium
  2. 07Check Every Sentence Has a Sourceimplement · medium
All collections