LongEmbed: Extending Embedding Models for Long Context Retrieval

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Zhu, Dawei, Wang, Liang, Yang, Nan, Song, Yifan, Wu, Wenhao, Wei, Furu, Li, Sujian
Natura: Preprint
Pubblicazione: 2024
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866912108707315712
author Zhu, Dawei
Wang, Liang
Yang, Nan
Song, Yifan
Wu, Wenhao
Wei, Furu
Li, Sujian
author_facet Zhu, Dawei
Wang, Liang
Yang, Nan
Song, Yifan
Wu, Wenhao
Wei, Furu
Li, Sujian
contents Embedding models play a pivot role in modern NLP applications such as IR and RAG. While the context limit of LLMs has been pushed beyond 1 million tokens, embedding models are still confined to a narrow context window not exceeding 8k tokens, refrained from application scenarios requiring long inputs such as legal contracts. This paper explores context window extension of existing embedding models, pushing the limit to 32k without requiring additional training. First, we examine the performance of current embedding models for long context retrieval on our newly constructed LongEmbed benchmark. LongEmbed comprises two synthetic tasks and four carefully chosen real-world tasks, featuring documents of varying length and dispersed target information. Benchmarking results underscore huge room for improvement in these models. Based on this, comprehensive experiments show that training-free context window extension strategies like position interpolation can effectively extend the context window of existing embedding models by several folds, regardless of their original context being 512 or beyond 4k. Furthermore, for models employing absolute position encoding (APE), we show the possibility of further fine-tuning to harvest notable performance gains while strictly preserving original behavior for short inputs. For models using rotary position embedding (RoPE), significant enhancements are observed when employing RoPE-specific methods, such as NTK and SelfExtend, indicating RoPE's superiority over APE for context window extension. To facilitate future research, we release E5-Base-4k and E5-RoPE-Base, along with the LongEmbed benchmark.
format Preprint
id arxiv_https___arxiv_org_abs_2404_12096
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle LongEmbed: Extending Embedding Models for Long Context Retrieval
Zhu, Dawei
Wang, Liang
Yang, Nan
Song, Yifan
Wu, Wenhao
Wei, Furu
Li, Sujian
Computation and Language
Machine Learning
Embedding models play a pivot role in modern NLP applications such as IR and RAG. While the context limit of LLMs has been pushed beyond 1 million tokens, embedding models are still confined to a narrow context window not exceeding 8k tokens, refrained from application scenarios requiring long inputs such as legal contracts. This paper explores context window extension of existing embedding models, pushing the limit to 32k without requiring additional training. First, we examine the performance of current embedding models for long context retrieval on our newly constructed LongEmbed benchmark. LongEmbed comprises two synthetic tasks and four carefully chosen real-world tasks, featuring documents of varying length and dispersed target information. Benchmarking results underscore huge room for improvement in these models. Based on this, comprehensive experiments show that training-free context window extension strategies like position interpolation can effectively extend the context window of existing embedding models by several folds, regardless of their original context being 512 or beyond 4k. Furthermore, for models employing absolute position encoding (APE), we show the possibility of further fine-tuning to harvest notable performance gains while strictly preserving original behavior for short inputs. For models using rotary position embedding (RoPE), significant enhancements are observed when employing RoPE-specific methods, such as NTK and SelfExtend, indicating RoPE's superiority over APE for context window extension. To facilitate future research, we release E5-Base-4k and E5-RoPE-Base, along with the LongEmbed benchmark.
title LongEmbed: Extending Embedding Models for Long Context Retrieval
topic Computation and Language
Machine Learning
url https://arxiv.org/abs/2404.12096