Chapter 3. Adding Knowledge: Bass
Foundational models are closed systems that are limited by their training data. In many cases, you’ll need to give a foundational model additional information. For example, the information may be based on recent events that had not occurred when the foundational model was being trained, or the information may have been private, confidential, or otherwise unavailable to the foundational model trainers.
It’s impractical to retrain an LLM with additional knowledge or even perform continuing pretraining (CPT) on a foundational model to add knowledge to it. The cost of even a single training run is significant, and information changes so fast that CPT would have to be done very frequently. These costs can add up to tens of millions of dollars,1 so you’ll typically want to use a foundational model as is and add knowledge to it at runtime.
The key pattern that’s used to provide additional information to a foundational model at runtime was introduced in the landmark paper “Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks” in 2020 by researchers working at Facebook AI Research (which is now part of Meta). Retrieval-augmented generation (RAG) transforms foundational models from closed systems that are limited by their training data into open systems that can leverage external knowledge on demand.
Figure 3-1. The patterns in Chapter 3 and ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access