Lend Me Your Eyes: Instruction-Aware Text Embeddings via Attention Relay
cs.CL, cs.LG
Submitted: 2026-10-04
Updated: 2026-10-04
Code: https://github.com/qdd99/attention-relay
License: http://creativecommons.org/licenses/by/4.0/
The gist: 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.
Terminology
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.
Sources
- The Llama 3 Herd of Models
- Instruction Following by Principled Boosting Attention of Large Language Models
- Model-Aware Tokenizer Transfer
- Towards General Text Embeddings with Multi-stage Contrastive Learning
- Olmo 3
- Text Embeddings by Weakly-Supervised Contrastive Pre-training
- Out-of-the-Box Conditional Text Embeddings from Large Language Models
- Qwen3 Technical Report
- Model Tells Itself Where to Attend: Faithfulness Meets Automatic Attention Steering
- Qwen3 Embedding: Advancing Text Embedding and Reranking Through Foundation Models
Related papers
- Exploring Solution Divergence and Its Effect on Large Language Model Problem Solving
- Ishigaki-IDS-Bench: A Benchmark for Generating Information Delivery Specification from BIM Information Requirements
- Subliminal Steering: Stronger Encoding of Hidden Signals
- MedStruct-S: A Benchmark for Key Discovery, Key-Conditioned QA and Semi-Structured Extraction from OCR Clinical Reports
- The End of Transformers? On Challenging Attention and the Rise of Sub-Quadratic Architectures
- Untangling the Mechanisms of Misleading Context in Medical Question Answering