RAVEN: In-Context Learning with Retrieval-Augmented Encoder-Decoder Language Models

Jie Huang, Wei Ping, Peng Xu, Mohammad Shoeybi, Kevin Chang, Bryan Catanzaro

TL;DR

This paper introduces RAVEN, a novel retrieval-augmented encoder-decoder language model that significantly improves in-context learning capabilities. By combining retrieval-augmented masked language modeling with prefix language modeling and a new "Fusion-in-Context Learning" technique, RAVEN achieves performance comparable to much larger models on knowledge-intensive tasks, despite having fewer parameters.

What Problem Does This Paper Address?

Large Language Models (LLMs) have shown remarkable abilities in "in-context learning" (ICL), where they can adapt to new tasks with just a few examples provided in the prompt, without needing explicit fine-tuning. While this has been extensively studied for decoder-only models (like GPT-3), encoder-decoder models, which are known for their strong representational power, have been less explored in the context of ICL. Existing retrieval-augmented encoder-decoder models face limitations such as a mismatch between their pretraining and inference objectives, and restricted context lengths, which hinder their few-shot performance and scalability. This paper aims to bridge this gap by developing an encoder-decoder model that excels at in-context learning.

Methods

The authors propose RAVEN, a model built upon an encoder-decoder architecture. Its key innovations include:

  • Retrieval-Augmented Masked Language Modeling (R-MLM) & Prefix Language Modeling: To address the pretraining-inference mismatch, RAVEN first uses R-MLM (similar to ATLAS) for joint training of the retriever and reader. This is followed by prefix language modeling, where the model learns to predict the suffix of a sequence given a prefix and retrieved passages. This combined approach aligns better with the typical in-context learning setup.
  • Fusion-in-Context Learning (FiCL): To overcome context length limitations and allow models to leverage more in-context examples, FiCL is introduced. Instead of feeding all examples at once, FiCL iteratively feeds subsets of in-context examples along with retrieved passages to the encoder. This allows for a more flexible and scalable way to incorporate a larger number of examples during inference.
  • In-Context Example Retrieval: The paper also proposes using RAVEN's own retriever to select the most relevant in-context examples, automating the process and potentially improving performance.

Datasets

The primary datasets used for evaluation are:

  • Natural Questions (NQ): An open-domain question answering dataset.
  • TriviaQA (TQA): Another open-domain question answering dataset.
  • Massively Multitask Language Understanding (MMLU): A benchmark for evaluating language understanding across various domains.
  • ELI5: Used for a case study on long-form question answering.

The models are trained using Wikipedia corpora (December 2018 for NQ and December 2021 for TriviaQA).

Key Insights and Ideas

  • Encoder-Decoder Models for ICL: The paper demonstrates that encoder-decoder models, when properly designed, can be highly effective for in-context learning, challenging the dominance of decoder-only models in this area.
  • Pretraining-Inference Alignment is Crucial: The mismatch between how models are pretrained (e.g., masked language modeling) and how they are used for in-context learning (where the target question often appears at the end) is a significant bottleneck. RAVEN's combined R-MLM and prefix LM strategy directly addresses this.
  • FiCL for Scalability: The proposed Fusion-in-Context Learning is a practical solution to the context length limitations of LLMs, enabling them to benefit from a much larger number of in-context examples without retraining.
  • Retriever's Dual Role: The retriever, crucial for fetching relevant documents, can also be leveraged to select the best in-context examples, further enhancing performance.

Key Results

  • RAVEN significantly outperforms its baseline, ATLAS, on both Natural Questions and TriviaQA across various shot settings. For instance, RAVEN 11B shows an improvement of 8.8% (0-shot) and 30.7% (1-shot) on TriviaQA compared to ATLAS 11B.
  • RAVEN achieves performance comparable to much larger decoder-only LLMs like GPT-3 175B and PaLM 62B, despite having significantly fewer parameters (e.g., RAVEN 3B has 180 times fewer parameters than PaLM 540B).
  • Fusion-in-Context Learning (FiCL) provides a consistent ~1% improvement on average for both ATLAS and RAVEN, demonstrating its effectiveness in leveraging more in-context examples.
  • On the MMLU benchmark, RAVEN shows impressive zero-shot performance, surpassing GPT-3 175B and being competitive with PaLM 62B, even without instruction finetuning.
  • Qualitative results on long-form QA show that RAVEN tends to generate more informative and coherent answers compared to ATLAS.

Limitations and Future Work

  • Constrained Context Length: A primary limitation is the inherent context length constraint of the base models (T5/ATLAS), which affects scalability. While FiCL mitigates this, extending context length further is suggested.
  • Model Scale: Compared to state-of-the-art decoder-only models exceeding 100B parameters, RAVEN's deployed models are smaller. The authors believe scaling up RAVEN could lead to even better performance.
  • Future Directions: The paper suggests exploring how to combine the Fusion-in-Decoder architecture with existing decoder-only LLMs to harness the strengths of both. Further research into scaling up RAVEN and applying instruction tuning to it is also encouraged. The transferability of RAVEN's methods to other models is highlighted.

Summary updated

BibTeX
@inproceedings{huang2024raven,
  author = {Jie Huang and Wei Ping and Peng Xu and Mohammad Shoeybi and Kevin Chang and Bryan Catanzaro},
  title = {{RAVEN: In-Context Learning with Retrieval-Augmented Encoder-Decoder Language Models}},
  booktitle = {COLM},
  year = {2024},
  url = {https://openreview.net/forum?id=GMalvQu0XL},
}
Figure