# Retrieve Anything To Augment Large Language Models

**Authors:** Peitian Zhang, Shitao Xiao, Zheng Liu, Zhicheng Dou, Jian-Yun Nie  
**arXiv:** [2310.07554](https://arxiv.org/abs/2310.07554)  
**Date:** 2023-10-11  
**Summary page:** https://www.summarizepaper.com/en/paper/2310.07554v1/

## Key points

- In the realm of large language models (LLMs), inherent limitations exist in knowledge, memory, alignment, and action that pose challenges.
- External support such as knowledge bases, memory stores, demonstration examples, and tools are needed to overcome these limitations.
- Retrieval augmentation is crucial for bridging the gap between LLMs and external assistance.
- The novel approach called the LLM Embedder supports diverse needs of LLM retrieval augmentation with a unified embedding model.
- Training the model involves strategies like reward formulation based on LLM feedback, knowledge distillation stabilization, multi-task fine-tuning with explicit instructions, and homogeneous in-batch negative sampling.
- The empirical performance of the LLM-Embedder surpasses both general-purpose and task-specific retrievers in various evaluation scenarios.
- Retrieval-augmented LLMs enhance language understanding and generation capabilities by retrieving information from external databases for knowledge enhancement, historical context for long-term memory establishment, examples for instruction following improvement, and tools for engaging with the physical world.
- The quality of retrieved content significantly impacts retrieval augmentation effectiveness in generators and retrievers within retrieval augmented LLMs.
- The LLM-Embedder combines generality and specificity to comprehensively support major retrieval augmentation needs while achieving leading performance across application scenarios.

## Summary

In the realm of large language models (LLMs), there exist inherent limitations in knowledge, memory, alignment, and action that pose significant challenges. These limitations cannot be overcome by LLMs alone and require external support such as knowledge bases, memory stores, demonstration examples, and tools. <br>
Retrieval augmentation serves as a crucial mechanism to bridge the gap between LLMs and external assistance. However, traditional methods face issues with general-purpose retrievers not being optimized for LLM retrieval augmentation and task-specific retrievers lacking versatility across different scenarios. To address these challenges, a novel approach called the LLM Embedder is introduced to comprehensively support diverse needs of LLM retrieval augmentation with a unified embedding model. <br>
Training such a model is complex due to the varied semantic relationships captured by different retrieval tasks. To optimize training methodology, strategies such as reward formulation based on LLM feedback, knowledge distillation stabilization, multi-task fine-tuning with explicit instructions, and homogeneous in-batch negative sampling are employed. The empirical performance of the LLM-Embedder surpasses both general-purpose and task-specific retrievers in various evaluation scenarios, demonstrating remarkable enhancements in retrieval augmentation for LLMs. The project is publicly available at https://github.com/FlagOpen/FlagEmbedding.<br>
Retrieval-augmented LLMs play a crucial role in enhancing language understanding and generation capabilities. They are utilized for tasks such as knowledge enhancement by retrieving information from external databases to ground generated content on proper knowledge. Additionally, they can retrieve historical context for long-term memory establishment, examples for instruction following improvement, and tools for engaging with the physical world.<br>
The retrieval augmented LLMs consist of generators and retrievers where the quality of retrieved content significantly impacts retrieval augmentation effectiveness. Two common types of retrievers include general-purpose ones like BM25 and dense models like DPR or task-specific ones like AAR or LLM-R. While general-purpose methods offer simplicity but may lack retrieval quality, task-specific ones excel in specific scenarios but lack transferability.<br>
In contrast to existing approaches, the LLM-Embedder combines generality and specificity to comprehensively support all major retrieval augmentation needs while achieving leading performance across application scenarios. Dense retrieval leveraging latent text embeddings is also highlighted as an effective method for searching relevant information. Overall, large language models coupled with efficient retrieval augmentation mechanisms have the potential to overcome inherent limitations and enhance their performance across various tasks in natural language processing domains.
