jargon

Comparison

Fine-tuningvsRetrieval-augmented generation (RAG)

Fine-tuning

prompting plateaued, so you take a few hundred of your own examples and train the model on them until it does the thing by default.

Continuing training on your own examples so behaviour moves toward them. It teaches style, format and task-specific behaviour well; it is a poor way to inject facts, which retrieval handles better and more updatably.

trained inQuestionPromptModelYourexamples
Full entry →

Retrieval-augmented generation (RAG)

you look up the relevant bits of your own documents first and paste them into the prompt, so the answer comes from your data instead of the model's memory.

The pattern of retrieving relevant chunks and placing them in the prompt so the model answers from your data instead of its memory: embed and index at write time, retrieve and generate at read time. Script 7 is the whole thing in 80 lines; production RAG is those 80 lines plus retrieval quality work.

retrievedQuestionPromptModelYourdocuments
Full entry →

Related comparisons