[Paper Review] Knowledge Infused Decoding
Knowledge Infused Decoding (KID) is a task- and model-agnostic decoding algorithm that dynamically injects external knowledge into autoregressive language model generation via a reinforcement learning–optimized local knowledge memory and a dynamically constructed knowledge trie. It significantly improves factual consistency and performance on six knowledge-intensive NLG tasks, outperforming both strong baselines and task-optimized models, especially in few-shot settings, without requiring retraining or architectural changes.
Pre-trained language models (LMs) have been shown to memorize a substantial amount of knowledge from the pre-training corpora; however, they are still limited in recalling factually correct knowledge given a certain context. Hence, they tend to suffer from counterfactual or hallucinatory generation when used in knowledge-intensive natural language generation (NLG) tasks. Recent remedies to this problem focus on modifying either the pre-training or task fine-tuning objectives to incorporate knowledge, which normally require additional costly training or architecture modification of LMs for practical applications. We present Knowledge Infused Decoding (KID) -- a novel decoding algorithm for generative LMs, which dynamically infuses external knowledge into each step of the LM decoding. Specifically, we maintain a local knowledge memory based on the current context, interacting with a dynamically created external knowledge trie, and continuously update the local memory as a knowledge-aware constraint to guide decoding via reinforcement learning. On six diverse knowledge-intensive NLG tasks, task-agnostic LMs (e.g., GPT-2 and BART) armed with KID outperform many task-optimized state-of-the-art models, and show particularly strong performance in few-shot scenarios over seven related knowledge-infusion techniques. Human evaluation confirms KID's ability to generate more relevant and factual language for the input context when compared with multiple baselines. Finally, KID also alleviates exposure bias and provides stable generation quality when generating longer sequences. Code for KID is available at https://github.com/microsoft/KID.
Motivation & Objective
- To address factual hallucinations in pre-trained language models during knowledge-intensive generation.
- To overcome limitations of static knowledge retrieval in models like RAG, which fail to adapt to evolving context during long generations.
- To develop a lightweight, inference-time solution that enhances factual consistency without requiring model fine-tuning or architectural modifications.
- To improve few-shot generalization and mitigate exposure bias in long sequence generation.
- To enable interpretable and controllable knowledge infusion through a learnable, context-aware knowledge memory.
Proposed method
- KID maintains a local knowledge memory as a finite, first-in-first-out (FIFO) list that stores relevant entities and facts from retrieved documents.
- At each decoding step, KID constructs a dynamic knowledge trie from retrieved supporting documents to efficiently search for relevant knowledge.
- The local knowledge memory is updated via reinforcement learning to guide decoding by shaping the next-token probability distribution toward knowledge-relevant entities.
- Knowledge infusion is performed at inference time only, making KID compatible with any pre-trained LM without retraining or architecture changes.
- The method uses a reward signal based on entity consistency and relevance to optimize the knowledge-aware decoding policy.
- KID integrates with standard decoding strategies like beam search or nucleus sampling, enhancing them with real-time knowledge constraints.
Experimental results
Research questions
- RQ1Can a lightweight, inference-time decoding method significantly improve factual consistency in pre-trained language models without retraining or architectural changes?
- RQ2How does dynamic knowledge infusion during decoding compare to static retrieval methods in long-form and multi-turn generation tasks?
- RQ3To what extent can KID generalize to few-shot and low-resource settings compared to task-optimized models?
- RQ4Does KID effectively reduce exposure bias in long sequence generation?
- RQ5Can knowledge-aware decoding via reinforcement learning improve both relevance and factuality in abstractive NLG tasks?
Key findings
- KID significantly outperforms conventional beam search and sampling on six diverse knowledge-intensive NLG tasks, including abstractive summarization, dialogue generation, and open-ended story generation.
- On the ELI5 and WoW benchmarks, KID-generated outputs were rated 1.5–2.0 points higher in factuality and relevance by human annotators compared to RAG and other baselines.
- In few-shot settings, KID surpassed seven strong knowledge-infusion baselines, demonstrating superior generalization and robustness in low-resource regimes.
- KID mitigated exposure bias, maintaining consistent factual quality even in long-form generation, where RAG and similar models often drift off-topic.
- The method achieved state-of-the-art performance on all evaluated tasks using only GPT-2 and BART—without any fine-tuning—highlighting its effectiveness as a plug-and-play enhancement.
- The knowledge trie and local memory components added minimal inference overhead, with KID’s memory footprint remaining manageable (under 10MB for knowledge trie) and inference cost approximately O(1) per step.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.