Manuscript Offprint

arXiv:2610.05564

Lend Me Your Eyes: Instruction-Aware Text Embeddings via Attention Relay

Yiyuan Luo, Vaggos Chatziafratis

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Text embedding models trained with contrastive learning learn to follow task instructions from instruction-paired data, while instruction-tuned LLMs already know how to follow them. We show that this instruction-following ability can carry over from an LLM to a Transformer-based embedder without any training. We propose Attention Relay, which passes the attention weights an LLM produces to the embedder's own attention. Across six instruction-tuned LLMs from the Qwen3, Llama 3.1 and OLMo 3 families and ten widely used embedding models that differ in tokenizer, size and pooling type, Attention Relay makes nearly every combination instruction-aware. Experiments that break the method down into its parts show that the LLM's attention weights track the instruction in its later layers and come largely from instruction tuning. They also show that relaying these weights selects which content in the text matters: it makes the aspect of the text that the instruction asks about dominant in the embedding, or restores that aspect where averaging had diluted it.

Project Page: qdd99.github.io/attention-relay

Code: github.com/qdd99/attention-relay

1 INTRODUCTION

Text embeddings are central to search, retrieval-augmented generation, clustering and classification (Muennighoff et al., 2023), and the success of Large Language Models (LLMs) has made them stronger: the best embedding models are now built on LLM backbones (Wang et al., 2024; BehnamGhader et al., 2024; Muennighoff et al., 2025; Zhang et al., 2025c). What makes two texts similar, however, can depend on the task: news articles can be grouped by topic or by where they happened, customer messages by how the customer feels or by what the customer needs. We call any model or readout that turns a text into one vector by pooling its token states an embedder; trained embedding models are the most common kind.

An embedder trained without instructions cannot follow one, even when the instruction is placed in its input. Most recent embedders are therefore trained with instructions: they take an instruction as part of their input and learn to use it by contrastive training on texts paired with instructions, from InstructOR (Su et al., 2023) to Qwen3-Embedding (Zhang et al., 2025c), which takes curated instruction data and a round of training for each embedder, to teach what the LLMs they are built on already do (Wei et al., 2022; Ouyang et al., 2022).

An instruction-tuned LLM follows such instructions readily, but it is no substitute for an embedder. Its hidden states were never shaped for similarity, and embeddings read from them without training, such as PromptEOL (Jiang et al., 2024), Echo embeddings (Springer et al., 2025) and Value Aggregation (Zhang et al., 2026), remain well behind trained embedders. Nor does the LLM's grasp of an instruction obviously carry over to an embedder, which differs from it in size, tokenizer and representation space.

We show that one part of an instruction-tuned LLM's instruction following does carry over, without any training: where the LLM reads a text when it is about to answer, the attention it pays to the text's tokens, which we call its reading weights (Figure 1). We propose Attention Relay, which hands these weights to the pooling of an instruction-agnostic embedder. The embedder never sees the instruction, and the embedding stays in the space the embedder was trained for.

"How does the customer feel?" It's really confusing, how exactly are you determining your exchange rates?

"What does the customer need?" It's really confusing, how exactly are you determining your exchange rates?

Figure 1: One customer message read by Qwen3-1.7B under two questions, each token shaded by its reading weight.

We apply Attention Relay to instruction-tuned LLMs of the Qwen3, Llama 3.1 and OLMo 3 families (Yang et al., 2025a; Grattafori et al., 2024; Team Olmo, 2025) and to widely used embedders, from the sentence-transformers models all-MiniLM-L6-v2 and all-mpnet-base-v2 (Reimers & Gurevych, 2019) to BGE, GTE and E5 (Xiao et al., 2024b; Li et al., 2023; Wang et al., 2022) and Qwen3-Embedding (Zhang et al., 2025c), which differ in tokenizer, size and kind of pooling. We show that Attention Relay makes the embedders instruction-aware in nearly every combination of LLMs and embedders, on the New York Times (NYT) and IntentEmotion datasets and on InBedder's other sets (Peng et al., 2024).

References (66)