Instruction tuning vs domain adaptation: two different fine-tuning goals

Presenting KrishGyan, farming advice in your voice and language
Presenting KrishGyan, farming advice in your voice and language

Originally published at https://pranjulrathour.scult.in/blog/instruction-tuning-vs-domain-adaptation. That copy is the canonical version and gets updates first.

"Fine-tune it on our data" hides two different requests. One is: make the model behave the way we want when asked. The other is: make the model fluent in our field. They need different datasets, different training setups and different tests. Confusing them is the most common design error I see in student projects.

Instruction tuning

The data is pairs — or conversations — of request and ideal response. The loss is computed on the response tokens. The goal is behaviour: follow the format, respect the constraints, respond in the house tone. A few thousand carefully written examples go a long way. This is what most QLoRA projects in FineTune Studio are.

At an Integral Startup Foundation hackathon
At an Integral Startup Foundation hackathon

Domain adaptation

The data is raw text from the field — manuals, papers, transcripts — and the loss is computed on all of it, the way the base model was pre-trained. The goal is vocabulary and fluency: the model stops stumbling over your acronyms. It needs far more text, and it does not by itself teach the model to answer questions politely. Usually you follow it with a short instruction-tuning stage.

How they differ in practice

  • Data volume — thousands of examples versus millions of tokens.
  • Loss masking — response-only versus full sequence.
  • Evaluation — task rubric on held-out instructions versus perplexity on held-out domain text, then task rubric after the instruction stage.
  • Risk — instruction tuning can overfit to phrasing; domain adaptation can erode general instruction-following if pushed too far.

What you probably want

If your problem is facts, neither — use retrieval, as argued in RAG vs fine-tuning. If your problem is behaviour, instruction tuning. If the model genuinely cannot read your domain's text, a modest domain-adaptation pass followed by instruction tuning. Decide which before you collect data, because the data you need is different.

Pranjul Rathour
Pranjul Rathour

Name the goal, and the recipe follows. Skip that step and you will train the wrong thing perfectly.

From my carousels
1,211 Prompts, Every One Stamped
1,211 Prompts, Every One Stamped, slide 11,211 Prompts, Every One Stamped, slide 2
1,211 Prompts, Every One Stamped, slide 31,211 Prompts, Every One Stamped, slide 4
Full carousel on Instagram and LinkedIn.
Pranjul Rathour
Pranjul Rathour
GenAI engineer, Kanpur · 3x first-prize hackathon winner · campus mentor
I ship production RAG pipelines, fine-tune LLMs and build agentic AI products end to end. I lead engineering at SCULT INDIA for a 14-member team and have mentored 200+ students through TechVerse Enclave.
Open to: GenAI roles, hackathon judging, mentorship sessions and guest talks at colleges.
On stage, at hackathons and on campus
Presenting to a room
Presenting to a room
Pranjul Rathour
Pranjul Rathour
Pranjul Rathour at a campus event
Pranjul Rathour at a campus event

Comments

Popular posts from this blog

Forming a hackathon team: roles, skills and the mistake most teams make

Hello from Kanpur: what I build, and what I'll write about here

I built 15 free tools, 1,211 prompts and a 50,000-skill library — here's what's inside tools.scult.in