Chapter 5. Fine-Tuning Generative AI Models in Azure
In this chapter, we will discuss when fine-tuning GenAI models is necessary and walk through the different fine-tuning approaches available in Azure, helping you determine the best strategy for optimizing model performance.
Fine-tuning represents a powerful method for adapting large language models (LLMs) to specialized tasks and domains by updating their internal parameters based on new data. Positioned next to prompt engineering and RAG, fine-tuning offers a means of embedding knowledge directly into the model, allowing it to internalize patterns, terminology, or behaviors that may not be well represented in its original training corpus. Unlike prompting, which relies on instructive input without altering the model, or RAG, which dynamically incorporates external context at inference time, fine-tuning permanently refines the model’s behavior. This approach enables more precise control over outputs, improved performance on domain-specific tasks, and reduced dependence on lengthy prompts or external retrieval mechanisms. In this chapter, we will explore what conditions are ideal for fine-tuning.
The fine-tuning process begins by continuing the training of a pretrained model on a new, typically smaller dataset that reflects the desired application domain or task. This is achieved by adjusting the model’s parameters to better capture the linguistic patterns, knowledge, or behaviors relevant to the target use case. There are two ...
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