Learn
Training & fine-tuning

Training from scratch vs fine-tuning: what is the difference?

The short answer

Training from scratch builds a model from random initialisation on trillions of tokens, which is where general language ability comes from. Fine-tuning starts from an existing checkpoint and adjusts it on a much smaller, task-specific dataset. Pretraining creates capability; fine-tuning shapes it into a product.

On this page

Two different projects, not two settings

Pretraining and fine-tuning are usually described as points on a single dial: less training, more training. In practice they are different projects with different inputs, budgets, teams and failure modes. Pretraining begins with random weights. Someone chooses an architecture, trains a tokenizer, assembles a corpus measured in trillions of tokens and runs next-token prediction until the loss stops improving. Before that run nothing exists: no vocabulary, no syntax, no facts, no notion of a sentence.

Fine-tuning begins with a checkpoint that already contains all of those things and adjusts it on a dataset measured in thousands or millions of examples. The loss function is the same cross-entropy over next tokens. What changes is the starting point, the scale and the intent. A fine-tune cannot install a capability the base model does not have; it can sharpen, redirect, constrain or format what is already present.

Between the two extremes sit several activities that get lumped together and then mis-scoped. Continued pretraining runs the pretraining objective on billions of domain tokens, usually at a lower learning rate, to shift what the model knows. Supervised fine-tuning trains on instruction-response pairs to shape behaviour. Preference optimisation such as DPO or PPO adjusts the model using comparisons rather than demonstrations. Adapter methods such as LoRA change how the update is parameterised, not what the objective is. Naming the activity precisely matters, because the data requirements differ by three orders of magnitude.

What pretraining actually produces

A base model is a compressed statistical summary of its corpus. It learns orthography, grammar, entity relationships, translation pairs, code syntax, arithmetic patterns, discourse structure and a great deal of incidental world knowledge. It also learns calibration: how confident to be when the next token is genuinely ambiguous versus nearly determined. None of that is written down as rules; it is distributed across billions of weights and only becomes visible when you probe the model.

Pretraining also fixes the tokenizer. The vocabulary and merge rules are baked into the checkpoint, and every downstream task inherits the resulting token boundaries. A tokenizer that spends four tokens on a common Hindi word instead of one and a half makes that language permanently more expensive to serve and harder to learn, and no amount of fine-tuning repairs it. This is why tokenizer quality is a strategic decision rather than an implementation detail.

A base model is also not an assistant. Ask it a question and it may answer, continue the question, or produce a list of similar questions, because all three are plausible continuations of the text. It has no notion of a request, a refusal or a persona. Those behaviours are added afterwards, and they are surprisingly shallow relative to the knowledge underneath: a few thousand well-chosen demonstrations can change how a model responds without changing what it knows.

The most important consequence is the ceiling. Capability is largely set during pretraining; post-training elicits it. Fine-tuning a model on mathematics will make it produce cleaner derivations and follow the requested format, but it will not give it an algorithm for multiplication that it never acquired. Teams that expect a 5,000-example fine-tune to turn a small base model into a competent reasoner usually conclude that fine-tuning does not work, when the real problem is that they asked it to do pretraining's job.

The cost structure of a from-scratch run

Training compute is roughly six times the parameter count times the number of tokens: 6ND. A 7B model trained on one trillion tokens therefore needs about 4.2e22 floating-point operations. On H100s running at roughly 40 percent model FLOPs utilisation, that is on the order of 70,000 to 80,000 GPU-hours, or about three days on a thousand GPUs. At two to three dollars per GPU-hour that is 150,000 to 250,000 dollars of compute for a single successful run.

The Chinchilla heuristic of about twenty tokens per parameter puts the compute-optimal point for a 7B model near 140 billion tokens, but competitive models are trained well past that because inference cost matters more than training cost. Llama 3 8B was trained on roughly 15 trillion tokens, over a hundred times the Chinchilla minimum. The gap between the textbook optimum and production practice is a deliberate bet that a better model is worth more than a cheaper training run.

  • Data pipeline: crawling, text extraction, language identification, quality filtering and near-duplicate removal at trillion-token scale needs its own engineering and its own cluster.
  • Experimentation: nobody ships the first run. Ablations at 1B scale, learning-rate sweeps and data-mix comparisons typically consume a large fraction of the total budget.
  • Failures: at a thousand GPUs, node failures, silent data corruption and loss spikes are routine. You pay for the wasted compute and for the checkpointing machinery that recovers from it.
  • People: pretraining needs distributed-systems engineers, data engineers and evaluation specialists, not just modellers.
  • Evaluation: contamination-resistant benchmarks and held-out sets have to be built before the run, not after.

The cost structure of fine-tuning

Fine-tuning is cheap on the compute side and expensive on the data side. A LoRA run on a 7B model fits on a single 24GB consumer card with gradient checkpointing, takes a few hours and costs a few dollars of electricity. A full-parameter fine-tune of the same model fits on eight 80GB GPUs and takes days. Compared with pretraining, these are rounding errors.

The real cost is the dataset. Two thousand high-quality demonstrations, each requiring twenty minutes of an expert's time to write and review, is about 660 hours of skilled labour. That is frequently more expensive than the entire GPU bill, and it is the part teams try to skip. The second real cost is the evaluation harness: held-out prompts, a scoring rubric, a frozen baseline and a regression suite that catches the case where a fix for one behaviour breaks three others. Most groups need between five and fifteen training runs before a fine-tune is genuinely usable, and each iteration costs another round of data review as well as compute.

