Fine-Tuning in depth
Fine-tuning compared with the alternatives
Fine-tuning is one of several ways to improve a model on your task, and usually not the first one to try.
| Approach | Changes | Best for |
| Prompt engineering | Instructions and examples in the prompt | Most tasks; fastest to iterate |
| RAG | Facts supplied at request time | Company knowledge that changes; answers with citations |
| Fine-tuning | Model weights | Consistent format, style or behavior; narrow classification or extraction; shorter prompts at high volume |
| Distillation | A smaller model trained on a larger one's outputs | High-volume tasks where speed and running cost matter |
A useful rule: use retrieval to teach the model facts, and fine-tuning to teach it behavior. Fine-tuning a model on your policy documents does not reliably make it recall them accurately, and the knowledge goes stale when policies change.
Example: a hypothetical microfinance lender extracts fields from loan application forms filled in Hindi and English, often handwritten and then transcribed. A prompted model gets most fields right but formats dates and names inconsistently and occasionally invents values for empty fields. The team assembles a few thousand reviewed examples of transcribed forms with the correct structured output, including many with empty fields marked as null. A smaller open-weight model is fine-tuned with LoRA. On a held-out set, it is compared with the prompted large model per field. The fine-tuned model ships for the fields where it matches or beats the baseline, with low-confidence cases sent to a person.
- Supervised fine-tuning: training on input and ideal output pairs. The most common form.
- Parameter-efficient methods: LoRA and QLoRA train small adapter weights instead of the full model, reducing hardware needs and letting several adapters share one base model.
- Preference tuning: methods such as DPO train on pairs of better and worse answers to shape style and judgment.
- Managed fine-tuning: offered by major providers and clouds, including OpenAI, Google Vertex AI, Amazon Bedrock and Azure.
- Open-source stack: Hugging Face Transformers, TRL and PEFT, with serving through engines such as vLLM.
Data and evaluation
Data quality matters more than quantity. Examples should be correct, consistent in format, representative of real inputs, and free of personal data you are not permitted to use for training. Hold out a test set before training starts and never train on it. Compare the fine-tuned model against the best prompted baseline on the same evaluation set, and check for regressions on general behavior the application still relies on.
Common mistakes
- Fine-tuning before trying a well-written prompt with good examples.
- Training on a few hundred inconsistent examples and blaming the method.
- No plan for retraining when the base model is deprecated or the task changes.
- Including customer data in training sets without a lawful basis under the DPDP Act 2023.
Fine-tuned models need MLOps discipline, and are often paired with quantization for inference. We do this work in model training and fine-tuning, including Indian language AI.