[Paper Review] Augmenting Transformers with KNN-Based Composite Memory for Dialogue
This paper proposes KNN-based Information Fetching (KIF) modules to augment generative Transformers with efficient, scalable access to external knowledge from diverse sources—such as Wikipedia, images, and dialog histories—using K-Nearest Neighbors search on pre-encoded knowledge. The method improves dialog coherence and factual grounding, achieving state-of-the-art performance on Wizard of Wikipedia and Engaging ImageChat with human-evaluated response quality on par with retrieval-only models.
Various machine learning tasks can benefit from access to external information of different modalities, such as text and images. Recent work has focused on learning architectures with large memories capable of storing this knowledge. We propose augmenting generative Transformer neural networks with KNN-based Information Fetching (KIF) modules. Each KIF module learns a read operation to access fixed external knowledge. We apply these modules to generative dialog modeling, a challenging task where information must be flexibly retrieved and incorporated to maintain the topic and flow of conversation. We demonstrate the effectiveness of our approach by identifying relevant knowledge required for knowledgeable but engaging dialog from Wikipedia, images, and human-written dialog utterances, and show that leveraging this retrieved information improves model performance, measured by automatic and human evaluation.
Motivation & Objective
- To enable generative dialog models to dynamically retrieve and incorporate relevant external knowledge from multiple modalities, such as text, images, and dialog histories.
- To address the challenge of efficiently retrieving relevant information from large, fixed external knowledge bases without training the memory itself.
- To improve dialog quality by combining retrieved knowledge with context-aware representations in a differentiable, scalable manner.
- To ensure interpretability by retrieving specific, human-readable knowledge elements that condition model responses.
- To evaluate the effectiveness of KIF in multi-modal, multi-source settings using automatic and human evaluation.
Proposed method
- KIF modules use K-Nearest Neighbors (KNN) search to retrieve relevant knowledge from pre-encoded external sources, such as Wikipedia sentences or image-utterance pairs.
- Each KIF module operates on a query embedding derived from the dialog context and retrieves the nearest neighbors from fixed memory banks using similarity metrics.
- Retrieved knowledge is re-embedded and combined via a learnable gating mechanism that computes a weighted sum of retrieved elements.
- The model integrates retrieved knowledge into the decoder through concatenation with context representations, enabling end-to-end training.
- Multi-hop retrieval is emulated by applying KIF multiple times across layers or in sequence, with constraints to avoid redundant retrieval.
- The method leverages efficient libraries like FAISS for GPU-accelerated KNN inference, ensuring scalability to large memory banks.
Experimental results
Research questions
- RQ1Can KNN-based retrieval effectively identify relevant knowledge from diverse, multi-modal sources (e.g., Wikipedia, images, dialog history) in a dialog context?
- RQ2How does incorporating retrieved knowledge improve the factual accuracy and coherence of generative dialog models?
- RQ3What is the impact of using multiple knowledge sources and multi-hop retrieval on model performance?
- RQ4How does the gating mechanism affect the model’s ability to filter out irrelevant or noisy retrieved information?
- RQ5To what extent does the choice of query representation (e.g., previous utterance, dialog context, turn number) influence retrieval quality and downstream performance?
Key findings
- The KIF-augmented Transformer achieved a F1 score of 27.4 on the Wizard of Wikipedia dataset, outperforming models using only previous utterances or dialog context.
- Incorporating dialog context and turn embeddings improved performance by 1.0 F1 point over using only the previous utterance.
- Using multiple KIF modules to fetch knowledge at different network depths yielded comparable performance (26.5 F1) to single-module multi-fetch settings (26.9 F1), suggesting no significant benefit from spreading fetches across layers.
- Multi-hop retrieval with 2 or 3 hops did not improve performance, likely due to the dataset’s design, where each utterance is grounded in a single knowledge sentence.
- Including an irrelevant knowledge source (PersonaChat) without gating degraded performance, but the gating mechanism restored nearly full performance, demonstrating its effectiveness in filtering noise.
- Optimal KNN performance was achieved with K=3, as increasing K beyond this point led to performance degradation due to information blurring in the weighted sum.
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.