REPLUG: Retrieval-Augmented Black-Box Language Models

TL;DR

REPLUG enhances black-box large models like GPT-3 by simple retrieval-based input augmentation, boosting performance by 6.3% without parameter fine-tuning.

cs.CL πŸ”΄ Advanced 2023-01-30 47 views
Weijia Shi Sewon Min Michihiro Yasunaga Minjoon Seo Rich James Mike Lewis Luke Zettlemoyer Wen-tau Yih
NLP retrieval augmentation large models black-box knowledge integration

Key Findings

Methodology

REPLUG treats large pre-trained models as black boxes, integrating a tunable retrieval module. It retrieves relevant documents via a dual-encoder retriever, then prepends each document separately to the input, feeding into the frozen model. Outputs are ensembled through weighted averaging based on cosine similarity scores. The approach avoids internal model modifications. Additionally, LM supervision (REPLUG LSR) uses model perplexity to optimize the retriever, employing KL divergence loss to align retrieval likelihood with LM scores. This modular design allows universal applicability across models like GPT-3 and Codex, leveraging FAISS for efficient retrieval.

Key Results

  • On GPT-3 (175B), REPLUG reduces perplexity by 6.3%, significantly improving language modeling performance. For Codex on five-shot MMLU, performance increases by 5.1%, surpassing some fine-tuned counterparts. REPLUG LSR further boosts GPT-3 performance by 6.3% through supervised retriever training. Across diverse tasks, the method demonstrates robustness and scalability, with consistent gains on language modeling, question answering, and reasoning benchmarks.

Significance

This work addresses the critical challenge of enhancing large, API-accessible models without costly fine-tuning. By enabling retrieval-augmented inference, it reduces hallucinations, expands knowledge coverage, and simplifies deployment. The approach democratizes access to powerful models, making them more adaptable for real-world applications such as question answering, content generation, and knowledge-intensive tasks. It also opens pathways for future research on modular, plug-and-play AI systems that leverage external knowledge sources efficiently.

Technical Contribution

REPLUG introduces a novel retrieval-augmented framework for black-box models, combining simple input concatenation with ensemble strategies. It innovates by employing LM perplexity as a supervision signal to adapt the retriever, a departure from traditional fine-tuning-based methods. The system supports multiple retrieval algorithms and scales to models with over 100 billion parameters. The integration of ensemble and supervised retriever training constitutes a significant advancement in knowledge-enhanced language modeling, validated across multiple datasets and tasks.

Novelty

This is the first framework to effectively incorporate retrieval augmentation into large, inaccessible black-box models without internal modifications. Unlike prior work relying on internal representations or parameter updates, REPLUG's plug-and-play design offers a universal, scalable solution. Its use of LM perplexity for retriever supervision is a key innovation, enabling targeted retrieval that directly improves model perplexity and downstream task performance.

Limitations

  • The method's effectiveness depends heavily on the quality of external retrieval data; poor retrieval can negate benefits. It incurs additional computational costs due to multiple inference passes, especially for very large models. Handling extremely long inputs or multi-modal data remains challenging. Future work should focus on optimizing retrieval efficiency, reducing inference overhead, and extending to multi-modal scenarios.

Future Work

Future directions include integrating multi-modal retrieval, developing more efficient indexing and ensemble techniques, and exploring reinforcement learning to further optimize retriever relevance. Extending the framework to support real-time, low-latency applications and broader model architectures will enhance its practical impact. Additionally, combining REPLUG with continual learning paradigms could further improve knowledge updates without retraining from scratch.

AI Executive Summary

The rapid growth of large-scale pre-trained language models like GPT-3 and Codex has revolutionized NLP, yet their closed, parameter-heavy nature limits practical deployment and knowledge coverage. Traditional approaches to improve these models involve costly fine-tuning or internal representation modifications, which are often infeasible for API-based models. Recognizing this challenge, Shi et al. propose REPLUG, a retrieval-augmented framework that treats the large model as a black box, sidestepping the need for internal access.

REPLUG operates by retrieving relevant documents from external corpora using a dual-encoder retriever, then prepending each document separately to the input prompt. The model generates predictions for each augmented input, and these outputs are ensembled through a weighted average based on cosine similarity scores. This simple yet effective approach leverages external knowledge without altering model parameters, making it compatible with any API-accessible large model.

A key innovation is the introduction of LM supervision for the retriever (REPLUG LSR). By using the model's perplexity as a training signal, the retriever learns to prioritize documents that improve the model's confidence and accuracy. This method significantly enhances retrieval relevance, leading to better downstream performance.

Experimental results demonstrate that REPLUG boosts GPT-3's language modeling perplexity by 6.3%, and improves Codex's five-shot MMLU accuracy by 5.1%. These gains surpass many existing fine-tuning or retrieval-based methods, confirming the approach's effectiveness and scalability. The framework's simplicity, flexibility, and strong empirical performance suggest it will play a vital role in making large models more accessible and knowledge-aware.

Looking ahead, future work will focus on extending REPLUG to multi-modal data, optimizing retrieval efficiency, and reducing inference costs. Its potential to democratize powerful NLP models and facilitate knowledge integration positions REPLUG as a foundational step toward more intelligent, adaptable AI systems.

Deep Dive

Abstract

We introduce REPLUG, a retrieval-augmented language modeling framework that treats the language model (LM) as a black box and augments it with a tuneable retrieval model. Unlike prior retrieval-augmented LMs that train language models with special cross attention mechanisms to encode the retrieved text, REPLUG simply prepends retrieved documents to the input for the frozen black-box LM. This simple design can be easily applied to any existing retrieval and language models. Furthermore, we show that the LM can be used to supervise the retrieval model, which can then find documents that help the LM make better predictions. Our experiments demonstrate that REPLUG with the tuned retriever significantly improves the performance of GPT-3 (175B) on language modeling by 6.3%, as well as the performance of Codex on five-shot MMLU by 5.1%.

cs.CL