LLaRA

LLaRA adapts a decoder-only LLM for dense retrieval via two tailored pretext tasks that leverage text embeddings from the LLM itself.
Ask this paper
EBAE pretext task: Embedding-Based Auto-Encoding uses LLM embeddings to reconstruct tokens of the input sentence, aligning the embedding space with semantic content.
EBAR pretext task: Embedding-Based Auto-Regression predicts tokens of the next sentence from the current embedding, injecting discourse-level signal into retrieval embeddings.
LLaMA 2 7B base: A LLaMA 2-7B base model is adapted into a retriever with these pretext tasks, yielding significant gains on MSMARCO and BEIR.
Decoder retrievers validated: Provides another data point that decoder-only LLMs, with the right adaptation, rival specialized encoder retrievers - a theme that continued through 2024.
Abstract
Dense retrieval calls for discriminative embeddings to represent the semantic relationship between query and document. It may benefit from the using of large language models (LLMs), given LLMs' strong capability on semantic understanding. However, the LLMs are learned by auto-regression, whose working mechanism is completely different from representing whole text as one discriminative embedding. Thus, it is imperative to study how to adapt LLMs properly so that they can be effectively initialized as the backbone encoder for dense retrieval. In this paper, we propose a novel approach, called Llama2Vec, which performs unsupervised adaptation of LLM for its dense retrieval application. Llama2Vec consists of two pretext tasks: EBAE (Embedding-Based Auto-Encoding) and EBAR (Embedding-Based Auto-Regression), where the LLM is prompted to reconstruct the input sentence and predict the next sentence based on its text embeddings. Llama2Vec is simple, lightweight, but highly effective. It is used to adapt LLaMA-2-7B on the Wikipedia corpus. With a moderate steps of adaptation, it substantially improves the model's fine-tuned performances on a variety of dense retrieval benchmarks. Notably, it results in the new state-of-the-art performances on popular benchmarks, such as passage and document retrieval on MSMARCO, and zero-shot retrieval on BEIR. The model and source code will be made publicly available to facilitate the future research. Our model is available at https://github.com/FlagOpen/FlagEmbedding.