Heads up! Large Language Models Can Perform Tasks Without Your Instruction via Selective Attention Head Masking
Authors: Senyu Han
Hongchuan Zeng
Kai Yu
Lu Chen
Venue: ICML 2025 poster (2025)
Keywords: Large Language Model
Attention Mechanism
Interpretability
Deep Learning
Primary area: deep_learning->large_language_models
TL;DR: By selectively masking attention heads and allowing only certain heads to remain active in LLMs, they can directly exhibit specific task functionalities without the presence of instruction prompts.

Abstract: Large language models (LLMs) consist of numerous Transformer modules, and while the models can perform various functions, it remains an open question of how these modules are combined to elicit distinct inherent functionalities. In this paper, we investigate the modules inside LLMs and demonstrate that, by simply masking or retaining specific attention heads during inference, LLMs can exhibit specific task functionalities without requiring explicit instructions or modifications to the model parameters. Experiments across various models and tasks reveal that LLMs inherently encode ``functional pathways'', the structured groups of interdependent attention heads that are crucial for executing specific tasks. These pathways not only govern the model's functional behaviors but also enhance parameter efficiency, as suppressing attention heads outside the pathway can improve task performance. The code is available in this repository: [https://github.com/OpenDFM/HeadsUp](https://github.com/OpenDFM/HeadsUp).

Heads up! Large Language Models Can Perform Tasks Without Your Instruction via Selective Attention Head Masking
Senyu Han 123
Hongchuan Zeng' 2
Kai Yu 1234 Lu Chen 1234
Abstract
ing their inner module functionaliiies has always been of significant interest to research within the community.
Large language models (LLMs) consist of numer- ous Transformer modules, and while the mod- els can perform various functions, remains an open question of how these modules are com- bined to elicit distinct inherent functionalities. In this paper, we investigate the modules inside LLMs and demonstrate that, by simply masking or retaining specific attention heads during infer- ence, LLMs can exhibit specific task function- alities without requiring explicit instructions modifications to the model parameters. Experi- ments across various models and tasks reveal that LLMs inherently encode "functional pathways". the structured groups of interdependent attention heads that are crucial for executing specific tasks. These pathways not only govern the model's s functional behaviors but also enhance parame- ter efficiency, suppressing attention heads out- side the pathway can improve task performance. The code is available in this repository: ht https: / //gt //githuul thub. com wwwpa///p/e/////aaiiii..ppppp
Recent works have demonstrated that built-in transformer modules of LLMs exhibit certain functionality, For example, decoder layers of different depths vary in their effects on the inference and functionality of the model, and existing research probes the importance of layers and their impact the outputs (Men al., 2024; Bandarkar al., 2025). A more fine-grained division of model functional modules is the level of neurons within the FFN layers. Before L.MMs became popular, many studies suggested that Transformer- based models store their knowledge in the neurons FFN layers (Dalvi al., 2019; Geva al., 2021). Later research LLMs has further analyzed and localized the types of knowledge stored within these neurons, such as languages (Zeng et al., 2025; Tan et al., 2024), concepts (Rai & Yao, 2024) and various tasks (Xiao et al., 2024). Apart from the two modules above, many works also study the functional behaviors of attention heads. Although lieved that function-related knowledge primarily stored in the neurons of FFN layers, there are also considerable works indicating that attention heads play crucial role in knowledge storage and processing, including long-context retrieval, knowledge editing and more (Wu et al., 2025; Todd et al., 2024; Jin et al., 2024). As these works above provide valuable insights into the model module function- ality, most of their methodologies rely on certain tasks or carefully designed prompts, limiting their generalization to other uncovered tasks. Furthermore. these works often require explicit instructions to elicit the corresponding task functionalities of the model, but the reasons and mecha- nisms behind how a module of the same model supports different functions are still not well explored.
generally be-
1. Introduction
Large language models (LLMs) have demonstrated their powerful capabilities across diverse fields. For the most popular Transformer-basee (Vaswani, 2017) architecture, the model comprises multiple stacked modules such as at- tention layers and FFN (Feed-Forwarc Network) layers. After being trained on large amounts of data, the model can support wide range of functions by prompting texts containing task instructions. To understand the mechanism of how a single LLM processes multiple tasks, interpret-
Interestingly, in neuroscience, many similar cases have iden- tified the phenomenon of functional partitioning in the brain (Bertolero al., 2015; Wig, 2017: Béna & Goodman, 2025), where various functions can be exhibited through different combinations of modules (Diez et al.. 2015). Inspired by the modularity in brains, we suppose that the combinations of LLM modules form functionalities inside the model, and we propose a simple yet effective method to detect the task functionalities in LLMs. More specifically, we investigate
X-LANCE Lab, School of Computer Science, Shanghai Jiao Tong University, Shanghai, China *MoE Key Lab of Artificial Intelligence, Shanghai, China Jiangsu Key Lab of Language Com- puting, Suzhou, China 'Suzhou Laboratory, Suzhou, China. Corre- spondence to: Lu Chen <chenlusz @ eju..edu.cn.
Proceedings of the 4nnd International Conference Machine Learning. Vancouver, Canada. PMLR 267, 2025. Copyright 2025 by the author(s).

