Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

Llama2Vec: Unsupervised Adaptation of Large Language Models for Dense Retrieval

About

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.

Zheng Liu, Chaofan Li, Shitao Xiao, Yingxia Shao, Defu Lian• 2023

Related benchmarks

TaskDatasetResultRank
Semantic Textual SimilaritySTS-B
Spearman's Rho (x100)70.01
70
Information RetrievalBEIR v1.0.0 (test)
ArguAna56.5
55
Document RetrievalMS MARCO Document (dev)
MRR@1000.479
24
Passage RankingTREC DL 2019
NDCG@100.734
24
Passage retrievalMS MARCO (dev)
MRR@1043.1
17
Passage RankingTREC DL 2020
NDCG@100.729
16
Semantic Textual SimilarityLCQMC
Pearson Correlation0.5698
11
Semantic Textual SimilarityPAWSX
Pearson Correlation0.2113
11
Semantic Textual SimilarityATEC
Pearson Correlation0.343
11
Semantic Textual SimilarityBQ
Pearson Correlation0.5233
11
Showing 10 of 25 rows

Other info

Code

Follow for update