All books

Professional

Apps About Coach Log in Start reading

Quantitative Finance · Glossary

What is Retrieval-augmented generation, BM25?

Also known as: retrieval-augmented generation · BM25

Definition 14.3 Machine Learning for Markets · Chapter 14 — Large Language Models in Finance

Retrieval-augmented generation (RAG) answers a question by first retrieving passages relevant to it from a document collection and then generating the answer from a prompt that contains them (Lewis and co-authors, 2020). BM25 is the standard lexical retrieval score: for each query term found in a passage, the term’s inverse document frequency times a saturating function of its count in the passage, normalised by the passage’s length (Robertson and Zaragoza, 2009).

Share of the 540 questions whose top passage is the one asked about, by search method and wording. Data: ml_llm.retrieval.
Figure 14.1. Share of the 540 questions whose top passage is the one asked about, by search method and wording. Data: ml_llm.retrieval.
Read in context →