atlas

Research map / Large language models / Instruction and fine-tuning

Teaching LLMs How to Learn with Contextual Fine-Tuning

ICLR 2025 · Large language models › Instruction and fine-tuning · approach: Fine-tuning generalization and delta compression

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes contextual fine-tuning (CFT), which prepends educational-style prompts to domain text during continued training of Llama-2 models, and shows gains over continued pretraining and AdaptLLM on medical and financial benchmarks.

Problem

Updating LLMs with new domain knowledge via fine-tuning often causes forgetting or loss of instruction-following, and standard continued pretraining is inefficient at improving reasoning and recall in domain tasks.

Approach

Generalize instruction tuning into contextual fine-tuning: prepend a randomly sampled cognitively motivated contextual prompt to each domain text and train the model to predict the text tokens conditioned on that prompt, so the prompt shapes gradients toward useful semantic structure.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use contextual fine-tuning instead of continued pretrainingLlama 2 7B Chat · Medical MMLU + MedQA (average)accuracy: 45.96 -> 47.81; 1.85%Helped
Use contextual fine-tuning instead of continued pretrainingLlama 2 13B Chat · Medical MMLU + MedQA (average)accuracy: 54.31 -> 56.56; 2.25%Helped
Use contextual fine-tuning instead of continued pretrainingLlama 2 7B Chat · FiQA + Causal20 + MultiFin (average)F1: 4.32%Helped
Use contextual fine-tuning instead of continued pretrainingLlama 2 13B Chat · FiQA + Causal20 + MultiFin (average)F1: 3%Helped
Replace contextual prompts with misleading negative prompts (ablation)Llama 2 7B Chat (CFT) · Medical benchmarksaccuracy: -2.57%Hurt
Replace contextual prompts with misleading negative prompts (ablation)Llama 2 13B Chat (CFT) · Medical benchmarksaccuracy: -1.36%Hurt
Replace contextual prompts with misleading negative prompts (ablation)Llama 2 7B Chat (CFT) · Financial benchmarksF1: -3.41%Hurt
Replace contextual prompts with misleading negative prompts (ablation)Llama 2 13B Chat (CFT) · Financial benchmarksF1: -2.39%Hurt
Use text-adaptive generated prompts instead of manually designed contextual prompts (ablation)Llama 2 7B Chat · Medical MMLU + MedQA (average)accuracy: 45.05 -> 46.31; 45.96 -> 46.31Helped
Use CFT + IFT instead of CPT + IFT (ablation)Llama 2 7B Base · Medical benchmarksaccuracy: 2.95%; 1.91%Helped
Use CFT + IFT instead of CPT + IFT (ablation)Llama 2 7B Base · Financial benchmarksF1: 36.28%; 8.67%Helped
Use CFT rather than AdaptLLM domain-specific continued pretrainingLlama 2 7B · Medical benchmarksaccuracy: 4.89% on averageHelped

Surprising findings

Limitations

Experimental setup

Datasets: OpenMedText financial news articles (306,242) FinAlpaca UltraChat MMLU medical subsets MedQA FiQA MultiFin Causal20

Benchmarks: MMLU medical subsets (Anatomy, Clinical Knowledge, College Biology, College Medicine, Medical Genetics, Professional Med MedQA FiQA Causal20 MultiFin

Metrics: accuracy F1 average accuracy relative improvement %Δ

Baselines: Continued pretraining (CPT) Instruction fine-tuning (IFT) AdaptLLM Negative contextual fine-tuning

Builds on: instruction tuning continued pretraining chain-of-thought prompting

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy