Fine-Tuning
Definition
The process of further training a pre-trained language model on a specific dataset to improve its performance on targeted tasks. Fine-tuning adjusts the model's weights to better handle domain-specific language, follow particular output formats, or exhibit desired behaviors. In the agent context, fine-tuning can improve: tool selection accuracy, output format compliance, domain knowledge, and response style. Methods range from full fine-tuning (expensive, updates all weights) to parameter-efficient methods like LoRA (cheap, updates a small adapter layer).
Builder Context
Fine-tuning is rarely the right first step for agent development. The priority order: (1) improve prompts and tool descriptions (free, immediate impact), (2) add RAG for domain knowledge (moderate effort, high impact), (3) fine-tune for specific behavior patterns only after (1) and (2) are optimized. Fine-tuning is most valuable for: teaching consistent output formats, reducing prompt size (bake common instructions into weights), and handling domain-specific jargon. The biggest mistake: fine-tuning on small datasets that overfit to training examples.