Repetition Improves Language Model Embeddings

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Springer, Jacob Mitchell, Kotha, Suhas, Fried, Daniel, Neubig, Graham, Raghunathan, Aditi
Natura: Preprint
Pubblicazione: 2024
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866914026694377472
author Springer, Jacob Mitchell
Kotha, Suhas
Fried, Daniel
Neubig, Graham
Raghunathan, Aditi
author_facet Springer, Jacob Mitchell
Kotha, Suhas
Fried, Daniel
Neubig, Graham
Raghunathan, Aditi
contents Bidirectional models are considered essential for strong text embeddings. Recent approaches to adapt autoregressive language models (LMs) into strong text embedding models have largely had the requirement to modify the LM architecture to be bidirectional. We challenge this premise by introducing "echo embeddings" which converts autoregressive LMs into high quality text embedding models without changing the architecture or requiring fine-tuning. By repeating the input and extracting embeddings from the repeated tokens -- which have access to all original tokens -- echo embeddings improve over classical LM embeddings by over 5% in zero-shot settings. Our zero-shot embeddings nearly match those obtained by bidirectionally-converted LMs that undergo additional masked-language modeling training. Echo embeddings are also compatible with supervised fine-tuning, matching or outperforming bidirectionally-converted LMs in an apples-to-apples comparison, even with an identical compute budget during training and inference. Overall, repetition is a simple and effective strategy to circumvent the need for bidirectional attention in embedding models, paving the way towards a unified architecture for all NLP tasks.
format Preprint
id arxiv_https___arxiv_org_abs_2402_15449
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Repetition Improves Language Model Embeddings
Springer, Jacob Mitchell
Kotha, Suhas
Fried, Daniel
Neubig, Graham
Raghunathan, Aditi
Computation and Language
Machine Learning
Bidirectional models are considered essential for strong text embeddings. Recent approaches to adapt autoregressive language models (LMs) into strong text embedding models have largely had the requirement to modify the LM architecture to be bidirectional. We challenge this premise by introducing "echo embeddings" which converts autoregressive LMs into high quality text embedding models without changing the architecture or requiring fine-tuning. By repeating the input and extracting embeddings from the repeated tokens -- which have access to all original tokens -- echo embeddings improve over classical LM embeddings by over 5% in zero-shot settings. Our zero-shot embeddings nearly match those obtained by bidirectionally-converted LMs that undergo additional masked-language modeling training. Echo embeddings are also compatible with supervised fine-tuning, matching or outperforming bidirectionally-converted LMs in an apples-to-apples comparison, even with an identical compute budget during training and inference. Overall, repetition is a simple and effective strategy to circumvent the need for bidirectional attention in embedding models, paving the way towards a unified architecture for all NLP tasks.
title Repetition Improves Language Model Embeddings
topic Computation and Language
Machine Learning
url https://arxiv.org/abs/2402.15449