Training (pre-training) teaches a model from random weights using trillions of tokens and thousands of GPUs. Fine-tuning adapts an existing model with thousands to millions of examples, usually on one machine in hours. Inference runs a finished model to answer requests; it needs only the weights in memory and runs continuously.
- Pre-training data
- Trillions of tokens (Llama 3: over 15 trillion, per Meta)
- Fine-tuning data
- Thousands to millions of examples
- Inference memory
- Weights (2 bytes/param in BF16) + KV cache
- Full training memory
- ≈ 16–20 bytes per parameter + activations
- Training compute
- ≈ 6 × parameters × tokens FLOPs
- Inference compute
- ≈ 2 × parameters FLOPs per generated token
Training, fine-tuning and inference are three stages in a model's life, and they need very different amounts of data, memory and money. Mixing them up is how teams end up pricing a pre-training cluster when they needed an afternoon of LoRA, or budgeting for a fine-tune when the real bill is serving. This guide defines each, puts numbers on the differences, and helps you work out which one you actually need. It is part of our complete guide to GPU model training.
What is the difference in one table?
The short version: pre-training creates a model's general ability, fine-tuning shapes it for a job, and inference uses it.
| Pre-training | Fine-tuning | Inference | |
|---|---|---|---|
| Starting point | Random weights | A pretrained model | A finished model |
| Goal | General language ability and knowledge | Specific behaviour, format, domain or task | Answer requests |
| Data | Trillions of tokens of raw text | Thousands to millions of curated examples | User prompts |
| Weights change? | Yes, all of them | Yes: all (full) or small adapters (LoRA) | No |
| Memory per parameter | 16–20 bytes + activations | 16–20 bytes (full), ≈ 2 (LoRA), ≈ 0.55 (QLoRA) + a few GB | ≈ 2 bytes (BF16), 1 (FP8), ≈ 0.55 (4-bit) + KV cache |
| Typical hardware | Thousands of GPUs across many nodes | 1–8 GPUs in one machine | 1 GPU up to a few, per replica |
| Duration | Weeks to months | Minutes to days | Continuous, while the product runs |
| Who does it | Model labs (Meta, Alibaba Qwen, Mistral, DeepSeek…) | Product teams, researchers | Everyone using a model |
What is training (pre-training)?
Pre-training is the process of teaching a neural network from random weights by showing it huge amounts of data and adjusting every weight to reduce prediction error. For a language model, the task is predicting the next token across trillions of tokens of text.
The scale is what defines it. Meta reports that Llama 3 was pre-trained on over 15 trillion tokens. The compute for training a dense transformer is approximately 6 × parameters × tokens floating-point operations (2 for the forward pass, 4 for the backward pass). For an 8B model on 15 trillion tokens that is:
6 × 8×10⁹ × 1.5×10¹³ = 7.2×10²³ FLOPs.
At one H100 PCIe's published dense BF16 peak of about 756 TFLOPS and a realistic 40% utilisation, that is 7.2×10²³ ÷ (3.0×10¹⁴) ≈ 2.4 billion GPU-seconds, about 660,000 GPU-hours, or 75 years on one card. That is why pre-training happens on clusters of thousands of GPUs joined by high-speed networks, and why almost nobody outside model labs does it for general-purpose LLMs.
Pre-training at smaller scale is still useful. Training a 100M–1B parameter model for a specific domain (code in an in-house language, protein sequences, sensor data) on a few billion tokens is a realistic project on one 8-GPU machine. A 1B model on 20 billion tokens is 1.2×10²⁰ FLOPs, which our compute estimate puts at about 126 GPU-hours on H100 PCIe at 35% utilisation: under a day on an 8-GPU machine.
What is fine-tuning?
Fine-tuning is further training of a pretrained model on a smaller, targeted dataset so it behaves the way you need. It uses the same forward and backward passes as pre-training, but starts from a model that already understands language, so it needs orders of magnitude less data and compute.
There are three common forms:
- Supervised fine-tuning (SFT). Train on example conversations or input-output pairs. This is what most people mean by fine-tuning.
- Preference tuning (DPO, ORPO, RLHF). Train on pairs of better and worse answers to shift style, safety or helpfulness.
- Continued pre-training. Train on raw domain text (legal, medical, a new language) before SFT. This is the most expensive form and sits closest to pre-training.
And two ways of updating weights:
- Full fine-tuning updates every weight. Memory is the same 16–20 bytes per parameter as pre-training, so an 8B model needs about 128–160 GB before activations.
- Parameter-efficient fine-tuning, mainly LoRA and QLoRA, freezes the model and trains small adapters. An 8B QLoRA run fits in about 8–13 GB. Our LoRA and QLoRA guide explains how.
The compute is small next to pre-training. Fine-tuning an 8B model on 20 million tokens is 6 × 8×10⁹ × 2×10⁷ = 9.6×10¹⁷ FLOPs, about 750,000 times less than the 15-trillion-token pre-training run above. On one H100 PCIe that is roughly 1–1.5 hours by our compute estimate.
What is inference?
Inference is running a trained model to produce outputs: generating text, classifying an image, transcribing audio. No weights change. For an LLM, each generated token costs roughly 2 × parameters FLOPs, and the whole set of weights is read from memory for every decode step.
That last point shapes inference hardware. A single user's chat is limited by memory bandwidth rather than compute. A rough estimate: tokens per second ≈ 0.6–0.75 × memory bandwidth ÷ bytes read per token. For Llama 3.1 8B in BF16 (16 GB of weights) on an H100 PCIe (2.0 TB/s): 0.6–0.75 × 2,000 ÷ 16 ≈ 75–94 tokens per second for one stream, as an estimate. Serving many users at once with continuous batching (vLLM, SGLang) multiplies total throughput because one weight read serves many requests.
Memory for inference is weights plus the KV cache, which grows with context length and the number of concurrent requests. Our guide to LLM inference covers this in depth, and GPU memory for LLMs has the sizing tables.
How do the GPU requirements compare?
The same model can need very different GPUs at each stage. Take Llama 3.1 8B and Llama 3.3 70B:
| Task | Llama 3.1 8B | Llama 3.3 70B |
|---|---|---|
| Inference, BF16 | 16 GB weights + KV cache → RTX 4090 at short context, L40S comfortably | 140 GB → H200 or 2 × 80 GB cards |
| Inference, FP8 | 8 GB → RTX 4090 | 70 GB → one 80 GB card, short context; RTX PRO 6000 (96 GB) more room |
| Inference, 4-bit | ≈ 4.4–4.8 GB → anything | ≈ 35–42 GB → L40S (48 GB) |
| QLoRA fine-tune | 8–13 GB → RTX 4090 | 45–60 GB → A100 80GB or H100 |
| 16-bit LoRA fine-tune | 20–26 GB → L40S | 150–165 GB → B200, or 2–4 cards sharded |
| Full fine-tune | 145–185 GB → B200, or 4–8 cards sharded | ≈ 1.25–1.6 TB → 8 × B300, or multi-node |
| Pre-training from scratch | Thousands of GPU-days and up | Multi-node cluster for months |
The pattern: inference and parameter-efficient fine-tuning fit on one card for almost every open model up to 70B. Full fine-tuning needs a multi-GPU machine. Pre-training general LLMs needs a cluster.
How do the costs compare?
Fine-tuning is a one-off cost measured in GPU-hours; inference is a running cost measured in GPU-hours per day. Here is the same 8B project priced both ways on our hardware. Training hours are compute estimates (6 × N × T FLOPs at NVIDIA's dense BF16 peaks, 25% utilisation for QLoRA); serving assumes one GPU kept up during working hours.
| Item | GPU | GPU-hours | Price per GPU-hour | Cost |
|---|---|---|---|---|
| QLoRA fine-tune, 20M tokens | L40S | ≈ 3 (budget 4–6 with evaluation) | $1.89/hr | ≈ $7.56–$11.34, once |
| Re-run after fixing data | L40S | ≈ 3 | $1.89/hr | ≈ $5.67, once |
| Serve the model, 10 h × 22 working days | L40S | 220 per month | $1.89/hr | $415.80, every month |
| Serve the model 24/7 | L40S | ≈ 730 per month | $1.89/hr | $1,380, every month |
Estimates; prices as of November 2026. Even with two retries, the fine-tune is a small fraction of one month's serving. That is the most common budgeting mistake in this space: obsessing over training cost and under-planning inference. See the cost to fine-tune an LLM for more training scenarios.
Do you need to fine-tune at all?
Often not. Try the cheaper options first, in this order:
- Prompting. A clear system prompt with a few examples. Costs nothing but tokens.
- Retrieval (RAG). Put your documents in a search index and feed relevant passages into the prompt. Best when the answer lives in documents that change, or when you need citations.
- A bigger or better open model. Moving from an 8B to a 32B or 70B model can fix quality problems that fine-tuning the small one would not.
- Fine-tuning. When you need consistent output format, a house tone, a narrow task done cheaply by a small model, or behaviour that prompts cannot reliably produce.
- Continued pre-training or training from scratch. When your data is genuinely unlike anything the base model saw.
A useful test for fine-tuning: if you can write 500–1,000 examples of exactly what good looks like, and prompting gets you most of the way but not reliably, fine-tuning will probably help. If you cannot write the examples, it will not.
How long does each stage take in practice?
Time is where the three stages feel most different day to day. Pre-training is a project measured in weeks of cluster time, with checkpoints, restarts and a team watching loss curves. Fine-tuning is a job measured in hours: you prepare data for days, then the run itself is short. Inference is a service measured in milliseconds per request and months of uptime.
| Stage | Typical wall-clock | What dominates the effort |
|---|---|---|
| Pre-training a general 7B+ LLM | Weeks to months on thousands of GPUs | Data pipeline, cluster reliability, checkpointing |
| Pre-training a small domain model (≤ 1B) | Hours to days on one 8-GPU machine | Data collection and cleaning |
| LoRA / QLoRA fine-tune of 8B–70B | Minutes to a day on one machine | Writing and cleaning examples, evaluation |
| Full fine-tune of 8B–14B | Hours to days on 4–8 GPUs | Memory planning, sharded checkpoints |
| Inference | Continuous | Latency, throughput, uptime, cost per token |
The practical consequence: for fine-tuning, most of your calendar time is spent off the GPU. Prepare and validate data on a laptop or a cheap card, then rent the right GPU only for the run. With per-minute billing on Wandering Giants Compute, a two-hour fine-tune costs two hours, not a day.
Which tools are used at each stage?
The tooling differs more than the maths.
| Stage | Common tools |
|---|---|
| Pre-training | PyTorch with FSDP, Megatron-LM, DeepSpeed, NVIDIA NeMo, TorchTitan |
| Fine-tuning | Hugging Face TRL and PEFT, Unsloth, Axolotl, torchtune, LLaMA-Factory |
| Inference | vLLM, SGLang, TGI, llama.cpp, Ollama |
A working fine-tuning script for Llama is in our step-by-step fine-tuning tutorial.
When renting from Wandering Giants fits
Wandering Giants Compute covers two of the three stages on one service. For fine-tuning, choose Root and get the whole machine (SSH, Jupyter, CUDA, PyTorch) with 1, 2, 4 or 8 of the same GPU, billed by the minute. For inference, choose API and get an OpenAI-compatible vLLM endpoint on your own GPU, or Chat for a private chat with an open model. You can fine-tune, stop the machine, and serve the result the same day.
We do not offer multi-node clusters, so pre-training general-purpose LLMs at 7B and above is out of scope. For that, providers with InfiniBand clusters, such as CoreWeave, Lambda or Nebius, are the right choice.
Frequently asked questions
Is fine-tuning the same as training?
Fine-tuning is a kind of training: it runs the same forward and backward passes and updates weights. The difference is the starting point and scale. Pre-training starts from random weights on trillions of tokens; fine-tuning starts from a capable model and uses a small, targeted dataset.
Which needs more GPU memory, training or inference?
Training, by a wide margin. Inference in BF16 needs about 2 bytes per parameter plus a KV cache; full training with Adam needs about 16–20 bytes per parameter plus activations. LoRA and QLoRA close most of that gap for fine-tuning.
Should I fine-tune or use RAG?
Use retrieval-augmented generation when the model must answer from documents that change or must cite sources. Fine-tune when you need consistent format, tone or task behaviour that prompting cannot produce. Many production systems use both.
Can I train my own LLM from scratch?
Small models, yes: a 100M–1B parameter model on a few billion tokens is a realistic project on one 8-GPU machine. Training a competitive general-purpose model at 7B and above takes trillions of tokens and large multi-node clusters, which is why most teams fine-tune open models instead.
Does inference or training cost more over time?
For a product in use, usually inference. A fine-tune is a one-off cost of hours; serving runs every hour the product is live. Plan the serving bill first, then the training bill.
Can the same GPU do training and inference?
Yes. The same card can fine-tune a model in the morning and serve it in the afternoon. Training favours compute and memory capacity; single-user inference favours memory bandwidth.
Rent the GPU for this, by the minute.
Fine-tune and serve on the same rented GPU: Root access for training, a vLLM API for inference, billed by the minute.
Prepaid credit, billed by the minute, stops itself when credit runs out. Prices in £, $, €, ¥, CA$, A$, CHF and S$; UK prices include VAT.
Keep reading
- Complete guideWhat Is GPU Model Training? A Complete Guide
- Complete guideWhat Is LLM Inference? A Complete Technical Guide
- GuideWhat Is LoRA and QLoRA? A Practical Guide
- TutorialHow to Fine-Tune Llama on a Cloud GPU
- Cost breakdownHow Much Does It Cost to Fine-Tune an LLM?
- GuideHow Much GPU Memory Do You Need to Run LLMs?
About this article. Written by the Wandering Giants Compute team, the people who run Wandering Giants Compute. Hardware figures are the manufacturers’ published specifications. Speeds and costs marked as estimates are worked out from those specifications and our current prices, with the method shown; they are not measured benchmarks. Wandering Giants prices are taken live from our price list each time this page is built.
Last reviewed 25 November 2026.