AI Anatomy Class · Part 10 · The world after ChatGPT

88. Look it up, then answer

Q. How do you ask an AI about something it never learned, like the date of your school festival?

  1. Let's ask the model when our school festival is. A model only knows text it saw in training. It has never seen our school's notices.
  2. But it still continues with the next piece, so it can make up a plausible date. That's the hallucination from chapter 84.
  3. The fix is simple: look it up before answering! Search the pile of school documents for ones related to the question.
  4. Turn the question and documents into vectors and pick the closest (chapter 8). The festival notice is the closest.
  5. Put the found document and the question into the model as one text, along with the request 'Answer using the document.'
  6. Now the model just copies the date written in the document. It can even cite which document it used as its source.
  7. This is retrieval-augmented generation, or RAG, a name from 2020. It uses new information without retraining the model.
  8. But if the document is wrong, so is the answer. Find last year's notice and you get last year's date. So check the source yourself.

Chapter summary