Glossary
Instruction tuning
A fine-tuning stage that trains a pre-trained language model on instruction and response pairs so that it follows natural-language requests instead of simply continuing text.
Instruction tuning is a stage of training in which a pre-trained language model is fine-tuned on examples of instructions paired with good responses, so that it learns to follow requests written in plain language. A base model fresh from pre-training is a powerful text predictor, but asked "Summarise this article in three bullet points" it may continue the text with more questions, or ramble, because predicting the next token is all it was trained to do. After instruction tuning on many thousands of examples across many kinds of task, the same model answers the request, in the requested format, and generalises to instructions it never saw in training. The technique is also called supervised fine-tuning, or SFT, and it is the step that turns a base model into the instruct or chat model most people use. Work such as Google's FLAN and OpenAI's InstructGPT, both published around 2021 and 2022, established it as a standard part of building assistants.
Where instruction tuning sits in model training
Most modern assistants are built in stages. Each stage changes something different about the model.
Stage | What it trains on | What it changes |
|---|---|---|
Pre-training | Trillions of tokens of general text and code | Knowledge, language ability, reasoning patterns |
Instruction tuning (SFT) | Thousands to millions of instruction and response pairs | Following requests, answer format, task generalisation |
Preference tuning | Human or AI judgements between candidate responses | Helpfulness, tone, safety, refusals |
Optional domain tuning | Task- or company-specific examples | Specialised formats, style, narrow skills |
Pre-training produces most of what a large language model knows. Instruction tuning is comparatively cheap, often a small fraction of the compute, yet it has an outsized effect on how usable the model is. Preference tuning methods such as RLHF or direct preference optimisation then refine which of the model’s possible responses it prefers. InstructGPT combined the two, with supervised instruction tuning first and RLHF after, and that recipe shaped most chat models that followed.
How instruction tuning works
An instruction tuning dataset is a collection of examples, each with an instruction, sometimes an input, and a target response. “Translate into French: The meeting is at noon” with its translation is one example. “Write a SQL query that returns customers who ordered twice in March” with a correct query is another. For chat models, examples are formatted as conversations with system, user and assistant turns, using a fixed chat template of special tokens that marks where each turn begins and ends.
Training is ordinary fine-tuning: the model reads each example and its weights are adjusted to make the target response more likely. The loss is usually computed only on the response tokens, so the model learns to produce answers rather than to reproduce instructions. Because the examples cover many different tasks, the model learns a general skill, which is to read a request and respond to it appropriately, rather than any one task. That is why instruction-tuned models perform well at zero-shot prompting: the instruction alone is enough.
Instruction tuning can also be done with parameter-efficient methods such as LoRA, which train a small set of added weights instead of the whole model. That makes it practical to instruction-tune open weight models on a single machine for a specific domain.
Where instruction data comes from
Converted task collections. Early work, including FLAN, rewrote existing labelled datasets for translation, classification, question answering and summarisation into instruction form using templates. This gave scale and variety cheaply, though the phrasing could be formulaic.
Human-written examples. Annotators write prompts and high-quality responses, which is expensive but gives natural, varied requests. Research such as LIMA in 2023 suggested that a small, carefully curated set, around a thousand examples in that study, can go a long way, supporting the view that instruction tuning mostly teaches format and style on top of knowledge learned in pre-training.
Model-generated data. Methods such as Self-Instruct use an existing model to write new instructions and responses, which are then filtered. Synthetic data of this kind is now a large share of instruction datasets, and distillation from a stronger teacher model is a common way to produce it.
Whatever the source, quality matters more than quantity. Duplicate and near-duplicate examples are removed through deduplication, inconsistent formats are cleaned up through data normalisation, and examples are mixed across task types so the model does not overfit to one. Datasets increasingly include chain of thought responses, tool calls for function calling and examples of structured output, so the model learns those behaviours too.
What instruction tuning does and does not do
Instruction tuning reliably improves how a model responds. It makes outputs follow the requested format, makes the model better at using a system prompt, improves zero-shot performance on new tasks and makes behaviour more consistent. It also improves how well the model learns from examples in the prompt, which is the mechanism described under in-context learning.
It is a weak way to add knowledge. Training on a few thousand examples that mention new facts tends to teach the model the style of those answers more than the facts themselves, and the model may then answer confidently in that style about things it does not know, which can increase hallucination. Knowledge also stays fixed at training time, bounded by the model’s knowledge cutoff. Further tuning can also degrade earlier abilities, the problem known as catastrophic forgetting, which is why domain tuning is usually done lightly and evaluated carefully.
This is the core of the RAG vs fine-tuning decision. Tuning suits behaviour that should be the same on every call: a house format, a tone, a narrow classification task at high volume. Facts that change, or that differ between users, are better supplied in context at request time through retrieval and memory, where they can be updated without retraining. The argument is made at more length in agents shouldn’t learn in their weights.
Base models vs instruct models
Many model families are released in two versions. The base model has only been pre-trained; the instruct or chat model has been instruction-tuned and usually preference-tuned. For almost all application work, the instruct model is the right choice. Base models are mainly useful as a starting point for your own tuning, or for research into what pre-training alone produces.
Instruction-tuned models are sensitive to their chat template. Sending a prompt without the expected role markers, or with the wrong ones, can noticeably degrade output quality, which is a common source of confusion when serving open weight models directly. Safety behaviour is also partly a product of this stage and the preference tuning after it, so removing or overriding it, as jailbreaks attempt, targets what these stages taught.
A worked example
A software company wants its support assistant to reply in a specific structure: a one-line answer, numbered steps, then a link to the relevant help article, in the company’s plain tone. Prompting gets close but drifts on long conversations. The team instruction-tunes an open weight model with LoRA on 3,000 historical ticket and reply pairs that support leads have marked as good, after removing duplicates and personal data.
The tuned model follows the structure far more consistently, and the team can shorten the system prompt because the format no longer needs spelling out. They are careful about what they do not tune in. Product details, plan limits and known issues change every few weeks, so those stay out of the training data and are retrieved from the help centre at request time. A golden dataset of 300 tickets, scored with LLM evaluation methods, is rerun whenever either the model or the retrieval changes.
Six months later the help centre has been reorganised and dozens of articles renamed. The tuned model is unaffected, because it learned the reply structure and not the article titles; retrieval picks up the new links automatically. Had the team tuned the facts into the model, every change would have meant another round of data preparation and training.
Where Exabase fits
Exabase does not train or host models, and it does not provide instruction tuning. It covers two parts of the work around it: preparing source material, and supplying the changing facts that should stay out of a tuned model.
Building an instruction dataset from internal documents usually starts with getting clean text out of PDFs, slide decks, Word files and recordings. Extract turns these into structured JSON or Markdown with text chunks, page numbers and timestamps, with OCR for scans and transcription for audio and video, so dataset builders can work from consistent text; see about extraction and the PDF to JSON tool. The file extraction solution covers the wider pattern, and turning slide decks into knowledge your agent can use covers one of the harder formats.
For the facts a tuned model should not memorise, Deep Search retrieves current passages from stored documents with citations, and Memory keeps per-user facts and preferences that update as they change. Workers can re-extract documents on a schedule so retrieved content stays current, as described in the knowledge base solution. The tuned model handles behaviour; Exabase handles what is true today.
Frequently asked questions
What is the difference between instruction tuning and fine-tuning?
Instruction tuning is a kind of fine-tuning that uses instruction and response pairs across many tasks to teach a model to follow requests. Fine-tuning in general can use any training data for any goal.
Is instruction tuning the same as RLHF?
No. Instruction tuning is supervised training on example responses. RLHF trains on preference judgements between responses. Most chat models use instruction tuning first and RLHF or a similar method after.
Is SFT the same as instruction tuning?
In most usage, yes. Supervised fine-tuning on instruction data is what people usually mean by instruction tuning.
How much data does instruction tuning need?
It varies widely. General-purpose instruction tuning uses large, diverse datasets, while studies have shown useful results from about a thousand high-quality examples. Domain tuning often uses a few thousand.
Does instruction tuning teach a model new facts?
Not reliably. It mainly teaches format and behaviour. Facts that change are better supplied in context through retrieval or memory.
Should I use a base model or an instruct model?
Use the instruct model for applications. Base models are mainly a starting point for your own training.
Can Exabase instruction-tune a model?
No. Exabase does not train models. Extract helps prepare clean source text for datasets, and Deep Search and Memory supply current facts at request time.
Related pages: fine-tuning, RLHF, LoRA, zero-shot prompting, in-context learning, synthetic data, RAG vs fine-tuning, file extraction, agents shouldn’t learn in their weights