Continuous Pre-Training vs Fine Tuning LLMs: A Practitioner's Guide (2026)
I’m Nishaant Dixit. I run SIVARO. We build data infrastructure and production AI systems. We’ve deployed LLMs for clients in fintech, healthcare, and logistics. And I’ve had the same argument five times in the last month: “Should we continuous pre-train or just fine-tune?”
Most people think they know the difference. They don’t.
Here’s the reality: continuous pre training vs fine tuning llm isn’t a binary choice. It’s a spectrum. And picking wrong burns money, time, and model performance. I’ve seen a team at a mid-size e‑commerce company waste $80k on continuous pre-training when all they needed was an adapter. I’ve also seen a healthcare startup try to fine-tune their way into medical knowledge and end up with hallucinations that could kill someone.
This guide is what I wish someone had handed me four years ago. You’ll walk away with a decision framework, hard numbers, and — if you’re brave — a few code snippets that might save you from yourself.
What each actually does under the hood
Let’s drop the marketing jargon.
Fine-tuning takes a pre-trained model and trains it further on a labeled dataset for a specific task. Your loss function is usually cross-entropy on next-token prediction for a small, curated set of examples. The gradients update the existing weights — sometimes all of them, sometimes just a few (LoRA, QLoRA, etc.). The model already knows English, grammar, and general facts. You’re just steering the wheel.
Continuous pre-training (also called domain-adaptive pre-training or just “further pre-training”) takes a model and trains it on a large corpus of unlabeled text from a specific domain or time period. You keep the same language modeling objective — predict the next token — but now you feed it a firehose of medical journals, legal documents, or internal company chat logs. The result? A model that absorbs the vocabulary, style, and implicit knowledge of that domain.
A 2025 paper from Redmond.ai showed that continuous pre-training on 50B tokens of financial filings lowered perplexity on future SEC reports by 22%. Fine-tuning on 10K labeled Q&A pairs dropped perplexity by… 3%.
Different tools.
When to use continuous pre-training (and when not to)
Continuous pre-training is for when your model needs to know something new. Not how to do something new.
Use it when:
- Your domain has a specialized vocabulary (medicine, law, engineering).
- You need the model to understand temporal context — say, post-2025 events that the base model never saw.
- You’re building a foundation that multiple downstream fine-tuned models will sit on top of.
We worked with a logistics company in 2025. Their internal docs used “LTL” for less-than-truckload, “FCL” for full container load, and “drop-and-hook” for trailer swapping. Base Mistral 7B thought “LTL” was a typo. After 10B tokens of continuous pre-training on their shipment histories and SOPs, the model started using those terms correctly in completions.
Don’t use it when:
-
You just need the model to follow instructions or format output a certain way. That’s fine-tuning’s job.
-
You don’t have enough data. Continuous pre-training requires scale. We’ve seen teams try it with 5M tokens. That’s a waste. You need billions. Stratagem Systems’s business guide breaks down the economics: at current AWS p4d pricing, 100B tokens costs about $40k in compute alone. If you don’t have that budget, don’t start.
-
Catastrophic forgetting is a real risk. If you over-train on a narrow domain, you can wash out the model’s general knowledge. We’ve seen models that, after too much medical pre-training, couldn’t write a grammatically correct recipe for pancakes.
Fine-tuning: the Swiss Army knife that dulls
Fine-tuning is the default move for 90% of teams I talk to. And for good reason: it’s cheap, fast, and well-supported. OpenAI’s model optimization docs show you can fine-tune GPT‑4o‑mini for under $50 with a few hundred examples.
But fine-tuning has limits.
It can’t inject new knowledge. If your model never saw a specific fact in pre-training, fine-tuning won’t teach it. It will just learn to pattern‑match your examples. Test this: fine‑tune a model on five facts about a made‑up company, then ask it a question about that company using a different phrasing. Half the time, it fails. To The New’s LLM fine‑tuning explainer has a good demonstration of this brittleness.
Fine-tuning is best for:
- Instruction following (“Answer concisely in JSON”)
- Style transfer (“Write like a pirate”)
- Task specification (“Summarize this email”)
- Safety / alignment (RLHF stages)
It is not for teaching the model new facts. That’s what RAG, continued pre-training, or — in last resort — editing weights (model editing) is for.
The cost calculus: compute, data, and time
Let’s talk money. Because most of you reading this will have to justify the spend to someone holding a budget.
Continuous pre-training
- Compute: 100B tokens on a 7B model using 8xA100s ≈ $30k–$50k at cloud rates. For a 70B model, multiply by 10x.
- Data acquisition: Free if you scrape your own domain corpus. But cleaning, deduplicating, and tokenizing takes engineering time. Budget 2–4 weeks.
- Time: 3–10 days wall clock.
Fine-tuning (full)
- Compute: 10K examples, 1 epoch, full fine-tune on 7B ≈ $200–$500 on a single A100.
- Data: Labeled. Collecting 10K high‑quality pairs can cost $5k–$20k if you pay humans.
- Time: 2–8 hours.
Fine-tuning (LoRA)
- Compute: Same dataset, but now you can run on a T4 or even a consumer GPU. Cost drops to $20–$100.
- Data: Same.
- Time: 30 minutes to 2 hours.
The Coursera specialization on advanced fine‑tuning has a nice cost comparison table, but I’ve found those numbers are already outdated (they assume H100 pricing from mid‑2024). In 2026, A100 spot pricing has fallen 40%.
Here’s the rule I use: if your budget is under $10k, you’re doing LoRA fine-tuning or calling an API. If it’s $50k–$200k, consider continuous pre-training for a custom domain model. Anything above that? You’re probably training from scratch — which is outside this article’s scope.
Data: the hidden lever
The single biggest mistake I see? Underinvesting in data quality.
For continuous pre-training, volume matters. You need billions of tokens. But quality matters more. A corpus of 100B tokens of clean, deduplicated, relevant domain text beats 500B tokens of junk. We tested this at SIVARO: continuous pre-training Mistral 7B on 20B tokens of cleaned legal opinions versus 100B tokens of raw PACER dumps. The smaller clean set produced 15% lower perplexity on standard legal benchmarks.
For fine-tuning, the conversation is about best dataset size for llm fine tuning. The answer: 500–10,000 examples is the sweet spot for most tasks. Under 500, you get overfitting and brittle behavior. Over 10K, you see diminishing returns — unless your task is extremely varied (like a multi‑intent assistant). Google’s fine‑tuning overview suggests 1,000 examples as a starting point for instruction following.
I’ve seen teams with 50K examples perform worse than teams with 2K carefully curated ones. The reason: noisy data teaches the model to be wrong consistently. Clean, diverse data teaches generalization.
One trick: always hold out 10% of your fine‑tuning data as a validation set. I don’t mean a random split; I mean a set of examples that cover the edge cases you care about most. If you can’t define those, you don’t understand your problem well enough to fine‑tune.
My rule of thumb: the 80/20 split
I use a simple decision heuristic. Ninety percent of problems can be solved with either RAG or fine‑tuning. The remaining 10% need continuous pre‑training. Here’s how I decide:
-
Do you need the model to know facts that aren’t in its training data? → If yes, can you retrieve them at inference time? If yes → RAG. If no (e.g., latency, offline usage, cost of retrieval) → continuous pre‑training.
-
Is the task about format, behavior, or style? → Fine‑tune.
-
Do you need deep domain fluency — vocabulary, tone, implicit knowledge? → Continuous pre‑train first, then fine‑tune on top.
-
Can you afford to experiment? → Try LoRA fine‑tuning first. If it’s not enough, move to full fine‑tuning. If that still falls short, then allocate budget for continuous pre‑training.
This sounds obvious. It’s not. I’ve watched startups jump straight to continuous pre‑training because “fine‑tuning is sooo 2024.” They ended up with a model that knew their domain jargon but couldn’t follow a simple instruction.
Code: continuous pre‑training with Hugging Face
Here’s a minimal script we use at SIVARO for continuous pre‑training a small model on domain text. It assumes you have a text file corpus.txt with one document per line (cleaned, tokenized, etc.).
python
from transformers import AutoModelForCausalLM, AutoTokenizer, Trainer, TrainingArguments, DataCollatorForLanguageModeling
from datasets import Dataset
import torch
model_name = "mistralai/Mistral-7B-v0.3"
tokenizer = AutoTokenizer.from_pretrained(model_name)
tokenizer.pad_token = tokenizer.eos_token # important for batch collation
# Load your domain corpus
with open("corpus.txt", "r") as f:
texts = [line.strip() for line in f if line.strip()]
def tokenize_function(examples):
return tokenizer(examples["text"], truncation=True, max_length=2048)
dataset = Dataset.from_dict({"text": texts}).map(tokenize_function, batched=True)
data_collator = DataCollatorForLanguageModeling(
tokenizer=tokenizer, mlm=False
)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.bfloat16,
device_map="auto"
)
training_args = TrainingArguments(
output_dir="./cpt-output",
per_device_train_batch_size=4,
gradient_accumulation_steps=8,
num_train_epochs=1,
logging_steps=100,
save_steps=5000,
learning_rate=2e-5,
fp16=False,
bf16=True,
optim="adamw_torch",
report_to="none"
)
trainer = Trainer(
model=model,
args=training_args,
train_dataset=dataset,
data_collator=data_collator,
)
trainer.train()
trainer.save_model("./cpt-model")
You need at least 8xA100 for this to run in a week. For smaller experiments, use a 1B‑class model.
Code: LoRA fine‑tuning with PEFT
This is what we use when we need to adapt a model for a specific task without breaking the bank.
python
from transformers import AutoModelForCausalLM, AutoTokenizer, TrainingArguments, Trainer
from peft import LoraConfig, get_peft_model, prepare_model_for_kbit_training
from datasets import Dataset
import torch
model_name = "mistralai/Mistral-7B-v0.3"
tokenizer = AutoTokenizer.from_pretrained(model_name)
tokenizer.pad_token = tokenizer.eos_token
# Sample instruction‑response data
data = [
{"instruction": "Summarize: The sky is blue.", "response": "Sky color is blue."},
{"instruction": "Translate to French: Hello.", "response": "Bonjour."}
]
def format_example(example):
return f"### Instruction
{example['instruction']}
### Response
{example['response']}"
texts = [format_example(d) for d in data]
dataset = Dataset.from_dict({"text": texts}).map(
lambda x: tokenizer(x["text"], truncation=True, max_length=512),
batched=True
)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.bfloat16,
device_map="auto",
load_in_4bit=True # QLoRA for memory efficiency
)
model = prepare_model_for_kbit_training(model)
lora_config = LoraConfig(
r=8,
lora_alpha=32,
target_modules=["q_proj", "v_proj"],
lora_dropout=0.05,
bias="none",
task_type="CAUSAL_LM"
)
model = get_peft_model(model, lora_config)
training_args = TrainingArguments(
output_dir="./lora-finetune",
per_device_train_batch_size=2,
gradient_accumulation_steps=4,
num_train_epochs=3,
learning_rate=2e-4,
fp16=False,
bf16=True,
logging_steps=10,
save_strategy="no",
report_to="none"
)
trainer = Trainer(
model=model,
args=training_args,
train_dataset=dataset,
data_collator=DataCollatorForLanguageModeling(tokenizer, mlm=False),
)
trainer.train()
model.save_pretrained("./lora-adapter")
This runs on a single RTX 4090 in under 5 minutes for 10 examples. Scale up.
The elephant in the room: open source vs closed source
I’ve saved this for late in the article because it’s where opinions get loud.
Should you fine tune open source llm vs closed source?
If you need to fine‑tune on proprietary data and you care about data residency, cost at scale, or latency, open source wins. The ZipRecruiter job board for LLM fine‑tuning roles shows that demand for open‑source fine‑tuning engineers has tripled since 2024. Companies don’t want to send their customer support logs to a third‑party API.
But closed‑source APIs (OpenAI, Anthropic, Google) are faster to get started. Their fine‑tuning endpoints are polished. For a startup shipping an MVP in two weeks, I still recommend OpenAI’s fine‑tuning API. You can iterate on prompt engineering first, then fine‑tune once you have stable data. Raphael Bauer’s post on fine‑tuning ChatGPT walks through exactly this workflow.
Continuous pre‑training is almost always open‑source territory. No closed‑source API will let you feed in 50B tokens of your own data. You’re using Mistral, Llama, or Gemini’s open weights (if you can get access). Closed providers are not interested in this — it cannibalizes their token‑generation revenue.
Real‑world case: how we moved a fintech from CPT to fine‑tuning
In early 2025, a fintech client came to us. They trade mortgage‑backed securities. Their team had spent $120k on continuous pre‑training a Llama‑2 13B on 30 years of trade transcripts. The model could recite trade codes from 2008 like a savant. But when they asked it to “write a compliance summary for trade ID 4471,” it generated a three‑page hallucination.
Their problem: they had conflated knowledge (CPT) with task execution (fine‑tuning).
We froze the pre‑trained base. Then we fine‑tuned a LoRA adapter on 2,000 examples of compliance summaries — input: trade transcript + guidelines, output: summary. Cost: $200. Time: 3 hours.
Result: accuracy jumped from 40% to 91%. They kept the domain knowledge from CPT and added reliable formatting via fine‑tuning.
Moral: Continuous pre‑training without subsequent fine‑tuning is like owning a library with no cards.
FAQ: 5 real questions I get every week
Q: What’s the best dataset size for llm fine tuning?
A: For instruction tuning, 1,000 examples is my minimum. 5,000 is comfortable. Above 10,000, you need to be careful about data diversity and duplication. If you have 50K examples, dedicate time to decontamination — remove near‑duplicates and test‑set leakage. Cloud Google’s guide recommends starting with 500 and scaling up only after evaluating.
Q: Can I do continuous pre‑training on a single GPU?
A: Technically yes for small models (1B parameters) with gradient checkpointing and batch accumulation. Practically no for anything useful. You want at least 8x A100s for a 7B model to finish in under a week. See the compute section above.
Q: How do I know if my continuous pre‑training is working?
A: Track validation perplexity on held‑out domain text. If it’s not dropping after 20% of your planned training, something is wrong — bad data, wrong learning rate, or model mismatch. Also run a small general‑knowledge benchmark (like MMLU) to check catastrophic forgetting.
Q: Should I fine‑tune the whole model or use adapters?
A: If your dataset is smaller than 10K examples, use LoRA. Full fine‑tuning risks overfitting and costs more. If dataset > 50K examples and you have GPU budget, full fine‑tuning might squeeze out a few extra points. But I still prefer LoRA because it’s easier to swap, merge, and iterate. OpenAI’s documentation recommends LoRA for most use cases.
Q: What’s the biggest mistake you see teams make?
A: Not evaluating properly. They fine‑tune, see a loss curve drop, and declare victory. Then in production, the model fails on any input slightly different from training. Always build a test set that includes adversarial examples — typos, paraphrases, edge cases. If you only test on‑distribution, you’re fooling yourself.
Conclusion
Continuous pre training vs fine tuning llm isn’t a battle. It’s a partnership. Continuous pre‑training gives a model domain fluency. Fine‑tuning gives it task reliability. Skip one, and you’ll pay for it later.
My advice as of July 2026: start with RAG. Then try LoRA fine‑tuning on a small dataset. If you can’t get the accuracy you need, consider continuous pre‑training. And every step of the way, measure what matters — not just perplexity, but end‑task performance on realistic inputs.
The teams that win are the ones that treat model adaptation as an engineering discipline, not a magic trick. Measure. Iterate. Don’t be afraid to go back to square one if the data isn’t there.
Nishaant Dixit — Founder of SIVARO. Building data infrastructure and production AI systems since 2018. Built systems processing 200K events/sec.