RAFT (Retrieval-Augmented Fine-Tuning)
RAFT is a training technique that combines retrieval-augmented generation with fine-tuning. The model is fine-tuned on examples that include both a relevant document and several distractor documents, and the training objective teaches it to cite the relevant document while ignoring the distractors. The resulting model outperforms pure RAG on domain-specific tasks because it has been trained on the exact retrieval distribution it will see at inference — noisy, mixed-quality context that must be filtered in-place. RAFT requires curated training data: each example needs a labeled "golden" passage plus realistic distractors, which is non-trivial to assemble. It is a strong fit for narrow, high-stakes domains such as legal, medical, or internal policy Q&A.
Example
A compliance team builds a RAFT dataset of 2,000 policy Q&A pairs. Each training example includes the correct policy paragraph plus four distractor paragraphs pulled from adjacent policies. The fine-tuned model learns to answer "What is the expense-report approval threshold for contractors?" by citing the contractor-specific paragraph rather than the employee paragraph that a standard RAG retriever often returns alongside it. Accuracy on held-out compliance questions rises compared to the base model with the same retriever.
Put this into practice
Build polished, copy-ready prompts in under 60 seconds with SurePrompts.
Try SurePrompts