---

Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking
the functions of LLM modules by just removing these mod- ules from the model. We directly provide the LLM with the task dataset without instructions, and train 0-1 binary module mask to determine the modules selected for this task. Surprisingly, on the modules of attention heads, this straightforward idea leads us to a marvelous discovery: by selectively masking attention heads and allowing only certain heads to remain active in LLMs, they can directly exhibit specific task functionalities without the presence of instruction prompts (Figure 1). We widely confirm this phenomenon across various open-sourced L.MSs covering both base and instruct models, various sizes of LLMs rang- ing from 0.5B to 14B, and various tasks including classifica- tion, extraction, generation and more. Our detailed analysis experiments on attention heads suggest that LLMs contain functional pathways, which are groups of interdependent attention heads that work together to enable specific func- tionalities. Such pathways play critical roles when the model performs related functions, and disrupting these dependent attention heads can significantly worsen performance on related tasks. Furthermore, as a de-noising process for the attention heads, if attention heads outside the pathway are reduced or pruned, the model may even exhibit improved performance. Our findings reveal the inherent capabilities of attention heads and locate their specific functional com- binations within the model, providing valuable insights into the inner functionalities and behaviors of LLMs.
laper Ovspat
MIP
Attention Head Mask
W: Propection
[+2
0
0
Layer
2+1
0
1
1
1
0
1
2
Head
Leser Impet
Input
have never seen such beautiful sunset.
No mask
Original output
I'm glad you're enjoying the moment! Sunsets truly breathtaking.
M
en-zh translation output
M2
en-de translation output
Ich habe nie ein wanderschänes Sonnenuntergang gesehen.
M2
Sentiment analysis output positive
Figure I. By masking and selecting certain attention heads, the model can directly exhibit task functionalities and generate differ- ent outputs under the same input.
Our contributions can be summarized as follows:
universal approaches to detect the parameter functionality, like mapping module parameters or outputs to the vocabu- lary space (Wendler et al., 2024; Feng et al., 2024; Rai & Yao, 2024; Elhelo & Geva, 2024) or comparing parameter changes after task fine-tuning (Zhang et al., 2024; Panigrahi et al., 2023; Xu et al., 2025; Wu et al., 2024b). Particularly, some PEFT-related works also use the strategies of scaling and biasing the output of attention heads (Yin et al., 2024; Wu et al., 2024a), which is similar to our attention mask. In contrast, we only use the discrete scale of 0 or I to select the heads, and such unmodified head parameters are better able reflect the original behavior of the model.
We find that masking out certain attention heads can trigger the task functionality in the LLM without us- ing prompts, and we propose a simple learning-base method to detect them (Section 3).
The selected heads form interdependent functional pathway the model, and they have more critical impact on the model's functionalities (Section 4).
By scaling down the outputs of heads outside the func- tional pathway, we can effectively mitigate the negative impact of these heads on the model, and even improve the model's performance on the task (Section 5).
2. Related Work
Functionality in attention heads Attention heads are be- lieved to be capable of performing functions in editing the information flow (Zheng et al., 2024). In smaller pre- re-trained language models, Jo & Myaeng (2020) evaluate each atten- tion heads on various tasks and finds that heads differ in their influence. For LLMs, Jin et al. (2024) use the gradient- based method locate "memory heads" and "context heads", and Wu et al. (2025) further locate "retrieval heads" by counting their retrieval scores. Such functionality of attention heads is too generic and task-dependent, making it unsuitable for wide application on other tasks. Other works also manage to locate the important heads in respective of different tasks or knowledge (Todd et al., 2024; Yao al., 2024), but they
Discovering functionality in LLMs Previous studies uti- lize diverse approaches to locate the modularity or function- ality of LLMs. For neurons FFN layers, the activation function works as a natural judge to determine whether the neuron important the input, and many works use the activating frequency (Tan et al., 2024; Zeng al., 2025) or the output magnitude (Xiao et al., 2024) to partition the model. At the granularity of attention heads, other methods can be applied, such as comparing head logit differences and calculating attention scores (Zheng et al., 2024). Besides these granularity specified methods, many works also use
2

---

Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking
usually require carefully designed prompts to work well. In our work, the training of attention masks allows any ordi- nary task datasets, and the usage or removal of heads can directly reflect their inherent functionalities on the task.
in the mask. Using the similar approach, we can also block the output of certain FFN layers, though the mask mostly just simply use all the layers (see Appendix C.3.3). Here, we will only apply masks to attention heads.
3. Attention Head Selection Extensively Triggers Functionality
3.2. Mask Training
For a certain task t, We use the training- based method to get its attention head mask M. Specifically, we freeze all the original parameters in the model, and only train a head weight M that has the same size with M but in the Rn*h space, Weights in M can indicate the importance of heads to the task, and the binary mask M can be obtained by the sigmoid function M = TT(a(M) > 0.5). Inspired by Fang et al. (2024) and Csordás et al. (2021), we introduce the Gumbel trick (Gumbel, 1954) into the sigmoid function to encourage o (M) to converge towards 0 or in the training:
In this section, we provide our main experiment results of the attention head selection. We first define the notations, methods and settings used in the module selection, then we show the conclusion that attention head selection can extensively trigger functionalities in LLMs.
3.1. Preliminaries and Notations
Modern LLMs are commonly decoder-only Transform- ers, and a decoder layer includes a multi head attention (MHA) layer and an FFN layer. For LLM that has hidden size of d, consider the input X E Raxd with the length at the decoder layer I. Four projection matri- ces Wo: WK. Wy. Wo E IRdxd compute the attention scores and write the processed hidden states MHA(X) into the residual stream. For the MHA part, suppose the atten- tion layer has h heads', and each head has dim size of dhead d/h. Thus for head i, its contribution Y E Rex to the MHA output is
M M=1 0
M
G
2 0.5
(3)
E E, ~ (0 is the left- tail Gumbel noise matrix and T is the temperature. Smaller T amplifies the impact of noise while also encouraging the weights M to shift toward the positive or negative extremes. Using the reparametrization trick, we can get a discrete but still differentiable mask M during the training.
where G = --og(-loog)]
Just like fine-tuning an ordinary language model, it's straightforward to train an attention head mask: for a sam- ple (z, y) in the task dataset Dr, we directly take the ælly as input without any task instructions and optimize the head weight M on the output sequence y to minimize the loss. Note that the weight M is initialized with positive value so that initial (M) 1, and the training process is like removing attention heads from the full model. After training, we remove the Gumbel noise from (3) and use M = (M( 2 0.5) as the final mask for inference.
XW (W
Y softmax
XW
U V O
(
Dhead
(L)
where w Q. K V Raxduoud are submatrices be-
O E Rd xd is the "head" sub- matrix that projects the output of head i to the hidden space. In this way, the final output of MHA can be calculated as MHA(X)= = Σ. (
longing to head i, and w
Using this notation, it's easy to block the output of certain heads by simply setting their contributions to zero. Specif- ically, for layer / we use binary mask m 10, to indicate which heads are selected in the model, and the layer MHA output can be written as:
3.3. Experiment Setting
Models To verify the generalization of this attention selec- tion strategy, we experiment with different types and sizes of LLMs as follows:
h
MHA(X) = Σ m, Y
(2)
Llama 3.1 series (Dubey et al., 2024): 8B, 8B-instruct
Qwen2.5 series (Team, 2024b): -.St-instruct, 1.5B- instruct, 3B-instruct, 7B, 7B-instruct, 14B-instruct
There will be different masks at different layers of the model. For LLM with n layers, we expect a mask ME {0, 1 to indicate all the selected attention heads in the model. When applying M to the model, it can be re- garded as combining the selected attention heads as a group
Other series of LLMs:
(Adina-
Tru, 2024, with 3.8B params), (Jiang et al., 2023)
Details of their size and attention head settings are listed in Appendix A. We primarily conduct experiments using two 8B Llama 3.1 models, while other models are mainly used
Some LLMs have fewer KV heads than Q heads, and the matrices of KV heads are repeated to be equal in size during the runtime. We take WK. K. Wy v as already repeated for simplicity.
3

---

Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking
to validate the effectiveness of the attention head mask. By convenience, we refer to the 8B-instruct version of Llama 3.1 as Llama3. I sp-inst in this paper, and other models follow similar patterns. We use LM Transparency Tool (Tufanov et al., 2024) to probe the logit outputs inside the models.
Table I. Numbers of attention heads selected in the masks, and the metrics of translation tasks from English to other 6 languages. "Original" uses no instructions nor masks, and "w/ instruction" adds explicit translation prompts to the original model. "Random M shuffles the task mask and has the equal number of heads. Bold and underline indicate the best and sccond- best scores.
Tasks and datasets We train the head mask on two types of tasks: simple tasks and machine translation. Simple tasks are taken from the work by Todd et al. (2024), including 35 datasets of relatively simple tasks like generating antonyms and extracting items. Machine translation uses the XNLI (Conneau et al., 2018) parallel corpus for 15 languages, and we choose English, Chinese, French, Spanish, German, Russian and Arabic (en, zh, fr, es, de, ru, ar) for translation. These languages can be combined into 42 translation pairs for a broad generalization of the head mask. Both types of tasks have the characteristic that models can hardly generate the desired output solely based on the input unless they are explicitly instructed on the task to be performed. For each dataset, we select 100 samples as the evaluation set, and the remaining samples are used for training. Details of these datasets are listed in Appendix A.
Method
en-zh
en-fr
en-es
en-de
en-ru en-ar
Llamu3.Isg-ine of heads in M
832
860
846
862
828
837
PPL (L)
-Original
2.643
2.172
2.319
2.314
2.327
2.730
w/ instruction
1.091
0.619
0,550
0.627
0.954
1,303
w/ random M
2,909
2.370
2.762
2.482
2.677
3.204
w/ M
1.017
0.552
0.504
0,580
L.05S
1.322
w/ M of Llaama3 1s
2.269
1.114
1.061
1.612
2,105
2.381
ROUGE-L (t)
Original
0.020
0.082
0.069
0.069
0.045
0.029
instruction
0.539
0.541
0.599
0.576
0.491
0.414
w/ M
0.589
0.711
0.748
0.677
0.401
0,427
w/ . of Llamm3.1
0.019
0.204
0.241
0.099
0.046
0.045
1Jama3.
# of heads MM
819
809
811
816
795
821
PPL (L)
-Oiggnal
2,308
1.672
1.853
1,780
1.824
2.434
w/ instruction
1
1,240
1,350
1,258
1.573
19455
w/ random M
2,703
2.329
2,337
2.133
2,377
3.251
3.4. Experiment Results
w/ M
1.158
0.585
0.577
0.660
1.142
1.867
w/ M of Llama3
2.213
1.512
1,515
1,480
1.754
2.393
Following the paradigm defined above, we train head masks
ROUGE-L (t)
Original
0.017
0.072
0.067
0.066
0.045
0.030
for different tasks on various models. Our finding is: these masks extensively work on all the tasks, and such attention head combinations trigger the functionalities on both pre-
w/ instruction
0.017
0.084
0,080
0.076
0.054
0.029
w/ M
0.424
0.658
0.657
0.606
0.179
0.067
w/ M of Llammam. 1 IB-iimst
0,016
0.071
0.074
0.076
0.037
0.030
trained and instruction fine-tuned models.
Evaluation results We report the perplexity (PPL) and ROUGE-L (Lin, 2004) of Llama3. 1 gn-inst and Llama3. In on 6 English translation tasks, as shown in Table 1. With the mask M, by removing 15%-20% attention heads from the model, both models can reach better or comparable scores than the full models with explicit translation instructions (e.g. "Translate into Chinese:"). As an ablation, randomly selecting an equal number of attention heads results in a higher PPL than the original full model, indicating that the learned M effectively covers the attention heads necessary for the task. Additionally, we attempt to swap the masks between pre-trained and instruction models for the same task, finding that their PPI. also decreases compared to the original full model. Appendix C presents the experiment results on other translation pairs and models. Except for the relatively poor performance on Owen2..5o.s-.ne other models consistently yield similar conclusions.
partial attention heads selected by .M only can trigger the model functionality, and significantly improve the accuracy of these tasks. The results on other tasks and experiments on Qwen2.57p-inst Qwen2.57p are listed in Appendix C.I, and on simple tasks the pre-trained model Qwen2.57p also exhibits well functionality.
Besides, we found that the model's few-shot in-context learning functionality can also be enhanced by applying the head mask, as shown in Table 3. For the representative simple tasks, we constructed 5-shot demonstration samples (without instructions) for each task. The masks trained using these samples generally outperform the original model with instructional 5-shot samples. Furthermore, we mix the 5- shot data from 32 out of 35 simple tasks to form a 5-shot multi-task hybrid dataset. After training the mask on this hybrid dataset, the model demonstrates improved few-shot in-context learning performance across various tasks, even including those not seen in the training data. This suggests that the attention head mask can also promote the model's s abstract functionality of in-context learning.
Simple tasks also show the similar phenomenon. We select representative tasks out of 35 in Table 2: sentiment (clas- sification), antonym (semantic), capitalize letter (pat- tern), product-company (knowledge). conl12003_locatinn (recognition) and fruit_v v_ v_animal= 3 (logic). In this genera- tion scenario, the original full model can hardly generate the desired output without task instructions. Instead, using
Larger model shows better head functionality As a part of scaling validation, when using the head mask to trigger translation functionalities, we find that larger LLMs tend to have better results. In Table 4, we show the genera-
4

---

Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking
Table 2. Numbers of attention heads selected in the masks, and the accuracy of 6 representative simple tasks. Using the same notation as the Table I.
Table 4. Left: After applying the head masks, the generated results of the English input "i have never seen such beautiful sunset." across different sizes of models. We use green to highlight the correct translations, yellow for partially correct translations, and red for incorrect translations. Right: Top output tokens and their logits Qwen2. i.st-instt Upper (a) is with the M of task en-de, and lower (b) is with the explicit translation instruction.
Method
senti-
anto- mym
cupitalize first letter
product- company
cont12003 location
fruit v animal
Aloma3.Aapees
A of heads in M
745
831
774
751
787
827
Accuracy (?) Original
0.01
0.12
0.15
0.06
0.00
0.00
instracciio
0.59
0:97
0.73
0.51
Model & Task
Predliction
w/ M of Llamaaa
0.86
0.76
1.000
0.83
0.92
0.98
0.64
0.75
0.98
0.78
0.75
0.82
-moh en fr
Je n jamass tellement une belle hear de ciel.
SRAAA q 1i de it Rt IS-
2370
La
I'm surry, but I cun't provile the exeet description of sunset... becutiful
- of heads in
679
726
678
674
670
786
de Qwen2.5
I've
Accuracy (T) OOrigiaal
(a) W/ M
0:30
0.113
0.00
0.07
0.017
0.00
99.90 $3n it
w/ instraction
0.91
0.25
0.99
ren'a jamats uz coucher de
w/ M
0.80
0.66
0.99
0.76
0.79
0.97
susca lubia visto un selsiccio hersunae.
of Llama3. Iosiiet
0.00
0.11
0.06
0.35
0.37
0.43
-en de
sea I've ever wilnessed one like that before.
Owenn.55y-aaa
mmoh
SR,A duut Rt i8-
Table Accuracy of representative simple tasks in the 5-shot scenario on gn-iisst- Italic indicates that the correspond- ing task not included in the hybrid dataset (unseen during the training).
en ft
I'al jamals tel couciter de sobell si beus.
Nunca babla
soi hernosa,
babe nle wunder accittes Saneeunterrung geschen.
(b) w/ inst
Table S. Jaccard similarities of head masks on 12 tasks between Llama3. 1 88-inst and Llama3. "Random" calculates the math expectation of Jaccard similarity on two randomly shuffled masks.
Method
senti-
anto-
capitallie first letter
product- company
con1i22003 location
fruit v
ment
nym
animal
Original, S-shot
0.96
0..56
D.55
0.77
0.61
0.98
Task
en-zh
en-fr
en-es
en-de
en-ru
en-ar
insersction, 5-shor
0.97
0.67
1,00
0.84
0.72
w/ M. S-shot
0.99
0.73
0.59
0.88
0.95
1.00
Similarity Random
0.766 0.675
0.766
0.797
0,802
0.740
0,762
. of hyhrid, 5-shot
0.98
0.69
1.00
0.88
0.82
0.687
0.679
0.693
0.656
0.680
capitalize first letter
product- company
conli2003
Task
sentiment
antonym
location
animal
tion examples of four translation pairs on Qwen2.5 series. Smaller models suffer from difficulties in triggering target functionality (e.g. Qwen2.5a.s8-ins on en-es directly takes the input as instruction), aligning to the target language (e.g. Qwen2.5a..n.inn on en-de), and accurately translating the sentence. From the perspective of attention heads, as larger models usually have more attention heads, there are more combinations of heads available to correspond more functionalities. On the other hand, Qwen2.5p.st. Qwen2.51.sn.a have the same amount of attention heads, but the latter has larger hidden size and more parameters in FFN layers, which may work better to process the func- tionality from incomplete MHA output. A more illustrative example is shown in Table 4a and 4b, where we probe the last layer's ' output logits the last token of the input. When using the head mask of the translation task en-de, Qwen2.55.sniine takes "I" as the top-1 token, but German words "Es" (It), the expected "Ich" (I) and Russian "X" (I) are also in top tokens. In contrast, with the explicit instruc- tion, the model can correctly predict the token "Ich" as the I token. This suggests that the small models may have difficulty in distinguishing and triggering the functions of different attention heads.
Similarity Random
0.591
0.707
0.612
0.634
0.615
0.707
0.531
0.610
0.545
0.533
0.547
0.649
This makes us believe that the pre-trained models have al- ready learned some task-related knowledge in the attention heads during the next-token prediction pre-training. As swapping the head masks can also trigger certain function- alities in some cases, we further investigate the similarity of the selected attention heads between the pre- pre-trained and instruction models. For two masks of Llama3. gn-inst and Llama3. 1 gg on the same task, we calculate the Jaccard sim- ilarity of the selected attention heads. Table 5 shows that the mask similarity is generally higher than the random expectation, but still lower than identical 1.0, as masks of the instruction model tend to use more heads. We suppose that the instruction model inherits most of the attention head functionalities from the pre-trained model, and also introduces new functionalities that are not present in the pre-trained model during the instruction fine-tuning.
and
4. Attention Head Selection Forms Functional Pathways
models also possess functionalities Even though pretrained models (base models without instruction -uninun generally perform worse than instruction fine- tuned models on both types of tasks, we observe that they still exhibit certain functionalities, especially in simple tasks.
In this section, we further investigate how the combination of selected attention heads triggers the task functionality in the LLM. We first define the functional pathway as a group of interdependent attention heads that work together to enable specific functionalities. In the following experi-
5

---

Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking
#dfroeedd
Geseraid
That hig
in hoally wilh
yew
114
161
162
degphig Soow suup kaadpood)
W9
on she
<00
Uu Bara kone bockyad
caling por in tyoes)
311
R
FUB 221 2. 3.2700 ter miipping hnvtyyedt
650
FL (LT thel (1 vheil Wei hi (Toe sive, kaddowe sadieeliee Secigaa Larve lad ln
350
hourr ary
215
400
900 3004
Rarmoved Iacodd
Figure 2. Prompt Llama3. 8B-inst with "I see llama sleeping in my backyard.", and remove attention heads from the full model by head
weight of en-zh translation task in ascending order. Left: With the removal of attention heads, changes of token ranks in the first generated token. Blue lines indicate the original top-5 tokens and the red line indicates the target token "Ik" (I) for translation. Right: Generated outputs of the model after removing different amounts of attention heads.
ments, We find that attention heads selected by the mask form such pathways in the model, and disrupting or selec- tively masking these heads significantly alters the model's I task performance. We further reveal that these heads tend to shift the model's original behavior towards the task func- tionality, and such pathway effect is unlikely caused by paying more attention to certain tokens.
Table 6. PPL of explicit translation tasks from English to other languages when applying different masks on Llama3.1gn-ine We remove attention heads from the full mask 1 that: "all" - used by all 42 translation tasks, "en"- used by 12 translation tasks related to English, and "unused" not used by any translation tasks.
Method
of heads
en-zh
en-fr
en-es
en-de
en-ru
en-ar
Instruction
1024
1.091
0.619
0.550
0.627
0.954
1.303
Attention heads form critical, interdependent functional pathways inside the model We first want to know how masking certain attention heads can switch the model's 's be- havior from instruction- following towards task functionality. One way to probe the behavior changes is progressively removing attention heads one by one from the full model. On model Llama3. Iss-inst and the en-zh translation task, we start with the attention head that has the minimum weight in M. remove heads in the weight ascending order, and check the changes in the generated responses. As shown in Figure 2, the model experiences multiple stages in behaviors:
w/ Lil
847
4.322
4.129
4.149
5.008
5.441
w/ random 1
847
2,122
0.792
0,864
1,248
1,237
2,578
w/ 1:m w/ random 1ye
741
7.029
6.137
6,396
6,511
6,903
7,011
3.325
1.480
2.136
1.540
2.619
2.972
w/ guuuee w/ random 1 (uaused
977
1,064
0.577
0,497
0,585
0.924
1.269
977
1.112
0.688
0.705
0.603
1.020
1.369
Specifically, we observe that when attention heads are re- moved, there are numerous abrupt, drastic changes in token ranks. If the attention heads worked independently, then firstly removing those heads that significantly promote the target token rank would accelerate the behavior shift of the model. However, this influential removal order actually de- lays the functionality switch (see more in Appendix C.3). This suggests that the behavior changes are not caused by removing certain independent attention heads, but are built upon the removal of all previously removed attention heads.
Stage 1: The model can still preserve the functional- ity as an instruction model, but when approximately 100 attention heads are removed, the rank of the tar- get translation token (red line) experiences drastic increase. This surge indicates that the model's transla- tion functionality begins emerge.
Considering such dependency between attention heads, if we take the selected attention heads as nodes and connect them with edges, then we can get an interdependent func- tional pathway that influence model behaviors. To verify the impact of such head pathways on model functionality, we initialize the head weights M with negative values (so that initial a (M) As 0) when training the mask M. This approach yields us masks with fewer and more task-specific attention heads while slightly damaging language capability, We train these masks 42 pairs of translation tasks, iden- tify the heads that are commonly used or unused, remove these common heads from the model and evaluate PPL on translation tasks. As these common heads are used in every translation task, we can consider them as key components of the translation function pathway. Within our expectation,
Stage 2: After removing 158 attention heads, the model undergoes rapid transition, and starting from the removal of the 162nd head, it shifts from its original instruction- mnstruction-folloiing behavior to a translation behavior. This task functionality begins to dominate, and further removal of attention heads causes the rankings of initial top tokens (blue lines) to drop rapidly.
Stage 3: As more attention heads are removed, after 528 heads, the model's language processing ability begins to lose, and the generated tokens will become meaningless in the end. This is expected as the model has lost the majority of its attention heads.
6

---

Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking
Ongins va Wn maxeckn alve Instuate at estiation
Tranning propresa
Luger
Figure 3. Changes of head weights in the mask training progress. Blue lines indicate the heads that are selected in the final mask, and red lines indicate the heads that are not selected. We highlight the heads that undergo dependent changes during the training.
Figure 4. Cosine similarities of hidden states hetween different settings after each layer. Dark lines indicate the outputs of decoder (also FFN) layers and light lines indicate the outputs of attention layers. We also project the decoder hidden states of Original and w/ M into the vocabulary space and label their top-1 tokens.
in Table 6 we find that blocking the key translation-related attention heads in the pathway can lead to a severe perfor- mance drop on the translation tasks.? This demonstrates that combined attention heads inside the task pathway sig- nificantly influences the related functionality of the model.
ure 4. We use three settings for comparison: (Blue) Original vs. w/ instruction ("Translate into Chinese"), which uses the same model but different functions; (Red) w/ .M vs. w/ instruction, which performs the same function but differs in model; and (Green) w/ M vs. w/ M + instruction, which performs the same function in the same model. Compared with the original model without instructions nor masks, the FFN hidden state outputs of the masked model gain higher similarity with the unmasked instructed model in the later layers. It's easy to understand that LLM often performs lan- guage understanding and semantic processing at shallower layers, while more complex task-related inferences are car- ried out at deeper layers (Bandarkar et al., 2025; Wendler et al., 2024), so consequently the model with M demon- strates an advantage in similarity only in the latter half of the model. Meanwhile, considering the inherent differences in the instructions given to the model inputs, even having the same model perform the same function, the layer out- puts still cannot always maintain a high level of similarity at every layer (green line). Compared with it, the advantage of the masked model over the original model in later layer output similarities indicates that: as the layer goes deeper, the combined attention heads are attempting to reconstruct the functional information flow of the model.
We further explain the point that heads inside the task path- way do not just independently retain task-related functions.
A piece of illustrative evidence in Figure 3 shows that at- tention heads in the pathway are dependent on each other, where we probe into the changes in head weights during the mask training. We notice that many unused heads in the final M initially have been temporarily selected during the training (sigmoid weight greater than 0.5), but more other heads join the pathway during the training progress, these heads are eventually ablated from the pathway. A similar phenomenon can be also observed in some heads that are selected in the final mask, as they are not selected in the early training stage but are added to the pathway later. From this perspective, such functionality exhibited by the com- bination of attention heads is not independently triggered by the individual attention heads being combined, but is instead triggered through functional pathways formed by their interdependence.
Attention head masks attempt to reconstruct the task functionality We further investigate why the functional pathway formed by attention heads can trigger the task func- tionality without explicit instructions. Intuitively, if the output of the model using head mask M on the last token is similar to that of the model with instructions, it can be considered that the pathway formed by the mask is attempt- ing to approximate the information flow required to execute the function. Again, we prompt Llama3. Inn.inst with the sentence "I see a Ilama sleeping in my backyard.", and cal- culate the cosine similarities of layer hidden state outputs between different model and input settings, as shown in Fig-
In the same scenario depicted in Figure 2, we also calculate the similarities of layer outputs during this one- by-one head removal and present their changes in Figure 5. We find that as attention heads are gradually removed, the similarity in deeper decoder layers between the masked model and instructed model increases, and the value becomes stable once the masked model fully exhibits the target translation functionality (after removing 192 heads). This increase in similarity indicates that the remaining attention heads are reconstructing the task functionality during the process of unveiling the function pathway. In contrast, the similarity of the shallower layer outputs slightly decreases as more attention heads are removed. This can be explained since
SSurprisingyy, removing unused heads results in slight improve- ments. This enlightens us to further utilize it in Section 5.
7

---

Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking
Table 7. Average attention scores of attention heads the target word. These tasks require selecting word that differs from the others among words (so the uniform score is 0.33). We calculate the attention score of each attention head on these words for the last token of the input, normalize it, and then sum up the attention on all tokens of the target word as the values below.
Cosnne siicenty Spper Output
adjective verb
object concept
verb v adjective
fruit animal
Method
0.
Original, all heads
0.352
0.306
0.314
0.347
Removed heads
w/ instruction, all heads
0,409
0.363
0.345
0.468
w/ instruction, heads in .M w/ instruction. heads in 1 MM
0,408
0.356
0,353
0,462
Figure 5. Remove attention heads from the full model by weight ascending order, and the cosine similarities of hidden states be- tween w/ instruction and w/ M after each decoder layer. Darker lines indicate later layers (eloser to the model output).
0.413
0,386
0.316
0.494
w/ M, heads in JM
0.462
0.471
0.426
0,566
w/ M. heads in 1 -M
0.484
0.537
0.379
0.607
the shallower layers have not yet processed much about functionality, and removing attention heads reduces their capacity to handle language and semantic processing.
with the previous findings that the selected attention heads are not independently triggering the functionality, but are forming pathways to activate the model.
Attention head mask is not selecting attention scores Although the attention head selection involves the model's attention mechanism, we did not explore how this selection affects token attention scores in the previous discussion. Normally, in the attention layer, the model attends to the preceding tokens with varying attention scores. However, since our attention selection is independent of instructions, the model's 'ss attention will not focus nonexistent instruc- tion tokens. Especially in some simple tasks, the model input is just a single token, and there is little space for the attention mechanism to work around. From this perspective, such functionality is unlikely caused by simply selecting attention heads that are more focused on the target.
5. Attentiton Head Selection Potentially Improves Model Performance
In Table 6, we notice that removing translation-unrelee attention heads can decrease the perplexity of the model on the translation task. This suggests that the model may inherently possess a better ability to perform specific tasks, but this ability is suppressed by the noise of other attention heads outside the pathway to better handle a broader range of tasks. To measure the influence of unselected heads to the task, we introduce a scaling factor a E [0, 1] on the outputs of attention heads outside M, and in this case the head mask can be written as A = IMMMMM > 0.5) + all(a (M) 0.5). We conduct grid search on 6 explicitly instructed translation tasks of XNLI with Llama3, Is snn-inst- As shown in Figure 6, it can be observed that using masks to remove attention heads outside the pathway (a = 0) consistently results in lower PPL than using all attention heads (a = 1). Meanwhile, this scaling method is not simple linear interpolation between the full model and the zero-masked model, but convex combination of the two: using small around 0.2 or 0.3 can achieve a lower PPL. To further verify the performance improvement of the model in the generation scenario, we conduct evaluations using the additional translation dataset IWSLT2017 (Cettolo et al., 2017). Under the condition of providing the same translation instructions, we compare the score differences between the original model and the model with the scaled M applied. As shown in Table 8, using M consistently improves the model's BLEU scores on these translation tasks, and applying a small scaler a can offer further slight enhancements. From this perspective, selecting attention heads can better showcase the model's 's inherent but hindered capabilities, potentially improving its performance.
We verify this hypothesis by calculating the average atten- tion score distribution of heads on 4 extractive simple tasks on Llama3. I ss-iinst as they have explicit target tokens in the inputs. The input to these tasks is a set of words, and the objective is to extract the target one that is different from the others. As shown in Table 7, for the original model without task instructions, the model does not pay significant atten- tion to the target word, and as expected, the instructed model has higher attention scores on the target word. However, if we separately calculate the average attention scores of heads in and out of the task mask M, we find that the selected at- tention heads do not necessarily have higher attention scores (even lower in 3 out of 4 tasks) on the target word. This indicates that the head selection is not based on the attention scores of the instructed model. Even in the masked model, attentions to the target word are further promoted, but the unused heads still have high attention scores on the target word, notwithstanding they are not involved in the model inference. Such anomaly in attention scores suggests that the selection of attention heads functions more as influenc- ing the overall behavior of the model. This is consistent
8

---

Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking
References
14-
Aru. Discover the new multi-lingual, high-quality phi-3.5 slms, August 2024. URL https: /akaaaaaaa. ms/ phi3. 5.techbloog
PPL wil respecove
Bandarkar, L.., Muller, B., Yuvraj, P., Hou, R., Singhal, N., Lv, H., and Liu, Layer swapping for zero-shot cross-lingual transfer in large language models. In The Thirteenth International Conference Learning Rep- resentations, ICLR 2025, Singapore, April 24-28, 2025. OpenReview.net, 2025, URL https: wwwptttt////eeeeeeeteet /oppneveeee.... net wtt.//oorummmiii@nnnammame
08
9,50
0.5
0.1
02
0.3
0.4
0.5
0.5 0.7 0.5 0.0
1.0
Scaling fector
Figure 6. PPL of translation tasks when using both explicit instruc- tions and task masks, with different scaling factors Mark "x" points to the PPL of the model without instructions.
Béna, G. and Goodman, D. Dynamics of specialization in neural modules under resource constraints. Nature Communications, 16(1):18) 2025.
Table 8. BLEU scores for explicitly instructed translation pairs on IWSLT2017. Each scaled translation pair uses its own mask with the best scaling factor shown in Figure 6.
Bertolero, M. A., Yeo, B. T., and D D'Esposito, M. The modular and integrative functional architecture of the human brain. Proceedings of the National Academy of Sciences, 112(49) E6807, 2015.
Method
en-zh
en-fr
en-de
zh-en
fr-en
de-en
Instructed
0.322
0.699
0.657
0.604
0.739
0.716
Cettolo, M. Federico, M., Bentivogli, L., Niehues, J., Stüker, S., Sudoh, K., Yoshino, K., and Federmann, C. Overview of the IWSLT 2017 evaluation cam- paign. In Proceedings of the 14th International Con- ference on Spoken Language Translation, pp. 2-14, Tokyo, Japan, December 14-15 2017. International Work- shop on Spoken Language Translation. URL https: //aclant //aclanthology org/ 201. iwslt-1.1.
w/ MM
0.347
0.716
0.674
0.610
0.743
0.720
w/ scaled M
0.349
0.717
0.678
0.611
0.743
0.719
6. Conclusion
In this paper, we discover that I.LMs can directly exhibit functionality solely through combining attention heads, and we propose simple method to identify intrinsic functional pathways within the model. By focusing on the model's inherent functionality, we conduct detailed investigation into its mechanisms, contributing to the interpretability of attention heads and the phenomenon of functional parti- tioning in LLMs. In the future, we plan to extend similar research to structures such as FFNs and MoE models with the expectation of constructing a comprehensive functional pathway for the model.
Conneau, A., Rinott, R., Lample, G., Williams, A., Bowman, S. R., Schwenk, H., and Stoyanov, V. Xnli: Evaluating cross-lingual sentence representations. In Proceedings of the 2018 Conference on Empirical Methods Natu- ral Language Processing. Association for Computational Linguistics, 2018.
Csordás, R., van Steenkiste, S., and Schmidhuber, J. Are neural nets modular? inspecting functional modularity through differentiable weight masks. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. Open 2021. URL https:: /ttp:::////peeeieww net nwt/forunt id=7uVcpu-ght
Acknowledgments
This work is funded by the China NSFC Projects (92370206, U23B2057, 62120106006) and Shanghai Municipal Science and Technology Major Project (2021SHZ2DZX0002,,
Dalvi, F, Durrani, N., Sajjad, H., Belinkov, Y., Bau, A., and Glass, J. What is one grain of sand in the desert? analyzing individual neurons deep nlp models. In Proceedings of the AAAI Conference on Artificial Intelli- gence, volume 33, pp. 6309-6317, 2019.
Impact Statement
This paper advances the interpretability of large language models, aiming make their internal reasoning processes more transparent and understandable to users and develop- ers. By improving interpretability, we contribute to more accountable and trustworthy AI systems. There are other many potential societal consequences of our work, none which we feel must be specifically highlighted here.
Diez, L,, Bonifazi, P., Escudero, I., Mateos, B., Muñoz, M. A., Stramaglia, S., and Cortes, J. M. novel brain partition highlights the modular skeleton shared by struc- ture and function. Scientific reports, 511):1053,, 2015.

---

Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking
Dubey, A., Jauhri, A., Pandey, A., Kadian, A., Al-Dahle, A., Letman, A., Mathur, A., Schelten, A., Yang, A., Fan, A., et al. The Ilama 3 herd of models. arXiv preprint arXiv:2407.21783. 2024.
Jo, J.-y. and Myaeng, S.-H. Roles and utilization of attention heads in transformer-based neural language models. In Jurafsky, D., Chai, J., Schluter, N., and Tetreault, J. (eds.), Proceedings of the 58th Annual Meeting of the Associa- tion Computational Linguistics, pp- 3404-3417, On- line, July 2020, Association for Computational Linguis- tics, doi: 10.186633/1122022ccllllmm / //aclanthology org acl
Elhelo, A. and Geva, M. Inferring functionality of at- tention heads from their parameters. arXiv preprint arXiv:2412.11965, 2024.
URL https: ac1-mmaa...mmian maaemmmmain..... 311/.
Fang. G., Yin, H., Muralidharan, S., Heinrich, G., Pool, J., Kautz, J., Molchanov, P., and Wang, X. Maskllm: Learnable semi-structured sparsity for large language models. arXiv preprint arXiv:2409. 17481, 2024.
Lin, C.-Y. ROUGE: A package for automatic evalua- tion of summaries. In Text Summarization Branches Out, pp. 74-81, Barcelona, Spain, July 2004. Asso- ciation for Computational Linguistics. URL https: / //aclanthooooe wtg//04-111110
Feng, Z., Zhou, H., Mao, K., and Zhu, Z. FreeCtrl: Con- structing control centers with feedforward layers for learning-free freee controllable text generation. In Ku, L.-W., Martins, A., and Srikumar, V. (eds.), Proceedings of the 62nd Annual Meeting of the Association for Computa- tional Linguistics (Volume 1: Long Papers), pp. 7627- 7640, Bangkok, Thailand, August 2024. Association for Computational Linguistics. doi: 10.18653/v1/2024 acl-Iong.412, URL https:/:: aalcollantooooyyoy .rgg 2024. acl- long. 412.
Men, X., Xu, M., Zhang, Q., Wang. B., Lin, H., Lu, Y., Han, X., and Chen, W. Shortgpt: Layers in large language mod- els are more redundant than you expect. arXiv preprint arXiv:2403. 2403:22003.0383, 2024.
Panigrahi, A.,. Saunshi, N., Zhao, H., and Arora, S. Task- specific skill localization in fine-tuned language models. In Proceedings of the 40th International Conference on Machine Learning, ICML'23. JMLR. org, 2023.
Rai, D. and Yao, Z. An investigation of neuron activation as a unified lens to explain chain-of-thought eliciting arith- metic reasoning of LLMs. In Ku, L.-W., Martins, A., and Srikumar, V. (eds.), Proceedings of the 62nd Annual Meet- ing of the Association for Computational Linguistics (Vol- ume 1: Long Papers), pp. 7174-7193, Bangkok, Thailand, August 2024. Association for Computational Linguis- tics. doi: 10. 10.18653//112224.ecloooogg / //aclantholege wtw.llgg..rrgg.oo/
Geva, M., Schuster, R., Berant, J., and Levy, O. Trans- former feed-forward layers are key-value memories. In Moens, M.-F., Huang, X., Specia, L.., and Yih, S. W.-t. (eds.). Proceedings of the 2021 Conference Empirical Methods in Natural Language Processing, pp. 5484-5495, Online and Punta Cana, Dominican Republic, November 2021. Association for Computa- tional Linguistics. doi: 10. 10.18653/v1/2021 hew.22/m0...mmmmmi..... 446. URL ht https:/ /aaaaaaaanhloooyy... org/2021. emnlp main 446/.
URL https: acl-long.......... long. 387.
Tan, S., Wu, D., and Monz, C. Neuron specialization: Leveraging intrinsic task modularity for multilingual ma- chine translation. In Al-Onaizan, Y., Bansal, M., and Chen, Y.-N. (eds.), Proceedings of the 2024 Conference Empirical Methods in Natural Language Process- ing, pp. 6506-6527, Miami, Florida, USA, November 2024. Association for Computational Linguistics. doi: 10. 10118653.1220244.mmmbmmmimii. emn.p-main 374. aclantho wwtph/ooooooo.gg//2eoe//e// http://oo..or//22222mmmmmmmmaa..
Gumbel, E. J. Statistical theory of extreme values and some practical applications: a series of lectures, volume 33. US Government Printing Office, 1954.
Jiang, A. Q., Sablayrolles, A., Mensch, A., Bamford, C.,, Chaplot, D. S., Casas, D. d. 1., Bressand, F., Lengyel, G., Lample, G., Saulnier, L., et al. Mistral 7b. arXiv preprint 1xXiv:2310.0682 2023.
URL https://
Team, G. Gemma. 2024a. doi: 10.34740FKAGG1EEM/3301
URL httph:ttp//// //www. kagg le com/n/3301....
Jin, Z., Cao, P., Yuan, H., Chen, Y., Xu, J., Li, H., Jiang, X., Liu, K., and Zhao, J. Cutting off the head ends the conflict: A mechanism for interpreting and mitigating knowledge conflicts in language models. In Ku, L.- Martins, A., and Srikumar, V. (eds.), Findings of the Association for Computational Linguistics: ACL. 2024, pp. 1193- 1215, Bangkok, Thailand, August 2024. Association for Computational Linguistics. doi: 10.18453/v1/202. findings- 7c.. URL https:/ aaclnnthooggy. org/2024. findings-acl, 70.
Team, Q. Qwen2.5: A party of foundation models, Septem- ber 2024b. URL https: blog/ htopg//wen2..///
Todd, E., Li, M. L.,, Sharma, A. S., Mueller, A., Wallace, B. C., and Bau, D. Function vectors in large language models. In The Twelfth International Conference on Learning Representations, ICLR 2024, Vienna, Austria, May 7-11, 2024. OpenReview.net, 2024. URL https: / //openrevien ew. net/ forum? d=AwyxtyMwaG.
10

---

Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking
Tufanov, I., Hambardzumyan, K., Ferrando, J., and Voita, E. LM transparency tool: Interactive tool for analyzing trans- former language models. In Cao, Y., Feng, Y., and Xiong, D. (eds.), Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 3: System Demonstrations), pp. 51-60, Bangkok, Thailand, August 2024. Association for Computational Linguis- URL https: tics. doi: wtwp:gg.oorrgggoeee wwwp////////... acl-demos 6. //aclanthology.
Xiao, C., Zhang, Z., Song, C., Jiang, D., Yao, F., Han, X., Wang, X., Wang, S., Huang, Y., Lin, G., et al. Config- urable foundation models: Building Ilms from modular perspective. arXiv preprint PrXiv:2409.02877, 2024.
Xu, H., Zhan, R., Ma, Y., Wong, D. F., and Chao, L. S. Let's focus neuron: Neuron-level supervised fine-tuning for large language model. In Rambow, O., Wanner, L., Apid- ianaki, M., Al-Khalifa, H.,, Eugenio, B. D., and Schock- aert, S. (eds.), Proceedings of the 31 International Con- ference on Computational Linguistics, pp. 9393-9406, Abu Dhabi, UAE Jamuary 2025. Association for Compu- tational Linguisties. URL https: / ac aclanthology. O org / 2025 co in-mma i i 630/-
Vaswani, A. Attention is all you need. Advances in Neural Information Processing Systems, 2017.
Wendler, C., Veselovsky, V., Monea, G., and West, R. Do Ilamas work in English? on the latent language of multi- lingual transformers. In Ku, L..W., Martins, A., and Sriku- mar, V. (eds.), Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume I: Long Pupers), pp- 15366-15394, Bangkok, Thailand, August 2024. Association for Computational Linguis- tics. doi: 10. 10.18653ww1220024.elllooogg 820. URL https: //aclanthooogy: wtwp:/oooooorroooooooo.oo ottg acl- acl-leng: 820.
Yao, Y., Zhang, N., Xi, Z., Wang, M., Xu, Z., Deng, S., and Chen, H. Knowledge circuits in pretrained transformers. CoRR, abs/2405. I 17969, 2024. doi: 10.48550/ARXIV. 2405. URL https:/ wwddii..r///..oooo.o 48550/
Yin, F., Ye, X., and Durrett, G. Lofit: Localized fine-tuning on LLM representations. In The Thirty-eighth Annual Conference on Neural Information Processing Systems, 2024. URL https: https::/ /ttp:////pppeeeeeeeeeeeemee net forum? id=df SadFiFFFECS..
Wig, G. S. Segregated systems of human brain networks. Trends in cognitive sciences, 21 21(12):981-99, 2017.
Wu, M., Liu, W., Wang, X., Li, T., Lv, C., Ling, Z., Jian- Hao, Z., Zhang, C., Zheng, X., and Huang, X. Advanc- ing parameter efficiency in fine-tuning via representa- tion editing. In Ku, L.-W., Martins, A., and Srikumar, V. (eds.), Proceedings of the 62nd Annual Meeting of the Association for Computational Linguisties (Volume I: Long Pupers), pp. 13445-13464, Bangkok, Thailand, August 2024a. Association for Computational Linguis- tics. doi: 10. 10.18663//1/20222.elll 726. URL https: //aclanthology: hwwphhhwwwoo.....//////e// acl long. 726.
Zeng, H., Han, S., Chen, I.., and Yu, K. Converging to a lingua franca: Evolution of linguistic regions and seman- ties alignment in multilingual large language models. In Rambow, O., Wanner, L.., Apidianaki, M., Al-Khalifa, H., Eugenio, B. D., and Schockaert, S. (eds.), Proceed- ings of the 31st International Conference on Compula- tional Linguistics, pp. 10602-10617, Abu Dhabi, UAE, January 2025. Association for Computational Linguis- tics. URL https: / haaaaaaanntllooooooooooo hogy. org//0255 col holing-mar 707/.
Wu, W. Wang, Y., Xiao, G., Peng, H., and Fu, Y. Re- trieval head mechanistically explains long-context fac- tuality. In The Thirteenth International Conference on Learning Representations, ICLR 2025, Singapore, April 24-28, 2025. OpenReview.net, 2025. URL https: //opnreview. net forum? wete///orriiddeeeeeeeee ddyttdddtttttttttt....
Zhang, Z., Zhao. J., Zhang, Q., Gui, T., and Huang, X. Un- veiling linguistic regions in large language models. In Ku, L.-W., Martins, A., and Srikumar, V. (eds.), Proceed- ings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume I: Long Papers), pp. 0228-6247 Bangkok, Thailand, August 2024. Associa- tion for Computational Linguistics. doi: 10.18653/v1/ 2024 a024..cl-. URL https: org /22//224. acl-logg.. 338.
Wu, X. Yao, W., Chen, J., Pan, X., Wang, X., Liu, N., and Yu, D. From language modeling to instruction following: Understanding the behavior shift in LLMs after instruc- tion tuning. In Duh, K., Gomez, H., and Bethard, S. (eds.), Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies ( (Volume I: Long Papers), pp. 2341-2369, Mexico City, Mexico, June 2024b. Association for Computational Linguistics. doi: 10. 10.11665//1//2024mmmmllllll Iong.10.. 130. URL https:// ac aclanthology. www.thhoooo..oo//222222222 org//024. neacl n llngg 130.
Zheng, Z., Wang, Y., Huang, Y., Song, S., Yang, M., Tang, B., Xiong, F,, and Li, Z. Attention heads of large language models: A survey. arXiv preprint arXiv:2409.03752. 2024.

---

Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking
A. Models & Datasets
Table 9. M. used in this paper. We mainly report their attention layer configurations.
In this section, we introduce the models and datasets used in our experiments. Models are selected from various open- sourced LLMs, as listed in Table 9. For translation tasks, we use XNLI (Conneau et al., 2018) for training and main eval- uation, and IWSLT2017 (Cettolo et al., 2017) for additional evaluation in Section 5. XNLI contains 10000 samples for each language pair, and we use 100 samples for evaluation and the remaining 9900 for mask training. IWSLT2017 contains 8549 samples for Sanglish-Chinese pair, 8597 sam- ples for English-French pair, and 8079 samples for English- German pair. We use all the samples for the evaluation reported in Table 8. For simple tasks, we choose 35 datasets in the Function Vector work by Todd et al. (2024). In each task, we choose out 100 samples for evaluation, and the remaining samples are used for the fixed-step mask training. The details of these datasets and our instruction prompts (for w/ instruction evaluations) are listed in Table 10.
Model name
Notation
Parums
Layers
lleads
KV heads
Total heads
LJunse3, 1-88-Instree
Llanad. han
8.088
32
x2
1004
Limma-3.1 3,1-83
Laadd. lan
8.030
12
32
1024
Qwen2. 5-0. SR-Indract
Qwen2 Seaa-ad
494M
24
14
336
Qwen?. 188-Irdtrcc
Qwes2.5
1.548
336
Qwee2,5.333 S-5-luicttt
Qwen2.5 Quen2.5ypaau
3,00B
16
576
Qwea2,5 7B Instruct
Qwes2.5r STa-kot
7.628
28
25
784
Qwen2.5 7B
Qwen2 Srn
7,628
28
28
784
Qwen2. 14B Instrcct
Qwen?
14.80
80
1920
Phi-3 10b-3.5-miiiillae
Phu3.5 sew
3.528
32
1024
Mistral 7B Instract v0.3
Mistrala sws
7.258
32
1024
alongside the context, which leads to lower ROUGE-L scores. On the other hand, the translation results of masked models are more concentrated on the task and context words, the w/ . scores of Qwen2.514B-in increase significantly compared to the w/ instruction scores (Table 29). This implies that attention heads could influence the response style of the model. We provide a translation example in Table 36.
B. Experimental Details
For some small models, attention head mask M may fail on translations relatively low-resource languages (e.g., translating to Arabic using models smaller than Qwen2.5an-imx) Theoretically, if a model has more attention heads, then it can form more functional path- ways through their combinations. We suggest that this phenomenon of attention heads exhibiting functionality better applicable to larger LLMs.
All experiments are conducted on a NVIDIA A800 80GB GPU. We summarize the hyper-parameters used in the mask training in Table 11. In particular, for memory reasons, the batch size on translation tasks of Qwen2.51an-ine is set to 8 and its training steps are 12370. Other hyper-parameters remain the same. For the evaluation of simple tasks, we generate 10 new tokens and check whether the response contains the correct answer, in case the instruct models may generate some leading words (like "the answer is:"). But for some tasks like capitalizing letters and extracting items, we only check whether the response starts with the correct answer. You may check more implementation details in our public code repository.
We also test the attention head mask on Gemma series (Team, 2024a). While Gemma2ou-inet the masked model can also directly elicit the functional- ity, the masked model on Gemma2zn-inst fails on all the translation pairs. We would ascribe this to the number of attention heads in the model (208 heads in total, 26 layers and 8 heads for each). Although the model has more parameters than Qwen2.50.58.im and Owen2.55.s5.ine. the lack of sufficient gramularity prevents it from acquiring a combination of attention heads that can directly elicit functionalities.
C. More Experiment Results
In this section, we provide more experiment results to sup- port the findings in the main text.
For the attention head masks in pre-trained models, we also provide full results (Table 37, 38) as complementary to the examples Table 5. Specifically, we calculate the math expectation of Jaccard similarity on two randomly shuffled masks ("Random" column) as follows:
C.1. Full Evaluation Results on All Models
As complementary to the results in Section 3, we provide the full evaluation results on all models in Table 12-35 (transla- tion PPL. Table 12-21, translation ROUGE-L. Table 22-31, simple task accuracy Table 32-35). From these complete results, also find some other phenomena:
E [IM1 n Mall
E [Jaccard M2)]
E [[M U Mall
Qwen2.51un-ast does not give the dominant ROUGE- I. performance in the instructed translation task, al- though it is the largest model in our experiments. We examine the translation outputs of Qwen2.5|4n.ig and Qwen2.578-tnst finding that the 14B model tends to generate more explanation words than the 7B model
|
LM, LM2l
[
II
E|M + MM₂
[M n Mell
I.M. 11Ma
1 + ||2
J.M
[1]
(4)
12

---

Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking
Table 10. Simple task datasets and their task instructions used in this paper.
Task name
Samples
Prompt
lowercase, first letter
814
Output the first letter of the given word in lowercase ininlnput:-iin iippat | Vnnnnuuppu:'ninnn Identify the country where the given national park locuted. innnoputtonnnnnnnnnnii (input) Onnnnurpputlnnnnnn Identify a synonym for the given word wwlalauut (atlaputttuuiinuuuut Munput///aOuupuuu/aii
park-country
749
synonym
2880
Classify the given news headline into one of the categories: Business, Science, Sports, or World. Provide only the category name JubnInput//wlal (input)'aiie (aataauuuOOuuuuull
aews
7600
word Jeng_
814
Determine the number of letters in the given word and output the count. count. wakalaput//alnn (input /ntntutputt/ala
present past
293
Convert the given verb from its present tense to its simple past tense wwwnInput-innn Woluut//lOnnuuuttiiiii
capitalize
813
Output the given word with its first letter capitalized 'ntaInput''na (input) Wlaouupuut
counntrr
836
Identify the country where the given landmark is located. wwaate////alppp///eeee Anint (inpttttttttttiaiaaaii hatppu////tuuuuu///aa
english-german
5145
Translate the given English word into German wwwninputtinnnnn finput Vnnnnuupuurrinnnn
sentiment
1167
Determine the sentiment of the given input. Output either positive'' or 'negative' wwbainput (input Uulaautputtaal
copntry-capital
197
What is the capital of the given country? Provide only the name of the cupital Intn/nptt//rll iinptt | /wbnOuttput//iln
person-occupation
821
Identify the occupation of the given individual www.Inptt//an//////.. (input] Inlnnuuuuttininnn
country currency
197
What is the official currency of the given country country7ainnnngn "'rinInput-Annn input /utaOutputtlnln
lowercase_ last_ lest_retter
814
Output the last letter
given word lowercase. In ininnppt:/nnni (input) /winOurpuu///nnn
person-sport
318
Identify the sport associated with the given individual wwtlloputtlalltt (input]lalnOea Jaln
person instrument
510
Identify the musical instrument played by the given musician. Ininloppt//nnnn innput httnn//nuu//utt/nuunntnao InlnOutpuu/nn
antonym
2398
Identify the antonym of the given word wttp:////ann/p///alalaaaaa (input) /utuuuuutt:/u
capitalize Jast__ettee
814
Output the last letter of the given word in uppercase. www.wawtt.attaaaooo...o batp:ppuuttt/iuuuuu//au (inputt/llllaatta lubouutptu/un
english- english-french french
4698
Translate the given English word into French. French. wwallput (input /wlntutputtrrila
next_item
225
What is the next sequential item following the given inpur?u'uu Ptlalapptt lala (input) /u/tOuuuuuu/lln
singular-puura
205
Provide the plural form of the given singular noun www.nppttittttn (input /ulaauppuuullla
capitalize_seconda secee_scooddette
787
Output the second letter of the given word in uppercuse. in'ninput//nnnn input /n'nOutputtnnnnnn
prey_item
225
What is the item that comes before the given input in sequential context Sottext/aninnnpuu/eallll (input /ulnoutput//llla
capitalize_find letter
813
Output the first letter of the given word in uppercase, Inlnnpuut::i innutt /whnOOutputt/ii
english-spunish
5199
Translate the given English word into Spanish Inwnnnput /nin imput Innnnurpptt/nnnn
next cotp_cppitll_aaa Jetter letter
814
What is the next upperease letter in alphabetical order after the given input/ibblnnput/aaaat paaptninnpuuutttt /inlnuutputtaain
national national_parks parks
451
Identify the U.S. state where given national park located inpptutt:nnnnn finput innput/wwnnOutpuutn.ni
product-company
522
Identify the company associated with the given product ww'aInput//uu (input (input//wlaaat /ulnautpuut/llaa
conl120033orgaan organization
3843
Extract the organization mentioned in the given text. bninllpttt/lllnn (input) /ntntutpttt/lainn
04l120033pprsoo0
3544
Extract the name of the person mentioned in the given text. wwt.la/allput///e (input] Ourpuutt
conl12003_locatte
4499
Extract the location mentioned in the given text. wnlulnpu Inln (input] /ulatuupuu//laaa
adjective v__ v__erb33
1000
From the given words, identify the one that is an adjjectivelainnnuuttao lninlnput: input /nbaOutpuut/ulaa
bhjoct_y_concepee
1000
From the given words, identify the one that is a object. www.ooput/aann (annaninnpt//ttuuuunnn /n/nOutput//
verb_ v_djee_vjeet 3
1000
From the given words. identify the one that verb werb:uaaaappu//wt... (input//iuuttuu Wllnuupuutaata
fruit_y_anima__
1000
From the given words, identify the that is fruit. ininnputtitn poaaannniinee (input| /n/nuupuutinnnn
C.2. Visualization of Attention Head Masks
Table 11. parperrrrrmmteerss used in the mask training.
We illustrate the attention head mask weight or (M) for all 42 translation pairs on Llama3. in Figure 7. From this we can draw some intuitive conclusions: (1) The re- moved attention heads do not exhibit a clear distribution pattern across the layers of the model. Heads used in the latter half of the model are only slightly more than those in the earlier layers. This indicates that the functionality of attention heads is widely distributed, with attention heads in different layers contributing to functional pathways. (2) When the model switches from instruction foolooiinn func- tionality to translation functionality, the removed functional components are unlikely to be located in the KV heads. This is because Llamaš. ISn-inst features a grouped structure for attention heads (divided into 8 groups of KV heads each, with each group containing 4 Q heads). If the original functionality rely on KV heads, the corresponding group of heads would consistently go unused. However, this pat- tern of all 4 attention heads in a row being unused is not evident in the figure. This suggests that such functionality is more likely distributed the Q heads or O heads (the corresponding parts of the projection matrix Wo).
Pypee-paramette
Translation task
Simple task
Mask weight initialize
(444, 0.02)
(4.00
Negurive initialize in Table 6
| 3, 0.02)
Af 3, 3.0.02)
Batch size
16
Train epochs
Train steps
6190
6250
carning
[1o-2, 1e-4]. cosine scheduler 0.1
[le-2, 1e-4], pasine schodaler
Warmup radio
0.1
Gumbel temperature
[4, 0.05), linear scheduler
[4. (4.0.05) linear schedoler
7 decrease
where |MM] is the number of selected heads in the mask M, and [1| (full mask) is the total number of heads in the model. As the selected heads in the instruction model are always more than the pre-trrined model, we also calculate the recall rate on the masks of instruction models. These high recall rates across tasks indicate that the attention head masks can be largely inherited from the pre-trained models, therefore such functionalities probably have been already learned in the pre-training stage.
13

---

Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking
Table 12. XNLI translation perplexity (PPL) on Llama3. in-ssst-
Table 13. XNLI translation perplexity (PPL) on Llama3.
Original
Original
To
To
From
en
es
de
ru
ar
From
en
fr
es
de
ru
ar
en
2.643
2.172
2.319
2.314
2.327
2.730
en
2.308
1.672
1.853
1.780
1.824
2,434
zh
2.143
2.093
2.339
2.257
2.304
2.925
zh 1.947
2.071
2.335
2.298
2.186
2.918
fr 2.439
2.911
2.357
2.296
2.280
2.751
fr 1.714
2.573
2.002
1.951
1.932
2.516
es
2.254
2.766
2.130
2.236
2.273
2.909
es 1.543
2.446
1.704
1.904
1.863
2.465
de
2.320
2.816
2.176
2.388
2.210
2.744
de 1.592
2.532
1.778
2.008
1.854
2.574
ru
2.621
3.532
2.240
2.513
2.377
3.085
ru 1.960
2.704
1.886
2.202
2.087
2.670
2.720
3.668
2.318
2.662
2.608
2.591
2.201
2.914
2.053
2.312
2.340
2.282
w/ instruction
w/ instruction
To
From
en
zh
fr
es
de
ar
From
zh
fr
de
ru
1.091
0.619
0.550
0.627
0.954
1.303
1.901
1.240
1.350
1,258
1.573
1.945
1.003
0.945
0.988
1.109
1,233
1.645
1.542
1.492
1.658
1.621
1.685
2.183
0.756
1.342
0.825
0.912
1.090
1.486
1,523
2.136
1,543
1.525
1.660
2.086
es
0.558
1.206
0.705
0.781
1.030
1.426
es
1.327
1.955
1.289
1.402
1.609
2.029
de
0.629
1.303
0.759
0.758
1.026
1,472
de
1.410
2.080
1.366
1.499
1.614
2.107
1.096
1.555
0.973
1.040
1.073
1.701
1.902
2.279
1.624
1.862
1.773
2.294
ar 1.218
1.691
1.167
1.230
1.397
ar 2.410
1.754
1.942
1.908
1.961
w/ random M
w/ random M
To
To
zh
fr
de
zh
fr
de
From
From
2.909
2.370
2.762
2.482
2.677
3,204
en 2.041
2.703
2.329
2.337
2.133
2.377
3,251
2,250
2.208
2.745
2.257
2.791
3.320
2.578
2.699
2.934
2.912
3.753
fr
2.645
3.268
2.838
2.138
3.039
2.929
fir 1.727
2.875
3.190
2.407
2.187
2.916
2.187
3.039
2.629
2.257
2.383
3.024
2.221
2.630
1.849
2.841
2.115
3.179
2.128
3.188
1.969
2.391
2.718
2.964
de 2.511
3.247
2.055
2.445
2.190
4.044
ru
2.655
2.791
2.198
2.568
3.223
4.732
ru 1.935
3.710
2.139
2,430
3.188
3.328
ar
3.018
3.674
2.775
2,602
2.821
2.556
ar 2.567
3,440
2.596
2.958
2.680
4.758
M
w/ M
To
To
From
en
es
ru
ar
From
en
fr
es
de
ru
ar
en
1.017
0.552
0.504
0.580
1.055
1.322
en 1.087
1.158
0.585
0.577
0.660
1.142
1.867
zh 0.997
0.970
1.036
1.115
1.241
1.689
zh
1.111
1.142
1.300
1.349
1.960
fr 0.735
1.314
0.805
0.909
1.098
1,504
fr 0.798
1.450
0.923
1.027
1.161
1.734
0.551
1.177
0.805
1.076
1.487
1.336
0.800
1.087
1.709
de
0.639
1.242
0.758
0.765
1.050
1,501
de 0.701
1.386
0.846
0.832
1.108
1.738
ru 1,070
1.486
0,927
1.032
1.073
1.697
ru 1.124
1.641
1.037
1.137
1.172
1.998
1.175
1.657
1.131
1.211
1.286
1.464
1.275
1.810
1.294
1.324
1.404
1.506
w/ .M of Llama3.
w/ M Llama3. Iuu-tnst
To
To
From
en
zh
fr
es
de
ru
ar
From
en
zh
fr
es
de
ru
ar
1.017
0.552
0.504
0.580
1.055
1.322
2.213
1.512
1.515
1.480
1.754
2.393
zh 0.997
0.970
1.036
1.115
1.241
1.689
zh 1.566
1.661
1.967
1.933
2.014
2.692
0.735
1.314
0.805
0.909
1.098
1,504
1.312
2.051
1.742
1.596
2.363
es
0.551
1.177
0.699
0.805
1.076
1.487
es 1.048
1.915
1.410
1.539
1.759
2.395
de
0.639
1.242
0.758
0.765
1.050
1.501
de 1.224
1.998
1.566
1.730
1.658
2,446
1,070
1.486
0.927
1.032
1.073
1.697
1.618
2.367
1.612
1.908
1.690
2.563
ar
1.175
1.657
1.131
1,211
1.286
1.464
ar 1.785
2.334
1.809
1.901
1.868
1.939
14

---

Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking
Table XNLI translation perplexity (PPL) on Qwen2.57B-inst
Table 15. XNLI translation perplexity (PPL) on Qwen2.57p.
Original
Original
From
zh
fr
de
ar
From
zh
fr
de
5,481
3.268
3,466
3.171
3.109
3.925
2.612
1.844
2.024
1.907
1.763
2.702
zh
3.983
3.418
3.712
3.612
3.019
3,920
1.855
2.010
2.220
2.131
1.985
2.706
5.962
3.682
3,443
2.884
3.964
1,931
3.117
2.188
2.156
1.909
2.771
es
3.799
5.809
3.183
3.112
2.754
4.092
es
1.622
2,808
1.872
2,010
1.782
2.662
de
3.673
5.627
3.328
3.722
2,820
4.065
de
1.872
3.071
2.045
2.285
1.878
2.832
4.665
6,459
3.618
4.036
3.611
4.600
2.323
3.401
2.212
2.469
2.275
2.970
4.299
5.744
3.239
3.663
3.543
2.891
2.193
3.306
2.086
2.361
2.392
2.093
w/ instruction
w/ instruction
To
To
From
em
zh
fr
es
de
ru
ar
From
en
zh
fr
es
de
ru
ar
em
2.045
1.023
0.942
0.980
1.429
1.902
en
1,692
1.067
0.998
1.171
1.371
2.005
zh 2.488
2,008
2.036
1.863
1.924
2.469
zh 1.297
1,286
1.345
1,454
1.497
2.102
fr
2.120
2.875
1.770
1.773
1.826
2.334
fr 1.453
1.985
1.309
1.405
1.451
2.031
1.690
2.504
1.446
1,450
1.701
2.257
1.262
1.794
1.212
1.323
1.415
2.027
1.843
2.879
1.595
1.639
1.781
2.372
1.451
1.917
1.255
1.273
ru
3.105
3.742
2.171
2.367
2.064
2.825
ru 1.843
2.228
1.554
1.574
1.658
2.212
ar
2.824
3.514
2.303
2.300
2.211
2.144
1.783
2.372
1.595
1.661
1.784
1.705
w/ random M
w/ random M
1o
To
From
fr
ar
From
fr
de
en
4.604
3.523
6.213
4.080
13.644
8.878
8.193
7.783
7.990
3.947
3.884
5.011
zh 3.349
7.187
6.858
6.744
3.784
6.103
4.700
5.472
7.655
4,886
4,930
13.43
fr 6.117
8.348
3.928
8.762
5.616
5.521
fr 2.671
6.117
5.439
3.106
4.681
3.915
es 3,976
5,231
6.837
3,276
5.282
3.813
1.913
5,683
2.719
5.643
3.796
4.019
de
5,392
5,698
4.055
3.774
3.488
9.176
de 5.234
3,973
3,909
6.127
7.972
3.662
4.078
4.440
5.415
8.665
3.820
5.574
6.286
10.887
7.899
5.810
4.157
6.908
ar 7.215
5.548
9.866
6.808
5.344
3,336
ar 2.598
7.619
4.024
5,524
4.220
2.606
w/ M
w/ M
To
From
zh
fr
de
ar
From
zh
fr
de
1.158
0.884
0.708
0.800
1.070
1.720
2.590
1.712
1.730
1.792
1.788
2.592
zh
1.058
1.355
1.330
1.406
1.357
2.075
1,680
1.944
2.050
2.116
1.945
2.658
1.588
1.035
1.242
2.042
1.819
2.761
1.897
1.982
es
0.735
1.395
0.986
1.021
1.216
1.974
es
1.538
2.460
1.615
1.886
1.705
2.656
de
0.840
1.572
1.149
1.135
1.225
2,103
de
1.799
2.712
1.862
2.103
1.790
2.751
ru
1.236
1.832
1.377
1.462
1.456
2.376
2.102
3.162
2.031
2.156
2.139
2.262
1.368
2.068
1.444
1.602
1.582
1.521
1.354
2.167
1.483
1.501
1.758
1.517
M Qwen2.5yp
w/ M of Qwen2.5yyp-nst
To
To
From
en
zh
fr
es
de
ru
ar
From
en
zh
fr
es
de
ru
ar
en
3.024
2.444
2.476
2.339
2.419
3.226
en
2.628
1.697
1,799
1.773
1.689
2.582
zh 1.943
2.338
2.552
2.401
2.497
3.550
zh 1.641
1.924
2.087
2.012
1.854
2.661
fr
1.553
2.935
2.369
2.350
2.353
3.415
fr
1.699
2.972
1.997
2.030
1.867
2.742
1.521
2.796
2.101
1.775
2.216
3.397
1,510
2.631
1.748
1.945
1.768
2.690
1.732
2.604
2.052
2.252
2.055
3.298
1.743
2,883
1.946
1,956
ru
2,411
3.169
2.761
2,741
2.334
3.389
ru
2.110
3.271
2.187
2.409
2.182
2.991
ar
1.968
3.136
2.063
2.319
2.676
2.434
2.050
3,054
2.077
2.288
2,410
2.037
15

---

Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking
Table XNLI translation perplexity (PPL) on instt
Table 18. XNLI translation perplexity (PPL) on Qwen2. 3n-inst
Original
Original
To
xh
fr
es
de
From
zh
fr
de
3.045
2,100
2.386
2.545
2.254
3.365
5.220
2.913
3.295
3.232
3.233
4.116
zi 2,530
2.748
3,073
3.255
2,666
3,761
zh
4.120
3.383
3.883
3.726
3,290
4,425
fr
2,608
4,223
3,056
3.224
2,608
4.020
4.318
6.318
4.034
3.663
3.449
4.609
es
2.505
2.646
3.360
4.506
de
2.727
4.306
2,804
3.36
2.723
4.228
3.369
5.673
3.153
3.759
3.268
4.308
r
2.967
4,447
2.709
3.148
3.1
4,582
4.658
6.772
3,570
4.193
3,883
5.203
ur 3,511
4919
3.066
3.493
3.771
3.302
ar
4.576
6.573
3.620
4.081
4.043
3.656
instruction
w/ instruction
To
From
en
zh
fr
85
de
ar
From
en
es
de
ru
ar
en
1,763
1.021
0.989
1.361
1.485
2.401
1,864
0.919
0.828
1.008
1.277
1.930
zh
1.601
1.574
1.688
2.061
1.864
2.726
2.215
1.647
1.682
1.781
1.827
2.516
2.325
1.369
2.267
1.142
2.152
1.223
1.707
1.640
2.509
1.390
2.360
1.267
1,368
1.539
2,163
de
1.357
2.565
1.478
1,586
1,751
2.681
de
1.607
2.748
1.370
1.347
1.651
2.289
ru
1.911
2.784
1.746
1,858
2.077
2,711
ru
2.600
3.396
1.753
1.925
1.828
2.577
ar
3.067
2.152
2.364
2.677
2.193
2.105
w/
w/ MM
To
To
xh
de
From
From
en
1.939
1.427
2.070
1.874
1.707
3.128
en
1.176
0.730
0.736
1.033
1.084
1.584
zh
1.601
2.084
2.324
2.543
2.380
fr
1,210
2.358
2.047
2.170
1.954
3.038
0.833
1.6155
1.231
1.463
1.313
1.902
es
1.113
2.528
1,870
2,263
2.369
3.185
0.729
1.489
0
1.345
1.299
1.892
de
1.328
2.483
2.111
2,322
2,030
3,090
0.840
1.604
1.102
1.167
1.236
1.896
2.329
2.056
4.174
3,016
2.540
2.638
2.874
2.547
1.457
2.121
1.528
1.748
1.997
1.739
Table 17. XNLI translation perplexity (PPL) on (iven2.51.s--il
Table 19, XNLI translation perplexity (PPL) on Qwen2.5 14BB-istt
Original
Original
To
From
en
zh
fr
es
de
ru
From
zh
fr
de
ar
2.941
1.919
2.025
2.138
1.984
2.918
7.331
4,954
5.043
4.740
4.621
5,106
zh
2.327
2.475
2,716
2.765
2.421
3.438
zh
6.797
5.683
6.016
5.718
5.021
5.413
fr
2.679
4.329
2.987
2.873
2.457
3.709
6.748
8.296
5.653
5.345
4,956
5.438
es
5,225
4,893
5.328
de
2.385
4.022
2.572
2.935
2.442
3.584
5.895
7.858
4.887
5.235
4.630
5.148
3,023
4.627
2.606
3,109
2.833
4,093
7.253
8.558
5,587
66065
5,533
5,539
ar 3,142
4.450
2.718
3.016
3,287
3.023
ar
6.358
7.803
5.092
5.597
5.272
4.625
Instruction
w/ instruction
To
From
en
zh
fr
es
de
ar
From
en
es
de
ru
ar
en
1.545
0.867
0,835
0.984
1.198
1.886
3.372
1.732
1.485
1.553
2,015
2.467
zh
1.429
1.433
1.440
1.628
1.515
2.238
3.805
3,081
3.116
3.046
2.919
3,707
2.153
1.300
1.476
1.472
2.699
3.296
1.052
1.879
1.081
1.324
1.340
2.024
2.915
4.250
2.253
2.192
2.355
3.090
de
1.153
2.086
1.237
1.252
1.413
2.181
de
3.103
4.749
2.408
2.340
2,396
3.009
ru
1.794
2.551
1.497
1.623
1.652
2.303
ru
5.059
6.196
3,166
3.504
3.081
3.794
ar
2.170
1.864
2.963
w/
w/ AM
To From
To
zh
fr
de
From
em
1.354
0.889
0.854
1.086
1.177
2.018
1,000
0.524
0.440
0.564
0.739
1.195
zh
1.219
1.400
1.616
1.790
1.542
Ir
0.996
2.050
1.411
1.516
1.319
2.236
0.791
1.309
0.781
0.896
0.902
1.426
es
0.802
2.109
1.041
1.111
1.292
2.134
es
0,500
1.186
0.651
0.788
0.828
1.335
de
0.901
1.872
1.332
1.442
1.363
2.290
0.665
1.313
0.746
0.744
0.877
1.397
2.364
1.701
1.716
1.668
1.561
1.637
2.472
1.694
1.920
2,080
1.868
1.131
1.648
1.026
1.115
1.186
1.108
16

---

Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking
Table 20. XNLI translation perplexity (PPL) on Phi3. mini-inst.
Original
Table 22. XNLI translation ROUGE-L L on Llama3. 18B-inst
en
xh
fr
de
Original
3.337
3.262
3.682
3.773
3.698
2.126
To
zh 6.035
4,509
5.159
5.003
5.202
2.884
From
en
zh
fr
es
de
ru
ar
Fr
5.627
4.046
4.893
5.054
4.606
2.479
ts
5.673
4.392
en
0.020
0.082
0.069
0.069
0.045
0.029
de
5.276
3.978
4.378
4,96]
4,487
2.504
zh
0.021
0.019
0.024
0.023
0.025
0.013
r 6.271
4,341
4.427
5.168
4.883
2.756
ar 6.192
4.419
4.440
4.915
5. 5.367
4.965
w/ instruction
instruction
To
From
en
zh
fr
es
de
ar
From
en
zh
fr
e5
de
ar
en
0.539
0.541
0.599
0.576
0.491
0,414
en
2.256
2.710
2.752
2.965
2.695
1.665
zh
0.669
0.519
0.556
0.501
0.423
0.352
zh
4.958
4.024
4,396
4.382
3.563
2.145
3.893
3.810
w/ MM
3.602
2.707
3.457
3.704
3.184
1,926
de
ru
3.713
5.315
3,126
2.770
3.543
4,286
4.575
3.704
4.511
3.142
2,005
2,222
From
To
en
zh
fr
es
de
ru
ar
ar 5.165
4.283
4.601
4.692
3.749
0.589
0.711
0.748
0.677
0.401
0.427
w/
zh
0.656
0.474
0.518
0.488
0.384
0.334
To
xh
fr
de
w/ M of Llama3.1sm
From
zh
en
1,263
0.945
0.589
1.185
1.320
0.549
0.722
1.198
1,050
From
zh
fr
de
ru
fr
0.813
1.153
0.900
1.129
1.603
1,045
es
0.664
1.080
0.808
1.016
1.492
0.973
0.019
0.204
0.241
0.099
0.046
0.045
de
0.739
1.131
0.868
0.946
1.404
1.161
zh
0.344
0.442
0.068
0.227
0.071
0.039
1,271
1.368
1.184
1.463
1.523
1.384
1,484
1.728
8.590
Table 21. XNLI translation perplexity (PPL) on Mistral7B-inst
Original
Table 23, XNLI translation ROUGE-L on Llama3.
From
en
zh
fr
es
de
ru
Original
3.667
3.032
3.264
3.333
2.821
2.381
To
zh
4.457
3.174
3.261
3.512
3.014
2.184
From
en
zh
fr
es
de
ru
ar
fr
3.438
3.118
2,863
3,032
2.517
2.163
es
3.190
2.787
en
0.017
0.072 0.017
0.067
0.066
0.045
0.030
de
3.460
3.329
2.650
2.791
2.483
2.265
zh
0.020
0.019
0.022
0.023
0.010
4,512
3.551
2.931
3,6
3.204
2.207
ar 4.304
3.551
3.077
3.315
3.527
2.981
w/ instruction
Instruction
To
From
en
zh
fr
es
de
ru
ar
From
en
zh
fr
es
de
Fu1
ar
en
0.017
0.084
0.080
0.076
0.054
0.029
en
1.910
1.327
1.267
1.516
1.560
1,600
zh
0.140
0.078
0.080
0.071
0.059
0.034
zh
2.103
1.928
2.052
2,238
2.022
1,834
fr
1.947
w/ A
1.147
1.915
1.342
1.467
1.553
1,628
ru
de
1.979
1.215
2.288
1.937
1.636
1.320
1.765
1.271
1.892
1,513
1.670
1.713
From
To
en
zh
fr
de
ru
ar
ar
2.255
2.469
2.262
en
0.424
0.658
0.657
0.606
0.179
0.067
w/ MM
zh
0.581
0.406
0.443
0.311
0.258
0.129
To From
zh
fr
de
w/ M of Llama3. Isu-inst
zh
em
2.914
3.275
3.605
2.440
3.063
3,540
3.275
2.524
3.170
2.854
2.654
From
zh
fr
de
ru
Ir
3,518
3.338
2.248
3.562
2.744
2.061
es
2,377
3.159
4.525
3.784
2.572
2.358
0.016
0.071
0.074
0.076
0.037
0.030
de
2,474
4.737
2.720
3.608
2.944
2,828
0.134
0.044
0.038
0.043
0.023
0.012
3.547
4.554
3.492
4.710
3,349
4.378
5.172
3.782
3.962
3.510
17

---

Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking
Table XNLI translation ROUGE-L Qwen2.5o.5B-in
Table 24. XNLI translation ROUGE-L L on Qwen2.57B
Original
Original
From
To
en
zh
fr
es
de
ru
ar
To
From
em
zh
Ir
es
de
ru
ar
en
0.015
0.083
0.066
0.069
0.052
0.031
zh
0.013
0.008
0.011
0.017
0.018
0.010
en
0.017
0.076
0.067
0.066
0.043
0.027
w/ instruction
zh
0.014
0.011
0.013
0.019
0.019
0.006
To
instruction
From
en
zh
fr
cs
de
ru
ar
From
To
em
zh
fr
es
de
ru
ar
zh
en
0.481
0.505
0.389
0.499
0.498
0.350
0.308
0.456
0.233
0.264
0.242
0.214
0.570
0.581
0.635
0.580
0.405
0.387
w/ .M
zh
0.586
0.462
0.484
0.432
0.352
0.290
To
M
From
en
zh
fr
05
de
ru
arr
To
en
0.367
0.296
0.081
0.296
0.133
0.044
From
em
zh
fr
05
de
ru
ar
zh
0.446
0.129
0.120
0.175
0.086
0.088
0.599
0.390
0.583
0.522
0.253
0.142
zh
0.634
0.215
0.326
0.328
0.181
0.149
Table 27. XNLI translation ROUGE-L on Qwen2.5,,st.in
w/ M of Qwen2.5mn
Original fr
From
en
zh
fr
es
de
ur
To
de
From
0.020
0.079
0.066
0.057
0.042
0.025
0.014
0.077
0.060
0.067
0.043
0.029
0.095
0.024
0.035
0.031
0.022
0.006
0.019
0.013
0.014
0.018
0.022
0.009
instruction
To
From
es
de
ru
0.557
0.543
0.570
0.544
0.343
0.279
Table 25. XNLI translation ROUGE-L on Qwen2.57p.
0.569
0.396
0.369
0.347
0.296
0.236
Original
From
To
en
zh
fr
es
de
ru
ar
From
To
es
de
ru
0.505
0.522
0.518
0.461
0.211
0.152
en
0.012
0.081
0.075
0.068
0.045 0.019
0.028
0.587
0.351
0.279
0.285
0.217
0.072
zh
0.019
0.014
0.014
0.021
0.009
instruction
Table 28. XNLI translation ROUGE-L on Qwen2.5
To
From
en
zh
fr
es
de
ru
ar
Original zh
en
0.242
0.327
0.339
0.269
0.240
0.175
To
zh
0.371
0.237
0.239
0.217
0.205
0.166
From
fr
de
M
en
0.016
0.082 0.013
0.068
0.070
0.045
0.029
zh
0.016
0.015
0.020
0.018
0.005
To
From
en
zh
fr
es
de
ru
ar
w/ Instruction
0.013
0.083
0.077
0.073
0.036
0.035
zh
fr
de
zh
0.127
0.035
0.042
0.047
0.032
0.008
From
w/ M of Qwen2.57n.tut
en
0.581
0.618 0.426
0.625
0.527
0.356
0.305
zh
0.464
0.438
0.399
0.273
0.230
To
From
en
zh
fr
es
de
ar
w/ M
0.016
0.095
0.066
0.061
0.052
0.024
zh
fr
de
From
zh
0.142
0.023
0.030
0.038
0.032
0.015
en
0.615
0.567
0.574
0.416
0.243
0.352
zh
0.566
0.299
0.323
0.136
0.061
0.056
18

---

Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking
Table 29, XNLI translation ROUGE-L on 2ween..114B-neg
Table 32. Simple task accuracy on Llama3. 8B-inst
Original
w/ w/.. of
Task name
Original
w/ Instruction
w/ MM
Llama3.ks
To
From
em
zh
fr
de
ru
ar
park-comatry
lowercase, jnwercss_fiirs_loee Jeter
0.18
0.65
0.68
1,00
0.67
en
0.017
0.077
0.064
0.067
0.042
0.027
news word lenth past capitalize
sysoeym
0.01
0.00
0.48
0.51
xh
0.013
0.010
0.012
0.018
0.017
0.004
0.00
0.97
0.29
0.07
0.92
0.76
0.1
0.97
w/ instruction
0.10
landmark-country
0.03
0.86
0.87
0.57
From
To
en
zh
fr
cs
de
ru
ar
sentiment
english-german
0.00
0.01
0.39
0.61
0.86
country capital
0,04
0.92
0.85
0.30
en
0,498
0.599
0.588
0.506
0,416
0.247
person-scupatioe
0.17
0.68
xh
0.521
0.403
0.380
0.362
0,300
0.184
country-cumency
0.00
0.77
044
Inwercase Jast leteer
0.00
0.00
0.88
0.65
w/ M
person-sport
0.38
091
0.36
person instrument
0.05
0.05
0.80
0.77
From
To
en
zh
fr
85
de
ru
ar
english- french next
copitaaliz last letter
antonym
0.12
0.01
0.60
0.30
0.76
0.77
0.75
0.70
0.01
0.06
0.28
0.64
en
0.676
0.716
0.761
0.660
0.534
0.454
qa
xh
0.684
0.542
0.586
0.499
0,362
0.357
singula-plural
0.02
0.95
0.7
0.99
copitalize scoodd letter
0.07
0.00
063
0.17
prev. jim capinalize_fnst festketee
0.57
0.15
0.97
1.00
0.98
Table 30. XNLI translation ROUGE-L on Phi3.5 mini-itts
english-spunish next capina
0.00
0.59
0.77
0.56
Original
product vompany
national parks
0.05
0.04
0.65
0.73
0.83
0.64
0.63
0.78
To
cont12003, organization
0.57
zh
fr
conl120001 person
0.02
0.40
0.89
0.54
From
cunil2003 location
0.00
0.1
0.92
0.75
adjective_y_vet__ objevtyy cuncppL
en
0.018
0.086
0.076
0.073
0,048
0.032
0.00
0.02
0.98
0.99
zh
0.012
0.012
0.012
0.022
0,025
0.010
yedb_y_djecciv__
0.00
0.88
fruit v vniinal
0.51
0.98
w/ instruction
Average
0.05
0.44
081
0.70
To
From
en
zh
fr
es
ar
Table 33. Simple task accuracy on Llama3. Igg.
en
0.276
0.351
0.342
0.334
0.215
0.279
zh
0.234
0.228
0,216
0.208
0.152
0.183
Task nume
Original
instruction
w/
I.mm3, I
M
lowercase first letter
0.00
1,00
1.00
0.15
To
park countr
0.75
From
en
zh
fr
es
ar
syаооym
0.01
0.42
0.49
0.30
ag_news
0.00
0.49
0.82
0.50
en
0.463
0.669
0.699
0.656
0.293
0.074
present-pas past cuptialize
Jength
0.45
0.96
0.97
0.07
0.15
xh
0.525
0.406
0.399
0.400
0.132
0.156
0.00
1.00
0.99
0.23
landmar country
0.04
0.82
0.34
english-gemman
0.00
0.48
0.50
0.00
sentimest
0.00
0.91
0.80
0.00
Table 31. XNLI translation ROUGE-L on Mistral
stpiaal penson occupation
0.05
0.89
0.85
0.94
0.03
Original zh
country-cureieey
0.00
0.06
0.6
0.00
lowercase list killer
6.00
0.93
081
0.00
To
person-apect
0.13
0.00
From
en
fr
de
penson-ins instiminsttmmen
antonyas
0.13
0.00
0.65
0.15
0.66
0.68
0.11
0.01
cogitalize Jist keter
0.76
0.00
en
0.020
0.087
0.073
0.075
0.048
0.030
english- english-renchh
0.00
0.73
0.80
0.02
zh
0.022
0.020
0.019
0.028
0.029
0.011
Liem
0.02
0.67
0.85
0.21
communeense.gg
0.00
0,07
0.51
0.21
w/ instruction
singular plura
0.95
0.37
crgitalize sccond, Jetter
0.00
0.44
0.22
0.00
To
pras item
0.01
0.62
0.79
0.15
From
en
zh
fr
de
capttalize
1,00
0.95
english-sganish
0.00
0.71
0.78
0.00
em
0.264
0.431 0.290
0.433
0.378
0.282
0.177
next ceggtal Jenerr
national
0.00
0.86
0.47
0.25
0.31
zh
0.405
0.306
0.267
0.232
0.156
product-compuny
0.07
0.75
0.76
0.35
cont organizaaiion
0.06
0.64
0.48
0.28
w/ M
coot12001 pesson
0.89
0.36
cootiZIKe Jocation
0.79
0.79
0.37
From
To
en
zh
fr
de
object concepp.
adjectve verb 3
0.00
0.00
0.93
0.75
0.99
1.00
0.66
0.37
vatb_v_adjsatve__
0.82
0.95
0.59
en
0.547
0.663
0.656
0.673
0.461
0.199
froit. v. animal 1
0.00
0.99
0.97
0.43
zh
0.557
0.378
0,502
0.399
0.330
0.177
Average
0.02
0.69
0.75
0.15
19

---

Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking
Table 34, Simple task accuracy on Qwen2.5yB-inst
Task namee
Original
Instraction
Qwen2.55u
of
lowerease first letter
0:00
1.00
0.99
0:97
park-country
1.57
0.61
synonym
0.02
0.53
0.35
0.36
0.00
0.73
0.79
0.02
wonl Jength
0.00
0.73
0.29
0.10
present past
0.01
0.97
0.57
0.90
capitalize
0.99
Table 36, An example of en-zh translation on different sizes of models. Larger models (Qwen2.5144-ingg in this example) tend to generate more explanation words. The attention head mask M can help the model focus on the task and context words.
landmark country
0.07
0.30
0.72
0.70
englieh-ggrrmnn
0.00
0:40
0.36
0.11
sentmment
0.92
country-capital
0.03
0.89
0.50
0.79
person occepattion
0.09
0.04
0:49
0.38
country-
0.11
lowercase_ last, Jetter
0.00
0.93
0.37
0.15
Chinese input
person sport
0.35
0.82
0.20
personiintrament
8:03
0:14
0.40
0.46
antonym
0.09
0:20
0.00
0.63
capitalize letter
0.29
English gold label
People in England are required to speak more than one language.
english french
0.00
0.66
0.5L
0.31
nest Heem
0.00
0.86
0.77
0.71
commonsense_se
0.30
singular plural
0.04
0.98
0.93
0.80
Qwen2.514B-iss with instruction
capitalize_seconle secds_seeodd_dteeeeee
0.02
0.76
0.37
0.27
The English require that multiple languages be spoken.nnnnHow Howeee, it's important to note that the state- ment "Englanders require that mul- tiple languages be spoken" is not accurate in a general sense. In re- ality, English is the predominant language spoken in England,
prev, Item
0.71
0.51
capitalize first letter
0.22
1.00
1.00
0.87
englishh-sgaiish
0.25
next copital letter
0.03
0.38
0.05
0:44
national. parks
0:03
0.41
0.65
0.58
procucc-communy
coa1120003 oegunization
0.01
0.69
0.35
0.36
2om112003 person
0.04
0,91
0,90
0.59
coo112003, location
0.84
0.31
adjentive v. verb
0.00
0.99
0.84
0.70
objectyy 3
0.97
0.98
0.78
werh adjertive
0:00
0.86
0.80
0.79
fruit v. v_nnmmal_3 3
0.00
0.94
0.96
0.84
Qwen2.578-ine with instruction
Average
0.04
0.69
0.64
0.53
The English demand that multiple languages must be spoken.
Table 35. Simple task accuracy on Qwen2.5yB-
Qwen2.5.8-ing with instruction
English people demand that mul- tiple languages must be spo- ken ken.InlnHowever, it seems there might be a slight issue with the phrasing. The correct transla- tion would be:in'n "English people demand that multiple languages should be spoken. "InAnThis makes more sense as it conveys
Task
Original
instruction
w/
of Owen2.5rp-tut
lowercase_ Jettr
0.00
1.00
0.96
0.00
park-comay
0.06
0.54
0.67
0.23
synonym
sg_news
0.00
0.75
0.02
0.01
word langth
0.02
0.70
0.11
0:00
present past
0.94
0.08
capinalize
0.03
0.99
0.96
0.26
landnark-country
0.06
0.33
0.71
0.26
englisb-german
sentiment
0.00
0.97
0,72
0.10
country-caping capital
0.05
0.96
0.1
0:04
personnnccputionn
0.19
0.00
country-currency currency
country
0.00
0.08
0,36
0.00
Qwen2.514n.in with M
lowerezse_ Jetter
0.00
0.97
0.40
0:00
The English required that multiple languages be spoken.
person-sport
0.39
0.05
person-intrument
0.02
0.14
0.39
0.01
aatonym
0.10
0.39
0.59
0.07
capitalioe_
0.90
0.00
Qwen2.578--nst with M
english-french
001
0.60
0.36
0.00
The English require that multiple languages be spoken.
next_ttem
0.03
0.74
0.78
0.01
commonsesse.gp
0.50
0.60
singala--plura
0.05
0.98
0.83
0.08
capitalier second_ Jetter
0.01
0.71
0.28
0.02
Qwen2.553-tnn with M
prev _Ro
0.52
0.01
The English demand to speak in many languages.
capiniize first letter
0.05
1.00
0.94
0:11
english spanish
0.00
0.61
0.25
0.00
nest_appnnL
0.75
0.66
0.03
narional parks
0.46
0.56
0.25
mroduc-eompunt
0.88
0.48
0.55
0.06
conli2003 orguizztiin
0.03
0.88
0.34
0,03
con1l2000 person
091
0.73
0:08
con122003 location
0.65
0.81
0.61
0.16
adjective_ v_ver_3
0.00
0.92
0.83
0.21
object_ 3
0.1
0.88
0:05
verh v ofjertive
0.00
0.86
0.82
0.20
friiy vnimmll
0.00
0.97
0.92
0.09
Average
0.68
0.07
20

---

Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking
Table 37. Attention head mask similarity between Ilama3. IBB-inst (Minst) and Llama3. 8B (Masse). ).
Table 38. Attention head mask similarity between Qwen2.57B-inst
(Miss)) ) and Qwen2.57B (Masse).
Task name
Mial
[Mesel
Recall
Jaceard similarity
Random similarity
Task name
[Mail
[Musel
Recall
Jaccard similarity
Randon similarity
en-th
832
819
0.874
0,766
0.675
en-2h
645
611
0.894
0.771
0.666
en-fr
860
0.895
0.687
587
0.719
0.618
eu-es
8:16
811
0.906
0.797
0.679
cn es
609
580
0.862
0.726
0.610
en-sl
862
816
0.915
0.693
cu-cl
589
0.744
0.612
en-ru
828
795
0.868
0.740
0.656
en-nu
614
590
0.859
0.727
0,623
837
821
0.873
0.762
0.680
618
597
0.859
0.731
0.63
zh-en
937
895
0.951
0.867
0.808
zh-en
666
615
0.912
0.779
0.689
de-rr
899
843
0.943
0.839
0.739
cle-f
630
603
0.872
0.741
0.617
th-ss
896
856
0.921
0.817
0.747
zh-es
630
576
0.822
0.728
0,63
hh-de
898
834
0.928
0.816
0.724
zh-de de
629
596
0.876
0.743
0.640
ab-ru
909
0.939
cu
590
0.739
0.628
dh-ar
889
855
0.916
0.815
0.741
zhro
619
612
0.818
0.729
0.616
fr-en
924
0.948
0.781
600
0.769
0.681
fe-zh
865
821
0.912
0,799
0.699
fr-zh
650
602
0.892
0.751
0.663
frees
903
0.979
0.734
f--es
580
0.732
0,666
fr-de
892
827
0.931
0.811
0.721
fr-de
635
593
0.885
0.747
0.642
freu
899
849
0.927
0.819
0.743
fr-ru
628
590
0.864
0.720
0.634
fr-r
882
827
0.919
0.801
0.715
fr-ar
625
603
0.859
0.730
0,613
925
879
0.947
0,856
0.786
661
618
0.892
0.757
0.677
es-zh
863
823
0.911
0.801
0.699
es-2h
607
0914
0.773
0
es-fr
909
821
0.937
0,500
0.728
es-fi
614
58.3
0.864
0.727
0.617
es-de
R81
0.921
0.712
588
0.895
0.756
0.637
es-ru
K86
835
0.905
0,783
0.724
cs-tu
629
598
0.875
0.743
0.612
N71
0.911
591
0.723
0.629
de-en
923
875
0.944
0.850
0.781
de-en
680
632
0911
0.783
0.718
de-zt
868
820
0.918
0,805
0.700
de de-zh
669
611
0,907
0.763
0.687
de-fr
911
830
0.934
0.802
0.736
de-ft
640
590
0.880
0.730
0.614
de-es
920
845
0.933
0,807
0.755
de-es
636
594
0.884
0.745
0.644
de-ru
893
852
0.918
0.812
0.742
du-ru
636
611
0.871
0.711
0.660
do-sr
885
835
0.919
0,805
0.723
de-ar
626
609
0,862
0.739
0.649
nu-en
923
0.940
0.788
mien
625
0917
0.787
0.707
ru-zh
870
$29
0.913
0.504
0.708
ru-sh
670
608
0.918
0.775
0.685
ru-fr
898
0.933
0.732
ru-fc
589
0.866
0.720
0.634
ru-es
902
831
0.930
0.805
0.731
ru-es
626
595
0.861
0.722
0.637
mudee
886
838
0.930
0.834
0.726
midde
626
595
0.747
0.637
ru-ar
873
854
0.906
0.812
0.729
ru-ar
641
605
0.868
0,728
0.658
943
900
0.951
0,867
0.817
671
652
0,911
0.815
0.729
ar-zh
885
862
0,928
0.845
0.743
ar-zh
677
6:19
0.917
0.814
0.732
ar-fr
918
843
0.926
0,005
0.745
ar-It
638
625
0.877
0.766
0.674
ar-es
899
0.935
0.818
0.732
ar-es
624
0.772
0.676
ardde
909
859
0.951
0,859
0.758
ar-de
637
6:3
0.873
0.774
0.684
ar-mu
888
0.926
0.742
ar-r
636
0.771
0.689
kowerswse pmwersascllint_leee Jeittletterr
790
672
0.835
0.623
0,519
Lowercase wwweraaselitss_aage Jottr
520
414
0.758
0,506
0.116
park-country
826
0.850
0.640
park country
517
0.641
0,550
synonym
833
689
0.875
0.656
0,583
5ymommm Rg.
602
502
0.861
0.613
0.536
og. news
737
0.777
0.534
486
0.576
0.493
word, length
792
673
0.798
0.579
0.551
word length
568
452
0.759
0.507
0.473
present- past
845
691
0.874
0.648
0.590
present past
577
494
0.866
0.603
0.514
capitalize
895
777
0.915
0.740
0.684
cxpilalize
626
503
0.871
0.631
0.552
kandmark-country
779
685
0.848
0.658
0,553
landmar k-country
592
478
0.60
0.624
0,509
english-gemman
837
734
0.887
0.708
0.618
581
473
0.595
0.498
sentiment
745
679
0.779
0.591
0.531
sentiment
565
481
0.807
0.590
0.496
country-
859
797
0.867
0.716
0.677
country capital penson-scccpation
515
0.614
0.556
parson-occupaioo
748
658
0.814
0.639
0.538
593
459
0.841
0,580
0.493
crumrry-curiecyy
754
744
0.806
0.668
0.577
country country-cunent -curency
496
0.623
0.524
lowercase letter
746
608
0.768
0.526
0.486
lowercase_ lest_letter
516
407
0.764
0.508
0.409
persen-sport
758
686
0.805
0.619
0.542
person sport
569
464
0.813
0.575
0.484
person-instmmmntt
765
646
0.837
0.622
0.520
person-insttumaaat
551
456
0.768
0.533
0.167
antonym
834
726
0.890
0,707
0,610
anionym
602
509
0.868
0.661
0,543
capitalize Jetier
752
651
0.774
0.561
0.517
copitalize__ast Jeste
519
432
0.750
0.517
0.130
english-trench
822
727
0.867
0.686
0.604
english-frent french next item
586
473
0837
0.597
0.501
next, item
871
728
0.886
0.676
0.632
491
0.604
0,525
singular plural
837
704
0.874
0.664
0.596
plural
575
473
0.825
0.593
0.495
capitalize second Jetter
723
0.718
0.508
capitalizo second Jotter
431
0.530
0.111
prey. item
830
713
0.860
0.659
0.599
prev jiom
603
477
0.834
0.584
0,514
cupitalize first letter
774
678
0.813
0.612
0.545
capitalize first letter
433
0.760
0.526
0.432
englissh-spanid
808
737
0.855
0.689
0.604
english spliish-panishh
589
475
0.857
0.619
0.505
nest capial Jetter Jetter
748
654
0.778
0,570
0.517
next cost_capiaalletee
531
427
0.745
0.197
0,432
national parks
827
792
0.837
0.694
0.653
national porks
587
510
0.825
0.623
0,534
product-company
754
674
0.822
0.634
0,533
product-company
560
445
0,820
0.570
D.463
con112003, organization
826
723
0.864
0.676
0.604
comt12001 organizaaiinn
501
0.846
0.635
0.529
com112003 person
831
710
0.887
0.692
0.597
con1i2005_ _0112003__ppsoon___
593
515
0.862
0.669
0.542
conti2003 Jocation
757
0.828
0.615
0.547
com1120013 location
492
0.638
0.517
sevetive___vert___
81.3
756
0.868
0.719
0.620
adjective_y_verr_)
621
549
0.883
0.708
0.592
826
733
0.877
0,702
0.611
object_y v_onospp__
525
0.652
0.579
verb v. adjective_ 3
839
768
0.867
0,708
0.644
varb v. aljective_ 3
613
524
0.665
0.662
0.563
friit v. animal_
827
786
0.850
0.707
0.649
fniialy 3
617
562
0867
0.704
0,600
21

---

Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking
LIghT
Ligh
Head
Hoad roce
Houd Indo
1900
Ikscindo:
Lage Laghttion
Hoad
Hescisior
de
00
HANK rdse
02
0.4
0.5
0.5
Head weight (sigmeia)
Figure 7. Visualization of sigmoid attention head mask weight (M) for all translation pairs (translate from left labels to top labels) on Llama3. BB-inst- Heads with value greater than 0.5 are selected the final mask M.
22

---

Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking
C.3. More Removal Experiments
C. ONE-BY-ONE HEAD REMOVAL
In the one-by-one head removal experiment depicted in Fig- ure 2, unveil the model's translation functionality by removing certain amount of attention heads. We provide more detailed results to enhance the conclusions that: (1) the model behavior change is not caused by removing certain independent, influential attention heads; (2) the model can maintain its original behavior as long as the functional path- way remains intact, even if the model loses more attention heads.
Telooy
Man
Damooed
Remove by influential order Figure 2 involves many target token's 's rank surges when removing certain attention heads, and we claim that removing heads in the order of target token's 's rank increments caused by each head will not accelerate the switch model behavior. To verify this point, we select the first 320 heads from the ascending order of the task head weight, and for these 320 heads, we re-order them by the target token's 's rank increment caused by each head in descending order. Then we remove these heads one by one and compare their token rank changes with the original order. The token rank changes are illustrated in Figure 8. In this influential order, the model could indeed perform higher target token rank in the early stage, but its domination is postponed to around 290 heads. Therefore, removing more influential heads does not necessarily lead to faster switch in the model behavior.
Figure 8. Prompt Llama3. 1 aB-inst with "I "Lsee Iaaa sleeping in my backyard.", and remove the first 320 attention heads from the full model by head weight of en-zh translation task in different orders. We use a gray vertical line to indicate where the target token becomes the lop-1 token. Top: In original ascending order of head weights. Bottom: In descending order of target token's s rank increments.
Remove on the negative initialized mask We provide the token ranks and the model outputs of the negative ini- tialized mask in Figure 9. The behavior switch of the model happens at removing the 355th head, which is nearly 200 heads later than the results in Figure 2. Although it loses more attention heads, the model can still maintain certain instruction following behavior before the switch.
1000
2000
2:03
C.3.2. HUERY-HEAD REMOVAL
Damovdd hunacla
Equation (2) actually applics M on the value heads of the MHA layer, and it ignores the attention scores calculated by query and key heads. To explore whether such masks can be applied to the attention scores, move the mask value inside the softmax function in Equation (I) to make it work on the query (also key) head outputs. In this configuration, masking out a head means that the head pays uniformly equal attention to all the input tokens. Nevertheless, the training of this query-head mask fails to steadily trigger the model functionality on most of the tasks. As described in Section& 4, the attention head mask is not only simple se- lection of higher lower attention scores, and even unused heads are still working to focus on important tokens. This can explain why the query-head mask fails to work. Table 39 shows a case study of failed translations.
Genarane satuas
Tra''s oppiir Timnn tpys only femm hwiyens on
Thank eate suppted Liars tepicall avadd hadijants
225 Than's a paay aasrontng rugst U'e Bana deeplig mo backyand hetoer Bai
serping
Tha''s seved weed fome shoppng you lyyeth Meggt anl you voliee
serping buckyand
191 Tt 1: R. 1M1 in shophig tovey mocec)
743
Laa faee deiplin hudoy
bec skrging halpaaaaa bidpaaa''s bejui' lalur beque'haippe's
Figure 9. In the negative initialization scenario, we prompt Alama33.gg-ins with "I see ilaaa sleeping in my backyard." and remove attention heads from the full model by head weight of en-zh translation task in ascending order. Use the same notations as in Figure 2.
23

---

Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking
Table 39. Case study of failed translations in the query-head re- moval scenario.
Table 40. XNLI translation perplexity (PPT.) on LJama3. SB-inst when taking FFN layers (32 in total) in the mask. Translation pairs with yellow background use FFN layers in M, others use all 32 FFN layers. Attention heads are also selected in M.
Case 1: Fail to translate
Input
Lots of people from England speak more than one language.
zh
fr
de
From
Output
Many people from England speak more than one language.
1.700
1.130
1.221
1.330
1.915
1.869
zh 1.990
1.537
1.701
4.143
1.828
2.523
Case 2: Low quality translation
fr 1.698
1.934
1.437
1.543
1.936
2.042
es 1.509
1.970
1.283
1,479
1.868
2.315
Input
Niceness is not solely owned by Western tra-
de 3.650
4.709
1.359
1,531
2.026
5.121
dition.
2.047
2.077
1.469
3.915
4.315
2,494
Output
(Western tra- dition is not solely hospitable.)
E -
ar 2.201
2.211
1.643
4.488
5.089
1.949
We take my in each layer into the whole mask M, train it together with attention heads on Llama3, Inn-int for XNLI translation tasks, and results are shown in Table 40. After training, most translation tasks still use all the FFN layers. Only 8 tasks remove only one FFN layer in M, and their performance severely degrade compared to the head-only mask in Table 12. Since taking FFN into the mask does not contribute the study of model functionality, and the model itself tends to utilize all FFN layers, do not remove the FFN layers in the main experiments.
Case 3: Mix with other languages
Input
Due to our population, there are few virgin forests still left in the United States. En realidad, debido a nuestra población, to- davía quedan pocos bosques virgenes en los Estados Unidos
Output
Input
Japan and Sweden are members of the Auld Alliance.
Output
# & マ0ン 1 2ク=7ンルカИ7747>
2 x アアア..
C.4. A Probe of Layer Outputs
For Figure 4, we provide probing example of layer out- put logits in the vocabulary space in Table 41. We prompt Llama3.1g--mn with "I see Ilama sleeping in my back- yard.", and check the layer outputs in different settings. From the table, we can observe that model outputs w/ in- struction and w/ M exhibit a high degree of overlap the top-5 tokens in the latter layers of the model (Layer 22-30), reflecting the similarity in information flow when execut- ing the functionality. At the output layer (Layer 31), the masked model produces translations in the target language, as well as semantically aligns other top tokens with the in- put text. This also demonstrates the semantic preservation characteristic of the translation task.
From these cases, we discover an interesting phenomenon that the model may occasionally output translations in other languages (Spanish and Japanese in Case 3), even though has never encountered these languages during the mask training. This suggests that merely unifying the distribution of attention scores is insufficient for the model to accurately elicit the corresponding functionality. In addition, Section C.2 mentions that the functionality of attention heads is not likely to be concentrated in the KV heads. Combined with the results of query-head removal, we infer that the func- tionality of attention heads is more likely to be distributed in the output projection matrix Wo. which may serve role similar to the FFN layer in the model.
C.5. IWSLT2017 Evaluation Examples
C.3.3. FEN LAYER REMOVAL
In Section 5, we evaluate the BLEU scores of the model with a-scaled M on the IWSLT2017 translation dataset. Considering the style difference between the models shown in Table 36, in the evaluation, we clean up the generated outputs so that they contain no explanation words or punctu- ation marks. Therefore, the BLEU scores reported in Table 8 are more reliable in reflecting the translation quality of the model. We provide some examples of the model outputs in Table 42, Overall, whether the instructed model includes scaled M does not make too much difference in the gener- ated sentences. However, the model w/ scaled M generally provides responses that better align with the labels.
This section mainly explains that removing FFN layers is not necessary for triggering functionalities. In our experiments, we only apply the mask M on the attention heads, but the mask can also be applied to FFN layers by removing their contributions to the residual stream. Similar to Equation (2), for the input X at the decoder layer 1, if we use a binary mask E (0. 1} to indicate whether the FFN layer is selected in the model, then the decoder layer output can be written as:
Decoder, (X) = X *+HH((X)+mEFFF) (X (HA(X)) (5)
24

---

Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking
Table 41. A prohing of the logit outputs in the vocabulary space in Figure 4. White background indicates the original model without instructions, blue background indicates the model w/ instruction, and green background indicates the model w/ M.
Layer
Egpl
Egg3
Topiinlee
Tags
Lspt
Taps
Frebudding
rell
Table 42, Examples of IWSLT2017 en-zh translation on instructed L inn-inst and the instructed model with a-scaled M. We provide their BLEU scores in the bracket, and highlight the alignments and differences among the translations.
Alan
Almn
nathara
sink
uss
reficats
onterskoss
Combiaation
pek
puach
netheaza
actbeurs
Aogal
cacea
22
utr
aeficurs
Chinese input
ITT fi 2 : -
secficats
ell
ATAB
DDperdonry
PSN
English gold label
And sometimes little prototype of this experi- ence is all that it takes turn us from an uhoh moment to a tada moment
Nub
Mic
Atr
kah
<ff
oll
Axl
9ab
netlears
sethears
1966
Mi
bust
Instructed
And sometimes a small models experience will help us turn oh no moment into a ha ha moment
-LAST
Nab
(0.556)
ekaor
w/ scaled
And sometimes small prototype models expe- rience will help us turn oh no moment into ha ha moment
Starper
fex
hus
(*ee]
M
Gaim
pall
SKS
saspen
Gartei
bub
Stag
Cipe
(0.640)
3:20
20l
Cla.
Nab
10
14
vetterment
5xtm
SIG
Stems
hurreker
poll
Chinese
RE 24
VRRR TRA EE
TAC
input
x 1 1 HE
sopuer
>ag
rey
Stapps
12
pNet
TAC
English gold label
And I wonder what youd choose because Ive been asking my friends this question a lot lately and they all want to go back
TAC
Raf
HITE
Vaa
15
Repening
Starper
hule
seacl
TAC
-W8
(DBG
-00g
Conrent caded
s4m.
1AC
can
Instructed
Ive been asking my friends this question a lot lately and they all say go back in time
diet
dic
(0.616)
kp
bon
Auf
w/ scaled
Ive been wondering how you would choose and lately Ive asked my friends this question a lot and they all say go back in time
16
Hotiall
zech
Conerrtoon
Vome
had
Mary
onedi
M
unfottanatel
iboss
old
OKY
(0.813)
17
hon
incresiigly
confderty
ouuch
eoed
hend
can
unfortunately
WEBPACK
Levy
OKY
Ht5
Chinese input
* & EX A 3 trtt fr oF th pot 20 R
cneridently
hos
WSTT
Iscracingly
hnn
ca13
but
B #
X
unfattustely
Highland
poobably
mikkely
T H
2 45j J In T FC
A #
chances
Heelioodd
milllly
20
Incrasnnly
MinhiicAligneert
bys
English gold label
So the average for most people is around 20 inches business schools students about half of that lawyers little better but not much better than that kindergarteners better than most adults
Thxt
Thut
charess
ikcliaood
21
Thx
That
clances
ikelivodd
you
usica
Thai
Instructed (0.749)
Most people build towers to an average height of 20 Teet Business school students are probably about half as good as lawyers but not much bet- ter Preschool children are better than most adults
Thxi
24
306
Thae
While
Thai
25
1n
s0c
-B
16
w/ scaled
Most people build towers with an average height of 20 feet The law students were about half as good but not much better The kindergarten chil- dren were better than most adults
Thxt
Thot
THAT
8
my
you
M (0.720)
..n
duc
THAT
hackyard
Thx
Thu
Node
Jn
Thut
Thas
Sadbver
courpi
However
21
25

---

Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking
C.6. Experiments MoE Model
Table 43. XNLI translation perplexity (PPL.) Phi-3.5-MoPmsst
MoE (Mixture-of-Eppetts) language models divide the model'ss FFN (Feed-Forward Network) layer into multiple experts, and during inference, only subset of these experts is selected by routers to contribute to the computation. MoE models often achieves better performance than dense mod- els with a similar number of activated parameters and is gradually becoming a popular research topic. In this section, we conduct experiments verify whether the attention head mask can still switch the model's behavior in MoE models.
w/ instruction
zh
fr
de
ru
From
1,088
1.046
0.857
1.008
1.286
0.851
2.747
2.160
2.371
2.317
1.825
1.237
w/ M
zh
fr
de
From
We select Thi-3.5-MoEEinsteee parameters, with 6.6B active parameters when using 2 ex- perts) for head mask training on the English and Chinese XNLI translation task. As shown Table 43-44, we observe that while head masking in the MoE model could trigger havior switch, does not lead performance improvements on the generative metric. This might be because the major- ity of MoE model parameters are concentrated in the FFN layers, while the attention layer accounts for only small portion of parameters. We propose another two possible explanations: (1) The primary functionality of MoE might reside the FFN, with the router playing a role similar to attention head masking for function selection. (2) The task- level mask and the token-level router may work well together. Improving the effeetiveness of head masks in MoE models is an important direction for our future research.
(AdinaTru, 2024) (16X3.8B
0.786
0.684
0.558
0.680
0.877
0.558
zh
1.098
1.048
1.141
1.202
1.148
0.746
Table 44. XNLI translation ROUGE-L Phi-3.5-Mooasst
w/ instruction
From
zh
fr
de
ru
0.448
0.650 0.465
0.674
0.628
0.429
0.425
0.519
0.484
0.449
0.378
0.344
w/ M
From
zh
fr
de
ru
0.400
0.361
0.568
0.481
0.282
0.278
0.558
0.314
0.327
0.350
0.231
0.237
26


Reviews:
[{"review_id": "IBaszHIJc0", "reviewer": "Reviewer_b411", "summary": "The authors study the case that there are several attention heads if switched off, the models actively can be tuned to perform a specific task without fine-tuning.", "questions": "", "limitations": "", "rating": 2, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "Thank your for your revisions and comments. We would provide our clarifications and responses below.\n\nFirst and foremost, we would like to clarify certain statements in your Summary, Methods and Experimental Designs sections. Our experiments are not limited to language translation tasks; they also include 35 simple tasks (Lines 166-169, left column; Table 2, 4, 6, 9, etc.), which account for nearly half of all our experiments. However, this aspect was not mentioned in the review. Additionally, as a paper focused on the functionality and interpretability of LLMs, we have dedicated substantial portions of the text to exploring and analyzing the mechanism that how model \"switches behavior through selective attention heads\". While it is true that using head masking can improve performance in certain scenarios, we would greatly appreciate it if you could focus more on the paper’s contributions to model functionality and interpretability.\n\nIf there are any aspects of the paper that remain unclear, we are always here to provide further clarification and assistance.\n\n> W1. Benefits\n\nAs stated above, our paper primarily contributes to the interpretability of models. We find the phenomenon of \"enabling the model to perform tasks without instructions by selecting attention heads\" to be very intriguing. We propose an efficient method, applicable to a wide range of tasks, for identifying which attention heads are crucial for the task. This phenomenon is not only observable across various architectures and sizes of LLMs (Section 3), but also applies to multimodal models, including those for speech (see below). These attention heads form interdependent \"functional pathways\" responsible for executing corresponding functions, thus helping us better understand how model modularity manifests in attention heads (Section 4). Additionally, by selecting these attention heads, the model often achieves a certain level of performance improvement (Section 5).\n\n- Speech model: test on SALMONN\n\n| Task | no instruction | with instruction | with mask |\n| -- | -- | -- | -- |\n| Gender recognition | 0.00 | 97.71 | **97.75** |\n| Emotion recognition | 0.00 | 69.70 | **72.36** |\n| ASV | 0.00 | **93.61** | 93.23 |\n| Audio captioning | 14.90 | 20.89 | **24.33** |\n| S2TT | 15.14 | **34.48** | 33.82 |\n\n> W2/Q1. Degrades\n\nAfter using the mask, the model undergoes a behavioral change and can no longer perform the original task as intended. As a result, the general performance will inevitably decrease. However, since the mask does not modify or add/remove any of the model’s parameters, we can simply stop using the mask to restore the model's original instruction capabilities. This process is straightforward and flexible.\n\nWe also conducted some mask experiments on general benchmarks. Please see our response to uwMV.\n\n> Q2. activation experiments\n\nIn the paper, we conducted an experiment (Line 370, right column) to investigate the relationship between attention head activation (focus on special tokens) and the mask. Our findings suggest that the correlation between them is not strong. We discuss this phenomenon further in Appendix C.3.2, where we suggest that the \"attentive function\" of the attention heads does not play a major role in their selection.", "claims_and_evidence": "- Switching off attention heads leads to similar results as prompting (experiments for language translation)\n\n- Masks can be learned, similar to fine-tuning", "methods_and_evaluation_criteria": "- Used language translation datasets", "theoretical_claims": "No theoratical claims", "experimental_designs_or_analyses": "- Yes, checked the translation experiments and comparison with random selection", "relation_to_broader_scientific_literature": "There have been other works like https://arxiv.org/abs/2410.05603, which have studied that models are superpositioning multiple tasks at the same time. Please comment how your findings are different.", "essential_references_not_discussed": "Check broader scientific literature", "other_strengths_and_weaknesses": "- The method is quite simple and easy to implement\n\n- It is unclear if there are any practical benefits of this method. \n\n- It is unclear, how general performance of the model degrades.", "other_comments_or_suggestions": "See strengths and weakness section", "questions_for_authors": "- Can authors compare how original performance degrades when removing attention heads\n- Can authors perform a comparison with activations with Prompting experiments", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "8iXpz0oHsm", "reviewer": "Reviewer_uwMV", "summary": "This paper proposes a simple yet effective attention head masking method for large language models. Specifically, it trains a head weight which can indicate the importance of heads to the task. After training, we can map the trained head weights to head mask and use it as the final mask for inference. Moreover, this paper finds that there are structured groups of interdependent attention heads for different tasks in LLMs.", "questions": "", "limitations": "", "rating": 3, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "Thank you for your thoughtful comments and suggestions on our work. We would like to answer and clarify your concerns as below. As the text length is constricted, we provide the results in the anonymous github (rebuttal.pdf).\n\nFirst, we would like to clarify that the primary focus of this paper is on the interpretability and functionality of LLMs - specifically, the phenomenon that \"tasks can be directly executed by selecting attention heads\". We find this phenomenon very interesting, and most of the paper is devoted to validating its generality and attempting to explain its underlying mechanisms. (We have even observed the same phenomenon even in multimodal speech models! See our response to b411) Although using masks can indeed enhance model performance in some cases, we sincerely hope that you will pay more attention to our contribution regarding the interpretability of model functionality.\n\n> W1. Training Overhead\n\nIt is indeed unavoidable to train a mask for each task on every model to identify its functional heads. However, because our training only involves trainable parameters equal to the number of attention heads, the process is both fast and requires little memory (only 44 minutes and 16.5GB of VRAM on llama3.1-8b). We have also compared this approach with full fine-tuning and LoRA fine-tuning in terms of resource consumption. (Note that since fine-tuning modifies the model parameters, these two methods would undoubtedly achieve better performance. Nevertheless, we are not proposing a PEFT method, and we have neither modified nor added to the model’s original parameters.)\n\n> W2. Lack of Experiments\n\nInitially, we chose to test on 100 samples because we wanted to use more training samples to locate the attention heads required for the translation task more accurately, and the evaluation set was just used to verify whether the model can perform translation. But, indeed, it's our bad to use such a small number of samples for the quantitative evaluation. As it is on the XNLI dataset, we nonetheless evaluated on the full IWSLT2017 evaluation set in the paper (see Table 7 and App. A) without incorporating any additional training data.\n\nWe would also like to argue that with a smaller train-test ratio, we can still achieve results similar to those reported in the paper. Please refer to the experimental results obtained after re-dividing the dataset with an 8:2 ratio. \n\nFor other benchmarks: although most benchmark tasks include explicit \"instructions\" such as options, we have still managed to conduct evaluations on some datasets. We achieved better performance on winogrande and hellaswag.\n\n> W3. Efficiency Analysis\n\nTaking the llama3.1-8b model and the en-zh translation task as an example, we masked out 192 (18.75%) attention heads, and pruned the corresponding Q-head and $W_O$ matrices. Since the attention heads account for only 16.7% of the model’s total parameters, and the pruning only affects Q and O, we actually only saved 2.5% of the parameters. As some studies focusing on pruning can remove 20-30% of the parameters with only minimal performance loss, we would like to clarify again that our work is not aimed at achieving inference efficiency, but rather at locating and interpreting the model’s modularity.\n\n> Q1. Head Pattern\n\nIn App. C.2 and Figure 7 we have some discussions on the head patterns, and you may check it out. We also have some other findings: **1.** Similar tasks tend to share more attention heads， for example, 42 translation tasks share 177 common attention heads, but 35 simple tasks share only 5 heads. **2.** Due to sparsity, as the model size increases (from Qwen2.5-1.5B to 14B), each attention head tends to be responsible for fewer tasks on average.\n\n> Q2. Performance on few-shot learning\n\nWe conducted some supplementary experiments on simple tasks; please take a look at the results. Summary:\n\n1. When using the mask obtained from 0-shot training for 5-shot inference, the performance ranking is: instructed 5-shot > mask 0-shot > mask 5-shot > 5-shot.\n2. For the tasks in Table 2, using a mask trained with 5-shot and then performing mask 5-shot inference yields better performance than instructed 5-shot.\n3. We combined multiple simple task datasets into a hybrid dataset, where each sample may come from different tasks but includes 5-shot examples from its corresponding task. After training the mask on this hybrid dataset, the model was able to enhance its 5-shot context learning performance (including tasks that were not seen during training).\n\nFor our more response please refer to the anobymous github. Sorry for the inconvience!", "claims_and_evidence": "Yes, the claims made in the submission are supported by clear evidence.", "methods_and_evaluation_criteria": "Yes, the proposed methods and evaluation criteria make sense.", "theoretical_claims": "There is no theoretical claims.", "experimental_designs_or_analyses": "Yes, the main experimental and ablation study designs and analysis are valid.", "relation_to_broader_scientific_literature": "This work provides a deep and comprehensive analysis for uncovering the functional behaviors of attention heads in LLMs. Unlike prior efforts that relied on pruning or external prompts, this study shows that selectively activating relevant heads can improve performance, offering insights into efficiency and controllability.", "essential_references_not_discussed": "The related works mentioned in this paper are good and enough to understanding the key contributions of the paper.", "other_strengths_and_weaknesses": "**Strengths**:\n1. The paper is easy to follow and understand, and the structure is good. \n2. The attention head masking strategy proposed in this paper performs well one various tasks.\n3. This work proves that LLMs inherently encode structured functional pathways, where specific attention heads are crucial for executing distinct tasks. \n\n**Weaknesses**:\n1. **Training Overhead**: For different model series and different tasks, we need to train different attention head masks, which introduces non-negligible computational overhead. Moreover, the paper is supposed to clarify the training overhead for head weights. \n2. **Lack of Experiments**: For the translation tasks, the 100 samples are selected as evaluation set without any motivation and explanations. The paper is supposed to clarify the reason why they choose 100 samples. Moreover, More evaluations on common down-stream tasks like Hellaswag or ARC-C are suggested to include.\n3. **Efficiency Analysis**: The efficiency analysis for inference stage is recommended to include in the paper, such as end-to-end latency, or GPU memory comparison; otherwise, there remain concerns about its actual efficiency in real world usage.", "other_comments_or_suggestions": "Please see the above sections.", "questions_for_authors": "1. Have you checked the patterns of attention heads selected for different tasks? Can we find some common patterns from those heads?\n2. What will the performance of the proposed attention head masking strategy be on few-shot learning?\n3. Could you please discuss and compare the findings in your work with the findings in DuoAttention [1]? \n4. Following Q3, will your strategy still be effective for long-context scenarios?\n5. How to control the masking ratio among all attention heads? Could you please provide some insights or solutions?\n\n\n[1] Xiao, G., Tang, J., Zuo, J., Guo, J., Yang, S., Tang, H., Fu, Y., & Han, S. (2024). DuoAttention: Efficient long-context LLM inference with retrieval and streaming heads. arXiv. https://arxiv.org/abs/2410.10819", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "kCH7NCcE7w", "reviewer": "Reviewer_7BU1", "summary": "This article explores the ability of large language models (LLMs) to perform tasks without relying on explicit instructions through selective attention head masks. It is found that there exists a \"functional path\" composed of attention head combinations within the model, which is crucial for task execution. Experiments have shown that masking strategies can effectively improve task performance, and pre trained models already have task related knowledge that can be triggered by masking. The study proposes a method for detecting functional pathways, revealing the key role of attention head combinations and providing a new perspective for understanding the internal mechanisms of LLMs.", "questions": "", "limitations": "", "rating": 4, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "Many thanks for your appreciation and valuable remarks on our work. We would like to answer and clarify your concerns as below.\n\n> W1. Theoretical analysis\n\nSince our conclusions are primarily derived from experiments and observations rather than strict theoretical analysis, we sincerely apologize for the shortcomings in this regard. Nevertheless, some studies [1][2] have provided insights that support the validity of our approach, in which we regard attention heads as computational nodes in the information flow and analyze their functionality.\n\n[1] Yao, Y., Zhang, N., Xi, Z., Wang, M., Xu, Z., Deng, S., & Chen, H. (2024). Knowledge circuits in pretrained transformers. arXiv preprint arXiv:2405.17969.  \n[2] Hao, Y., Dong, L., Wei, F., & Xu, K. (2021, May). Self-attention attribution: Interpreting information interactions inside transformer. In Proceedings of the AAAI Conference on Artificial Intelligence (Vol. 35, No. 14, pp. 12963-12971).\n\n> W2. Larger scale experiments\n\nIn Sec. 3.4, we stated that \"Larger model shows better head functionality,\" primarily based on the criterion of whether *behavior switching* can be achieved. This is because, in models smaller than 3B, masking out certain attention heads does not reliably trigger behavior switching. To further support this claim, we conducted additional experiments on Qwen2.5-32B-Instruct and found that it also exhibits behavior switching in translation tasks (see Q1).\n\n> Q1. Large model & MoE model\n\nWe are very sorry, but we currently do not have the resources to conduct experiments on a model as large as 72B. However, we have performed training on a 32B model (Qwen2.5-32B-Instruct). Due to time constraints, we only trained head masks for en to other six languages translation task. Generally, we found that applying masks can still improve model performance on the 32B model.\n\n- PPL\n\n||en-zh|en-fr|en-es|en-de|en-ru|en-ar|\n|-|-|-|-|-|-|-|\n|with instruction|2.739|1.325|1.385|1.448|1.587|1.960|\n|with mask|**0.943**|**0.553**|**0.448**|**0.554**|**0.832**|**1.326**|\n\n- ROUGE-L\n\n||en-zh|en-fr|en-es|en-de|en-ru|en-ar|\n|-|-|-|-|-|-|-|\n|with instruction|0.470|0.428|0.415|0.445|0.388|**0.293**|\n|with mask|**0.684**|**0.703**|**0.752**|**0.708**|**0.449**|0.290|\n\nFor MoE models, we selected Phi-3.5-MoE-instruct (16×3.8B, activating 6.6B) for head mask training on the en-zh translation task. We observed that while head masking in the MoE model could trigger behavior switch, it did not lead to performance improvements. This might be because MoE model parameters are more inclined toward memory. We propose another two possible explanations: **(1)** The primary functionality of MoE might reside in the FFN, with the router playing a role similar to attention head masking for function selection. **(2)** The task-level mask and the token-level router may not work well together. Improving the effectiveness of head masks in MoE models is an important direction for our future research.\n\n- PPL\n\n||en-zh|en-fr|en-es|en-de|en-ru|en-ar|zh-en|zh-fr|zh-es|zh-de|zh-ru|zh-ar|\n|-|-|-|-|-|-|-|-|-|-|-|-|-|\n|with instruction|1.088|1.046|0.857|1.008|1.286|0.851|2.747|2.160|2.371|2.317|1.825|1.237\n|with mask|**0.786**|**0.684**|**0.558**|**0.680**|**0.877**|**0.558**|**1.098**|**1.048**|**1.141**|**1.202**|**1.148**|**0.746**|\n\n- ROUGE-L\n\n||en-zh|en-fr|en-es|en-de|en-ru|en-ar|zh-en|zh-fr|zh-es|zh-de|zh-ru|zh-ar|\n|-|-|-|-|-|-|-|-|-|-|-|-|-|\n|with instruction|**0.448**|**0.650**|**0.674**|**0.628**|**0.429**|**0.425**|0.519|**0.465**|**0.484**|**0.449**|**0.378**|**0.344**|\n|with mask|0.400|0.361|0.568|0.481|0.282|0.278|**0.558**|0.314|0.327|0.350|0.231|0.237\n\n> Q2. Stimulate reasoning ability\n\nAfter the release of DeepSeek-R1, we attempted to use R1 to generate high-quality reasoning chains for simple tasks and then trained head masks on these chains in an effort to activate reasoning capabilities in other instruct models. Unfortunately, our results were not as promising as we had hoped. Whether we applied the mask directly or after explicitly prompting the model to \"think step by step,\" the model was still unable to achieve high-quality reasoning solely by selecting specific attention heads. (It may still require parameter modification to stimulate its potential reasoning capabilities, such as LIMO[3])\n\nFor the masks we obtained, they tended to discard only a small number of attention heads (less than 10% in a 7B model), and for complex tasks like mathematics, almost all attention heads were retained. This leads us to believe that reasoning is a complex process involving the coordination of multiple functions at different stages of generation. As a result, it may not be feasible to activate reasoning abilities solely through head masking at this level of \"task granularity\".\n\n[3] Ye, Y., Huang, Z., Xiao, Y., Chern, E., Xia, S., & Liu, P. (2025). LIMO: Less is More for Reasoning. arXiv preprint arXiv:2502.03387.", "claims_and_evidence": "Yes.", "methods_and_evaluation_criteria": "Yes.", "theoretical_claims": "No. There is no  theoretical claim.", "experimental_designs_or_analyses": "Yes.", "relation_to_broader_scientific_literature": "This article establishes a connection between instruction tuning and pruning of attention heads, which is a very interesting work. This provides a new perspective for us to better understand the essence of instruction tuning and the internal mechanisms of LLM.", "essential_references_not_discussed": "No.", "other_strengths_and_weaknesses": "**Strengths**\n\n1. Novel Insight into Model Functionality. The paper  revealing how specific combinations of attention heads enable task execution without explicit instructions. \n\n2. Practical Methodology. The proposed attention head masking technique is simple yet effective, requiring no modification to model parameters. This approach can be easily applied across various models and tasks\n\n**Weaknesses**\n\n1. Lack of rigorous theoretical analysis.\n\n2. There are no larger scale experiments. This article states that \"the Large model shows better head functionality\", but the maximum is only the 14B.", "other_comments_or_suggestions": "No.", "questions_for_authors": "1. Can you conduct corresponding experiments on a larger scale, such as on 72B. And conduct experiments on the MOE model. I am not sure if the MOE model has similar improvements as the dense model. Because generally speaking, the MOE model may be more inclined towards memory, and the proportion of attention in the MOE model is relatively small.\n\n2. Another curious question for me is whether this method can directly stimulate the reasoning ability of the base model. For example, for deepseek v3, masking some of  heads can significantly indicate its performance on benchmarks like AIM. If masking attention can stimulate better reasoning ability, I believe this will be a significant contribution.", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}]

Author rebuttal:

Meta-review: This paper investigates how LLMs can perform specific tasks without explicit instructions through selective attention head masking. The authors demonstrate that by applying discrete 0-1 masks to attention heads, models can directly exhibit task-specific functionalities without modifying any parameters. This phenomenon was validated across various model architectures, including both language and multimodal models, and across diverse tasks such as classification, extraction, and few-shot learning. The reviews recognized several strengths of this work: its novel approach to uncovering functional behaviors of attention heads in LLMs, clear paper structure with easy-to-follow methodology, and the effective performance improvements achieved through the proposed masking strategy. While there were some initial concerns about practical benefits and impact on general model performance, the authors provided additional experiments addressing these issues, including tests on larger models and MoE architectures. Multiple reviewers provided positive evaluations after reviewing the authors' thorough rebuttal. Given the thorough experimental validation, novel insights into model interpretability, and satisfactory author responses to reviewer concerns, I recommend accepting this paper for publication at ICML 2025.
Decision: Accept (poster)