Resources/Model training/What happens during training

Method

Full fine-tuning

Full fine-tuning updates every weight in the model. It has the most room to change behaviour, but needs many times the model's own size in GPU memory and is the most likely to erode skills the base model had.

Chapter 64 min read5 references

What it is

Full fine-tuning continues training the entire model on your examples: every weight in every layer may change. It is the most direct form of fine-tuning, and mechanically the same as the later stages of how the model was built. The alternative is parameter-efficient fine-tuning (PEFT), such as LoRA, which freezes the original weights and trains a small add-on instead.

Where the memory goes

Running a model needs only its weights. Training every weight needs, for each one, the weight itself, its gradient and the optimizer state. With AdamW in the usual mixed-precision setup, that is a 16-bit weight and a 16-bit gradient for the forward and backward passes, plus a 32-bit master copy of the weight and Adam's two 32-bit running averages, kept for stable updates. The ZeRO paper's accounting puts this at 16 bytes per weight; other setups that keep gradients in 32 bits come to about 18.

Memory per trainable weight
per trainable weight · AdamW · mixed precision
  16-bit weight              2 bytes
  16-bit gradient            2 bytes
  32-bit master weight       4 bytes
  32-bit Adam momentum       4 bytes
  32-bit Adam variance       4 bytes
  ───────────────────────────────────
                            16 bytes   + activations

7B model:  7 × 10⁹ × 16 bytes ≈ 112 GB
Full fine-tuning16-bit + Adam≈ 112 GBLoRA16-bit base, frozen≈ 15 GBQLoRA4-bit base, frozen≈ 4–5 GBAdam + fp32 copyfrozen weightstrainable weightsgradientsoptimizer state
Rough GPU memory to fine-tune a 7-billion-parameter model, before activations. Full fine-tuning with Adam needs about 16 bytes for every weight: the weights, their gradients, a full-precision master copy and two optimizer statistics. LoRA keeps the base frozen, so gradients and optimizer state exist only for the small adapter (here about 40 million weights).
A 7-billion-parameter model, three ways
  1. Just running it in 16-bit: 7 billion × 2 bytes ≈ 14 GB.
  2. Full fine-tuning with AdamW: 7 billion × 16 bytes ≈ 112 GB, before activations. That is more than a single 80 GB GPU holds, so the job is split across several GPUs with techniques such as ZeRO or FSDP, which divide the optimizer state, gradients and weights between them.
  3. LoRA at rank 16 on all linear layers of a Llama-style 7B model: about 40 million trainable weights, 0.6% of the model. Their training state is about 40 million × 16 bytes ≈ 0.6 GB, on top of the 14 GB frozen base: roughly 15 GB.
  4. QLoRA: the frozen base held in 4 bits takes about 3.5 GB, so the total is around 4–5 GB plus activations, within reach of a single consumer GPU.
  5. Activations come on top in every case and grow with batch size and sequence length. Gradient checkpointing trades extra compute for less activation memory.

What it buys you

Full fine-tuning can change the model in any direction, not just within the small subspace an adapter can reach. One study comparing the two found that full fine-tuning learns changes with 10–100× the rank of typical LoRA settings, and that it learned more on large code and maths training sets of around 100,000 examples. For the common business case, a few hundred to a few thousand chat examples that teach tone, format and domain phrasing, LoRA applied to all layers generally matches full fine-tuning.

What it costs you: forgetting

Catastrophic forgetting is the tendency of a network trained on something new to lose what it learned before. Because full fine-tuning can move every weight, it has the most room to overwrite general abilities: a support model that answers your product questions perfectly but has become worse at following unrelated instructions. An empirical study of continual instruction tuning observed forgetting across models from 1B to 7B parameters, and models fine-tuned with LoRA, which keeps the base frozen, have been found to forget less.

  • Fewer epochs and a lower learning rate, so the weights move less from where they started.
  • Mix in general data, such as a share of broad instruction-following examples alongside your own.
  • Evaluate beyond your task. Include a few general questions in the evaluation so a regression shows up.
  • Prefer an adapter unless a gain from full fine-tuning has actually been measured.

Full fine-tuning and LoRA side by side

AspectFull fine-tuningLoRA adapter
Trainable weightsAll of themTypically 0.1–1%
Memory to trainAbout 16 bytes per weight, plus activationsThe frozen base (2 bytes per weight, or about 0.5 in 4-bit) plus a small adapter
Saved resultA full model copy, e.g. about 14 GB for 7B in 16-bitAn adapter file, often tens to hundreds of MB
Typical learning rateAround 1e-5Roughly 10× higher
Forgetting riskHigherLower
Best forLarge datasets teaching substantial new skillsTone, format and domain phrasing; several variants of one base

Common mistakes

  • Choosing full fine-tuning because it sounds more thorough. On small datasets it usually costs far more for no measurable gain.
  • Budgeting GPU memory from the model's download size. Training every weight needs about eight times the 16-bit weights, plus activations.
  • Training many epochs at a high learning rate and testing only the target task, then discovering general skills have degraded.
  • Forgetting that every full fine-tune is a full-size model to store and to serve.

References and further reading

External sources open in a new tab.

  1. 01ZeRO: Memory Optimizations Toward Training Trillion Parameter ModelsRajbhandari et al., 2019 · arXiv · arxiv.orgThe source of the 16-bytes-per-parameter accounting, and of the sharding used to spread it across GPUs.
  2. 02GPU memory usageHugging Face Transformers docs · huggingface.coA breakdown of weights, optimizer states, gradients and activations during training.
  3. 03LoRA Learns Less and Forgets LessBiderman et al., 2024 · arXiv · arxiv.orgA careful comparison of full fine-tuning and LoRA on code and maths: what each learns and what each forgets.
  4. 04An Empirical Study of Catastrophic Forgetting in Large Language Models During Continual Fine-tuningLuo et al., 2023 · arXiv · arxiv.org
  5. 05LoRA vs. full fine-tuningTogether AI docs · docs.together.aiA provider's practical advice on when to move from an adapter to full fine-tuning.

Turn weeks of expert work into minutes

See how Scalata fits your team, your data, and your controls.