liveBook · Manning

Fine-tuning

As explained in AI Agents and Applications

Fine-tuning is the additional training of a pretrained model on a narrower or task-specific dataset to adapt its behavior.

Fine-tuning adapts a pretrained language model to a narrower task or domain by training it on curated examples. The examples capture the terminology, style, and reasoning patterns the model should reproduce. section 1.4.3

Its main advantage is efficiency at use time: domain behavior becomes part of the model instead of requiring long instructions or repeated examples in every prompt. This is especially useful for specialized fields such as medicine, law, finance, and code. section 1.4.3

A practical fine-tuning decision involves:

  • Prepare a high-quality, curated dataset that represents the desired behavior; dataset creation requires time and expertise. section 1.4.3
  • Choose an implementation route: hosted services such as OpenAI’s fine-tuning API can reduce setup, while open-source toolkits offer another path. section 1.4.3
  • Consider parameter-efficient methods such as Low-Rank Adaptation (LoRA) when reducing training cost and complexity matters. section 1.4.3
  • Compare fine-tuning with RAG: RAG supplies changing context at runtime, whereas fine-tuning embeds domain behavior or knowledge in the model. section 1.7 section 1.4.2

Specialized model examples

BioMistral targets biology and life sciences, LexiGPT targets legal work, BloombergGPT targets finance, and code-focused models such as Code Llama or Claude Code target programming tasks. section 1.4.3 section 1.5

Fine-tuning is not automatically the best choice. Training can require costly GPU runs, while RAG can reduce retraining needs and often performs better for less-popular knowledge that changes or must be supplied dynamically. section 1.4.3

How AI Agents and Applications covers it

How deep it goes
Defines curated training and major tradeoffs, but stops short of dataset schemas, training code, and evaluation procedures.
Examples
Uses BioMistral, LexiGPT, BloombergGPT, Code Llama, and Claude Code as specialized-model examples.
What it assumes
Assumes a pretrained language model and curated examples, while avoiding assumptions about specialized frameworks through hosted tooling.
What you can do after
Apply it via a fine-tuning API or open-source toolkit to adapt a model for specialized behavior.
How it connects
Connects fine-tuning with prompt engineering, RAG, instruction tuning, RLHF, LoRA, and model selection.

Also explained in

Compare how 37 books explain fine-tuning →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of AI Agents and Applications. The section links point to the parts of the book it draws on.