Introduction
Knowledge-intensive tasks, such as Open-Domain Question Answering (ODQA), require models to access information beyond their internal parameters. Currently, researchers face a stark trade-off between Parametric Models (like T5 or GPT), which are fast but limited by their "knowledge ceiling," and Retrieval-Augmented Models (like RAG or FiD), which are accurate but computationally expensive due to the latency of retrieving and encoding long text passages.
EMAT (Efficient Memory-Augmented Transformer) bridges this gap. By integrating a massive key-value memory directly into the Transformer's layers and utilizing a clever single-pass inference design, it achieves state-of-the-art accuracy while running up to 300x faster than traditional retrieval-based systems.
Methods
The core innovation of EMAT is the retrieval of dense vector representations from a pre-computed key-value memory instead of raw text. The memory is populated using PAQ (Probably Asked Questions), a dataset of 65 million question-answer pairs generated from Wikipedia.
Architecture and Integration
- Asynchronous Retrieval: EMAT generates a query vector at an early layer of the Transformer encoder. While the Transformer continues its forward pass through intermediate layers, an external engine (using Maximum Inner Product Search) finds the best matches in the memory.
- Layer Integration: The retrieved key-value vectors are injected back into the model at later layers. This "single-pass" design allows retrieval to happen concurrently with computation, drastically reducing overhead.
- Specialized Pre-training: The model undergoes specific training tasks, including Key/Value Auto-encoding and Memory-Augmented Generation, to learn how to reconstruct and utilize its dense embeddings effectively.
Key Insights
- Decoupling is Efficiency: By triggering the search early and the integration late, EMAT exploits the inherent depth of Transformers to hide retrieval latency.
- Dense vs. Sparse: Retrieving pre-encoded dense vectors is significantly more efficient than retrieving text passages and running them through a heavy encoder.
- Learning to Remember: Ablation studies show that pre-training is critical; without it, performance on NaturalQuestions (NQ) dropped from 44.3 to 27.1 EM. The model must be explicitly taught how to "read" its own memory.
Key Results
EMAT was evaluated across several benchmarks, including NaturalQuestions (NQ), TriviaQA (TQA), and Wizard-of-Wikipedia (WoW).
- Accuracy: On NQ, EMAT improved the Exact Match (EM) score of a T5-base model from 25.8 to 44.3.
- Speed: EMAT achieved a throughput of over 1,000 queries per second on NQ, making it roughly 270x faster than the popular FiD-base model.
- Resource Efficiency: EMAT is approximately 5x faster than concurrent memory-augmented work like QAMAT while running on a single A100 GPU.
- Generalization: The model outperformed RAG and BART+DPR on dialogue (WoW) and long-form QA (ELI5), proving that a QA-based memory can generalize to non-QA tasks.
Limitations and Future Work
While highly efficient, EMAT currently requires significant hardware resources, specifically around 300GB of CPU RAM to store 65 million dense vectors. Additionally, the retriever relies on lexical matching for training, which can be noisy for open-ended tasks. Future research may focus on integrating more diverse knowledge sources, such as knowledge graphs or multi-modal data, into the key-value memory structure.
Summary updated