Abstract
Large Language Models (LLMs) demonstrate impressive zero-shot capabilities but require massive parameter counts, leading to high computational costs. Semi-parametric models offer a more efficient alternative by retrieving external knowledge, yet their ability to generalize to unseen tasks in a zero-shot setting has remained under-explored. We present Zemi, a 0.8B parameter semi-parametric model that utilizes a novel gated fusion mechanism to effectively incorporate retrieved information while remaining robust to noise. Zemi outperforms models nearly four times its size, such as T0-3B, by an average of 16% across diverse evaluation benchmarks, demonstrating that well-designed retrieval-augmentation can significantly enhance zero-shot performance in compact models.
Introduction: The Challenge of Zero-Shot Generalization
The "zero-shot" ability of models like GPT-3—performing tasks without specific training—has set a new standard in NLP. However, the sheer size of these models makes them inaccessible for many real-world applications. Semi-parametric models offer an alternative by decoupling "reasoning" from "knowledge," using a smaller model to process information retrieved from an external corpus. While efficient, these models often struggle with "noise" in uncurated corpora, and their zero-shot generalization across varied tasks hasn't been fully established.
Methods: Architecture and Gated Fusion
Zemi builds upon the T5 architecture, integrating a retrieval pipeline and a specialized fusion module. The workflow consists of three main stages:
- C4 Retrieval: For any given prompt, Zemi uses BM25 to pull the top 5 most relevant documents from a subset of the C4 corpus. Crucially, C4 is task-agnostic, ensuring a fair comparison with non-retrieval models.
- Perceiver Resampler: To handle multiple retrieved documents of varying lengths, Zemi employs a Perceiver Resampler to compress retrieved text into a fixed-length set of latent representations, allowing the model to scale without massive computational overhead.
- Gated Cross-Attention: This is the model's "secret sauce." Inspired by the Flamingo vision-language model, Zemi uses Tanh-gated cross-attention layers. This allows the model to learn when to pay attention to the retrieved "knowledge" and when to ignore it if the retrieved snippets are noisy or irrelevant.
Zemi is trained using semi-parametric multitask prompted training, where it learns to solve various tasks while simultaneously learning how to filter and incorporate retrieved information.
Datasets and Evaluation
Zemi was trained on a subset of 8 multiple-choice QA datasets from the T0 mixture (e.g., CommonsenseQA, SciQ). Evaluation focused on seven "held-out" tasks the model never encountered during training, spanning:
- QA: OpenbookQA, Piqa.
- Sentiment Analysis: Rotten Tomatoes (RT).
- Natural Language Inference: CommitmentBank (CB).
- Sentence Completion: COPA, HellaSwag.
- Word Sense Disambiguation: WiC.
Key Results and Insights
- Efficiency via Retrieval: Zemi-Large (800M parameters) achieved a 16% average improvement over the 3B parameter T0 model. This suggests that a well-designed retrieval system can compensate for a 3.8x reduction in parameter count.
- Outperforming Giants: Zemi-Large outperformed the 175B parameter GPT-3 on specific tasks like CommitmentBank (CB) and Rotten Tomatoes (RT), despite being roughly 200x smaller.
- Robustness to Noise: Ablation studies confirmed that the gated mechanism is vital. Removing the Tanh gates caused a significant drop in performance, proving that the ability to "gate out" irrelevant retrieval is the primary driver of Zemi's success.
- Universal Task Format: Training on a variety of multiple-choice QA tasks proved highly effective for generalizing to other task types, likely because QA forces the model to synthesize context and logic.
Conclusion
Zemi demonstrates that semi-parametric models can be zero-shot superstars. By combining efficient retrieval with a robust gating mechanism, Zemi achieves state-of-the-art performance for its size, offering a scalable and effective path forward for compact, high-performance language models.
Summary updated