Fine-Tuning

Further training an existing AI model on your own examples so it performs better on a specific task, tone or domain.

Related terms in this glossary

Fine-tuning is useful when prompting alone cannot reach the accuracy or consistency you need. It requires a set of good-quality examples and careful evaluation before use in production.

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.

ApproachChangesBest for
Prompt engineeringInstructions and examples in the promptMost tasks; fastest to iterate
RAGFacts supplied at request timeCompany knowledge that changes; answers with citations
Fine-tuningModel weightsConsistent format, style or behavior; narrow classification or extraction; shorter prompts at high volume
DistillationA smaller model trained on a larger one's outputsHigh-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: consistent extraction from Hindi and English forms

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.

Methods and tools

  • 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.

Questions about Fine-Tuning

Something else? Send us your question and an engineer replies with next steps.

How many examples do we need to fine-tune a model?

It varies with the task and method. Provider documentation for managed fine-tuning often suggests that improvements can appear with a modest number of high-quality examples, and narrow tasks such as format adherence need fewer than tasks that require nuanced judgment. In practice, start with a few hundred carefully reviewed examples, measure against your prompted baseline, and add data where the evaluation shows weakness. Consistency and correctness of examples matter more than raw volume.

Can we fine-tune a model and keep our data private?

Yes. Options include fine-tuning an open-weight model on your own infrastructure or cloud account, so training data never leaves your environment, or using a provider's managed fine-tuning under terms that state your data is not used to train their general models and is stored in a region you approve. Read the data handling terms carefully, remove personal data you do not need, and keep a record of what data went into each model version, since deletion requests may affect future training sets.

Articles that mention Fine-Tuning

All articles

Jump to

↑↓ to move↵ to open