Framework · Enterprise Platforms

Azure AI Foundry RAFT fine-tuning recipe

This Azure recipe generates a synthetic RAFT training set with a teacher model and fine-tunes a student model on Azure AI Foundry to improve domain-specific RAG.

Description

This is an official Azure-Samples recipe that applies UC Berkeley's RAFT technique on Azure AI Foundry. A teacher model such as GPT-4o or Llama 3.1 405B generates a synthetic dataset using the Gorilla project's RAFT method, with question-document-answer triplets that include oracle and distractor documents. The dataset fine-tunes a smaller student model (such as GPT-4o-mini or Llama 3.1 8B) so it learns to ignore distractor documents in domain-specific RAG. The recipe then deploys the fine-tuned model and evaluates it against a baseline.

Solution

A teacher model deployed on Azure AI generates a synthetic RAFT dataset of question-document-answer triplets, each combining an oracle document with distractor documents. That dataset fine-tunes a student model on Azure AI Foundry so it learns to attend to the oracle and ignore the distractors. The fine-tuned model is then deployed and its performance evaluated against a baseline model.

Primary use cases

  • domain-specific RAG fine-tuning on Azure AI Foundry
  • synthetic RAFT training-data generation
  • training models to ignore distractor documents
  • evaluating a fine-tuned model against a baseline

Open the full interactive page

Diagram, neighbourhood map, code examples, related patterns and full provenance.