atlas

Research map / Large language models / Language, safety and interpretability

Heads up! Large Language Models Can Perform Tasks Without Your Instruction via Selective Attention Head Masking

ICML 2025 · Large language models › Language, safety and interpretability · approach: Task vectors and steering

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Shows that learning a binary attention-head mask over a frozen LLM, with no instructions, can make the model perform tasks like translation and simple NLP tasks, and that the selected heads form interdependent "functional pathways".

Problem

How modules inside LLMs combine to produce distinct task functionalities, and whether task behavior can be elicited without explicit instructions by selecting attention heads.

Approach

Freeze the model and learn a 0/1 attention-head mask via a Gumbel-sigmoid relaxation on task data without instructions; masking out unselected heads makes the model exhibit the task behavior, and the selected heads act as an interdependent functional pathway. Scaling down unselected heads (alpha) can further improve performance.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Apply a learned en-zh attention head mask instead of using the unmasked modelLlama3.1-8B-Instruct · XNLI en-zhPPL: 2.643 -> 1.017Helped
Replace the learned mask with a random equal-size mask (ablation)Llama3.1-8B-Instruct · XNLI en-zhPPL: 1.017 -> 2.909Hurt
Apply a learned en-zh attention head mask instead of using the unmasked modelLlama3.1-8B · XNLI en-zhPPL: 2.308 -> 1.158Helped
Apply a learned en-zh attention head mask instead of explicit translation instructionsLlama3.1-8B-Instruct · XNLI en-zhROUGE-L: 0.539 -> 0.589Helped
Apply task-specific attention head masks without instructionsLlama3.1-8B-Instruct · sentiment, antonym, capitalize first letter, product-company, conll2003 location, fruit v animalaccuracy: 0.01 -> 0.86; 0.12 -> 0.76; 0.15 -> 1.00; 0.06 -> 0.83; 0.00 -> 0.92; 0.00 -> 0.98Helped
Scale outputs of heads outside the task pathway (ablation)Llama3.1-8B-Instruct · IWSLT2017 en-zhBLEU: 0.322 -> 0.347 -> 0.349Helped
Apply the learned attention mask to the MoE modelPhi-3.5-MoE-Instruct · XNLI translation tasksROUGE-L: en->zh: 0.448 -> 0.400; zh->en: 0.519 -> 0.558; en->fr: 0.650 -> 0.361; en->es: 0.674 -> 0.568; en->de: 0.628 -> 0.481; Hurt

Surprising findings

Limitations

Experimental setup

Datasets: Todd et al. (2024) simple tasks (35 datasets) XNLI parallel corpus (en, zh, fr, es, de, ru, ar) IWSLT2017

Benchmarks: XNLI translation (PPL, ROUGE-L) Todd et al. simple tasks (accuracy) IWSLT2017 (BLEU)

Metrics: perplexity ROUGE-L accuracy BLEU Jaccard similarity cosine similarity

Baselines: w/ instruction random mask original model without instruction

Builds on: Gumbel-softmax trick Todd et al. function vectors / task datasets Fang et al. 2024 mask learning

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy