Inject, Align, Recover: Staged Post-Training for Retrieval-Free Document Knowledge Internalization
Organizations: Beijing Academy of Artificial Intelligence (BAAI)
Abstract
Large language models often fail to answer questions about a bounded document collection when the source documents are not retrieved at inference time. We study this setting as document knowledge internalization: converting a fixed corpus into usable parametric knowledge for retrieval-free question answering. We propose IAR (Inject, Align, and Recover), a three-stage post-training framework that separates structured document knowledge injection, QA behavior alignment, and general ability recovery. Unlike conventional continued pretraining, Inject converts source documents into continuation, rewrite, and instruction-conditioned reconstruction objectives. Align then adapts the injected model with answer-only QA supervision, while Recover merges the domain-adapted model with the base instruction model to recover general capabilities. Across Common Corpus (CC) and CCI, and across Llama, Phi, Qwen, and SmolLM model families, IAR improves the domain-primary domain-general frontier for retrieval-free document internalization. In the main comparison, IAR improves over Vanilla SFT on all four reported metrics in 7 of 8 dataset-model settings, with average gains of 3.6 percentage points in domain QA accuracy and 12.1 percentage points in mean general performance across IFEval, MMLU, and MSBench. Extended CC baselines show that LoRA and FAPM can win individual general metrics, but among methods that also reach leading or near-leading domain internalization, IAR retains one of the strongest general profiles.
Figures & tables
| Model | Method | CC | CCI | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Dom. | IFEval | MMLU | MSB. | Dom. | IFEval | MMLU | MSB. | ||
| Llama-3.2-3B | Base Instruct | 11.2 | 77.1 | 50.8 | 54.5 | 29.2 | 77.1 | 50.8 | 54.5 |
| Vanilla SFT | 35.5 | 54.2 | 11.2 | 21.5 | 53.0 | 61.2 | 22.5 | 31.5 | |
| CPT+SFT | 38.3 | 26.4 | 3.7 | 13.5 | 53.7 | 24.2 | 4.3 | 17.5 | |
| IAR | 36.5 | 60.2 | 35.0 | 30.5 | 55.3 | 61.3 | 33.2 | 36.5 | |
| Phi-4-mini | Base Instruct | 13.1 | 77.2 | 61.0 | 62.0 | 27.3 | 77.2 | 61.0 | 62.0 |
| Model | Method | CC | CCI | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Dom. | IFEval | MMLU | MSB. | Dom. | IFEval | MMLU | MSB. | ||
| Llama-3.2-3B | Vanilla SFT | 35.5 | 54.2 | 11.2 | 21.5 | 53.0 | 61.2 | 22.5 | 31.5 |
| BudgetMatch | 40.4 | 53.4 | 17.3 | 22.0 | 53.0 | 45.3 | 22.5 | 24.0 | |
| IAR | 36.5 | 60.2 | 35.0 | 30.5 | 55.3 | 61.3 | 33.2 | 36.5 | |
| Qwen3-4B | Vanilla SFT | 42.4 | 51.1 | 8.8 | 51.0 | 75.1 | 45.6 | 26.3 | 49.5 |
| BudgetMatch | 46.8 | 49.4 | 31.8 | 45.0 | 72.2 | 56.1 | 29.5 | 52.5 | |
| Model | Method | Domain (%) | IFEval (%) | MMLU (%) | MSBench (%) |
|---|---|---|---|---|---|
| Qwen3-8B | Base Instruct | 38.5 | 87.6 | 65.3 | 82.5 |
| Vanilla SFT | 48.7 | 56.4 | 14.0 | 52.5 | |
| Best IA | 57.5 | 50.6 | 18.5 | 48.5 | |
| IAR (TIES ) | 56.8 | 62.2 | 26.7 | 73.5 | |
| Qwen3-14B | Base Instruct | 40.4 | 90.0 | 72.5 | 81.5 |
| Vanilla SFT | 54.8 | 62.9 | 54.5 | 57.0 |
Appendix figures & tables26 assets
Supplementary material from the paper’s appendix.
Appendix
| Dataset | Split | Count | Input at train time | Input at test time | Primary use |
|---|---|---|---|---|---|
| CC | train | 14,258 QA | question, answer, derived document fields | question only | mixed-domain internalization |
| test | 750 QA | / | question only | held-out domain test | |
| CCI | train | 10,926 QA | question, answer, derived document fields | question only | Chinese-domain internalization |
| test | 575 QA | / | question only | held-out domain test |
| Step | Prompt schema | Output contract |
|---|---|---|
| Anchor extraction | Given a text chunk, extract at most independently referable core objects. Prefer explicit concepts, methods, mechanisms, modules, devices, or technical terms appearing in the text. Do not output deictic objects such as “this method” or “the above mechanism.” | JSON list of anchors. |
| Type applicability | Given a question-type description and the text chunk, decide whether the chunk can support a question of that type. The supported types are factual extraction, mechanism explanation, design rationale, condition/constraint, limitation/trade-off, and comparison/relation. | yes/no. |
| Question generation | Given the chunk, a selected anchor, a question type, the type description, and an expected answer schema, generate one natural question. The anchor must be explicitly named; the question must be understandable without the source document; deictic expressions such as “this,” “above,” or “according to the text” are forbidden; output only one question ending with a question mark. | Plain question text. |
| Question validation | Check whether the question is independently understandable, avoids document/deictic references, is semantically clear, and has an answer direction. | JSON with valid and reason . |
| Answer generation | Given the source chunk and generated question, answer strictly from the chunk. The answer must be faithful, accurate, professional, directly answer the question, avoid document/deictic references, and be written as a natural paragraph rather than a template with section headings. | JSON with answer . |
| Dataset | Input docs | Files filtered | Chunks kept | Valid questions | QA kept | Experiment QA |
|---|---|---|---|---|---|---|
| CC | 4,001 | 1,944 (48.6%) | 5,324/6,593 (80.8%) | 37,397/77,224 (48.4%) | 16,674/37,397 (44.6%) | 15,008 |
| CCI | 7,000 | 310 (4.4%) | 11,407/11,793 (96.7%) | 100,096/140,148 (71.4%) | 62,670/100,096 (62.6%) | 11,501 |
| Objective | User input | Assistant target | Masked tokens | Recipe role | Intended exposure |
|---|---|---|---|---|---|
| Continuation | Continue/complete instruction plus a document prefix. | Held-out suffix. | System prompt, instruction, and prefix. | single or mixed | Prefix-conditioned document exposure. |
| Rewrite | Reconstruction instruction plus a generated summary, outline, or knowledge skeleton. | Full cleaned document. | System prompt, instruction, and compressed representation. | single or mixed | Recover document content from a compressed representation. |
| Instruction-formatted reconstruction | Short generic reading instruction. | Full cleaned document. | System prompt and instruction. | 1:0:0 or mixed | Dense exposure through a full-document target. |
| Parameter | Value | Parameter | Value |
|---|---|---|---|
| Optimizer | AdamW (PyTorch) | Learning rate | |
| Adam | Scheduler / warmup | cosine / ratio .05 | |
| Weight decay / max grad norm | Precision / max length | BF16 / 4096 | |
| Batch per GPU | 1 | Gradient accum. / GPUs | |
| Effective global batch | 64 examples/step | DeepSpeed | ZeRO-2, no offload |
| Termination / checkpoint | epoch based / final epoch | Gradient checkpointing | model-level enabled |
| Method / stage | Epochs | Data and objective | Method-specific setting |
|---|---|---|---|
| Vanilla SFT | 3 | QA; answer-only | Original Instruct initialization |
| BudgetMatch | 14/17/21/11 | Same QA and loss as Vanilla | CC Llama/Qwen; CCI Llama/Qwen order |
| Inject | 3 | Three assistant-target document-generation objectives | Selected mixtures and counts in Table 10 |
| Align | 3 | QA; answer-only | Initializes from the Inject final epoch |
| SDFT | 3 | Model-specific synthetic QA; answer-only | 14,258 CC examples per model |
| LoRA | 3 | CC QA; answer-only | , , dropout .05; merged for evaluation |
| Dataset | Model | Selected Inject recipe | Inject rows | Align QA rows |
|---|---|---|---|---|
| CC | Llama-3.2-3B | Mixed 1:1:2 | 19,000 | 14,258 |
| Phi-4-mini | Mixed 1:1:2 | 19,000 | 14,258 | |
| Qwen3-4B | Mixed 1:1:1 | 18,968 | 14,258 | |
| SmolLM3-3B | Mixed 1:1:1 | 18,960 | 14,258 | |
| CCI | Llama-3.2-3B | Mixed 1:1:2 | 19,000 | 10,926 |
| Phi-4-mini | Mixed 1:1:2 | 19,000 | 10,926 |
| Setting | Inject recipe (samples) | Inject | Align | IA total | BudgetMatch | BM/IA |
|---|---|---|---|---|---|---|
| CC Llama-3.2-3B | Mixed 1:1:2 (19k) | 45.736 | 12.917 | 58.653 | 60.280 | 102.8% |
| CC Qwen3-4B | Mixed 1:1:1 (18,968) | 46.017 | 10.191 | 56.208 | 57.752 | 102.7% |
| CCI Llama-3.2-3B | Mixed 1:1:2 (19k long-doc.) | 57.296 | 9.734 | 67.030 | 68.085 | 101.6% |
| CCI Qwen3-4B | 1:0:0 (10k) | 19.081 | 7.151 | 26.232 | 26.202 | 99.9% |
| Metric | Direction | Evaluation type | Reported unit |
|---|---|---|---|
| Domain accuracy | higher is better | V2 multi-judge correctness | percentage |
| IFEval inst-strict | higher is better | instruction-following evaluator | percentage |
| MMLU accuracy | higher is better | multiple-choice benchmark | percentage |
| MSBench accuracy | higher is better | LLM-judge benchmark | percentage |
| Scope | Records | Exact agree | Binary agree | Binary | Third judge |
|---|---|---|---|---|---|
| CC test artifacts | 163,347 | .732 | .854 | .691 | .274 |
| CCI test artifacts | 78,308 | .656 | .836 | .670 | .345 |
| Full audit | 242,255 | .707 | .848 | .691 | .297 |
| Judge | Votes | Mean score | ||
|---|---|---|---|---|
| gpt-oss-120b | 242,031 | .387 | .454 | .321 |
| MiniMax2.5_Local | 156,812 | .303 | .434 | .172 |
| deepseek-v3.2 | 131,172 | .296 | .465 | .127 |
| deepseek-v3.1 | 24,697 | .378 | .652 | .103 |
| Operator family | Hyperparameter grid | Candidate count |
|---|---|---|
| SLERP | 3 | |
| Task Arithmetic | 3 | |
| TIES | 3 | |
| DARE | 3 | |
| Total | fixed grid per IA checkpoint | 12 |
| Dataset | Model | Selected checkpoint | Domain (%) | IFEval (%) | MMLU (%) | MSBench (%) | Selection note |
|---|---|---|---|---|---|---|---|
| CC | Llama-3.2-3B | TIES | 36.5 | 60.2 | 35.0 | 30.5 | domain-primary feasible point |
| Phi-4-mini | Task Arithmetic | 34.1 | 49.0 | 57.0 | 43.0 | balanced feasible point | |
| Qwen3-4B | TIES | 50.5 | 59.8 | 19.5 | 63.0 | domain-primary feasible point | |
| SmolLM3-3B | TIES | 37.5 | 40.3 | 25.7 | 29.0 | domain-primary feasible point | |
| CCI | Llama-3.2-3B | TIES | 55.3 | 61.3 | 33.2 | 36.5 | domain-primary feasible point |
| Phi-4-mini | TIES | 39.7 | 51.6 | 50.2 | 44.0 | boundary trade-off point |
| Initial checkpoint | CCI QA (%) | Doc. mean BPB | Corpus BPB | Qwen–peer macro [95% CI] |
|---|---|---|---|---|
| Qwen3-4B-Instruct | 70.6 | 0.744 | 0.729 | – |
| Llama-3.2-3B-Instruct | 29.2 | 1.021 | 0.998 | [ , ] |
| Phi-4-mini-instruct | 27.3 | 0.968 | 0.948 | [ , ] |
| SmolLM3-3B | 34.1 | 0.838 | 0.819 | [ , ] |
| Model | MMLU | MMLU-Pro | BBH | MGSM | MMMLU | INCLUDE |
|---|---|---|---|---|---|---|
| Qwen3-1.7B-Base | 62.63 | 36.76 | 54.47 | 50.71 | 63.27 | 45.57 |
| Qwen3-4B-Base | 72.99 | 50.58 | 72.59 | 67.74 | 71.42 | 56.29 |
| Qwen3-8B-Base | 76.89 | 56.73 | 78.40 | 76.02 | 75.72 | 59.40 |
| Qwen3-14B-Base | 81.05 | 61.03 | 81.07 | 79.20 | 79.69 | 64.55 |
| Qwen3-32B-Base | 83.61 | 65.54 | 87.38 | 83.06 | 83.83 | 67.87 |
| Model | Setting | CCI domain (%) |
| Qwen3-1.7B | Base Instruct | 60.0 |
| Vanilla SFT | 57.0 | |
| Mixed 1:1:1 + Stage2 | 56.7 | |
| Qwen3-4B | Base Instruct | 70.6 |
| Vanilla SFT | 75.1 | |
| Context-aware SFT | 65.0 |
| Operator | Coefficient | CCI domain (%) | Operator | Coefficient | CCI domain (%) |
|---|---|---|---|---|---|
| DARE | 74.1 | SLERP | 69.0 | ||
| DARE | 74.3 | SLERP | 72.7 | ||
| DARE | 73.7 | SLERP | 73.2 | ||
| Task Arithmetic | 71.1 | TIES | 76.3 | ||
| Task Arithmetic | 74.1 | TIES | 72.5 | ||
| Task Arithmetic | 76.3 | TIES | 75.0 |
| Model | Method | Domain (%) | IFEval (%) | MMLU (%) | MSBench (%) |
|---|---|---|---|---|---|
| Llama-3.2-3B | Vanilla SFT | 35.5 | 54.2 | 11.2 | 21.5 |
| SDFT | 39.9 | 58.4 | 23.5 | 33.5 | |
| LoRA | 22.5 | 64.0 | 53.2 | 30.0 | |
| Replay | 30.8 | 56.7 | 30.7 | 37.5 | |
| Vanilla-FAPM | 22.3 | 75.3 | 51.8 | 62.0 | |
| IA-FAPM | 22.4 | 74.5 | 53.7 | 59.0 |
| Model | Method | Domain (%) | IFEval (%) | MMLU (%) | MSBench (%) |
|---|---|---|---|---|---|
| Qwen3-4B | Vanilla SFT | 42.4 | 51.1 | 8.8 | 51.0 |
| SDFT | 44.1 | 55.9 | 14.0 | 53.0 | |
| LoRA | 31.3 | 68.2 | 48.5 | 53.0 | |
| Replay | 42.8 | 69.7 | 34.7 | 66.5 | |
| Vanilla-FAPM | 41.2 | 83.8 | 61.3 | 83.5 | |
| IA-FAPM | 44.1 | 82.6 | 65.5 | 85.0 |
| Dataset | Model | Domain (%) | IFEval (%) | MMLU (%) | MSBench (%) |
|---|---|---|---|---|---|
| CC | Llama-3.2-3B | 38.7 | 43.5 | 9.8 | 19.5 |
| CC | Phi-4-mini | 31.2 | 43.3 | 40.7 | 31.0 |
| CCI | Llama-3.2-3B | 52.9 | 29.0 | 8.3 | 23.0 |
| Dataset | Model | Vanilla SFT (%) | Vanilla-FAPM (%) | IA-FAPM (%) |
|---|---|---|---|---|
| CC | Llama-3.2-3B | 35.5 | 22.3 | 22.4 |
| Phi-4-mini | 24.4 | 17.1 | 16.9 | |
| Qwen3-4B | 42.4 | 41.2 | 44.1 | |
| SmolLM3-3B | 32.1 | 24.7 | 26.1 | |
| CCI | Llama-3.2-3B | 53.0 | 38.6 | 40.7 |
| Phi-4-mini | 40.2 | 27.3 | 28.7 |
| Dataset | Model | Variant | Domain (%) | IFEval (%) | MMLU (%) | MSBench (%) |
|---|---|---|---|---|---|---|
| CC | Llama-3.2-3B | Vanilla-FAPM | 22.3 | 75.3 | 51.8 | 62.0 |
| IA-FAPM | 22.4 | 74.5 | 53.7 | 59.0 | ||
| Phi-4-mini | Vanilla-FAPM | 17.1 | 56.4 | 58.2 | 64.5 | |
| IA-FAPM | 16.9 | 53.8 | 61.3 | 63.0 | ||
| Qwen3-4B | Vanilla-FAPM | 41.2 | 83.8 | 61.3 | 83.5 | |
| IA-FAPM | 44.1 | 82.6 | 65.5 | 85.0 |
| Model | Vanilla | Mix 1:1:1 | Continue | 1:0:0 | Rewrite | Mix 1:1:2 |
|---|---|---|---|---|---|---|
| Llama-3.2-3B | 35.5 | 36.1 | 35.1 | 36.8 | 34.4 | 38.3 |
| Phi-4-mini | 24.4 | 27.5 | 27.2 | 29.9 | 27.6 | 32.1 |
| Qwen3-4B | 42.4 | 47.7 | 40.9 | 44.8 | 43.5 | 46.9 |
| SmolLM3-3B | 32.1 | 36.8 | 32.7 | 33.6 | 31.6 | 36.1 |
| Model | Vanilla | Mix 1:1:1 | Continue | 1:0:0 | Rewrite | Mix 1:1:2 |
|---|---|---|---|---|---|---|
| Llama-3.2-3B | 53.0 | 57.2 | 55.8 | 57.2 | 54.4 | 58.6 |
| Phi-4-mini | 40.2 | 45.0 | 42.1 | 36.7 | 37.7 | 46.3 |
| Qwen3-4B | 75.1 | 73.7 | 72.9 | 75.5 | 74.4 | 72.5 |
| SmolLM3-3B | 52.3 | 54.1 | 52.2 | 53.6 | 51.1 | 54.6 |
| Model | Method | Domain (%) | IFEval (%) | MMLU (%) | MSBench (%) |
|---|---|---|---|---|---|
| Qwen3-8B | Base Instruct | 38.5 | 87.6 | 65.3 | 82.5 |
| Vanilla SFT | 48.7 | 56.4 | 14.0 | 52.5 | |
| Best IA | 57.5 | 50.6 | 18.5 | 48.5 | |
| IAR (TIES ) | 56.8 | 62.2 | 26.7 | 73.5 | |
| Qwen3-14B | Base Instruct | 40.4 | 90.0 | 72.5 | 81.5 |
| Vanilla SFT | 54.8 | 62.9 | 54.5 | 57.0 |
Language Model Post-Training
Language model post-training adapts pretrained models to follow instructions, reason, use tools, and meet task-specific or human-defined goals.
See all 195 papers