Forward Deployed EngineeringAI EngineeringModel Training and Alignment
What's the difference between a base model and an instruct model, and why would a customer care?
Question 43 of 73 · Updated
On this page
- Interview-ready answer
- 1. The fundamental distinction
- 2. Pretraining: learning the distribution of language
- 3. How a base model becomes instruction-following
- Supervised fine-tuning (SFT)
- Preference alignment
- 4. RLHF and DPO: understand the difference
- Reinforcement learning from human feedback (RLHF)
- Direct preference optimization (DPO)
- Worked DPO example
- 5. Chat templates are part of the model contract
- 6. Why a customer should care: practical use cases
- Example: structured support-ticket classification
- Local verification
- 7. What instruct tuning does not solve
- 8. Choose a model with evidence
- 9. Deployment and maintenance trade-offs
- 10. Common mistakes
- Likely interviewer follow-ups
- Interview takeaway
Interview-ready answer#
A base model is generally a pretrained language model that has learned to model text, often by predicting the next token. Given a prompt, it continues the sequence according to patterns learned during training. It may answer questions or follow instructions in context, but its training does not necessarily make it a reliable conversational assistant.
An instruct model is a model adapted to respond to instructions more usefully. It typically starts from a pretrained checkpoint and undergoes instruction tuning, such as supervised fine-tuning on prompt-response examples. It may also undergo preference optimization through RLHF, DPO or other methods to improve behavior according to a defined set of human or model-generated preferences. These training stages are not universal requirements for every instruct model.
Both models can use the same Transformer architecture and next-token generation mechanism. What changes is the learned conditional distribution and often the expected input formatting. An instruct model usually expects its own chat template, role markers and generation boundaries.
For a customer building a support assistant, extraction workflow or RAG application, I would generally start with an instruct model because instruction following reduces integration effort. For a team doing domain pretraining, developing a custom post-training strategy or deliberately building a completion-oriented model, a base checkpoint may be the better foundation. I would evaluate the actual task, output reliability, safety, latency, licensing and total operating cost rather than assume that the instruct variant is always superior.
1. The fundamental distinction#
| Dimension | Base model | Instruct model |
|---|---|---|
| Typical objective | Learn general language patterns through pretraining | Learn to respond appropriately to instructions and dialogue |
| Input style | Text continuation or a few-shot completion prompt | Model-specific instruction or conversation format |
| Output behavior | Continuation of the supplied sequence | A response conditioned on the supplied instruction and roles |
| Customization | Foundation for additional training or specialized completion tasks | Useful starting point for assistant workflows and task-specific adaptation |
| Safety behavior | May lack assistant-specific safety post-training | May include safety and preference post-training, but is not a security boundary |
| Selection | Appropriate when control over the training objective or continuation behavior is important | Often appropriate when ready-to-use instruction following is important |
These are typical tendencies, not definitions enforced uniformly across providers. A base checkpoint can already demonstrate strong in-context instruction following. An instruct checkpoint can still hallucinate, fail to follow a constraint or give an inappropriate answer. Product names such as Base, Instruct, Chat and Assistant are clues; inspect the actual model card and evaluation evidence.
The distinction is independent of whether a model is open-weight or hosted, small or large, quantized or full precision, text-only or multimodal. Instruction tuning describes adaptation of behavior, not a deployment format or parameter count.
2. Pretraining: learning the distribution of language#
For a typical decoder-only causal language model, pretraining maximizes the likelihood of each next token given the previous tokens. The training loss is negative log-likelihood:
This objective provides a learning signal across a large corpus. The model learns representations of language, facts, code, reasoning patterns and many other regularities to the extent supported by its training data and capacity.
At inference time, a base model given:
Capital of France:
might continue with Paris, a list of additional countries, a quiz, or another plausible continuation. The objective does not uniquely specify that the next text must be a concise answer. Prompt demonstrations and carefully chosen completion patterns can improve behavior.
Pretraining does not mean the model contains a verified database of facts. It may memorize information, generalize, reproduce errors or produce plausible unsupported text. The same limitation remains relevant after instruction tuning.
3. How a base model becomes instruction-following#
This is a common conceptual pipeline, not a claim that every model uses these stages in this order. Training may involve multiple rounds, rejection sampling, synthetic demonstrations, reinforcement learning with various reward signals, direct preference losses, distillation or mixtures of objectives. Some products expose only a post-trained model, and some use the term instruct for an SFT-only checkpoint.
Supervised fine-tuning (SFT)#
SFT uses examples of desired responses to inputs. An example might contain an instruction to classify a synthetic support ticket, the ticket itself and a target category in a specified format. The model learns to place more probability on the target response conditioned on the provided context.
In assistant training, the loss is often applied to assistant response tokens while prompt tokens are masked out. The precise token masking, conversation packing and objective depend on the training implementation. Instruction tuning is not a different inference algorithm; the model still predicts tokens conditioned on its input.
High-quality demonstrations matter. If examples contradict one another, embed outdated information, or teach the wrong response format, SFT may reinforce undesirable behavior. More examples do not automatically produce a better model.
Preference alignment#
Several valid answers may exist for the same instruction. Preference data captures a comparison, such as choosing a concise, evidence-grounded answer over a verbose unsupported answer. Optimization can then favor responses according to the chosen criteria.
Preference alignment is alignment to a specified training signal, not proof of truth, universal human agreement or perfect safety. Labeler disagreement, biased preferences, reward misspecification and distribution shift can affect the resulting model.
4. RLHF and DPO: understand the difference#
Reinforcement learning from human feedback (RLHF)#
A widely discussed RLHF approach collects preference comparisons, trains a reward model to predict which response is preferred, and optimizes the language model using reinforcement learning. In the classic PPO-based approach, the optimization includes a regularization term that discourages excessive deviation from a reference policy.
Conceptually:
- Collect instructions and candidate answers.
- Obtain authorized preference judgments using a defined rubric.
- Fit a reward model or another suitable feedback mechanism.
- Optimize the policy against the reward signal while controlling undesired deviation.
- Evaluate helpfulness, factuality, safety and regressions independently.
RLHF is broader than PPO and does not imply a particular algorithm in every system. Optimizing a learned reward can lead to reward hacking or excessive changes in behavior, making independent evaluation important.
Direct preference optimization (DPO)#
DPO is an alternative way to train from preferred/rejected response pairs. In the standard formulation, the objective compares how much the trainable model favors the chosen response relative to the rejected response, compared with a reference model.
Define the preference margin:
z = β[(log πθ(y_chosen|x) − log πθ(y_rejected|x)) − (log πref(y_chosen|x) − log πref(y_rejected|x))].
The per-pair DPO loss is −log sigmoid(z), equivalently log(1 + exp(−z)). Here β is a positive hyperparameter, πθ is the trainable policy, and πref is the reference policy. The log probabilities refer to the corresponding response sequences under the same conditioning prompt.
DPO avoids the separate explicit reward-model training and on-policy reinforcement learning loop used in the classic RLHF pipeline. It still requires suitable preference data, correct tokenization and response log probabilities, reference-policy treatment, optimization and evaluation.
| Comparison | Classic reward-model-based RLHF | Standard DPO |
|---|---|---|
| Feedback | Preference comparisons | Preference comparisons |
| Intermediate reward model | Commonly trained explicitly | Not separately trained in standard DPO |
| Policy optimization | Reinforcement learning, often with reference-policy regularization | Direct differentiable preference objective |
| Operational concerns | Rollout generation, reward calibration, policy stability and infrastructure | Pair quality, reference consistency, log-probability computation and optimization stability |
| Quality guarantee | None from the algorithm alone | None from the algorithm alone |
DPO and RLHF are not mutually exclusive categories in every practical training pipeline. A model can use multiple stages or variants. Do not claim that one is inherently safer, cheaper or better for all customer tasks.
Worked DPO example#
Suppose the trainable model assigns sequence log probabilities −2 and −4 to a chosen and rejected response. The reference assigns −3 and −4. With β = 1, the margin is (2 − 1) = 1, and the loss is approximately 0.3133. If the model and reference have the same preference margin, the loss is log(2), approximately 0.6931.
The following educational helper computes that scalar loss using a numerically stable softplus expression. It is not a training loop and does not compute model gradients.
PYTHONimport math def dpo_loss(chosen, rejected, ref_chosen, ref_rejected, beta): if not all(math.isfinite(x) for x in (chosen, rejected, ref_chosen, ref_rejected, beta)) or beta <= 0: raise ValueError('finite log probabilities and positive beta required') z = beta * ((chosen - rejected) - (ref_chosen - ref_rejected)) if not math.isfinite(z): raise ValueError('nonfinite preference margin') return max(-z, 0.0) + math.log1p(math.exp(-abs(z)))
The inputs represent already-computed sequence log probabilities. The helper does not validate the entire probability distribution or enforce sequence-level log-probability semantics. A real DPO implementation uses the appropriate tokenizer, completion masking, reference-policy log probabilities and differentiable tensor operations. Stable arithmetic here avoids overflow in naive exponentiation for large finite margins.
5. Chat templates are part of the model contract#
A model consumes token sequences, not abstract JSON roles. An instruct model often learns conversation boundaries and roles through a particular serialization format. A serving layer maps structured system, user and assistant messages into that model's expected token sequence.
For example, a conceptual conversation could be:
System: Return a concise answer in the approved format. User: Summarize this synthetic support ticket. Assistant:
The actual model may require special control tokens, end-of-turn markers, beginning-of-sequence tokens or a generation prompt. The plain-text illustration above is not a universal chat template.
Using the wrong template can cause repeated role markers, echoing of the prompt, premature stopping, degraded instruction following or apparent quality regressions. A base checkpoint may not have an assistant chat template at all. Even related base and instruct checkpoints can have different formatting and termination requirements.
For a compatible Transformers model, a typical illustrative usage is:
PYTHON# Illustrative integration: use the exact approved local checkpoint. from transformers import AutoTokenizer tokenizer = AutoTokenizer.from_pretrained( "/approved/local/instruct-checkpoint", local_files_only=True ) messages = [ {"role": "system", "content": "Summarize the ticket concisely."}, {"role": "user", "content": "Synthetic ticket: the settings page will not load."} ] input_ids = tokenizer.apply_chat_template( messages, tokenize=True, add_generation_prompt=True )
This code illustrates formatting only, not generation. It requires an installed compatible Transformers version and a model whose tokenizer supplies a template supporting the specified roles. Check the model documentation: some templates do not support a system role or use different generation behavior. When tokenizing the formatted conversation separately, avoid accidentally adding special tokens twice. Use the checkpoint's own end-of-sequence and end-of-turn conventions.
No tokenizer or model checkpoint was loaded for this integration example. The exact API and role support must be checked in the deployed environment. Do not invent special-token syntax or transplant another model family's chat format simply because the architecture looks similar.
6. Why a customer should care: practical use cases#
Consider three hypothetical customer workflows.
| Customer requirement | Recommended initial experiment | Reason |
|---|---|---|
| Support assistant following response policies | Instruct model with a compatible chat template | Evaluate reliable instruction following and appropriate abstention without custom post-training |
| Structured extraction from approved documents | Instruct model with schema-constrained generation when supported, plus deterministic validation | The response must satisfy the application's output contract |
| Controlled domain pretraining and proprietary behavior research | Base and instruct baselines, with a base checkpoint considered for custom training | Preserve flexibility over the training objective and evaluate the cost of developing required assistant behavior |
A base model can work well for few-shot completion or extraction. An instruct model may also be an excellent starting point for additional fine-tuning. These are not hard boundaries. The right answer depends on measurable task quality, the available data and the amount of customization required.
Example: structured support-ticket classification#
Hypothetical input:
"My invoice shows two identical charges for the same subscription."
Desired output:
JSON{"category":"billing","summary":"Customer reports duplicate subscription charges."}
A base model might continue a supplied completion pattern, whereas an instruct model may be more likely to follow a direct request to return the classification. These are illustrative expectations, not measured outputs from either checkpoint.
Neither model's natural-language promise to return JSON is a guarantee. A production integration should parse and validate the output, reject unexpected fields and avoid executing actions based on an invalid or unauthorized response. Schema-constrained decoding can improve syntactic validity where supported, but it cannot prove that a category is correct or that a summary is factual.
The following dependency-free example validates a narrow synthetic ticket schema, including duplicate JSON key rejection.
PYTHONimport json def unique_object(pairs): result = {} for key, value in pairs: if key in result: raise ValueError('duplicate key') result[key] = value return result def valid_ticket(raw): try: obj = json.loads(raw, object_pairs_hook=unique_object) except (ValueError, TypeError): return False return (type(obj) is dict and set(obj) == {'category', 'summary'} and type(obj['category']) is str and obj['category'] in {'billing', 'technical', 'other'} and type(obj['summary']) is str and 0 < len(obj['summary'].strip()) <= 200)
The contract permits exactly two fields, one of three categories, and a nonblank summary of at most 200 Unicode code points after trimming. It does not guarantee semantic classification accuracy or prohibit every possible unusual character sequence. A production parser also needs input byte limits, suitable depth limits, resource-exhaustion protection, explicit encoding rules and a separately defined content and authorization policy.
Local verification#
The two executable examples above were tested with Python 3.13.5:
- 3,131 DPO checks: 3,125 combinations of synthetic log probabilities and positive beta values compared with a 60-digit Decimal reference, two large finite margin checks and four invalid-input cases.
- 107 ticket validation checks: 99 category/summary combinations and eight malformed or contract-violating JSON examples, including duplicate keys and unexpected fields.
All 3,238 checks passed. This verifies the scalar preference-loss calculation and schema validator on synthetic data. It does not measure actual model instruction following, train an LLM, validate the illustrative tokenizer integration or benchmark a deployed inference system.
7. What instruct tuning does not solve#
Instruction tuning changes behavior but cannot guarantee factual correctness. If a customer asks for answers from a changing document collection, a capable instruct model may still need authorized retrieval, grounding and citation checks. The next lesson addresses the choice between prompting, RAG and fine-tuning in more detail.
Instruction tuning is also not equivalent to a long context window, tool execution capability, structured-output guarantee or current factual knowledge. Tool-use protocols depend on the model's actual training, prompt format and serving integration. External software must validate parameters, authorize every consequential action and handle errors.
Do not treat a chat template or system prompt as an access-control mechanism. Retrieved documents, user input and tool results can contain untrusted instructions. Enforce permissions and tenant isolation outside the model, and do not permit arbitrary generated text to trigger privileged actions.
An instruct model with safety post-training may refuse some legitimate requests or answer some unsafe ones incorrectly. Evaluate both appropriate refusals and unnecessary refusals for the authorized task. Do not choose a base checkpoint simply to circumvent safety controls.
8. Choose a model with evidence#
For a fair comparison, consider paired base and instruct variants from the same family and size when available. Match the task and deployment constraints, but use the appropriate input interface for each model. Forcing an instruct chat template onto a base checkpoint or evaluating an instruct checkpoint with an incompatible raw prompt would confound the result.
Define a held-out evaluation set and an agreed rubric. Evaluate on realistic inputs, not just a few carefully selected successful prompts.
| Evaluation dimension | Example measurement |
|---|---|
| Instruction adherence | Fraction satisfying explicitly requested task constraints |
| Structured output | Parse/schema validity and semantic field correctness measured separately |
| Task quality | Accuracy, expert-reviewed helpfulness or another task-specific criterion |
| Grounding | Unsupported claim rate and citation correctness where evidence is available |
| Robustness | Response to ambiguous, conflicting and out-of-distribution inputs |
| Safety | Unauthorized actions or disclosures, appropriate abstention and false refusals |
| Operational performance | Time to first token, final-response latency, throughput, peak memory and error rate |
| Cost | Cost per successful task, including retries, validation and human review |
Use appropriate statistical caution. Small evaluation samples do not establish production reliability, especially for rare high-impact failures. Record sample sizes, versions, decoding settings and uncertainty. Never fabricate a measured uplift from a hypothetical example.
If comparing both models on a deployment budget, count the tokens introduced by templates and demonstrations. A model that produces more verbose answers may increase latency and output cost even when it has the same parameter count. Conversely, reliable instruction following can reduce retries and downstream manual effort. Measure the complete workflow.
9. Deployment and maintenance trade-offs#
Base and instruct variants of the same architecture and parameter count can have similar raw weight-memory requirements at the same precision. However, actual serving behavior depends on context lengths, output lengths, KV-cache implementation, batching, quantization, architecture and runtime. Instruction tuning does not intrinsically make a model faster or smaller.
Version the model checkpoint, tokenizer, chat template, decoding policy, quantization artifacts, tool schemas and prompt configuration. Re-evaluate on changes. A seemingly harmless tokenizer or end-of-turn change can alter stop behavior and invalidate previous evaluations.
For self-hosted deployment, consider hardware and runtime compatibility, model licensing, provenance, dependency review, artifact verification and controlled updates. Hosted interfaces may handle formatting internally, but a provider can change model behavior or supported features across versions; pin versions where feasible and run regression tests.
When considering further tuning, compare the baseline instruct model, improved prompts, constrained decoding and retrieval against the proposed training investment. Account for dataset permissions, annotation effort, training compute, evaluation, drift, version maintenance and safety regressions. An existing instruct checkpoint may reduce the amount of training needed, while a base checkpoint offers more control when custom post-training is the actual objective.
10. Common mistakes#
- Treating a base model as incapable of answering questions or an instruct model as incapable of text completion.
- Assuming every instruct model was trained using RLHF or DPO.
- Confusing supervised demonstrations with pairwise preference judgments.
- Assuming a chat template itself teaches a base model to follow instructions.
- Using the wrong tokenizer, role markers or stop tokens.
- Treating alignment as factuality, authorization or guaranteed security.
- Fine-tuning unnecessarily when an evaluated instruct baseline already meets the task.
- Comparing models using one prompt and reporting an unsupported universal ranking.
- Confusing parameter size, quantization or license terms with the base/instruct distinction.
Likely interviewer follow-ups#
Do base and instruct models use different architectures? Not necessarily. Two checkpoints may share the same architecture and tokenizer family but differ in post-training and learned behavior. Inspect actual model configurations.
Can a base model follow instructions? Yes, it can exhibit instruction following through pretraining and in-context examples. An instruct model is explicitly adapted for that behavior and often more convenient for assistant tasks.
Is an instruct model always trained with RLHF? No. It may use SFT alone or a combination of preference optimization and other training methods. Consult the actual training documentation.
What is the difference between SFT and DPO? SFT increases the likelihood of demonstrated responses. Standard DPO optimizes relative chosen/rejected response likelihoods against a reference policy.
Why can wrong chat formatting reduce quality? The model learned response behavior under particular serialized inputs and role boundaries. Changing them can shift the input distribution and generation termination behavior.
Would you use a base model for a customer support chatbot? I would normally benchmark a compatible instruct model first. A base model is a candidate only if the team's task or custom training requirements justify the additional work and it passes the required quality and safety gates.
Does fine-tuning make an assistant know the latest company facts? Not reliably. Changing factual knowledge often requires a separate approved evidence source and retrieval strategy. Evaluate that choice independently.
Interview takeaway#
Base models primarily learn language distributions; instruct models are adapted to respond to instructions and preferences. They may share the same underlying generation mechanism, but differ in behavior and expected input formatting. Choose the checkpoint using the customer's task, the model's documented contract, evaluation evidence and total operating cost. Preserve deterministic validation, authorization and human oversight where required.
References
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.Python json documentation (not live-verified)docs.python.org
- 7.
Related questions
Explore other topics:AI AgentsAI System DesignLarge Language Models