What you inherit when you fine-tune

  • Knowledge cutoff: the base model's training data ends on a fixed date, and no fine-tune moves it.
  • Tokenizer and context window: both are fixed at pretraining time and constrain what you can do downstream.
  • Licence: Apache 2.0, the Llama community licence, Gemma terms and non-commercial research licences impose very different obligations on redistribution and on derivative model naming.
  • Safety behaviour: refusal style, hedging and jailbreak resistance come from the base and from its post-training, and a narrow fine-tune can quietly remove them.
  • Biases and contamination: benchmark leakage in the base model's corpus will show up as suspiciously good scores in your evaluation.
  • Serving cost: parameter count, precision and architecture determine your inference bill no matter how small the adapter is.

A decision guide

The honest default for a small team is not to train from scratch. Work through the cheaper interventions in order and stop when the evidence says you have hit a capability ceiling rather than a behaviour problem.

If the model already knows the facts and simply answers in the wrong shape, that is a prompting problem. If it lacks facts that change weekly, that is a retrieval problem. If it has the knowledge but applies it inconsistently in a narrow domain, that is a supervised fine-tuning problem. If it understands the domain but the domain vocabulary is genuinely foreign to it, that is a continued pretraining problem. Only when you need control of the tokenizer, the architecture, the exact data provenance or the licence does a from-scratch run become the right answer.

  • From scratch: you need a new tokenizer or architecture, full control of training data for regulatory reasons, or a licence that no existing checkpoint can give you, and you have the compute to run it more than once.
  • Continued pretraining: you hold a large proprietary corpus, in the billions of tokens, that the base model has never seen, and the task depends on that knowledge rather than on style.
  • Supervised fine-tuning: you need a specific output format, tone, tool-call syntax, classification scheme or extraction schema.
  • Preference optimisation: you need to change which of several acceptable answers the model prefers, or tighten refusal behaviour.
  • Distillation: you need the behaviour of a large model at the serving cost of a small one.

Failure modes on both paths

From-scratch runs fail quietly. The most common failure is undertraining: the loss is still falling when the budget runs out, and the resulting model is fluent but shallow, unable to follow instructions even after post-training. The second is a tokenizer trained on an unrepresentative sample, which permanently handicaps entire languages or code bases. The third is evaluation contamination, where a benchmark appears in the pretraining corpus and the reported score measures memorisation rather than ability. The fourth is an unrecoverable loss spike late in the run with no earlier checkpoint that reproduces the good trajectory.

Fine-tunes fail loudly but are often misdiagnosed. Catastrophic forgetting appears when the learning rate is too high or the dataset is too narrow: the model gets excellent at the target task and loses general instruction following. Overfitting appears after a few epochs on a small set, visible as training loss falling while held-out loss rises. Template mismatch, where the training script uses different role markers or special tokens than the inference server, produces a model that looks broken for reasons no amount of data will fix. And a fine-tune trained only on correct answers frequently learns the surface distribution of the answers rather than the task, which survives the benchmark and collapses in production.

Where the middle ground actually sits

Continued pretraining is the option most teams forget, and it is often the correct one. Suppose you have three billion tokens of Indian court judgments, engineering drawings, or internal incident reports, and you want a model that writes in that register and knows its conventions. Fine-tuning on a few thousand summaries will teach the format but leave the model guessing at the vocabulary. Running the pretraining objective on the three billion tokens at a low learning rate first, then fine-tuning, gives the model the distribution before you ask it to behave.

The arithmetic is friendlier than people expect. A 3B model on 30 billion domain tokens costs about 5.4e20 FLOPs, which is roughly a thousand H100-hours, a few thousand dollars at market rates. That is a weekend on a small rented cluster and orders of magnitude below a frontier-scale run. The hard parts are data cleaning, deduplication and the risk of forgetting general ability if the domain corpus is narrow and the learning rate is too high, which is why a rehearsal mix of general text is usually included.

This hybrid pattern, adapt an existing checkpoint to a domain and then align it, is what most serious domain-specific models actually do. Genuine from-scratch training is concentrated in organisations that need a new tokenizer for an underserved language, that cannot accept any upstream licence, or that are researching architecture itself.

A practical sequence

Build the evaluation set first, then a prompt-and-retrieval baseline. Measure it. If the baseline is close to acceptable, stop; the cheapest intervention is usually the one you have not tried yet. If the errors are consistently about format, add a few hundred demonstrations and train a LoRA adapter. If the errors are about domain knowledge, add retrieval before adding parameters. If retrieval cannot cover the knowledge because it is diffuse and stylistic, such as legal drafting conventions across a decade of filings, that is the point where continued pretraining on a domain corpus earns its cost.

Each stage should have an explicit exit criterion. A useful rule: if the remaining errors are knowledge-shaped, more demonstrations will not fix them; if they are shape-shaped, more pretraining will not fix them either. Reviewing a sample of a hundred failures by hand tells you which of the two you have, and it is the highest-leverage hour in the whole project.

Keep a training log that records the base checkpoint by exact revision, the dataset hash, the tokenizer version, the hyperparameters and the evaluation scores. Six weeks later, when someone asks why the deployed model behaves differently from the one in the notebook, that log is the only thing that will answer the question. Treat the adapter as a build artefact: versioned, reproducible and tied to the data that produced it.

Page feedback

Was this helpful?

A quick signal helps improve these notes.

Report a mistake Straight to the lab inbox

Put it to work

See the models, datasets and gateway this lab runs.