Training the Knowledge Base through Evidence Distillation and Write-Back Enrichment
Organizations: Peking University · Georgia Institute of Technology · Tsinghua University
Abstract
The knowledge base in a retrieval-augmented generation (RAG) system is typically assembled once and never revised, even though the facts a query requires are often fragmented across documents and buried in irrelevant content. We argue that the knowledge base should be treated as a trainable component and propose WriteBack-RAG, a framework that uses labeled examples to identify where retrieval succeeds, isolate the relevant documents, and distill them into compact knowledge units that are indexed alongside the original corpus. Because the method modifies only the corpus, it can be applied once as an offline preprocessing step and combined with any RAG pipeline. Across four RAG methods, six benchmarks, and two LLM backbones, WriteBack-RAG improves every evaluated setting, with gains averaging +2.14%. Cross-method transfer experiments further show that the distilled knowledge benefits RAG pipelines other than the one used to produce it, confirming that the improvement resides in the corpus itself.
Figures & tables
| Dataset | Task | Metric | Train | Test |
|---|---|---|---|---|
| NQ | Open-domain QA | Acc | 79,168 | 3,610 |
| BoolQ | Yes/No QA | Acc | 9,427 | 3,270 |
| FEVER | Fact verification | F1 | 104,966 | 10,444 |
| zsRE | Slot filling | Acc | 147,909 | 3,724 |
| HotpotQA | Multi-hop QA | Acc | 90,447 | 7,405 |
| SQuAD | Extractive QA | EM | 87,599 | 10,570 |
| LLM | Method | NQ | BoolQ | FEVER | zsRE | Hotpot | SQuAD |
|---|---|---|---|---|---|---|---|
| Acc | Acc | F1 | Acc | Acc | EM | ||
| Gemma-3-12B | No Retrieval | 30.61 | 63.39 | 34.24 | 17.29 | 24.28 | 54.36 |
| Naive RAG | 31.44 | 80.85 | 32.77 | 22.34 | 41.13 | 60.89 | |
| + WB | 34.82 (+3.38) | 83.12 (+2.27) | 37.89 (+5.12) | 22.82 (+0.48) | 41.99 (+0.86) | 61.24 (+0.35) | |
| RePlug | 31.39 | 80.92 | 32.73 | 22.34 | 41.13 | 60.25 | |
| + WB | 34.63 (+3.24) | 83.52 (+2.60) | 37.92 (+5.19) | 22.77 (+0.43) | 41.97 (+0.84) | 61.39 (+1.14) |
| Dataset | Selected Rate | Retained Docs | Source Tokens | Distilled Tokens | Compression | Fallback Rate |
|---|---|---|---|---|---|---|
| NQ | 14.0% | 1.77 | 183.4 | 87.0 | 2.15 | 5.9% |
| BoolQ | 6.3% | 2.79 | 288.2 | 92.7 | 3.21 | 29.2% |
| FEVER | 9.1% | 2.37 | 243.0 | 85.6 | 2.88 | 13.5% |
| zsRE | 11.6% | 2.11 | 216.0 | 71.6 | 3.51 | 5.3% |
| HotpotQA | 49.3% | 4.76 | 489.2 | 79.8 | 6.79 | 1.2% |
| SQuAD | 48.1% | 1.97 | 203.2 | 87.9 | 2.55 | 96.2% |
| No-WB retrieval baseline on NQ: 31.44 Acc | |||||
|---|---|---|---|---|---|
| Utility gate | 0 | 0.05 | 0.15 | 0.20 | |
| NQ Acc | 34.78 | 34.76 | 34.82 | 34.71 | 34.66 |
| Document gate | 0 | 0.03 | 0.05 | 0.10 | |
| NQ Acc | 34.89 | 34.82 | 34.79 | 33.85 | 33.76 |
| Fallback | 1 | 3 | 4 | 5 | |
| NQ Acc | 33.19 | 34.82 | 34.71 | 33.60 | 34.28 |
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
| Dataset | Task | Description | Train | Test | Metric |
|---|---|---|---|---|---|
| NQ | Open-domain QA | Real user questions answered using retrieved Wikipedia evidence. | 79,168 | 3,610 | Acc |
| BoolQ | Yes or No QA | Naturally occurring Yes or No questions paired with supporting documents. | 9,427 | 3,270 | Acc |
| FEVER | Fact verification | Claim verification against Wikipedia evidence with SUPPORTS , REFUTES , and NOT ENOUGH INFO labels. | 104,966 | 10,444 | F1 |
| zsRE | Slot filling | Relation extraction framed as answering natural-language relation queries over factual knowledge. | 147,909 | 3,724 | Acc |
| HotpotQA | Multi-hop QA | Question answering that requires aggregating evidence across multiple Wikipedia documents. | 90,447 | 7,405 | Acc |
| SQuAD | Extractive QA | Reading comprehension where the answer is extracted as a text span from the provided passage. | 87,599 | 10,570 | EM |
| Hyperparameter | Value |
|---|---|
| Retrieval | |
| Retriever | E5-base-v2 |
| Retrieval top- | 5 |
| Write-back retrieval top- | 5 |
| Merged retrieval top- | 5 |
| Gating | |
Retrieval-Augmented Generation
Retrieval-augmented generation connects language models to external knowledge so answers can use current, domain-specific evidence.
See all 792 papers