May we use cookies so Meta, Google, LinkedIn and ChatGPT see your visit and we learn which ads work? PrivacyMay we use cookies to see which pages help, and let Meta, Google, LinkedIn and ChatGPT see your visit, so we know which of our ads work? That way we spend less on ads that do not work. We do not sell your data, and the site works the same if you decline. You can change your answer at any time under Cookie settings at the foot of the page. Privacy policy
Loading...
AI Engineering · Llm Genai Ops
Free preview: the first part of this 11-part lesson.
Already bought the course? Sign in to read the whole lesson.
this lesson is part of
Generative AI and Agentic AI Engineering
Unlock this lesson and the 208 other paid lessons
$35 once, by card or PayPal
See the Generative AI and Agentic AI courseread the rest of this lesson in
Generative AI and Agentic AI Engineering
Unlock this lesson and the 208 other paid lessons
$35 once, by card or PayPal
See the Generative AI and Agentic AI coursein Llm Genai Ops
This lesson is part of the AI Engineering course. Unlock the full course, a separate one-time payment, for lifetime access.
One-time payment by card or PayPal
Get Lifetime AccessOne-time payment: UPI, card or netbanking
Get Lifetime AccessFoundation lessons of this course are free, no payment needed. Try them now
A team wants to specialize a 7 billion parameter open model on their support tickets. The obvious plan is to fine-tune it: keep training the model on their own data until it speaks their domain. So they reach for full , the way you would train any neural network, and update every weight.
Then they price the hardware, and the number is not what intuition suggests. The weights themselves are the small part of the bill. Holding a 7B model in half precision is about 14 GB. But training with Adam, the standard optimizer, means you also carry a gradient for every weight and three more full-size copies of the model: a first-moment estimate, a second-moment estimate, and a full-precision master copy that mixed-precision training keeps to avoid rounding error accumulating. Those extra copies are held in fp32, which is 4 bytes per number, so each one is roughly 27 GB and the three together come to about 81 GB with the model's exact 6.74 billion weights (6.74 × 4 × 3 is about 80.9). The chart below rounds the model up to a flat 7 billion, which gives 7 × 4 × 3 = 84 GB. Add the fp16 weights and the fp16 gradients and you are already past 100 GB before you count activations, which grow with batch size and sequence length on top.

That does not fit on one card. You are renting a multi-GPU box, and the optimizer state you are paying for exists only because every weight is training.
Now the second bill arrives, at deployment. Every fine-tuned model is a full 14 GB copy. The support team wants one model. The sales team wants another. The onboarding team wants a third. Ten teams means ten 14 GB checkpoints, ten deployments, ten copies of nearly the same model sitting in memory and in storage.
Full fine-tuning of a large model is expensive twice over: the training needs a rack of GPUs, and every task produces a full copy of the model.
There is a much cheaper way that gives up almost nothing, and it comes from one sharp observation about what fine-tuning actually changes.