TL;DR
ReFusion introduces a highly efficient method to augment language models with external knowledge. Instead of concatenating retrieved text to the input sequence, ReFusion fuses retrieved representations directly into a model's hidden states. By utilizing bi-level optimization to automatically select the best fusion strategy for each layer, ReFusion achieves state-of-the-art performance on non-knowledge-intensive tasks while avoiding the massive computational overhead associated with processing long, augmented sequences.
The Problem: The Bottlenecks of Retrieval Concatenation
Retrieval-Augmented (RA) models have become a staple for "knowledge-intensive" (KI) tasks like open-domain question answering, where models must look up external facts. However, applying these techniques to "non-knowledge-intensive" (NKI) tasks—such as sentiment analysis or linguistic inference—remains challenging.
The standard approach is Retrieval Concatenation (RC): finding relevant sentences in a database and gluing them to the input text. This creates two major bottlenecks:
- The "Attention Tax": Transformer attention mechanisms have quadratic complexity relative to input length. Adding long retrieved contexts makes the model significantly slower and more memory-hungry.
- The Truncation Trap: Most models have a hard limit on input length (e.g., 512 tokens). If the retrieved context is too long, the actual input or the context gets truncated, leading to incomplete information and degraded performance.
Methods: Shifting to Representation Space
To overcome these limitations, the authors propose ReFusion, which shifts the augmentation from the input space to the representation space.
1. Retrieval Representation Fusion (RF)
Instead of feeding retrieved text into the encoder, ReFusion retrieves pre-computed vector representations (embeddings) of similar sentences. These vectors are then fused directly into the hidden states of the model’s internal layers. This keeps the input sequence length short and constant, bypassing the quadratic scaling of self-attention at the input level.
2. Dual Ranking Schemes
To ensure the model doesn't get distracted by irrelevant retrievals, ReFusion uses two filtering mechanisms:
- Reranker-based: A learnable module assigns a weight to each retrieved sentence, allowing the model to prioritize the most relevant ones.
- Ordered-mask-based: A fine-grained approach that ranks and masks individual dimensions within the representation vectors, essentially filtering noise at the feature level.
3. Adaptive Retrieval Integrator (ARI)
Not every layer in a Transformer needs the same amount of external help. ReFusion uses bi-level optimization (a technique popularized by neural architecture search) to automatically learn which layers should use which ranking scheme. It treats the choice of fusion strategy as a differentiable parameter, allowing the model to "search" for its optimal architecture during training.
Key Insights and Results
The authors evaluated ReFusion on 15 NKI tasks, including the GLUE Benchmark, various classification tasks, and a knowledge-intensive check on SQuAD.
- Efficiency via "Hidden" Augmentation: By bypassing the input layer, ReFusion keeps computational costs (FLOPs) nearly flat even as the number of retrieved items increases. In contrast, concatenation-based methods see costs skyrocket.
- Semantic Completeness: Because ReFusion doesn't rely on token limits, it avoids the performance drop-off seen in concatenation methods when they hit maximum sequence lengths and begin truncating data.
- Superior Performance: On RoBERTa-large, ReFusion achieved an average score of 74.3% across 15 tasks, outperforming the strong LM-BFF baseline (71.8%) and the concatenation-based CA-512 (69.5%).
- Speedup: In latency tests, the concatenation method (CA-512) took roughly 37.58 seconds per sentence due to long context processing. ReFusion took only 20.45 seconds—nearly a 2x improvement while delivering better accuracy.
- Robustness: ReFusion showed significantly lower variance across different random seeds compared to other prompt-based methods, suggesting it is less sensitive to the specific initialization of a training run.
Limitations and Future Work
While model inference is faster, the system still relies on an external vector database. The authors note that retrieving based on intermediate hidden states is even more accurate but requires multiple database lookups per forward pass, which is currently too slow for real-time use. Additionally, when using parameter-efficient fine-tuning like LoRA, improvements were less pronounced than with full fine-tuning, suggesting that aligning retrievals with the model requires deeper weight updates. Future work will explore more diverse ranking schemes and the diminishing returns of adding more knowledge.
Summary updated