=== PDF PAGE 1 ===
         Heads up! Large Language Models Can Perform Tasks Without Your

                  Instruction via Selective Attention Head Masking





                            Senyu Han 1 2 3 Hongchuan Zeng 1 2 3 Kai Yu 1 2 3 4 Lu Chen 1 2 3 4





                          Abstract                                     ing their inner module functionalities 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-                     Recent works have demonstrated that built-in transformer

       els can perform various functions, it remains an                modules of LLMs exhibit certain functionality. For example,

       open question of how these modules are com-                     decoder layers of different depths vary in their effects on

       bined to elicit distinct inherent functionalities.              the inference and functionality of the model, and existing

       In this paper, we investigate the modules inside                research probes the importance of layers and their impact

       LLMs and demonstrate that, by simply masking                    on the outputs (Men et al., 2024; Bandarkar et al., 2025). A

       or retaining specific attention heads during infer-             more fine-grained division of model functional modules is

       ence, LLMs can exhibit specific task function-                  the level of neurons within the FFN layers. Before LLMs

       alities without requiring explicit instructions or              became popular, many studies suggested that Transformer-

       modifications to the model parameters. Experi-                  based models store their knowledge in the neurons of FFN

       ments across various models and tasks reveal that               layers (Dalvi et al., 2019; Geva et al., 2021). Later research

       LLMs inherently encode “functional pathways”,                   on LLMs has further analyzed and localized the types of

       the structured groups of interdependent attention               knowledge stored within these neurons, such as languages

       heads that are crucial for executing specific tasks.            (Zeng et al., 2025; Tan et al., 2024), concepts (Rai & Yao,

       These pathways not only govern the model’s                      2024) and various tasks (Xiao et al., 2024). Apart from the

       functional behaviors but also enhance parame-                   two modules above, many works also study the functional

       ter efficiency, as suppressing attention heads out-             behaviors of attention heads. Although it is generally be-

       side the pathway can improve task performance.                  lieved that function-related knowledge is primarily stored

       The code is available in this repository: https:                in the neurons of FFN layers, there are also considerable

       //github.com/OpenDFM/HeadsUp.                                   works indicating that attention heads play a 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

1. Introduction

                                                                       provide valuable insights into the model module function-

Large language models (LLMs) have demonstrated their                   ality, most of their methodologies rely on certain tasks or

powerful capabilities across diverse fields. For the most              carefully designed prompts, limiting their generalization

popular Transformer-based (Vaswani, 2017) architecture,                to other uncovered tasks. Furthermore, these works often

the model comprises multiple stacked modules such as at-               require explicit instructions to elicit the corresponding task

tention layers and FFN (Feed-Forward Network) layers.                  functionalities of the model, but the reasons and mecha-

After being trained on large amounts of data, the model                nisms behind how a module of the same model supports

can support a wide range of functions by prompting texts               different functions are still not well explored.

containing task instructions. To understand the mechanism

                                                                       Interestingly, in neuroscience, many similar cases have iden-

of how a single LLM processes multiple tasks, interpret-

                                                                       tified the phenomenon of functional partitioning in the brain

   1

     X-LANCE Lab, School of Computer Science, Shanghai Jiao            (Bertolero et al., 2015; Wig, 2017; Béna & Goodman, 2025),

Tong University, Shanghai, China 2 MoE Key Lab of Artificial           where various functions can be exhibited through different

Intelligence, Shanghai, China 3 Jiangsu Key Lab of Language Com-       combinations of modules (Diez et al., 2015). Inspired by

puting, Suzhou, China 4 Suzhou Laboratory, Suzhou, China. Corre-       the modularity in brains, we suppose that the combinations

spondence to: Lu Chen <chenlusz@sjtu.edu.cn>.

                                                                       of LLM modules form functionalities inside the model, and

Proceedings of the 42 nd International Conference on Machine           we propose a simple yet effective method to detect the task

Learning, Vancouver, Canada. PMLR 267, 2025. Copyright 2025            functionalities in LLMs. More specifically, we investigate

by the author(s).



                                                                   1


=== PDF PAGE 2 ===
           Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking



the functions of LLM modules by just removing these mod-                                                                                                              Layer 𝑙 Output





ules from the model. We directly provide the LLM with                                                                                                                         ⊕

the task dataset without instructions, and train a 0-1 binary









                                                                                                                                FFN

                                                                                                                                                                          MLP





module mask to determine the modules selected for this                            Attention Head Mask

                                                                                                                                                                              ⊕

task. Surprisingly, on the modules of attention heads, this                                                                                                           𝑊𝑂 Projection

                                                                                  𝑙+2    1       0     0

straightforward idea leads us to a marvelous discovery: by                                                                                                      ⊙ 1             ⊙ 0             ⊙ 1









                                                                          Layer

                                                                                  𝑙+1    0       1     1                                                       𝑜1             𝑜2               𝑜3

selectively masking attention heads and allowing only









                                                                                                                                Multi-Head Attention

certain heads to remain active in LLMs, they can directly                           𝑙    1       0     1

                                                                                                                                                       𝑄1              𝑄2              𝑄3

exhibit specific task functionalities without the presence                                  1    2     3                                                 𝐾1              𝐾2              𝐾3

                                                                                                Head









                                                                                                                      Decoder

                                                                                                                                                           𝑉1              𝑉2              𝑉3



of instruction prompts (Figure 1). We widely confirm this                                                                                              Head1          Head2            Head3





phenomenon across various open-sourced LLMs covering

both base and instruct models, various sizes of LLMs rang-                                                                                                             Layer 𝑙 Input



ing from 0.5B to 14B, and various tasks including classifica-             Input

tion, extraction, generation and more. Our detailed analysis              I have never seen such a beautiful sunset.

experiments on attention heads suggest that LLMs contain                          No mask                  Original output

functional pathways, which are groups of interdependent                                                    I'm glad you're enjoying the moment! Sunsets

attention heads that work together to enable specific func-                                                can be truly breathtaking.

                                                                                    ℳ1                     en-zh translation output

tionalities. Such pathways play critical roles when the model

performs related functions, and disrupting these dependent                                                 我从来没有见过如此美丽的日落。

attention heads can significantly worsen performance on                             ℳ2                     en-de translation output

related tasks. Furthermore, as a de-noising process for the                                                 Ich habe nie so ein wunderschönes

attention heads, if attention heads outside the pathway are                                                 Sonnenuntergang gesehen.

                                                                                    ℳ3                     Sentiment analysis output

reduced or pruned, the model may even exhibit improved

performance. Our findings reveal the inherent capabilities                                                 positive

of attention heads and locate their specific functional com-

binations within the model, providing valuable insights into        Figure 1. By masking and selecting certain attention heads, the

the inner functionalities and behaviors of LLMs.                    model can directly exhibit task functionalities and generate differ-

                                                                    ent outputs under the same input.

Our contributions can be summarized as follows:

  • We find that masking out certain attention heads can            universal approaches to detect the parameter functionality,

    trigger the task functionality in the LLM without us-           like mapping module parameters or outputs to the vocabu-

    ing prompts, and we propose a simple learning-based             lary space (Wendler et al., 2024; Feng et al., 2024; Rai &

    method to detect them (Section 3).                              Yao, 2024; Elhelo & Geva, 2024) or comparing parameter

                                                                    changes after task fine-tuning (Zhang et al., 2024; Panigrahi

  • The selected heads form an interdependent functional

                                                                    et al., 2023; Xu et al., 2025; Wu et al., 2024b). Particularly,

    pathway on the model, and they have a more critical

                                                                    some PEFT-related works also use the strategies of scaling

    impact on the model’s functionalities (Section 4).

                                                                    and biasing the output of attention heads (Yin et al., 2024;

  • By scaling down the outputs of heads outside the func-          Wu et al., 2024a), which is similar to our attention mask. In

    tional pathway, we can effectively mitigate the negative        contrast, we only use the discrete scale of 0 or 1 to select

    impact of these heads on the model, and even improve            the heads, and such unmodified head parameters are better

    the model’s performance on the task (Section 5).                able to reflect the original behavior of the model.



2. Related Work                                                     Functionality in attention heads Attention heads are be-

                                                                    lieved to be capable of performing functions in editing the

Discovering functionality in LLMs Previous studies uti-             information flow (Zheng et al., 2024). In smaller pre-trained

lize diverse approaches to locate the modularity or function-       language models, Jo & Myaeng (2020) evaluate each atten-

ality of LLMs. For neurons in FFN layers, the activation            tion heads on various tasks and finds that heads differ in their

function works as a natural judge to determine whether the          influence. For LLMs, Jin et al. (2024) use the gradient-based

neuron is important to the input, and many works use the            method to locate “memory heads” and “context heads”, and

activating frequency (Tan et al., 2024; Zeng et al., 2025)          Wu et al. (2025) further locate “retrieval heads” by counting

or the output magnitude (Xiao et al., 2024) to partition the        their retrieval scores. Such functionality of attention heads

model. At the granularity of attention heads, other methods         is too generic and task-dependent, making it unsuitable for

can be applied, such as comparing head logit differences and        wide application on other tasks. Other works also manage

calculating attention scores (Zheng et al., 2024). Besides          to locate the important heads in respective of different tasks

these granularity specified methods, many works also use            or knowledge (Todd et al., 2024; Yao et al., 2024), but they



                                                                2


=== PDF PAGE 3 ===
            Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking



usually require carefully designed prompts to work well. In            in the mask. Using the similar approach, we can also block

our work, the training of attention masks allows any ordi-             the output of certain FFN layers, though the mask mostly

nary task datasets, and the usage or removal of heads can              just simply use all the layers (see Appendix C.3.3). Here,

directly reflect their inherent functionalities on the task.           we will only apply masks to attention heads.



3. Attention Head Selection Extensively                                3.2. Mask Training

   Triggers Functionality                                              For a certain task t, We use the training-based method to

                                                                       get its attention head mask M. Specifically, we freeze all

In this section, we provide our main experiment results of

                                                                       the original parameters in the model, and only train a head

the attention head selection. We first define the notations,

                                                                       weight M that has the same size with M but in the Rn×h

methods and settings used in the module selection, then

                                                                       space. Weights in M can indicate the importance of heads

we show the conclusion that attention head selection can

                                                                       to the task, and the binary mask M can be obtained by the

extensively trigger functionalities in LLMs.

                                                                       sigmoid function M = I(σ(M) ≥ 0.5). Inspired by Fang

                                                                       et al. (2024) and Csordás et al. (2021), we introduce the

3.1. Preliminaries and Notations                                       Gumbel trick (Gumbel, 1954) into the sigmoid function to

Modern LLMs are commonly decoder-only Transform-                       encourage σ(M) to converge towards 0 or 1 in the training:

ers, and a decoder layer includes a multi-head attention                                                       

(MHA) layer and an FFN layer. For an LLM that has                                                  M+G

                                                                                     M=I σ                   ≥ 0.5 ,            (3)

a hidden size of d, consider the input X ∈ Rs×d with                                                 τ

the length s at the decoder layer l. Four projection matri-

                                                                       where G = log(− log E), ϵij ∈ E, ϵij ∼ U (0, 1) is the left-

ces WQ , WK , WV , WO ∈ Rd×d compute the attention

                                                                       tail Gumbel noise matrix and τ is the temperature. Smaller

scores and write the processed hidden states MHA(X) into

                                                                       τ amplifies the impact of noise while also encouraging the

the residual stream. For the MHA part, suppose the atten-

                                                                       weights M to shift toward the positive or negative extremes.

tion layer has h heads1 , and each head has a dim size of

                                                                       Using the reparametrization trick, we can get a discrete but

dhead = d/h. Thus for head i, its contribution Y(i) ∈ Rs×d

                                                                       still differentiable mask M during the training.

to the MHA output is

                                                                       Just like fine-tuning an ordinary language model, it’s

                           (i)       (i) T

                                           !

                      XW   Q   (XW   K  )       (i)   (i)              straightforward to train an attention head mask: for a sam-

   Y(i) = softmax          √                 XWV WO ,

                               dhead                                   ple (x, y) in the task dataset Dt , we directly take the x||y

                                                          (1)          as input without any task instructions and optimize the

          (i)    (i)   (i)

where WQ , WK , WV ∈ Rd×dhead are submatrices be-                      head weight M on the output sequence y to minimize the

                            (i)                                        loss. Note that the weight M is initialized with a positive

longing to head i, and WO ∈ Rdhead ×d is the “head” sub-               value so that initial σ(M) ≈ 1, and the training process is

matrix that projects the output of head i to the hidden space.         like removing attention heads from the full model. After

In this way, the final output of MHA can be calculated as              training, we remove the Gumbel noise from (3) and use

              Ph

MHA(X) = i Y(i) .                                                      M = I(σ(M) ≥ 0.5) as the final mask for inference.

Using this notation, it’s easy to block the output of certain

heads by simply setting their contributions to zero. Specif-           3.3. Experiment Setting

ically, for layer l we use a binary mask m ∈ {0, 1}h to                Models To verify the generalization of this attention selec-

indicate which heads are selected in the model, and the                tion strategy, we experiment with different types and sizes

layer MHA output can be written as:                                    of LLMs as follows:

                                  h

                                  X

                 MHA(X) =             mi Y(i) .              (2)          • Llama 3.1 series (Dubey et al., 2024): 8B, 8B-instruct

                                  i

                                                                          • Qwen2.5 series (Team, 2024b): 0.5B-instruct, 1.5B-

There will be different masks at different layers of the                    instruct, 3B-instruct, 7B, 7B-instruct, 14B-instruct

model. For an LLM with n layers, we expect a mask                         • Other series of LLMs: Phi-3.5-mini-instruct (Adina-

M ∈ {0, 1}n×h to indicate all the selected attention heads                  Tru, 2024, with 3.8B params), Mistral-7B-Instruct-v0.3

in the model. When applying M to the model, it can be re-                   (Jiang et al., 2023)

garded as combining the selected attention heads as a group

   1

     Some LLMs have fewer KV heads than Q heads, and the               Details of their size and attention head settings are listed in

matrices of KV heads are repeated to be equal in size during the       Appendix A. We primarily conduct experiments using two

runtime. We take WK , WV as already repeated for simplicity.           8B Llama 3.1 models, while other models are mainly used



                                                                   3


=== PDF PAGE 4 ===
            Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking



to validate the effectiveness of the attention head mask. By

                                                                       Table 1. Numbers of attention heads selected in the masks, and

convenience, we refer to the 8B-instruct version of Llama

                                                                       the metrics of translation tasks from English to other 6 languages.

3.1 as Llama3.18B-inst in this paper, and other models follow          “Original” uses no instructions nor masks, and “w/ instruction”

similar patterns. We use LM Transparency Tool (Tufanov                 adds explicit translation prompts to the original model. “Random

et al., 2024) to probe the logit outputs inside the models.            M” shuffles the task mask and has the equal number of heads.

                                                                       Bold and underline indicate the best and second-best scores.

Tasks and datasets We train the head mask on two types

of tasks: simple tasks and machine translation. Simple tasks                    Method             en-zh   en-fr   en-es   en-de   en-ru   en-ar

are taken from the work by Todd et al. (2024), including 35            Llama3.18B-inst

datasets of relatively simple tasks like generating antonyms           - # of heads in M           832     860     846     862     828     837

and extracting items. Machine translation uses the XNLI                  PPL (↓)

                                                                       - Original                  2.643   2.172   2.319   2.314   2.327   2.730

(Conneau et al., 2018) parallel corpus for 15 languages,               - w/ instruction            1.091   0.619   0.550   0.627   0.954   1.303

and we choose English, Chinese, French, Spanish, German,               - w/ random M               2.909   2.370   2.762   2.482   2.677   3.204

Russian and Arabic (en, zh, fr, es, de, ru, ar) for translation.       - w/ M                      1.017   0.552   0.504   0.580   1.055   1.322

                                                                       - w/ M of Llama3.18B        2.269   1.114   1.061   1.612   2.105   2.381

These 7 languages can be combined into 42 translation pairs              ROUGE-L (↑)

for a broad generalization of the head mask. Both types                - Original                  0.020   0.082   0.069   0.069   0.045   0.029

of tasks have the characteristic that models can hardly                - w/ 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

generate the desired output solely based on the input                  - w/ M of Llama3.18B        0.019   0.204   0.241   0.099   0.046   0.045

unless they are explicitly instructed on the task to be                Llama3.18B

performed. For each dataset, we select 100 samples as                  - # of heads in M           819     809     811     816     795     821

the evaluation set, and the remaining samples are used for               PPL (↓)

                                                                       - Original                  2.308   1.672   1.853   1.780   1.824   2.434

training. Details of these datasets are listed in Appendix A.          - w/ instruction            1.901   1.240   1.350   1.258   1.573   1.945

                                                                       - w/ random M               2.703   2.329   2.337   2.133   2.377   3.251

                                                                       - w/ M                      1.158   0.585   0.577   0.660   1.142   1.867

3.4. Experiment Results

                                                                       - w/ M of Llama3.18B-inst   2.213   1.512   1.515   1.480   1.754   2.393

                                                                         ROUGE-L (↑)

Following the paradigm defined above, we train head masks              - Original                  0.017   0.072   0.067   0.066   0.045   0.030

for different tasks on various models. Our finding is: these           - w/ instruction            0.017   0.084   0.080   0.076   0.054   0.029

masks extensively work on all the tasks, and such attention            - w/ M                      0.424   0.658   0.657   0.606   0.179   0.067

                                                                       - w/ M of Llama3.18B-inst   0.016   0.071   0.074   0.076   0.037   0.030

head combinations trigger the functionalities on both pre-

trained and instruction fine-tuned models.

Evaluation results We report the perplexity (PPL) and                  partial attention heads selected by M only can trigger the

ROUGE-L (Lin, 2004) of Llama3.18B-inst and Llama3.18B                  model functionality, and significantly improve the accuracy

on 6 English translation tasks, as shown in Table 1. With the          of these tasks. The results on other tasks and experiments

mask M, by removing 15%-20% attention heads from the                   on Qwen2.57B-inst , Qwen2.57B are listed in Appendix C.1,

model, both models can reach better or comparable scores               and on simple tasks the pre-trained model Qwen2.57B also

than the full models with explicit translation instructions            exhibits well functionality.

(e.g. “Translate into Chinese:”). As an ablation, randomly             Besides, we found that the model’s few-shot in-context

selecting an equal number of attention heads results in a              learning functionality can also be enhanced by applying the

higher PPL than the original full model, indicating that the           head mask, as shown in Table 3. For the 6 representative

learned M effectively covers the attention heads necessary             simple tasks, we constructed 5-shot demonstration samples

for the task. Additionally, we attempt to swap the masks               (without instructions) for each task. The masks trained using

between pre-trained and instruction models for the same                these samples generally outperform the original model with

task, finding that their PPL also decreases compared to the            instructional 5-shot samples. Furthermore, we mix the 5-

original full model. Appendix C.1 presents the experiment              shot data from 32 out of 35 simple tasks to form a 5-shot

results on other translation pairs and models. Except for              multi-task hybrid dataset. After training the mask on this

the relatively poor performance on Qwen2.50.5B-inst , other            hybrid dataset, the model demonstrates improved few-shot

models consistently yield similar conclusions.                         in-context learning performance across various tasks, even

Simple tasks also show the similar phenomenon. We select               including those not seen in the training data. This suggests

6 representative tasks out of 35 in Table 2: sentiment (clas-          that the attention head mask can also promote the model’s

sification), antonym (semantic), capitalize_first_letter (pat-         abstract functionality of in-context learning.

tern), product-company (knowledge), conll2003_location                 Larger model shows better head functionality As a part

(recognition) and fruit_v_animal_3 (logic). In this genera-            of scaling validation, when using the head mask to trigger

tion scenario, the original full model can hardly generate             translation functionalities, we find that larger LLMs tend

the desired output without task instructions. Instead, using           to have better results. In Table 4, we show the genera-



                                                                   4


=== PDF PAGE 5 ===
                  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                                   Table 4. Left: After applying the head masks, the generated results

accuracy of 6 representative simple tasks. Using the same notation                                   of the English input "I have never seen such a beautiful sunset."

as in the Table 1.                                                                                   across different sizes of models. We use green to highlight the

                                                                                                     correct translations, yellow for partially correct translations, and

                             senti-    anto-    capitalize      product-   conll2003   fruit v

         Method                                                                                      red for incorrect translations. Right: Top output tokens and their

                             ment      nym      first letter    company     location   animal

Llama3.18B-inst                                                                                      logits on Qwen2.50.5B-inst . Upper (a) is with the M of task en-de,

- # of heads in M             745       834         774           754         787        827         and lower (b) is with the explicit translation instruction.

  Accuracy (↑)

- Original                    0.01      0.12        0.15          0.06        0.00       0.00

- w/ instruction              0.59      0.30        0.97          0.73        0.41       0.51        Model & Task         Prediction

- w/ M                        0.86      0.76        1.00          0.83        0.92       0.98        Qwen2.50.5B-inst

- w/ M of Llama3.18B          0.64      0.75        0.98          0.78        0.75       0.87        - en-zh              我从未见过如此美丽的日落。

                                                                                                     - en-fr              Je n’ai jamais vu tellement une belle lueur de ciel.

Llama3.18B                                                                                           - en-es              I’m sorry, but I can’t provide the exact description of a sunset ...

- # of heads in M             679       726         678           674         670        786         - en-de              I’ve never seen such a beautiful sunset.

  Accuracy (↑)

- Original                    0.00      0.13        0.00          0.07        0.07       0.00

                                                                                                     Qwen2.51.5B-inst

                                                                                                     - en-zh              我从未见过如此美丽的日落。

                                                                                                                                                                                                    (a) w/ M

- w/ instruction              0.91      0.66        1.00          0.75        0.79       0.99        - en-fr              Je n’ai jamais vu un coucher de soleil aussi beau.

- w/ M                        0.80      0.66        0.99          0.76        0.79       0.97        - en-es              He nunca había visto un solsticio tan hermoso.

- w/ M of Llama3.18B-inst     0.00      0.11        0.06          0.35        0.37       0.43        - en-de              I can’t say I’ve ever witnessed one like that before.

                                                                                                     Qwen2.53B-inst

                                                                                                     - en-zh              我从没见过如此美丽的日落。

                                                                                                     - en-fr              J’ai jamais vu un tel coucher de soleil si beau.

Table 3. Accuracy of 6 representative simple tasks in the 5-shot                                     - en-es              Nunca había visto una puesta de sol tan hermosa.

                                                                                                     - en-de              Ich habe nie so ein wunderschönes Sonnenuntergang gesehen.

scenario on Llama3.18B-inst . Italic indicates that the correspond-                                                                                                                                (b) w/ inst

ing task is not included in the hybrid dataset (unseen during the

training).                                                                                           Table 5. Jaccard similarities of head masks on 12 tasks between

                                                                                                     Llama3.18B-inst and Llama3.18B . “Random” calculates the math

                            senti-    anto-    capitalize      product-    conll2003   fruit v       expectation of Jaccard similarity on two randomly shuffled masks.

        Method

                            ment      nym      first letter    company      location   animal

Original, 5-shot            0.96      0.56        0.95           0.77        0.61       0.98            Task             en-zh             en-fr            en-es            en-de               en-ru   en-ar

w/ instruction, 5-shot      0.97      0.67        1.00           0.84        0.72       1.00

w/ M, 5-shot                0.99      0.73        0.99           0.88        0.95       1.00         Similarity           0.766            0.766            0.797            0.802               0.740   0.762

w/ M of hybrid, 5-shot      0.98      0.69        1.00           0.88        0.82       1.00          Random              0.675            0.687            0.679            0.693               0.656   0.680



                                                                                                                                                         capitalize        product-        conll2003     fruit v

                                                                                                        Task            sentiment       antonym

                                                                                                                                                         first letter      company          location     animal

tion examples of four translation pairs on Qwen2.5 series.                                           Similarity           0.591            0.707            0.612            0.634               0.615   0.707

Smaller models suffer from difficulties in triggering target                                          Random              0.531            0.610            0.545            0.533               0.547   0.649

functionality (e.g. Qwen2.50.5B-inst on en-es directly takes

the input as instruction), aligning to the target language                                           This makes us believe that the pre-trained models have al-

(e.g. Qwen2.50.5B-inst on en-de), and accurately translating                                         ready learned some task-related knowledge in the attention

the sentence. From the perspective of attention heads, as                                            heads during the next-token prediction pre-training. As

larger models usually have more attention heads, there are                                           swapping the head masks can also trigger certain function-

more combinations of heads available to correspond to more                                           alities in some cases, we further investigate the similarity

functionalities. On the other hand, Qwen2.50.5B-inst and                                             of the selected attention heads between the pre-trained and

Qwen2.51.5B-inst have the same amount of attention heads,                                            instruction models. For two masks of Llama3.18B-inst and

but the latter has larger hidden size and more parameters                                            Llama3.18B on the same task, we calculate the Jaccard sim-

in FFN layers, which may work better to process the func-                                            ilarity of the selected attention heads. Table 5 shows that

tionality from incomplete MHA output. A more illustrative                                            the mask similarity is generally higher than the random

example is shown in Table 4a and 4b, where we probe                                                  expectation, but still lower than identical 1.0, as masks of

the last layer’s output logits on the last token of the input.                                       the instruction model tend to use more heads. We suppose

When using the head mask of the translation task en-de,                                              that the instruction model inherits most of the attention

Qwen2.50.5B-inst takes “I” as the top-1 token, but German                                            head functionalities from the pre-trained model, and also

words “Es” (It), the expected “Ich” (I) and Russian “Я” (I)                                          introduces new functionalities that are not present in the

are also in top tokens. In contrast, with the explicit instruc-                                      pre-trained model during the instruction fine-tuning.

tion, the model can correctly predict the token “Ich” as the

top-1 token. This suggests that the small models may have

difficulty in distinguishing and triggering the functions of                                         4. Attention Head Selection Forms Functional

different attention heads.                                                                              Pathways

Pre-trained models also possess functionalities Even                                                 In this section, we further investigate how the combination

though pretrained models (base models without instruction                                            of selected attention heads triggers the task functionality

fine-tuning) generally perform worse than instruction fine-                                          in the LLM. We first define the functional pathway as a

tuned models on both types of tasks, we observe that they                                            group of interdependent attention heads that work together

still exhibit certain functionalities, especially in simple tasks.                                   to enable specific functionalities. In the following experi-



                                                                                                 5


=== PDF PAGE 6 ===
                            Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking

               0                                                                                                That          # of removed    Generated outputs

                                                                                                                It                       0    That’s quite a surprise! Llamas are not typically found in backyards, so it’s

                                                                                                                L

             500                                                                                                I

                                                                                                                                         1    That’s quite a surprise! Llamas are not typically found in backyards, so it’s

                                                                                                                                        ...   ...

                                                                                                                However

                                                                                                                                      158     What a lovely scene! It sounds like you’re enjoying a peaceful moment in your backyard.

         1000                                                                                                                         159     You see a llama sleeping in your backyard.

                                                                                                                                      160     You see a llama sleeping in your backyard.

                                                                                                                                      161     You see a llama sleeping in your backyard.

         1500

Token rank









                                                                                                                                      162     我在我的后院看到一只睡觉的羊驼。(I see a sleeping llama in my backyard.)

                                                                                                                                        ...   ...

         2000                                                                                                                         399     我在后院看到一只睡着的羊。(I see an asleep sheep in the backyard.)

                                                                                                                                      400     I see a llama sleeping in my backyard.

                                                                                                                                      450     I see a llama sleeping in my backyard.

         2500                                                                                                                         451     我看到我后院里睡着的山羊。(I see the asleep goat in my backyard.)

                                                                                                                                        ...   ...

                                                                                                                                      527     我看到一只睡觉的羊在后院里。(I see a sleeping sheep in the backyard.)

         3000

                                                                                                                                      528     我看到一只睡觉的山上的山上睡觉。(I see a sleeping on the mountain sleeping on the mountain.)

                                                                                                                                      650     我看到了我的后院里看到了我的后院里看到了我的后后后后 (I see in my backyard see in my backyard see my back back)

         3500                                                                                                                         651     我看到我家里看到我家里里里里里里里里里里里里 (I see in my house see in my house in in in in)

                                                                                                                                      659     I see a see a see a see a see a see a see a see a see a see

                                                                                                                                      715     assistant.assistant.assistant.assistant.assistant.assistant.assistant.assistant.assistant.assistant.

         4000                                                                                                                           ...   ...

                   0   64   128   192   256   320   384   448   512   576   640   704   768   832   896   960   1024

                                                          Removed heads



Figure 2. Prompt Llama3.18B-inst with “I see a 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 “我” (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                                                                       Table 6. PPL of explicit translation tasks from English to other

form such pathways in the model, and disrupting or selec-                                                                      languages when applying different masks on Llama3.18B-inst . We

tively masking these heads significantly alters the model’s                                                                    remove attention heads from the full mask 1 that: “all” - used by

task performance. We further reveal that these heads tend                                                                      all 42 translation tasks, “en” - used by 12 translation tasks related

                                                                                                                               to English, and “unused” - not used by any translation tasks.

to shift the model’s original behavior towards the task func-

tionality, and such a pathway effect is unlikely caused by                                                                      Method                            # of heads       en-zh      en-fr       en-es      en-de       en-ru      en-ar

paying more attention to certain tokens.                                                                                        Instruction                         1024           1.091      0.619       0.550      0.627       0.954      1.303

                                                                                                                                w/ 1\all                             847           4.322      4.129       4.149      4.406       5.008      5.441

Attention heads form critical, interdependent functional                                                                        w/ random 1\all                      847           2.122      0.792       0.864      1.248       1.237      2.578

pathways inside the model We first want to know how                                                                             w/ 1\en                              741           7.029      6.137       6.396      6.511       6.903      7.011

masking certain attention heads can switch the model’s be-                                                                      w/ random 1\en                       741           3.325      1.480       2.136      1.540       2.619      2.972

havior from instruction-following towards task functionality.                                                                   w/ 1\unused                          977           1.064      0.577       0.497      0.585       0.924      1.269

                                                                                                                                w/ random 1\unused                   977           1.112      0.688       0.705      0.603       1.020      1.369

One way to probe the behavior changes is progressively

removing attention heads one by one from the full model.

On model Llama3.18B-inst and the en-zh translation task, we                                                                     Specifically, we observe that when attention heads are re-

start with the attention head that has the minimum weight in                                                                    moved, there are numerous abrupt, drastic changes in token

M, remove heads in the weight ascending order, and check                                                                        ranks. If the attention heads worked independently, then

the changes in the generated responses. As shown in Figure                                                                      firstly removing those heads that significantly promote the

2, the model experiences multiple stages in behaviors:                                                                          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).

             • Stage 1: The model can still preserve the functional-

                                                                                                                                This suggests that the behavior changes are not caused by

               ity as an instruction model, but when approximately

                                                                                                                                removing certain independent attention heads, but are built

               100 attention heads are removed, the rank of the tar-

                                                                                                                                upon the removal of all previously removed attention heads.

               get translation token (red line) experiences a drastic

               increase. This surge indicates that the model’s transla-                                                        Considering such dependency between attention heads, if

               tion functionality begins to emerge.                                                                            we take the selected attention heads as nodes and connect

                                                                                                                               them with edges, then we can get an interdependent func-

             • Stage 2: After removing 158 attention heads, the model

                                                                                                                               tional pathway that influence model behaviors. To verify

               undergoes a rapid transition, and starting from the

                                                                                                                               the impact of such head pathways on model functionality,

               removal of the 162nd head, it shifts from its original

                                                                                                                               we initialize the head weights M with negative values (so

               instruction-following behavior to a translation behavior.

                                                                                                                               that initial σ(M) ≈ 0) when training the mask M. This

               This task functionality begins to dominate, and further

                                                                                                                               approach yields us masks with fewer and more task-specific

               removal of attention heads causes the rankings of initial

                                                                                                                               attention heads while slightly damaging language capability.

               top tokens (blue lines) to drop rapidly.

                                                                                                                               We train these masks on 42 pairs of translation tasks, iden-

             • Stage 3: As more attention heads are removed, after                                                             tify the heads that are commonly used or unused, remove

               528 heads, the model’s language processing ability                                                              these common heads from the model and evaluate PPL on

               begins to lose, and the generated tokens will become                                                            translation tasks. As these common heads are used in every

               meaningless in the end. This is expected as the model                                                           translation task, we can consider them as key components

               has lost the majority of its attention heads.                                                                   of the translation function pathway. Within our expectation,



                                                                                                                          6


=== PDF PAGE 7 ===
                                   Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking

                        1.0

                                                                                                                              illo                                                                                                                                                       Original vs. w/ instruction

                                                                                                                        1.0                                                                                                                                                              w/ vs. w/ instruction

                                                                                                                              illo          'gc 'gc

                                                                                                                                                      'gc                                                                                                                                w/ vs. w/ + instruction









                                                                                        Cosine similarity of layer output

                                                                                                                                                            'gc

                        0.8

                                                                                                                                                                  #ab 'gc                                                                                                           ..    ..   ..   ..

                                                                                                                        0.8                                                 LLU                                                                                            I

                                                                                                                                                                                                                                                                               I                         ..

                                                                                                                                                                                                                                                                                                                     ..

Head weight (sigmoid)









                                                                                                                                     spun                                                                     #__                                      owy          a

                                                                                                                                            'gc 'gc                                                                  _TAC                                    wonderfully

                                                                                                                                                      'gc 'gc kke 'gc             #ad            -*-                        _TAC       zsche

                                                                                                                                                                            kke                        #aa                     ContentSize

                        0.6                                                                                                                                                             ibase

                                                                                                                        0.6

                                                                                                                                                                                  kke            'gc                                -wsj

                                                                                                                                                                                        GetInt                _TAC           rych

                                                                                                                                                                                                                     cocci                 styleType

                                                                                                                                                                                                       koli

                                                                                                                                                                                                                                               unfortunately

                        0.4                                                                                             0.4                                                                                                                         unfortunately                                               that That

                                                                                                                                                                                                                                                             sounds                            it   That that

                                                                                                                                                                                                                                                                  That That               it                                That

                                                                                                                                                                                                                                                                               That it



                                                                                                                                                                                                                                                                                                                                   That

                        0.2                                                                                             0.2





                                                                                                                        0.0

                        0.0

                              0%      10%       20%               30%   40%   50%                                                    0                      4                     8                           12                            16                      20                   24                     28

                                                  Training progress                                                                                                                                                     Layer No.





      Figure 3. Changes of head weights in the mask training progress.                           Figure 4. Cosine similarities of hidden states between different

      Blue lines indicate the heads that are selected in the final mask,                         settings after each layer. Dark lines indicate the outputs of decoder

      and red lines indicate the heads that are not selected. We highlight                       (also FFN) layers and light lines indicate the outputs of attention

      the heads that undergo dependent changes during the training.                              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-                                ure 4. We use three settings for comparison: (Blue) Original

       mance drop on the translation tasks.2 This demonstrates                                    vs. w/ instruction (“Translate into Chinese”), which uses

       that combined attention heads inside the task pathway sig-                                 the same model but different functions; (Red) w/ M vs. w/

       nificantly influences the related functionality of the model.                              instruction, which performs the same function but differs in

                                                                                                  model; and (Green) w/ M vs. w/ M + instruction, which

      We further explain the point that heads inside the task path-

                                                                                                  performs the same function in the same model. Compared

      way do not just independently retain task-related functions.

                                                                                                  with the original model without instructions nor masks, the

      A piece of illustrative evidence in Figure 3 shows that at-

                                                                                                  FFN hidden state outputs of the masked model gain higher

      tention heads in the pathway are dependent on each other,

                                                                                                  similarity with the unmasked instructed model in the later

      where we probe into the changes in head weights during the

                                                                                                  layers. It’s easy to understand that LLM often performs lan-

      mask training. We notice that many unused heads in the

                                                                                                  guage understanding and semantic processing at shallower

      final M initially have been temporarily selected during the

                                                                                                  layers, while more complex task-related inferences are car-

      training (sigmoid weight greater than 0.5), but as more other

                                                                                                  ried out at deeper layers (Bandarkar et al., 2025; Wendler

      heads join the pathway during the training progress, these

                                                                                                  et al., 2024), so consequently the model with M demon-

      heads are eventually ablated from the pathway. A similar

                                                                                                  strates an advantage in similarity only in the latter half of

      phenomenon can be also observed in some heads that are

                                                                                                  the model. Meanwhile, considering the inherent differences

      selected in the final mask, as they are not selected in the

                                                                                                  in the instructions given to the model inputs, even having

      early training stage but are added to the pathway later. From

                                                                                                  the same model perform the same function, the layer out-

      this perspective, such functionality exhibited by the com-

                                                                                                  puts still cannot always maintain a high level of similarity

      bination of attention heads is not independently triggered

                                                                                                  at every layer (green line). Compared with it, the advantage

      by the individual attention heads being combined, but is

                                                                                                  of the masked model over the original model in later layer

      instead triggered through functional pathways formed by

                                                                                                  output similarities indicates that: as the layer goes deeper,

      their interdependence.

                                                                                                  the combined attention heads are attempting to reconstruct

      Attention head masks attempt to reconstruct the task                                        the functional information flow of the model.

      functionality We further investigate why the functional

                                                                                                   In the same scenario depicted in Figure 2, we also calculate

      pathway formed by attention heads can trigger the task func-

                                                                                                   the similarities of layer outputs during this one-by-one head

      tionality without explicit instructions. Intuitively, if the

                                                                                                   removal and present their changes in Figure 5. We find

      output of the model using head mask M on the last token

                                                                                                   that as attention heads are gradually removed, the similarity

      is similar to that of the model with instructions, it can be

                                                                                                   in deeper decoder layers between the masked model and

      considered that the pathway formed by the mask is attempt-

                                                                                                   instructed model increases, and the value becomes stable

      ing to approximate the information flow required to execute

                                                                                                   once the masked model fully exhibits the target translation

      the function. Again, we prompt Llama3.18B-inst with the

                                                                                                   functionality (after removing 192 heads). This increase in

      sentence “I see a llama sleeping in my backyard.”, and cal-

                                                                                                   similarity indicates that the remaining attention heads are

      culate the cosine similarities of layer hidden state outputs

                                                                                                   reconstructing the task functionality during the process of

      between different model and input settings, as shown in Fig-

                                                                                                   unveiling the function pathway. In contrast, the similarity

         2

           Surprisingly, removing unused heads results in slight improve-                          of the shallower layer outputs slightly decreases as more

       ments. This enlightens us to further utilize it in Section 5.                               attention heads are removed. This can be explained since



                                                                                    7


=== PDF PAGE 8 ===
                                                   Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking

                                                                                                         31

                                    1.0                                                                  30

                                                                                                         29

                                                                                                         28               Table 7. Average attention scores of attention heads on the target

                                                                                                         27

Cosine similarity of FFN layer output





                                                                                                         26

                                                                                                         25

                                    0.8                                                                  24

                                                                                                         23

                                                                                                                          word. These tasks require selecting 1 word that differs from the

                                                                                                         22

                                                                                                         21

                                                                                                         20

                                                                                                                          others among 3 words (so the uniform score is 0.33). We calculate

                                    0.6                                                                  19

                                                                                                         18

                                                                                                         17

                                                                                                                          the attention score of each attention head on these words for the









                                                                                                          Layer No.

                                                                                                         16

                                                                                                         15

                                                                                                         14

                                                                                                                          last token of the input, normalize it, and then sum up the attention

                                    0.4                                                                  13

                                                                                                         12

                                                                                                         11

                                                                                                                          on all tokens of the target word as the values below.

                                                                                                         10

                                                                                                         9

                                                                                                         8

                                    0.2                                                                  7                                                 adjective v   object v    verb v     fruit v

                                                                                                         6

                                                                                                         5                Method

                                                                                                         4                                                    verb       concept    adjective   animal

                                                                                                         3

                                                                                                         2

                                    0.0                                                                  1                Original, all heads                0.352        0.306      0.314      0.347

                                                                                                         0

                                          0   32     64   96   128   160   192   224   256   288   320

                                                                Removed heads                                             w/ instruction, all heads          0.409        0.363      0.345      0.468

                                                                                                                          w/ instruction, heads in M         0.408        0.356      0.353      0.462

           Figure 5. Remove attention heads from the full model by weight                                                 w/ instruction, heads in 1 − M     0.413        0.386      0.316      0.494

           ascending order, and the cosine similarities of hidden states be-                                              w/ M, heads in M                   0.462        0.471      0.426      0.566

                                                                                                                          w/ M, heads in 1 − M               0.484        0.537      0.379      0.607

           tween w/ instruction and w/ M after each decoder layer. Darker

           lines indicate later layers (closer to the model output).





             the shallower layers have not yet processed much about                                                       with the previous findings that the selected attention heads

             functionality, and removing attention heads reduces their                                                    are not independently triggering the functionality, but are

             capacity to handle language and semantic processing.                                                         forming pathways to activate the model.



           Attention head mask is not selecting attention scores

           Although the attention head selection involves the model’s                                                     5. Attention Head Selection Potentially

           attention mechanism, we did not explore how this selection                                                        Improves Model Performance

           affects token attention scores in the previous discussion.

                                                                                                                          In Table 6, we notice that removing translation-unrelated

           Normally, in the attention layer, the model attends to the

                                                                                                                          attention heads can decrease the perplexity of the model

           preceding tokens with varying attention scores. However,

                                                                                                                          on the translation task. This suggests that the model may

           since our attention selection is independent of instructions,

                                                                                                                          inherently possess a better ability to perform specific tasks,

           the model’s attention will not focus on nonexistent instruc-

                                                                                                                          but this ability is suppressed by the noise of other attention

           tion tokens. Especially in some simple tasks, the model

                                                                                                                          heads outside the pathway to better handle a broader range

           input is just a single token, and there is little space for the

                                                                                                                          of tasks. To measure the influence of unselected heads

           attention mechanism to work around. From this perspective,

                                                                                                                          to the task, we introduce a scaling factor α ∈ [0, 1] on

           such functionality is unlikely caused by simply selecting

                                                                                                                          the outputs of attention heads outside M, and in this case

           attention heads that are more focused on the target.

                                                                                                                          the head mask can be written as M = I(σ(M) ≥ 0.5) +

           We verify this hypothesis by calculating the average atten-                                                    αI(σ(M) < 0.5). We conduct a grid search on 6 explicitly

           tion score distribution of heads on 4 extractive simple tasks                                                  instructed translation tasks of XNLI with Llama3.18B-inst .

           on Llama3.18B-inst as they have explicit target tokens in the                                                  As shown in Figure 6, it can be observed that using masks

           inputs. The input to these tasks is a set of words, and the                                                    to remove attention heads outside the pathway (α = 0)

           objective is to extract the target one that is different from the                                              consistently results in lower PPL than using all attention

           others. As shown in Table 7, for the original model without                                                    heads (α = 1). Meanwhile, this scaling method is not

           task instructions, the model does not pay significant atten-                                                   a simple linear interpolation between the full model and

           tion to the target word, and as expected, the instructed model                                                 the zero-masked model, but a convex combination of the

           has higher attention scores on the target word. However, if                                                    two: using a small α around 0.2 or 0.3 can achieve a lower

           we separately calculate the average attention scores of heads                                                  PPL. To further verify the performance improvement of the

           in and out of the task mask M, we find that the selected at-                                                   model in the generation scenario, we conduct evaluations

           tention heads do not necessarily have higher attention scores                                                  using the additional translation dataset IWSLT2017 (Cettolo

           (even lower in 3 out of 4 tasks) on the target word. This                                                      et al., 2017). Under the condition of providing the same

           indicates that the head selection is not based on the attention                                                translation instructions, we compare the score differences

           scores of the instructed model. Even in the masked model,                                                      between the original model and the model with the scaled

           attentions to the target word are further promoted, but the                                                    M applied. As shown in Table 8, using M consistently

           unused heads still have high attention scores on the target                                                    improves the model’s BLEU scores on these translation

           word, notwithstanding they are not involved in the model                                                       tasks, and applying a small scaler α can offer further slight

           inference. Such anomaly in attention scores suggests that                                                      enhancements. From this perspective, selecting attention

           the selection of attention heads functions more as influenc-                                                   heads can better showcase the model’s inherent but hindered

           ing the overall behavior of the model. This is consistent                                                      capabilities, potentially improving its performance.



                                                                                                                      8


=== PDF PAGE 9 ===
                                  Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking

                           1.1

                                                                                                                    References

                           1.0

                                                                                                                    AdinaTru. Discover the new multi-lingual, high-quality

                           0.9

                                                                                                                      phi-3.5 slms, August 2024. URL https://aka.ms/

     PPL with respective







                                                                                                                      phi3.5-techblog.

                           0.8



                                                                                                                    Bandarkar, L., Muller, B., Yuvraj, P., Hou, R., Singhal,

                           0.7                                                                                        N., Lv, H., and Liu, B. Layer swapping for zero-shot

                                                                                                                      cross-lingual transfer in large language models. In The

                           0.6

                                                                                                                      Thirteenth International Conference on Learning Rep-

                                                                       en_zh         en_fr           en_de

                           0.5                                         zh_en         fr_en           de_en            resentations, ICLR 2025, Singapore, April 24-28, 2025.

                                 0.0   0.1   0.2   0.3   0.4   0.5    0.6      0.7   0.8       0.9    1.0             OpenReview.net, 2025. URL https://openreview.

                                                         Scaling factor

                                                                                                                      net/forum?id=vQhn4wrQ6j.

Figure 6. PPL of translation tasks when using both explicit instruc-

                                                                                                                    Béna, G. and Goodman, D. F. Dynamics of specialization

tions and task masks, with different scaling factors α. Mark “×”

points to the PPL of the model without instructions.                                                                  in neural modules under resource constraints. Nature

                                                                                                                      Communications, 16(1):187, 2025.



Table 8. BLEU scores for explicitly instructed translation pairs on                                                 Bertolero, M. A., Yeo, B. T., and D’Esposito, M. The

IWSLT2017. Each scaled translation pair uses its own mask with                                                        modular and integrative functional architecture of the

the best scaling factor α shown in Figure 6.                                                                          human brain. Proceedings of the National Academy of

                                                                                                                      Sciences, 112(49):E6798–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.,

   w/ M                                  0.347     0.716       0.674        0.610          0.743        0.720         Stüker, S., Sudoh, K., Yoshino, K., and Federmann,

   w/ scaled M                           0.349     0.717       0.678        0.611          0.743        0.719

                                                                                                                      C. Overview of the IWSLT 2017 evaluation cam-

                                                                                                                      paign. In Proceedings of the 14th International Con-

6. Conclusion                                                                                                         ference on Spoken Language Translation, pp. 2–14,

                                                                                                                      Tokyo, Japan, December 14-15 2017. International Work-

In this paper, we discover that LLMs can directly exhibit                                                             shop on Spoken Language Translation. URL https:

functionality solely through combining attention heads, and                                                           //aclanthology.org/2017.iwslt-1.1.

we propose a simple method to identify intrinsic functional

pathways within the model. By focusing on the model’s                                                               Conneau, A., Rinott, R., Lample, G., Williams, A., Bowman,

inherent functionality, we conduct a detailed investigation                                                           S. R., Schwenk, H., and Stoyanov, V. Xnli: Evaluating

into its mechanisms, contributing to the interpretability of                                                          cross-lingual sentence representations. In Proceedings

attention heads and the phenomenon of functional parti-                                                               of the 2018 Conference on Empirical Methods in Natu-

tioning in LLMs. In the future, we plan to extend similar                                                             ral Language Processing. Association for Computational

research to structures such as FFNs and MoE models with                                                               Linguistics, 2018.

the expectation of constructing a comprehensive functional

                                                                                                                    Csordás, R., van Steenkiste, S., and Schmidhuber, J. Are

pathway for the model.

                                                                                                                      neural nets modular? inspecting functional modularity

                                                                                                                      through differentiable weight masks. In 9th International

Acknowledgments                                                                                                       Conference on Learning Representations, ICLR 2021,

                                                                                                                      Virtual Event, Austria, May 3-7, 2021. OpenReview.net,

This work is funded by the China NSFC Projects (92370206,

                                                                                                                      2021. URL https://openreview.net/forum?

U23B2057, 62120106006) and Shanghai Municipal Science

                                                                                                                      id=7uVcpu-gMD.

and Technology Major Project (2021SHZDZX0102).

                                                                                                                    Dalvi, F., Durrani, N., Sajjad, H., Belinkov, Y., Bau, A.,

Impact Statement                                                                                                      and Glass, J. What is one grain of sand in the desert?

                                                                                                                      analyzing individual neurons in deep nlp models. In

This paper advances the interpretability of large language                                                            Proceedings of the AAAI Conference on Artificial Intelli-

models, aiming to make their internal reasoning processes                                                             gence, volume 33, pp. 6309–6317, 2019.

more transparent and understandable to users and develop-

ers. By improving interpretability, we contribute to more                                                           Diez, I., Bonifazi, P., Escudero, I., Mateos, B., Muñoz,

accountable and trustworthy AI systems. There are other                                                               M. A., Stramaglia, S., and Cortes, J. M. A novel brain

many potential societal consequences of our work, none                                                                partition highlights the modular skeleton shared by struc-

which we feel must be specifically highlighted here.                                                                  ture and function. Scientific reports, 5(1):10532, 2015.



                                                                                                                9


=== PDF PAGE 10 ===
            Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking



Dubey, A., Jauhri, A., Pandey, A., Kadian, A., Al-Dahle,              Jo, J.-y. and Myaeng, S.-H. Roles and utilization of attention

 A., Letman, A., Mathur, A., Schelten, A., Yang, A., Fan,                heads in transformer-based neural language models. In

 A., et al. The llama 3 herd of models. arXiv preprint                  Jurafsky, D., Chai, J., Schluter, N., and Tetreault, J. (eds.),

  arXiv:2407.21783, 2024.                                               Proceedings of the 58th Annual Meeting of the Associa-

                                                                         tion for Computational Linguistics, pp. 3404–3417, On-

Elhelo, A. and Geva, M. Inferring functionality of at-                   line, July 2020. Association for Computational Linguis-

  tention heads from their parameters. arXiv preprint                    tics. doi: 10.18653/v1/2020.acl-main.311. URL https:

  arXiv:2412.11965, 2024.                                               //aclanthology.org/2020.acl-main.311/.



Fang, G., Yin, H., Muralidharan, S., Heinrich, G., Pool,              Lin, C.-Y. ROUGE: A package for automatic evalua-

  J., Kautz, J., Molchanov, P., and Wang, X. Maskllm:                   tion of summaries. In Text Summarization Branches

  Learnable semi-structured sparsity for large language                 Out, pp. 74–81, Barcelona, Spain, July 2004. Asso-

  models. arXiv preprint arXiv:2409.17481, 2024.                        ciation for Computational Linguistics. URL https:

                                                                        //aclanthology.org/W04-1013.

Feng, Z., Zhou, H., Mao, K., and Zhu, Z. FreeCtrl: Con-               Men, X., Xu, M., Zhang, Q., Wang, B., Lin, H., Lu, Y., Han,

  structing control centers with feedforward layers for                X., and Chen, W. Shortgpt: Layers in large language mod-

  learning-free controllable text generation. In Ku, L.-W.,            els are more redundant than you expect. arXiv preprint

  Martins, A., and Srikumar, V. (eds.), Proceedings of the             arXiv:2403.03853, 2024.

  62nd Annual Meeting of the Association for Computa-

  tional Linguistics (Volume 1: Long Papers), pp. 7627–               Panigrahi, A., Saunshi, N., Zhao, H., and Arora, S. Task-

  7640, Bangkok, Thailand, August 2024. Association                     specific skill localization in fine-tuned language models.

  for Computational Linguistics. doi: 10.18653/v1/2024.                 In Proceedings of the 40th International Conference on

  acl-long.412. URL https://aclanthology.org/                           Machine Learning, ICML’23. JMLR.org, 2023.

  2024.acl-long.412.

                                                                      Rai, D. and Yao, Z. An investigation of neuron activation as

                                                                        a unified lens to explain chain-of-thought eliciting arith-

Geva, M., Schuster, R., Berant, J., and Levy, O. Trans-

                                                                        metic reasoning of LLMs. In Ku, L.-W., Martins, A., and

  former feed-forward layers are key-value memories.

                                                                        Srikumar, V. (eds.), Proceedings of the 62nd Annual Meet-

  In Moens, M.-F., Huang, X., Specia, L., and Yih, S.

                                                                        ing of the Association for Computational Linguistics (Vol-

  W.-t. (eds.), Proceedings of the 2021 Conference on

                                                                        ume 1: Long Papers), pp. 7174–7193, Bangkok, Thailand,

  Empirical Methods in Natural Language Processing,

                                                                        August 2024. Association for Computational Linguis-

  pp. 5484–5495, Online and Punta Cana, Dominican

                                                                        tics. doi: 10.18653/v1/2024.acl-long.387. URL https:

  Republic, November 2021. Association for Computa-

                                                                        //aclanthology.org/2024.acl-long.387.

  tional Linguistics. doi: 10.18653/v1/2021.emnlp-main.

  446. URL https://aclanthology.org/2021.                             Tan, S., Wu, D., and Monz, C. Neuron specialization:

  emnlp-main.446/.                                                      Leveraging intrinsic task modularity for multilingual ma-

                                                                        chine translation. In Al-Onaizan, Y., Bansal, M., and

Gumbel, E. J. Statistical theory of extreme values and some             Chen, Y.-N. (eds.), Proceedings of the 2024 Conference

  practical applications: a series of lectures, volume 33.              on Empirical Methods in Natural Language Process-

  US Government Printing Office, 1954.                                  ing, pp. 6506–6527, Miami, Florida, USA, November

                                                                        2024. Association for Computational Linguistics. doi:

Jiang, A. Q., Sablayrolles, A., Mensch, A., Bamford, C.,                10.18653/v1/2024.emnlp-main.374. URL https://

   Chaplot, D. S., Casas, D. d. l., Bressand, F., Lengyel, G.,          aclanthology.org/2024.emnlp-main.374.

   Lample, G., Saulnier, L., et al. Mistral 7b. arXiv preprint

   arXiv:2310.06825, 2023.                                            Team, G. Gemma. 2024a. doi: 10.34740/KAGGLE/M/3301.

                                                                        URL https://www.kaggle.com/m/3301.

Jin, Z., Cao, P., Yuan, H., Chen, Y., Xu, J., Li, H., Jiang, X.,

                                                                      Team, Q. Qwen2.5: A party of foundation models, Septem-

   Liu, K., and Zhao, J. Cutting off the head ends the conflict:

                                                                        ber 2024b. URL https://qwenlm.github.io/

   A mechanism for interpreting and mitigating knowledge

                                                                        blog/qwen2.5/.

   conflicts in language models. In Ku, L.-W., Martins,

   A., and Srikumar, V. (eds.), Findings of the Association           Todd, E., Li, M. L., Sharma, A. S., Mueller, A., Wallace,

   for Computational Linguistics: ACL 2024, pp. 1193–                   B. C., and Bau, D. Function vectors in large language

   1215, Bangkok, Thailand, August 2024. Association                    models. In The Twelfth International Conference on

   for Computational Linguistics. doi: 10.18653/v1/2024.                Learning Representations, ICLR 2024, Vienna, Austria,

   findings-acl.70. URL https://aclanthology.                           May 7-11, 2024. OpenReview.net, 2024. URL https:

   org/2024.findings-acl.70.                                            //openreview.net/forum?id=AwyxtyMwaG.



                                                                 10


=== PDF PAGE 11 ===
           Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking



Tufanov, I., Hambardzumyan, K., Ferrando, J., and Voita, E.          Xiao, C., Zhang, Z., Song, C., Jiang, D., Yao, F., Han, X.,

  LM transparency tool: Interactive tool for analyzing trans-          Wang, X., Wang, S., Huang, Y., Lin, G., et al. Config-

  former language models. In Cao, Y., Feng, Y., and Xiong,             urable foundation models: Building llms from a modular

  D. (eds.), Proceedings of the 62nd Annual Meeting of                 perspective. arXiv preprint arXiv:2409.02877, 2024.

  the Association for Computational Linguistics (Volume 3:

  System Demonstrations), pp. 51–60, Bangkok, Thailand,              Xu, H., Zhan, R., Ma, Y., Wong, D. F., and Chao, L. S. Let‘s

  August 2024. Association for Computational Linguis-                  focus on neuron: Neuron-level supervised fine-tuning for

  tics. doi: 10.18653/v1/2024.acl-demos.6. URL https:                  large language model. In Rambow, O., Wanner, L., Apid-

  //aclanthology.org/2024.acl-demos.6.                                 ianaki, M., Al-Khalifa, H., Eugenio, B. D., and Schock-

                                                                       aert, S. (eds.), Proceedings of the 31st International Con-

Vaswani, A. Attention is all you need. Advances in Neural              ference on Computational Linguistics, pp. 9393–9406,

  Information Processing Systems, 2017.                                Abu Dhabi, UAE, January 2025. Association for Compu-

                                                                       tational Linguistics. URL https://aclanthology.

Wendler, C., Veselovsky, V., Monea, G., and West, R. Do                org/2025.coling-main.630/.

 llamas work in English? on the latent language of multi-

                                                                     Yao, Y., Zhang, N., Xi, Z., Wang, M., Xu, Z., Deng, S., and

 lingual transformers. In Ku, L.-W., Martins, A., and Sriku-

                                                                       Chen, H. Knowledge circuits in pretrained transformers.

 mar, V. (eds.), Proceedings of the 62nd Annual Meeting

                                                                       CoRR, abs/2405.17969, 2024. doi: 10.48550/ARXIV.

 of the Association for Computational Linguistics (Volume

                                                                       2405.17969. URL https://doi.org/10.48550/

 1: Long Papers), pp. 15366–15394, Bangkok, Thailand,

                                                                       arXiv.2405.17969.

 August 2024. Association for Computational Linguis-

 tics. doi: 10.18653/v1/2024.acl-long.820. URL https:                Yin, F., Ye, X., and Durrett, G. Lofit: Localized fine-tuning

 //aclanthology.org/2024.acl-long.820.                                 on LLM representations. In The Thirty-eighth Annual

                                                                       Conference on Neural Information Processing Systems,

Wig, G. S. Segregated systems of human brain networks.                 2024. URL https://openreview.net/forum?

 Trends in cognitive sciences, 21(12):981–996, 2017.                   id=dfiXFbECSZ.

Wu, M., Liu, W., Wang, X., Li, T., Lv, C., Ling, Z., Jian-           Zeng, H., Han, S., Chen, L., and Yu, K. Converging to a

 Hao, Z., Zhang, C., Zheng, X., and Huang, X. Advanc-                  lingua franca: Evolution of linguistic regions and seman-

 ing parameter efficiency in fine-tuning via representa-               tics alignment in multilingual large language models. In

 tion editing. In Ku, L.-W., Martins, A., and Srikumar,                Rambow, O., Wanner, L., Apidianaki, M., Al-Khalifa,

 V. (eds.), Proceedings of the 62nd Annual Meeting of                  H., Eugenio, B. D., and Schockaert, S. (eds.), Proceed-

 the Association for Computational Linguistics (Volume                 ings of the 31st International Conference on Computa-

 1: Long Papers), pp. 13445–13464, Bangkok, Thailand,                  tional Linguistics, pp. 10602–10617, Abu Dhabi, UAE,

 August 2024a. Association for Computational Linguis-                  January 2025. Association for Computational Linguis-

 tics. doi: 10.18653/v1/2024.acl-long.726. URL https:                  tics. URL https://aclanthology.org/2025.

 //aclanthology.org/2024.acl-long.726.                                 coling-main.707/.



Wu, W., Wang, Y., Xiao, G., Peng, H., and Fu, Y. Re-                 Zhang, Z., Zhao, J., Zhang, Q., Gui, T., and Huang, X. Un-

 trieval head mechanistically explains long-context fac-               veiling linguistic regions in large language models. In

 tuality. In The Thirteenth International Conference on                Ku, L.-W., Martins, A., and Srikumar, V. (eds.), Proceed-

 Learning Representations, ICLR 2025, Singapore, April                 ings of the 62nd Annual Meeting of the Association for

 24-28, 2025. OpenReview.net, 2025. URL https:                         Computational Linguistics (Volume 1: Long Papers), pp.

 //openreview.net/forum?id=EytBpUGB1Z.                                 6228–6247, Bangkok, Thailand, August 2024. Associa-

                                                                       tion for Computational Linguistics. doi: 10.18653/v1/

Wu, X., Yao, W., Chen, J., Pan, X., Wang, X., Liu, N., and             2024.acl-long.338. URL https://aclanthology.

 Yu, D. From language modeling to instruction following:               org/2024.acl-long.338.

 Understanding the behavior shift in LLMs after instruc-

 tion tuning. In Duh, K., Gomez, H., and Bethard, S.                 Zheng, Z., Wang, Y., Huang, Y., Song, S., Yang, M., Tang,

 (eds.), Proceedings of the 2024 Conference of the North               B., Xiong, F., and Li, Z. Attention heads of large language

 American Chapter of the Association for Computational                 models: A survey. arXiv preprint arXiv:2409.03752,

 Linguistics: Human Language Technologies (Volume 1:                   2024.

 Long Papers), pp. 2341–2369, Mexico City, Mexico,

 June 2024b. Association for Computational Linguistics.

 doi: 10.18653/v1/2024.naacl-long.130. URL https://

 aclanthology.org/2024.naacl-long.130.



                                                                11


=== PDF PAGE 12 ===
            Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking



A. Models & Datasets

                                                                      Table 9. LLMs used in this paper. We mainly report their attention

In this section, we introduce the models and datasets used            layer configurations.

in our experiments. Models are selected from various open-            Model name                 Notation           Params   Layers   Heads   KV heads   Total heads

sourced LLMs, as listed in Table 9. For translation tasks, we         Llama-3.1-8B-Instruct      Llama3.18B-inst     8.03B    32        32       8          1024

                                                                      Llama-3.1-8B               Llama3.18B          8.03B    32        32       8          1024

use XNLI (Conneau et al., 2018) for training and main eval-           Qwen2.5-0.5B-Instruct      Qwen2.50.5B-inst    494M     24        14        2          336

                                                                      Qwen2.5-1.5B-Instruct      Qwen2.51.5B-inst    1.54B    28        12       2          336

uation, and IWSLT2017 (Cettolo et al., 2017) for additional           Qwen2.5-3B-Instruct        Qwen2.53B-inst      3.09B    36        16       2          576

evaluation in Section 5. XNLI contains 10000 samples for              Qwen2.5-7B-Instruct        Qwen2.57B-inst      7.62B    28        28       4          784

                                                                      Qwen2.5-7B                 Qwen2.57B           7.62B    28        28       4          784

each language pair, and we use 100 samples for evaluation             Qwen2.5-14B-Instruct       Qwen2.514B-inst     14.8B    48        40       8          1920

                                                                      Phi-3.5-mini-instruct      Phi3.5mini-inst     3.82B    32        32       32         1024

and the remaining 9900 for mask training. IWSLT2017                   Mistral-7B-Instruct-v0.3   Mistral7B-inst      7.25B    32        32       8          1024

contains 8549 samples for English-Chinese pair, 8597 sam-

ples for English-French pair, and 8079 samples for English-

German pair. We use all the samples for the evaluation                        alongside the context, which leads to lower ROUGE-L

reported in Table 8. For simple tasks, we choose 35 datasets                  scores. On the other hand, the translation results of

in the Function Vector work by Todd et al. (2024). In each                    masked models are more concentrated on the task and

task, we choose out 100 samples for evaluation, and the                       context words, so the w/ M scores of Qwen2.514B-inst

remaining samples are used for the fixed-step mask training.                  increase significantly compared to the w/ instruction

The details of these datasets and our instruction prompts                     scores (Table 29). This implies that attention heads

(for w/ instruction evaluations) are listed in Table 10.                      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 to relatively low-resource languages

All experiments are conducted on a NVIDIA A800 80GB                         (e.g., translating to Arabic using models smaller than

GPU. We summarize the hyper-parameters used in the mask                     Qwen2.53B-inst ). Theoretically, if a model has more

training in Table 11. In particular, for memory reasons, the                attention heads, then it can form more functional path-

batch size on translation tasks of Qwen2.514B-inst is set to                ways through their combinations. We suggest that this

8 and its training steps are 12370. Other hyper-parameters                  phenomenon of attention heads exhibiting functionality

remain the same. For the evaluation of simple tasks, we                     is better applicable to larger LLMs.

generate 10 new tokens and check whether the response                     • We also test the attention head mask on Gemma 2

contains the correct answer, in case the instruct models may                series (Team, 2024a). While on Gemma29B-inst the

generate some leading words (like “the answer is:”). But                    masked model can also directly elicit the functional-

for some tasks like capitalizing letters and extracting items,              ity, the masked model on Gemma22B-inst fails on all

we only check whether the response starts with the correct                  the translation pairs. We would ascribe this to the

answer. You may check more implementation details in our                    number of attention heads in the model (208 heads

public code repository.                                                     in total, 26 layers and 8 heads for each). Although

                                                                            the model has more parameters than Qwen2.50.5B-inst

C. More Experiment Results                                                  and Qwen2.50.5B-inst , the lack of sufficient granularity

                                                                            prevents it from acquiring a combination of attention

In this section, we provide more experiment results to sup-                 heads that can directly elicit functionalities.

port the findings in the main text.

                                                                      For the attention head masks in pre-trained models, we also

C.1. Full Evaluation Results on All Models                            provide full results (Table 37, 38) as complementary to the

As complementary to the results in Section 3, we provide the          examples in Table 5. Specifically, we calculate the math

full evaluation results on all models in Table 12-35 (transla-        expectation of Jaccard similarity on two randomly shuffled

tion PPL Table 12-21, translation ROUGE-L Table 22-31,                masks (“Random” column) as follows:

simple task accuracy Table 32-35). From these complete                                                              E [|M1 ∩ M2 |]

results, we also find some other phenomena:                           E [Jaccard(M1 , M2 )] =

                                                                                                                    E [|M1 ∪ M2 |]



   • Qwen2.514B-inst does not give the dominant ROUGE-                                                                             |1| |M 1 | |M2 |

                                                                                                                                        |1|    |1|

                                                                                                             =

     L performance in the instructed translation task, al-                                                          E [|M1 | + |M2 | − |M1 ∩ M2 |]

     though it is the largest model in our experiments. We                                                             |M1 ||M2 |

                                                                                                                         |1|

     examine the translation outputs of Qwen2.514B-inst and                                                  =

     Qwen2.57B-inst , finding that the 14B model tends to

                                                                                                                                   ||M2 |

                                                                                                               |M1 | + |M2 | − |M1|1|

     generate more explanation words than the 7B model                                                                                                         (4)



                                                                 12


=== PDF PAGE 13 ===
                   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.\n\nInput:\n\n{input}\n\nOutput:\n\n

     park-country                         749        Identify the country where the given national park is located.\n\nInput:\n\n{input}\n\nOutput:\n\n

     synonym                             2880        Identify a synonym for the given word.\n\nInput:\n\n{input}\n\nOutput:\n\n

                                                     Classify the given news headline into one of the categories: Business, Science, Sports, or World. Provide only the

     ag_news                             7600

                                                     category name.\n\nInput:\n\n{input}\n\nOutput:\n\n

     word_length                          814        Determine the number of letters in the given word and output the count.\n\nInput:\n\n{input}\n\nOutput:\n\n

     present-past                         293        Convert the given verb from its present tense to its simple past tense.\n\nInput:\n\n{input}\n\nOutput:\n\n

     capitalize                           813        Output the given word with its first letter capitalized.\n\nInput:\n\n{input}\n\nOutput:\n\n

     landmark-country                     836        Identify the country where the given landmark is located.\n\nInput:\n\n{input}\n\nOutput:\n\n

     english-german                      5145        Translate the given English word into German.\n\nInput:\n\n{input}\n\nOutput:\n\n

     sentiment                           1167        Determine the sentiment of the given input. Output either ’positive’ or ’negative’.\n\nInput:\n\n{input}\n\nOutput:\n\n

     country-capital                      197        What is the capital of the given country? Provide only the name of the capital.\n\nInput:\n\n{input}\n\nOutput:\n\n

     person-occupation                    821        Identify the occupation of the given individual.\n\nInput:\n\n{input}\n\nOutput:\n\n

     country-currency                     197        What is the official currency of the given country?\n\nInput:\n\n{input}\n\nOutput:\n\n

     lowercase_last_letter                814        Output the last letter of the given word in lowercase.\n\nInput:\n\n{input}\n\nOutput:\n\n

     person-sport                         318        Identify the sport associated with the given individual.\n\nInput:\n\n{input}\n\nOutput:\n\n

     person-instrument                    510        Identify the musical instrument played by the given musician.\n\nInput:\n\n{input}\n\nOutput:\n\n

     antonym                             2398        Identify the antonym of the given word.\n\nInput:\n\n{input}\n\nOutput:\n\n

     capitalize_last_letter               814        Output the last letter of the given word in uppercase.\n\nInput:\n\n{input}\n\nOutput:\n\n

     english-french                      4698        Translate the given English word into French.\n\nInput:\n\n{input}\n\nOutput:\n\n

     next_item                            225        What is the next sequential item following the given input?\n\nInput:\n\n{input}\n\nOutput:\n\n

     singular-plural                      205        Provide the plural form of the given singular noun.\n\nInput:\n\n{input}\n\nOutput:\n\n

     capitalize_second_letter             787        Output the second letter of the given word in uppercase.\n\nInput:\n\n{input}\n\nOutput:\n\n

     prev_item                            225        What is the item that comes before the given input in a sequential context?\n\nInput:\n\n{input}\n\nOutput:\n\n

     capitalize_first_letter              813        Output the first letter of the given word in uppercase.\n\nInput:\n\n{input}\n\nOutput:\n\n

     english-spanish                     5199        Translate the given English word into Spanish.\n\nInput:\n\n{input}\n\nOutput:\n\n

     next_capital_letter                  814        What is the next uppercase letter in alphabetical order after the given input?\n\nInput:\n\n{input}\n\nOutput:\n\n

     national_parks                       451        Identify the U.S. state where the given national park is located.\n\nInput:\n\n{input}\n\nOutput:\n\n

     product-company                      522        Identify the company associated with the given product.\n\nInput:\n\n{input}\n\nOutput:\n\n

     conll2003_organization              3843        Extract the organization mentioned in the given text.\n\nInput:\n\n{input}\n\nOutput:\n\n

     conll2003_person                    3544        Extract the name of the person mentioned in the given text.\n\nInput:\n\n{input}\n\nOutput:\n\n

     conll2003_location                  4499        Extract the location mentioned in the given text.\n\nInput:\n\n{input}\n\nOutput:\n\n

     adjective_v_verb_3                  1000        From the given words, identify the one that is an adjective.\n\nInput:\n\n{input}\n\nOutput:\n\n

     object_v_concept_3                  1000        From the given words, identify the one that is a object.\n\nInput:\n\n{input}\n\nOutput:\n\n

     verb_v_adjective_3                  1000        From the given words, identify the one that is a verb.\n\nInput:\n\n{input}\n\nOutput:\n\n

     fruit_v_animal_3                    1000        From the given words, identify the one that is a fruit.\n\nInput:\n\n{input}\n\nOutput:\n\n







                                                                                                          C.2. Visualization of Attention Head Masks

        Table 11. Hyper-parameters used in the mask training.

Hyper-parameter                          Translation task                   Simple task

                                                                                                          We illustrate the attention head mask weight σ(M) for all

Mask weight M initialize                     N (4, 0.02)                      N (4, 0.02)

                                                                                                          42 translation pairs on Llama3.18B-inst in Figure 7. From

- Negative initialize in Table 6            N (−3, 0.02)                     N (−3, 0.02)                 this we can draw some intuitive conclusions: (1) The re-

Batch size                                        16                               16

Train epochs                                      10                                −                     moved attention heads do not exhibit a clear distribution

Train steps                                      6190                             6250

Learning rate                      [1e-2, 1e-4], cosine scheduler   [1e-2, 1e-4], cosine scheduler

                                                                                                          pattern across the layers of the model. Heads used in the

Warmup ratio                                      0.1                              0.1                    latter half of the model are only slightly more than those

Gumbel temperature τ                 [4, 0.05], linear scheduler      [4, 0.05], linear scheduler

- τ decrease ratio                                0.4                              0.4                    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-following func-

                                                                                                          tionality to translation functionality, the removed functional

                                                                                                          components are unlikely to be located in the KV heads.

where |M| is the number of selected heads in the mask M,                                                  This is because Llama3.18B-inst features a grouped structure

and |1| (full mask) is the total number of heads in the model.                                            for attention heads (divided into 8 groups of 8 KV heads

As the selected heads in the instruction model are always                                                 each, with each group containing 4 Q heads). If the original

more than the pre-trained model, we also calculate the recall                                             functionality rely on KV heads, the corresponding group

rate on the masks of instruction models. These high recall                                                of heads would consistently go unused. However, this pat-

rates across tasks indicate that the attention head masks can                                             tern of all 4 attention heads in a row being unused is not

be largely inherited from the pre-trained models, therefore                                               evident in the figure. This suggests that such functionality

such functionalities probably have been already learned in                                                is more likely distributed in the Q heads or O heads (the

the pre-training stage.                                                                                   corresponding parts of the projection matrix WO ).



                                                                                                     13


=== PDF PAGE 14 ===
               Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking









Table 12. XNLI translation perplexity (PPL) on Llama3.18B-inst .              Table 13. XNLI translation perplexity (PPL) on Llama3.18B .



                                Original                                                                     Original

         To                                                                           To

               en      zh        fr        es     de      ru      ar                        en      zh        fr        es     de      ru      ar

From                                                                          From

    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

    ar        2.720   3.668     2.318    2.662   2.608   2.591     −             ar        2.201   2.914     2.053    2.312   2.340   2.282     −



                              w/ instruction                                                               w/ instruction

         To                                                                           To

               en      zh        fr        es     de      ru      ar                        en      zh        fr        es     de      ru      ar

From                                                                          From

    en          −     1.091     0.619    0.550   0.627   0.954   1.303           en          −     1.901     1.240    1.350   1.258   1.573   1.945

    zh        1.003     −       0.945    0.988   1.109   1.233   1.645           zh        1.542     −       1.492    1.658   1.621   1.685   2.183

    fr        0.756   1.342       −      0.825   0.912   1.090   1.486           fr        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

    ru        1.096   1.555     0.973    1.040   1.073     −     1.701           ru        1.902   2.279     1.624    1.862   1.773     −     2.294

    ar        1.218   1.691     1.167    1.230   1.274   1.397     −             ar        1.867   2.410     1.754    1.942   1.908   1.961     −



                              w/ random M                                                                  w/ random M

         To                                                                           To

               en      zh        fr        es     de      ru      ar                        en      zh        fr        es     de      ru      ar

From                                                                          From

    en          −     2.909     2.370    2.762   2.482   2.677   3.204           en          −     2.703     2.329    2.337   2.133   2.377   3.251

    zh        2.250     −       2.208    2.745   2.257   2.791   3.320           zh        2.041     −       2.578    2.699   2.934   2.912   3.753

    fr        2.645   3.268       −      2.838   2.138   3.039   2.929           fr        1.727   2.875       −      3.190   2.407   2.187   2.916

    es        2.187   3.039     2.629      −     2.257   2.383   3.024           es        2.221   2.630     1.849      −     2.841   2.115   3.179

    de        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     −



                                  w/ M                                                                         w/ M

         To                                                                           To

               en      zh        fr        es     de      ru      ar                        en      zh        fr        es     de      ru      ar

From                                                                          From

    en          −     1.017     0.552    0.504   0.580   1.055   1.322           en          −     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.087     −       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

    es        0.551   1.177     0.699      −     0.805   1.076   1.487           es        0.623   1.336     0.800      −     0.911   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

    ar        1.175   1.657     1.131    1.211   1.286   1.464     −             ar        1.275   1.810     1.294    1.324   1.404   1.506     −



                        w/ M of Llama3.18B                                                          w/ M of Llama3.18B-inst

         To                                                                           To

               en      zh        fr        es     de      ru      ar                        en      zh        fr        es     de      ru      ar

From                                                                          From

    en          −     1.017     0.552    0.504   0.580   1.055   1.322           en          −     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

    fr        0.735   1.314       −      0.805   0.909   1.098   1.504           fr        1.312   2.051       −      1.742   1.589   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

    ru        1.070   1.486     0.927    1.032   1.073     −     1.697           ru        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


=== PDF PAGE 15 ===
              Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking









Table 14. XNLI translation perplexity (PPL) on Qwen2.57B-inst .              Table 15. XNLI translation perplexity (PPL) on Qwen2.57B .



                               Original                                                                      Original

        To                                                                           To

              en      zh        fr        es    de      ru       ar                        en      zh          fr       es     de      ru      ar

From                                                                         From

   en          −     5.481    3.268   3.466    3.171   3.109    3.925           en          −     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           zh        1.855     −        2.010    2.220   2.131   1.985   2.706

   fr        4.178   5.962      −     3.682    3.443   2.884    3.964           fr        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

   ru        4.665   6.459    3.618   4.036    3.611     −      4.600           ru        2.323   3.401      2.212    2.469   2.275     −     2.970

   ar        4.299   5.744    3.239   3.663    3.543   2.891      −             ar        2.193   3.306      2.086    2.361   2.392   2.093     −



                             w/ instruction                                                                w/ instruction

        To                                                                           To

              en      zh        fr        es    de      ru       ar                        en      zh          fr       es     de      ru      ar

From                                                                         From

   en          −     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

   es        1.690   2.504    1.446     −      1.450   1.701    2.257           es        1.262   1.794      1.212      −     1.323   1.415   2.027

   de        1.843   2.879    1.595   1.639      −     1.781    2.372           de        1.451   1.917      1.255    1.273     −     1.462   2.036

   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.103   2.300    2.211   2.144      −             ar        1.783   2.372      1.595    1.661   1.784   1.705     −



                             w/ random M                                                                  w/ random M

        To                                                                           To

              en      zh        fr        es    de      ru       ar                        en      zh          fr       es     de      ru      ar

From                                                                         From

   en          −     4.604    3.523   6.213    4.080   13.644   8.878           en          −      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           zh        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           es        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

   ru        4.078   4.440    5.415   8.665    3.820      −     5.574           ru        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                                                                           To

              en      zh        fr        es    de      ru       ar                        en      zh          fr       es     de      ru      ar

From                                                                         From

   en          −     1.158    0.884   0.708    0.800   1.070    1.720           en          −     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           zh        1.680     −        1.944    2.050   2.116   1.945   2.658

   fr        0.876   1.588      −     1.035    1.147   1.242    2.042           fr        1.819   2.761        −      1.897   1.982   1.837   2.714

   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           ru        2.102   3.162      2.031    2.156   2.139     −     2.262

   ar        1.368   2.068    1.444   1.602    1.582   1.521      −             ar        1.354   2.167      1.483    1.501   1.758   1.517     −



                        w/ M of Qwen2.57B                                                          w/ M of Qwen2.57B-inst

        To                                                                           To

              en      zh        fr        es    de      ru       ar                        en      zh          fr       es     de      ru      ar

From                                                                         From

   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

   es        1.521   2.796    2.101     −      1.775   2.216    3.397           es        1.510   2.631      1.748      −     1.945   1.768   2.690

   de        1.732   2.604    2.052   2.252      −     2.055    3.298           de        1.743   2.883      1.946    1.956     −     1.825   2.786

   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      −             ar        2.050   3.054      2.077    2.288   2.410   2.037     −









                                                                        15


=== PDF PAGE 16 ===
                  Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking





Table 16. XNLI translation perplexity (PPL) on Qwen2.50.5B-inst .                  Table 18. XNLI translation perplexity (PPL) on Qwen2.53B-inst .



                                     Original                                                                          Original

             To                                                                                 To

                    en      zh        fr        es     de      ru      ar                             en      zh        fr        es     de      ru      ar

     From                                                                              From

        en           −     3.045     2.100    2.386   2.545   2.254   3.365                en          −     5.220     2.913    3.295   3.232   3.233   4.116

        zh         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                fr        4.318   6.318       −      4.034   3.663   3.449   4.609

        es         2.505   4.117     2.646      −     3.360   2.579   3.955                es        3.602   5.724     3.351      −     3.539   3.314   4.506

        de         2.727   4.306     2.804    3.361     −     2.723   4.228                de        3.369   5.673     3.153    3.759     −     3.268   4.308

        ru         2.967   4.447     2.709    3.148   3.119     −     4.582                ru        4.658   6.772     3.570    4.193   3.883     −     5.203

        ar         3.511   4.919     3.066    3.493   3.771   3.302     −                  ar        4.576   6.573     3.620    4.081   4.043   3.656     −



                                   w/ instruction                                                                    w/ instruction

             To                                                                                 To

                    en      zh        fr        es     de      ru      ar                             en      zh        fr        es     de      ru      ar

     From                                                                              From

        en           −     1.763     1.021    0.989   1.361   1.485   2.401                en          −     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                zh        2.215     −       1.647    1.682   1.781   1.827   2.516

        fr         1.233   2.325       −      1.369   1.781   1.676   2.596                fr        1.781   2.811       −      1.476   1.604   1.615   2.267

        es         1.142   2.152     1.223      −     1.707   1.640   2.509                es        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         2.268   3.067     2.152    2.364   2.677   2.193     −                  ar        2.737   3.620     2.035    2.110   2.207   2.105     −



                                       w/ M                                                                              w/ M

             To                                                                                 To

                    en      zh        fr        es     de      ru      ar                             en      zh        fr        es     de      ru      ar

     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.121   3.091                zh        1.141     −       1.318    1.336   1.823   1.586   2.380

        fr         1.210   2.358       −      2.047   2.170   1.954   3.038                fr        0.833   1.615       −      1.231   1.463   1.313   1.902

        es         1.113   2.528     1.870      −     2.263   2.569   3.185                es        0.729   1.489     0.901      −     1.345   1.299   1.892

        de         1.328   2.483     2.111    2.322     −     2.030   3.090                de        0.840   1.604     1.102    1.167     −     1.236   1.896

        ru         1.847   2.736     2.534    2.530   2.329     −     3.271                ru        1.261   1.955     1.198    1.356   1.508     −     2.056

        ar         4.174   3.016     2.540    2.638   2.874   2.547     −                  ar        1.457   2.121     1.528    1.748   1.997   1.739     −







Table 17. XNLI translation perplexity (PPL) on Qwen2.51.5B-inst .                  Table 19. XNLI translation perplexity (PPL) on Qwen2.514B-inst .



                                     Original                                                                          Original

             To                                                                                 To

                    en      zh        fr        es     de      ru      ar                             en      zh        fr        es     de      ru      ar

     From                                                                              From

        en           −     2.941     1.919    2.025   2.138   1.984   2.918                en          −     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                fr        6.748   8.296       −      5.653   5.345   4.956   5.438

        es         2.368   4.306     2.518      −     2.903   2.441   3.853                es        6.342   7.958     5.225      −     5.167   4.893   5.328

        de         2.385   4.022     2.572    2.935     −     2.442   3.584                de        5.895   7.858     4.887    5.235     −     4.630   5.148

        ru         3.023   4.627     2.606    3.109   2.833     −     4.093                ru        7.253   8.558     5.587    6.065   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     −



                                   w/ instruction                                                                    w/ instruction

             To                                                                                 To

                    en      zh        fr        es     de      ru      ar                             en      zh        fr        es     de      ru      ar

     From                                                                              From

        en           −     1.545     0.867    0.835   0.984   1.198   1.886                en          −     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                zh        3.805     −       3.081    3.116   3.046   2.919   3.707

        fr         1.303   2.153       −      1.300   1.476   1.472   2.108                fr        3.887   5.032       −      2.736   2.644   2.699   3.296

        es         1.052   1.879     1.081      −     1.324   1.340   2.024                es        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.019   2.718     1.850    2.015   2.170   1.864     −                  ar        4.787   5.923     3.316    3.627   3.227   2.963     −



                                       w/ M                                                                              w/ M

             To                                                                                 To

                    en      zh        fr        es     de      ru      ar                             en      zh        fr        es     de      ru      ar

     From                                                                              From

        en           −     1.354     0.889    0.854   1.086   1.177   2.018                en          −     1.000     0.524    0.440   0.564   0.739   1.195

        zh         1.219     −       1.400    1.616   1.790   1.519   2.480                zh        0.937     −       0.877    0.930   1.052   1.003   1.542

        fr         0.996   2.050       −      1.411   1.516   1.319   2.236                fr        0.791   1.309       −      0.781   0.896   0.902   1.426

        es         0.802   2.109     1.041      −     1.411   1.292   2.134                es        0.590   1.186     0.651      −     0.788   0.828   1.335

        de         0.901   1.872     1.332    1.442     −     1.363   2.290                de        0.665   1.313     0.746    0.744     −     0.877   1.397

        ru         1.763   2.364     1.701    1.716   1.668     −     2.426                ru        1.078   1.550     0.917    0.978   1.047     −     1.561

        ar         1.637   2.472     1.694    1.920   2.080   1.868     −                  ar        1.131   1.648     1.026    1.115   1.186   1.108     −







                                                                              16


=== PDF PAGE 17 ===
                  Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking





Table 20. XNLI translation perplexity (PPL) on Phi3.5mini-inst .



                                     Original                                        Table 22. XNLI translation ROUGE-L on Llama3.18B-inst .

             To

                    en      zh        fr        es     de      ru      ar                                         Original

     From

        en           −     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                      en      zh        fr        es     de      ru      ar

                                                                                   From

        fr         5.627   4.046       −      4.893   5.054   4.606   2.479

        es         5.673   3.992     4.392      −     4.918   4.669   2.665           en          −     0.020     0.082    0.069   0.069   0.045   0.029

        de         5.276   3.978     4.378    4.961     −     4.487   2.504           zh        0.021     −       0.019    0.024   0.023   0.025   0.013

        ru         6.271   4.341     4.427    5.168   4.883     −     2.756

        ar         6.192   4.419     4.440    4.915   5.367   4.965     −                                       w/ instruction

                                   w/ instruction                                          To

                                                                                                 en      zh        fr        es     de      ru      ar

             To                                                                    From

                    en      zh        fr        es     de      ru      ar

     From                                                                             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

        fr         3.893   2.808       −      3.810   3.919   3.208   1.963                                         w/ M

        es         3.602   2.707     3.457      −     3.704   3.184   1.926

        de         3.713   2.770     3.543    3.704     −     3.142   2.005                To

                                                                                                 en      zh        fr        es     de      ru      ar

        ru         5.315   3.126     4.286    4.575   4.511     −     2.222        From

        ar         5.165   3.359     4.283    4.601   4.692   3.749     −

                                                                                      en          −     0.589     0.711    0.748   0.677   0.401   0.427

                                       w/ M                                           zh        0.656     −       0.474    0.518   0.488   0.384   0.334

             To

     From

                    en      zh        fr        es     de      ru      ar                                 w/ M of Llama3.18B

        en           −     0.945     0.589    0.549   0.722   1.198   1.050                To

        zh         1.263     −       1.185    1.320   1.381   1.892   1.198

                                                                                                 en      zh        fr        es     de      ru      ar

                                                                                   From

        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           en          −     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

        ru         1.320   1.349     1.179    1.271   1.368     −     1.184

        ar         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.18B .

             To

                    en      zh        fr        es     de      ru      ar                                         Original

     From

        en           −     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                      en      zh        fr        es     de      ru      ar

                                                                                   From

        fr         3.438   3.118       −      2.863   3.032   2.517   2.163

        es         3.579   3.190     2.787      −     3.026   2.570   2.140           en          −     0.017     0.072    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.017    0.019   0.022   0.023   0.010

        ru         4.512   3.551     2.931    3.186   3.204     −     2.207

        ar         4.304   3.551     3.077    3.315   3.527   2.981     −                                       w/ instruction

                                   w/ instruction                                          To

                                                                                                 en      zh        fr        es     de      ru      ar

             To                                                                    From

                    en      zh        fr        es     de      ru      ar

     From                                                                             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.394   1.947       −      1.410   1.603   1.509   1.653                                         w/ M

        es         1.147   1.915     1.342      −     1.467   1.553   1.628

        de         1.215   1.937     1.320    1.271     −     1.513   1.670                To

                                                                                                 en      zh        fr        es     de      ru      ar

        ru         1.979   2.288     1.636    1.765   1.892     −     1.713        From

        ar         2.409   2.879     2.255    2.404   2.469   2.262     −

                                                                                      en          −     0.424     0.658    0.657   0.606   0.179   0.067

                                       w/ M                                           zh        0.581     −       0.406    0.443   0.311   0.258   0.129

             To

     From

                    en      zh        fr        es     de      ru      ar                                w/ M of Llama3.18B-inst

        en           −     3.275     2.440    3.540   2.524   2.854   2.654                To

        zh         2.914     −       3.605    3.063   3.275   3.170   2.540

                                                                                                 en      zh        fr        es     de      ru      ar

                                                                                   From

        fr         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           en          −     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           zh        0.134     −       0.044    0.038   0.043   0.023   0.012

        ru         3.547   4.554     3.442    3.492   4.710     −     2.916

        ar         3.349   4.378     5.172    3.782   3.962   3.510     −







                                                                              17


=== PDF PAGE 18 ===
              Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking





                                                                             Table 26. XNLI translation ROUGE-L on Qwen2.50.5B-inst .

  Table 24. XNLI translation ROUGE-L on Qwen2.57B-inst .                                                      Original

                                                                                       To

                               Original                                                      en      zh        fr        es     de      ru      ar

                                                                              From

        To

              en      zh        fr        es     de      ru      ar               en          −     0.015     0.083    0.066   0.069   0.052   0.031

From                                                                              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

                             w/ instruction                                                  en      zh        fr        es     de      ru      ar

                                                                              From

        To                                                                        en          −     0.505     0.499    0.498   0.456   0.264   0.242

              en      zh        fr        es     de      ru      ar

From                                                                              zh        0.481     −       0.389    0.350   0.308   0.233   0.214

   en          −     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

                                                                                             en      zh        fr        es     de      ru      ar

                                 w/ M                                         From

        To                                                                        en          −     0.367     0.296    0.081   0.296   0.133   0.044

              en      zh        fr        es     de      ru      ar               zh        0.446     −       0.129    0.120   0.175   0.086   0.088

From

   en          −     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.51.5B-inst .

                       w/ M of Qwen2.57B

                                                                                                              Original

        To

              en      zh        fr        es     de      ru      ar                    To

From                                                                                         en      zh        fr        es     de      ru      ar

                                                                              From

   en          −     0.020     0.079    0.066   0.057   0.042   0.025             en          −     0.014     0.077    0.060   0.067   0.043   0.029

   zh        0.095     −       0.024    0.035   0.031   0.022   0.006             zh        0.019     −       0.013    0.014   0.018   0.022   0.009



                                                                                                            w/ instruction

                                                                                       To

                                                                                             en      zh        fr        es     de      ru      ar

                                                                              From

                                                                                  en          −     0.557     0.543    0.570   0.544   0.343   0.279

       Table 25. XNLI translation ROUGE-L on Qwen2.57B .                          zh        0.569     −       0.396    0.369   0.347   0.296   0.236



                               Original                                                                         w/ M



        To                                                                             To

              en      zh        fr        es     de      ru      ar                          en      zh        fr        es     de      ru      ar

                                                                              From

From

                                                                                  en          −     0.505     0.522    0.518   0.461   0.211   0.152

   en          −     0.012     0.081    0.075   0.068   0.045   0.028

                                                                                  zh        0.587     −       0.351    0.279   0.285   0.217   0.072

   zh        0.019     −       0.014    0.014   0.021   0.019   0.009



                             w/ instruction

                                                                                Table 28. XNLI translation ROUGE-L on Qwen2.53B-inst .

        To

              en      zh        fr        es     de      ru      ar

From                                                                                                          Original

   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                        en      zh        fr        es     de      ru      ar

                                                                              From

                                 w/ M                                             en          −     0.016     0.082    0.068   0.070   0.045   0.029

                                                                                  zh        0.016     −       0.013    0.015   0.020   0.018   0.005

        To

              en      zh        fr        es     de      ru      ar                                         w/ instruction

From

   en          −     0.013     0.083    0.077   0.073   0.036   0.035                  To

                                                                                             en      zh        fr        es     de      ru      ar

   zh        0.127     −       0.035    0.042   0.047   0.032   0.008         From

                                                                                  en          −     0.581     0.618    0.625   0.527   0.356   0.305

                      w/ M of Qwen2.57B-inst                                      zh        0.464     −       0.426    0.438   0.399   0.273   0.230

        To

              en      zh        fr        es     de      ru      ar                                             w/ M

From

                                                                                       To

   en          −     0.016     0.095    0.066   0.061   0.052   0.024                        en      zh        fr        es     de      ru      ar

                                                                              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


=== PDF PAGE 19 ===
             Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking





 Table 29. XNLI translation ROUGE-L on Qwen2.514B-inst .                       Table 32. Simple task accuracy on Llama3.18B-inst .

                               Original                                      Task name                   Original    w/ instruction    w/ M

                                                                                                                                                 w/ M of

                                                                                                                                                Llama3.18B

        To

              en      zh        fr        es     de      ru      ar          lowercase_first_letter        0.00           0.61         1.00        0.99

From                                                                         park-country                  0.18           0.65         0.68        0.67

                                                                             synonym                       0.01           0.29         0.48        0.51

   en          −     0.017     0.077    0.064   0.067   0.042   0.027        ag_news                       0.00           0.76         0.81        0.87

   zh        0.013     −       0.010    0.012   0.018   0.017   0.004        word_length                   0.00           0.97         0.29        0.07

                                                                             present-past                  0.02           0.76         0.91        0.97

                             w/ instruction                                  capitalize                    0.10           1.00         0.98        0.97

                                                                             landmark-country              0.03           0.86         0.87        0.87

        To                                                                   english-german                0.00           0.43         0.61        0.47

              en      zh        fr        es     de      ru      ar          sentiment                     0.01           0.59         0.86        0.64

From

                                                                             country-capital               0.04           0.92         0.85        0.80

   en          −     0.498     0.599    0.588   0.506   0.416   0.247        person-occupation             0.17           0.19         0.68        0.53

                                                                             country-currency              0.00           0.07         0.44        0.56

   zh        0.521     −       0.403    0.380   0.362   0.300   0.184        lowercase_last_letter         0.00           0.00         0.88        0.65

                                                                             person-sport                  0.38           0.01         0.91        0.86

                                 w/ M                                        person-instrument             0.06           0.05         0.80        0.77

                                                                             antonym                       0.12           0.30         0.76        0.75

        To                                                                   capitalize_last_letter        0.01           0.14         0.96        0.08

              en      zh        fr        es     de      ru      ar

From                                                                         english-french                0.01           0.60         0.77        0.70

                                                                             next_item                     0.01           0.06         0.78        0.64

   en          −     0.676     0.716    0.761   0.660   0.534   0.454        commonsense_qa                0.00           0.33         0.70        0.17

   zh        0.684     −       0.542    0.586   0.499   0.362   0.357        singular-plural               0.02           0.95         0.97        0.99

                                                                             capitalize_second_letter      0.07           0.00         0.63        0.17

                                                                             prev_item                     0.02           0.20         0.87        0.65

                                                                             capitalize_first_letter       0.15           0.97         1.00        0.98

 Table 30. XNLI translation ROUGE-L on Phi3.5mini-inst .                     english-spanish               0.00           0.59         0.77        0.86

                                                                             next_capital_letter           0.03           0.12         0.99        0.19

                                                                             national_parks                0.04           0.65         0.64        0.63

                               Original                                      product-company               0.06           0.73         0.83        0.78

                                                                             conll2003_organization        0.04           0.13         0.57        0.37

        To                                                                   conll2003_person              0.02           0.40         0.89        0.84

              en      zh        fr        es     de      ru      ar

From                                                                         conll2003_location            0.00           0.41         0.92        0.75

                                                                             adjective_v_verb_3            0.00           0.14         0.99        0.97

   en          −     0.018     0.086    0.076   0.073   0.048   0.032        object_v_concept_3            0.00           0.02         0.98        0.99

   zh        0.012     −       0.012    0.012   0.022   0.025   0.010        verb_v_adjective_3            0.00           0.23         0.98        0.96

                                                                             fruit_v_animal_3              0.00           0.51         0.98        0.87

                             w/ instruction                                  Average                       0.05           0.44         0.81        0.70



        To

              en      zh        fr        es     de      ru      ar

From

                                                                                 Table 33. Simple task accuracy on Llama3.18B .

   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                                                                            w/ M of

                                                                             Task name                  Original    w/ instruction    w/ M

                                                                                                                                              Llama3.18B-inst

                                 w/ M

                                                                             lowercase_first_letter       0.00          1.00          1.00         0.15

        To                                                                   park-country                 0.06          0.78          0.75         0.12

              en      zh        fr        es     de      ru      ar          synonym                      0.04          0.42          0.49         0.10

From                                                                         ag_news                      0.00          0.49          0.82         0.00

                                                                             word_length                  0.00          0.45          0.32         0.15

   en          −     0.463     0.669    0.699   0.656   0.293   0.074        present-past                 0.01          0.96          0.97         0.07

   zh        0.525     −       0.406    0.399   0.400   0.132   0.156        capitalize                   0.00          1.00          0.99         0.23

                                                                             landmark-country             0.04          0.82          0.87         0.24

                                                                             english-german               0.00          0.48          0.50         0.00

                                                                             sentiment                    0.00          0.91          0.80         0.00

  Table 31. XNLI translation ROUGE-L on Mistral7B-inst .                     country-capital              0.05          0.89          0.85         0.04

                                                                             person-occupation            0.03          0.03          0.55         0.09

                                                                             country-currency             0.00          0.06          0.61         0.00

                               Original                                      lowercase_last_letter        0.00          0.93          0.81         0.00

                                                                             person-sport                 0.00          0.13          0.89         0.00

        To                                                                   person-instrument            0.00          0.15          0.68         0.01

              en      zh        fr        es     de      ru      ar

From                                                                         antonym                      0.13          0.66          0.66         0.11

                                                                             capitalize_last_letter       0.00          0.76          0.22         0.00

   en          −     0.020     0.087    0.073   0.075   0.048   0.030        english-french               0.00          0.73          0.80         0.02

   zh        0.022     −       0.020    0.019   0.028   0.029   0.011        next_item                    0.02          0.67          0.85         0.21

                                                                             commonsense_qa               0.00          0.07          0.51         0.21

                             w/ instruction                                  singular-plural              0.02          0.95          0.96         0.07

                                                                             capitalize_second_letter     0.00          0.44          0.22         0.00

        To                                                                   prev_item                    0.01          0.62          0.79         0.15

              en      zh        fr        es     de      ru      ar          capitalize_first_letter      0.00          1.00          0.99         0.06

From                                                                         english-spanish              0.00          0.71          0.78         0.00

                                                                             next_capital_letter          0.00          0.86          0.47         0.01

   en          −     0.264     0.431    0.433   0.378   0.282   0.177        national_parks               0.02          0.69          0.67         0.25

   zh        0.405     −       0.290    0.306   0.267   0.232   0.156        product-company              0.07          0.75          0.76         0.35

                                                                             conll2003_organization       0.06          0.64          0.48         0.28

                                 w/ M                                        conll2003_person             0.07          0.89          0.86         0.36

                                                                             conll2003_location           0.07          0.79          0.79         0.37

        To                                                                   adjective_v_verb_3           0.00          0.93          1.00         0.37

              en      zh        fr        es     de      ru      ar          object_v_concept_3           0.00          0.75          0.99         0.46

From

                                                                             verb_v_adjective_3           0.00          0.82          0.95         0.49

   en          −     0.547     0.663    0.656   0.673   0.461   0.199        fruit_v_animal_3             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


=== PDF PAGE 20 ===
          Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking





  Table 34. Simple task accuracy on Qwen2.57B-inst .

                                                                    w/ M of

Task name                   Original    w/ instruction    w/ M

                                                                   Qwen2.57B

lowercase_first_letter        0.00           1.00         0.99        0.97

park-country                  0.00           0.57         0.61        0.66

synonym                       0.02           0.53         0.35        0.36

ag_news                       0.00           0.73         0.79        0.02

word_length                   0.00           0.73         0.29        0.10

present-past                  0.01           0.97         0.87        0.90

capitalize                    0.17           0.99         0.99        0.92             Table 36. An example of en-zh translation on different sizes of

landmark-country              0.07           0.30         0.72        0.70

english-german                0.00           0.40         0.36        0.11             models. Larger models (Qwen2.514B-inst in this example) tend to

sentiment                     0.03           0.95         0.92        0.53             generate more explanation words. The attention head mask M

country-capital               0.03           0.89         0.80        0.79

person-occupation             0.09           0.04         0.49        0.38             can help the model focus on the task and context words.

country-currency              0.00           0.06         0.11        0.24

lowercase_last_letter         0.00           0.93         0.37        0.15

person-sport                  0.33           0.22         0.82        0.70              Chinese input           英格兰人要求必须讲多种语

person-instrument

antonym

                              0.03

                              0.09

                                             0.14

                                             0.70

                                                          0.40

                                                          0.60

                                                                      0.46

                                                                      0.63

                                                                                                                言。

capitalize_last_letter        0.02           0.84         0.29        0.24

english-french                0.00           0.66         0.51        0.31              English gold label      People in England are required to

next_item                     0.00           0.86         0.77        0.71

commonsense_qa                0.00           0.86         0.80        0.21

                                                                                                                speak more than one language.

singular-plural               0.04           0.98         0.93        0.80

capitalize_second_letter      0.02           0.76         0.37        0.27              Qwen2.514B-inst

prev_item                     0.02           0.71         0.51        0.37                                      The English require that multiple

                                                                                        with instruction

capitalize_first_letter       0.22           1.00         1.00        0.87                                      languages be spoken.\n\nHowever,

english-spanish               0.00           0.74         0.57        0.25

next_capital_letter           0.03           0.38         0.05        0.44                                      it’s important to note that the state-

national_parks                0.03           0.41         0.65        0.58

product-company               0.14           0.43         0.73        0.55

                                                                                                                ment "Englanders require that mul-

conll2003_organization        0.01           0.69         0.35        0.36                                      tiple languages be spoken" is not

conll2003_person              0.04           0.91         0.90        0.59

conll2003_location            0.01           0.84         0.81        0.65                                      accurate in a general sense. In re-

adjective_v_verb_3            0.00           0.99         0.84        0.70

object_v_concept_3            0.00           0.97         0.98        0.78

                                                                                                                ality, English is the predominant

verb_v_adjective_3            0.00           0.86         0.89        0.79                                      language spoken in England,

fruit_v_animal_3              0.00           0.94         0.86        0.84

Average                       0.04           0.69         0.64        0.53              Qwen2.57B-inst

                                                                                                                The English demand that multiple

                                                                                        with instruction

                                                                                                                languages must be spoken.

     Table 35. Simple task accuracy on Qwen2.57B .

                                                                                        Qwen2.53B-inst

                                                                                                                English people demand that mul-

Task name                  Original    w/ instruction    w/ M

                                                                   w/ M of              with instruction

                                                                 Qwen2.57B-inst                                 tiple languages must be spo-

lowercase_first_letter       0.00          1.00          0.96        0.00                                       ken.\n\nHowever, it seems there

park-country                 0.06          0.54          0.67        0.23

synonym                      0.00          0.11          0.27        0.01                                       might be a slight issue with the

ag_news                      0.00          0.75          0.02        0.01

word_length                  0.02          0.70          0.11        0.00

                                                                                                                phrasing. The correct transla-

present-past                 0.02          0.94          0.94        0.08                                       tion would be:\n\n"English people

capitalize                   0.03          0.99          0.96        0.26

landmark-country             0.06          0.33          0.71        0.26                                       demand that multiple languages

english-german               0.00          0.36          0.21        0.00

sentiment                    0.00          0.97          0.72        0.10

                                                                                                                should be spoken."\n\nThis makes

country-capital              0.05          0.96          0.81        0.04                                       more sense as it conveys

person-occupation            0.02          0.19          0.39        0.00

country-currency             0.00          0.08          0.36        0.00

                                                                                        Qwen2.514B-inst

lowercase_last_letter        0.00          0.97          0.40        0.00                                       The English required that multiple

person-sport                 0.06          0.39          0.68        0.05               with M

person-instrument            0.02          0.14          0.39        0.01                                       languages be spoken.

antonym                      0.10          0.39          0.59        0.07

capitalize_last_letter       0.00          0.90          0.24        0.00               Qwen2.57B-inst

english-french               0.01          0.60          0.36        0.00                                       The English require that multiple

next_item                    0.03          0.74          0.78        0.01               with M

commonsense_qa               0.00          0.50          0.77        0.60                                       languages be spoken.

singular-plural              0.05          0.98          0.83        0.08

capitalize_second_letter     0.01          0.71          0.28        0.02               Qwen2.53B-inst

prev_item                    0.02          0.52          0.48        0.01                                       The English demand to speak in

capitalize_first_letter      0.05          1.00          0.94        0.01               with M

english-spanish              0.00          0.64          0.25        0.00                                       many languages.

next_capital_letter          0.00          0.75          0.66        0.03

national_parks               0.02          0.46          0.56        0.25

product-company              0.08          0.48          0.55        0.06

conll2003_organization       0.03          0.68          0.34        0.03

conll2003_person             0.06          0.91          0.73        0.08

conll2003_location           0.05          0.81          0.61        0.16

adjective_v_verb_3           0.00          0.92          0.83        0.21

object_v_concept_3           0.00          0.91          0.88        0.05

verb_v_adjective_3           0.00          0.86          0.82        0.20

fruit_v_animal_3             0.00          0.97          0.92        0.09

Average                      0.02          0.68          0.58        0.07







                                                                                  20


=== PDF PAGE 21 ===
               Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking





Table 37. Attention head mask similarity between Llama3.18B-inst                            Table 38. Attention head mask similarity between Qwen2.57B-inst

(Minst ) and Llama3.18B (Mbase ).                                                           (Minst ) and Qwen2.57B (Mbase ).

                                                              Jaccard      Random                                                                         Jaccard      Random

   Task name                  |Minst |   |Mbase |   Recall                                     Task name                  |Minst |   |Mbase |   Recall

                                                             similarity   similarity                                                                     similarity   similarity

   en-zh                       832         819      0.874      0.766        0.675              en-zh                       643         611      0.894      0.771        0.666

   en-fr                       860         809      0.895      0.766        0.687              en-fr                       611         587      0.853      0.719        0.618

   en-es                       846         811      0.906      0.797        0.679              en-es                       609         580      0.862      0.726        0.610

   en-de                       862         816      0.915      0.802        0.693              en-de                       602         589      0.862      0.744        0.612

   en-ru                       828         795      0.868      0.740        0.656              en-ru                       614         590      0.859      0.727        0.623

   en-ar                       837         821      0.873      0.762        0.680              en-ar                       618         597      0.859      0.731        0.632

   zh-en                       937         895      0.951      0.867        0.808              zh-en                       666         615      0.912      0.779        0.689

   zh-fr                       899         843      0.943      0.839        0.739              zh-fr                       630         603      0.872      0.744        0.647

   zh-es                       896         856      0.921      0.817        0.747              zh-es                       630         576      0.882      0.728        0.623

   zh-de                       888         834      0.928      0.816        0.724              zh-de                       629         596      0.876      0.743        0.640

   zh-ru                       909         846      0.939      0.826        0.748              zh-ru                       620         590      0.871      0.739        0.628

   zh-ar                       889         855      0.916      0.815        0.741              zh-ar                       619         612      0.848      0.729        0.646

   fr-en                       924         873      0.948      0.854        0.781              fr-en                       668         606      0.914      0.769        0.681

   fr-zh                       865         821      0.912      0.799        0.699              fr-zh                       650         602      0.892      0.751        0.663

   fr-es                       903         833      0.929      0.805        0.734              fr-es                       617         580      0.872      0.732        0.616

   fr-de                       892         827      0.931      0.811        0.721              fr-de                       635         593      0.885      0.747        0.642

   fr-ru                       899         849      0.927      0.819        0.743              fr-ru                       628         590      0.864      0.720        0.634

   fr-ar                       882         827      0.919      0.801        0.715              fr-ar                       625         603      0.859      0.730        0.643

   es-en                       925         879      0.947      0.856        0.786              es-en                       661         618      0.892      0.757        0.687

   es-zh                       863         823      0.911      0.801        0.699              es-zh                       666         607      0.914      0.773        0.681

   es-fr                       909         821      0.937      0.800        0.728              es-fr                       614         583      0.864      0.727        0.617

   es-de                       881         825      0.921      0.803        0.712              es-de                       634         588      0.895      0.756        0.637

   es-ru                       886         835      0.905      0.783        0.724              es-ru                       629         598      0.875      0.743        0.642

   es-ar                       871         839      0.911      0.808        0.716              es-ar                       620         591      0.860      0.723        0.629

   de-en                       923         875      0.944      0.850        0.781              de-en                       680         632      0.911      0.783        0.718

   de-zh                       868         820      0.918      0.805        0.700              de-zh                       669         611      0.907      0.763        0.687

   de-fr                       911         830      0.934      0.802        0.736              de-fr                       640         590      0.880      0.730        0.644

   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              de-ru                       636         611      0.871      0.744        0.660

   de-ar                       885         835      0.919      0.805        0.723              de-ar                       626         609      0.862      0.739        0.649

   ru-en                       923         883      0.940      0.850        0.788              ru-en                       676         625      0.917      0.787        0.707

   ru-zh                       870         829      0.913      0.804        0.708              ru-zh                       670         608      0.918      0.775        0.685

   ru-fr                       898         836      0.933      0.818        0.732              ru-fr                       629         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

   ru-de                       886         838      0.930      0.824        0.726              ru-de                       626         595      0.877      0.747        0.637

   ru-ar                       873         854      0.906      0.812        0.729              ru-ar                       641         605      0.868      0.728        0.658

   ar-en                       943         900      0.951      0.867        0.817              ar-en                       671         652      0.911      0.815        0.729

   ar-zh                       885         862      0.928      0.845        0.743              ar-zh                       677         649      0.917      0.814        0.732

   ar-fr                       908         843      0.926      0.805        0.745              ar-fr                       638         625      0.877      0.766        0.674

   ar-es                       899         834      0.935      0.818        0.732              ar-es                       641         624      0.883      0.772        0.676

   ar-de                       909         859      0.951      0.859        0.758              ar-de                       637         637      0.873      0.774        0.684

   ar-ru                       888         857      0.926      0.835        0.742              ar-ru                       643         636      0.876      0.771        0.689

   lowercase_first_letter      790         672      0.835      0.623        0.549              lowercase_first_letter      520         414      0.758      0.506        0.416

   park-country                826         774      0.850      0.699        0.640              park-country                602         517      0.845      0.641        0.550

   synonym                     833         689      0.875      0.656        0.583              synonym                     602         502      0.861      0.643        0.536

   ag_news                     737         691      0.777      0.603        0.534              ag_news                     554         486      0.782      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.816      0.603        0.514

   capitalize                  895         777      0.915      0.740        0.684              capitalize                  626         503      0.871      0.634        0.552

   landmark-country            779         685      0.848      0.658        0.553              landmark-country            592         478      0.860      0.624        0.509

   english-german              837         734      0.887      0.708        0.618              english-german              581         473      0.831      0.595        0.498

   sentiment                   745         679      0.779      0.591        0.531              sentiment                   565         481      0.807      0.590        0.496

   country-capital             859         797      0.867      0.716        0.677              country-capital             615         515      0.835      0.614        0.556

   person-occupation           748         688      0.814      0.639        0.538              person-occupation           593         459      0.841      0.580        0.493

   country-currency            754         744      0.806      0.668        0.577              country-currency            590         496      0.841      0.623        0.524

   lowercase_last_letter       746         608      0.768      0.526        0.486              lowercase_last_letter       516         407      0.764      0.508        0.409

   person-sport                758         686      0.805      0.619        0.542              person-sport                569         464      0.813      0.575        0.484

   person-instrument           765         646      0.837      0.622        0.520              person-instrument           551         456      0.768      0.533        0.467

   antonym                     834         726      0.890      0.707        0.610              antonym                     602         509      0.868      0.661        0.543

   capitalize_last_letter      752         651      0.774      0.561        0.517              capitalize_last_letter      519         432      0.750      0.517        0.430

   english-french              822         727      0.867      0.686        0.604              english-french              586         473      0.837      0.597        0.501

   next_item                   871         728      0.886      0.676        0.632              next_item                   600         491      0.837      0.604        0.525

   singular-plural             837         704      0.874      0.664        0.596              singular-plural             575         473      0.825      0.593        0.495

   capitalize_second_letter    723         659      0.748      0.555        0.508              capitalize_second_letter    542         431      0.782      0.530        0.441

   prev_item                   830         713      0.860      0.659        0.599              prev_item                   603         477      0.834      0.584        0.514

   capitalize_first_letter     774         678      0.813      0.612        0.545              capitalize_first_letter     521         433      0.760      0.526        0.432

   english-spanish             808         737      0.855      0.689        0.604              english-spanish             589         475      0.857      0.619        0.505

   next_capital_letter         748         654      0.778      0.570        0.517              next_capital_letter         531         427      0.745      0.497        0.432

   national_parks              827         792      0.837      0.694        0.653              national_parks              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        0.463

   conll2003_organization      826         723      0.864      0.676        0.604              conll2003_organization      591         501      0.846      0.635        0.529

   conll2003_person            831         710      0.887      0.692        0.597              conll2003_person            593         515      0.862      0.669        0.542

   conll2003_location          787         670      0.828      0.615        0.547              conll2003_location          584         492      0.852      0.638        0.517

   adjective_v_verb_3          813         756      0.868      0.719        0.620              adjective_v_verb_3          621         549      0.883      0.708        0.592

   object_v_concept_3          826         733      0.877      0.702        0.611              object_v_concept_3          635         525      0.872      0.652        0.579

   verb_v_adjective_3          839         768      0.867      0.708        0.644              verb_v_adjective_3          613         524      0.865      0.662        0.563

   fruit_v_animal_3            827         786      0.850      0.707        0.649              fruit_v_animal_3            617         562      0.867      0.704        0.600







                                                                                       21


=== PDF PAGE 22 ===
                                               Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking









                                             en                    0 4 8 12 16 20 24 28            zh                                                     fr                                                     es                                                      de                                                    ru                                                     ar









                                                                                                                         0 4 8 12 16 20 24 28









                                                                                                                                                                                 0 4 8 12 16 20 24 28









                                                                                                                                                                                                                                         0 4 8 12 16 20 24 28









                                                                                                                                                                                                                                                                                               0 4 8 12 16 20 24 28









                                                                                                                                                                                                                                                                                                                                                     0 4 8 12 16 20 24 28

                                                           Layer index









                                                                                                                 Layer index









                                                                                                                                                                         Layer index









                                                                                                                                                                                                                                 Layer index









                                                                                                                                                                                                                                                                                       Layer index









                                                                                                                                                                                                                                                                                                                                             Layer index

en









                                                                                          0 4 8 12 16 20 24 28                                  0 4 8 12 16 20 24 28                                    0 4 8 12 16 20 24 28                                    0 4 8 12 16 20 24 28                                  0 4 8 12 16 20 24 28                                  0 4 8 12 16 20 24 28

                                                                                                Head index                                            Head index                                              Head index                                              Head index                                            Head index                                             Head index

             0 4 8 12 16 20 24 28









                                                                                                                         0 4 8 12 16 20 24 28









                                                                                                                                                                                 0 4 8 12 16 20 24 28









                                                                                                                                                                                                                                         0 4 8 12 16 20 24 28









                                                                                                                                                                                                                                                                                               0 4 8 12 16 20 24 28









                                                                                                                                                                                                                                                                                                                                                     0 4 8 12 16 20 24 28

     Layer index









                                                                                                                 Layer index









                                                                                                                                                                         Layer index









                                                                                                                                                                                                                                 Layer index









                                                                                                                                                                                                                                                                                       Layer index









                                                                                                                                                                                                                                                                                                                                             Layer index

zh









                                    0 4 8 12 16 20 24 28                                                                                        0 4 8 12 16 20 24 28                                    0 4 8 12 16 20 24 28                                    0 4 8 12 16 20 24 28                                  0 4 8 12 16 20 24 28                                  0 4 8 12 16 20 24 28

                                          Head index                                                                                                  Head index                                              Head index                                              Head index                                            Head index                                             Head index

             0 4 8 12 16 20 24 28









                                                                   0 4 8 12 16 20 24 28









                                                                                                                                                                                 0 4 8 12 16 20 24 28









                                                                                                                                                                                                                                         0 4 8 12 16 20 24 28









                                                                                                                                                                                                                                                                                               0 4 8 12 16 20 24 28









                                                                                                                                                                                                                                                                                                                                                     0 4 8 12 16 20 24 28

     Layer index









                                                           Layer index









                                                                                                                                                                         Layer index









                                                                                                                                                                                                                                 Layer index









                                                                                                                                                                                                                                                                                       Layer index









                                                                                                                                                                                                                                                                                                                                             Layer index

fr









                                    0 4 8 12 16 20 24 28                                  0 4 8 12 16 20 24 28                                                                                          0 4 8 12 16 20 24 28                                    0 4 8 12 16 20 24 28                                  0 4 8 12 16 20 24 28                                  0 4 8 12 16 20 24 28

                                          Head index                                            Head index                                                                                                    Head index                                              Head index                                            Head index                                             Head index

             0 4 8 12 16 20 24 28









                                                                   0 4 8 12 16 20 24 28









                                                                                                                         0 4 8 12 16 20 24 28









                                                                                                                                                                                                                                         0 4 8 12 16 20 24 28









                                                                                                                                                                                                                                                                                               0 4 8 12 16 20 24 28









                                                                                                                                                                                                                                                                                                                                                     0 4 8 12 16 20 24 28

     Layer index









                                                           Layer index









                                                                                                                 Layer index









                                                                                                                                                                                                                                 Layer index









                                                                                                                                                                                                                                                                                       Layer index









                                                                                                                                                                                                                                                                                                                                             Layer index

es









                                    0 4 8 12 16 20 24 28                                  0 4 8 12 16 20 24 28                                  0 4 8 12 16 20 24 28                                                                                            0 4 8 12 16 20 24 28                                  0 4 8 12 16 20 24 28                                  0 4 8 12 16 20 24 28

                                          Head index                                            Head index                                            Head index                                                                                                      Head index                                            Head index                                             Head index

             0 4 8 12 16 20 24 28









                                                                   0 4 8 12 16 20 24 28









                                                                                                                         0 4 8 12 16 20 24 28









                                                                                                                                                                                 0 4 8 12 16 20 24 28









                                                                                                                                                                                                                                                                                               0 4 8 12 16 20 24 28









                                                                                                                                                                                                                                                                                                                                                     0 4 8 12 16 20 24 28

     Layer index









                                                           Layer index









                                                                                                                 Layer index









                                                                                                                                                                         Layer index









                                                                                                                                                                                                                                                                                       Layer index









                                                                                                                                                                                                                                                                                                                                             Layer index

de









                                    0 4 8 12 16 20 24 28                                  0 4 8 12 16 20 24 28                                  0 4 8 12 16 20 24 28                                    0 4 8 12 16 20 24 28                                                                                          0 4 8 12 16 20 24 28                                  0 4 8 12 16 20 24 28

                                          Head index                                            Head index                                            Head index                                              Head index                                                                                                    Head index                                             Head index

             0 4 8 12 16 20 24 28









                                                                   0 4 8 12 16 20 24 28









                                                                                                                         0 4 8 12 16 20 24 28









                                                                                                                                                                                 0 4 8 12 16 20 24 28









                                                                                                                                                                                                                                         0 4 8 12 16 20 24 28









                                                                                                                                                                                                                                                                                                                                                     0 4 8 12 16 20 24 28

     Layer index









                                                           Layer index









                                                                                                                 Layer index









                                                                                                                                                                         Layer index









                                                                                                                                                                                                                                 Layer index









                                                                                                                                                                                                                                                                                                                                             Layer index

ru









                                    0 4 8 12 16 20 24 28                                  0 4 8 12 16 20 24 28                                  0 4 8 12 16 20 24 28                                    0 4 8 12 16 20 24 28                                    0 4 8 12 16 20 24 28                                                                                        0 4 8 12 16 20 24 28

                                          Head index                                            Head index                                            Head index                                              Head index                                              Head index                                                                                                   Head index

             0 4 8 12 16 20 24 28









                                                                   0 4 8 12 16 20 24 28









                                                                                                                         0 4 8 12 16 20 24 28









                                                                                                                                                                                 0 4 8 12 16 20 24 28









                                                                                                                                                                                                                                         0 4 8 12 16 20 24 28









                                                                                                                                                                                                                                                                                               0 4 8 12 16 20 24 28

     Layer index









                                                           Layer index









                                                                                                                 Layer index









                                                                                                                                                                         Layer index









                                                                                                                                                                                                                                 Layer index









                                                                                                                                                                                                                                                                                       Layer index

ar









                                    0 4 8 12 16 20 24 28                                  0 4 8 12 16 20 24 28                                  0 4 8 12 16 20 24 28                                    0 4 8 12 16 20 24 28                                    0 4 8 12 16 20 24 28                                  0 4 8 12 16 20 24 28

                                          Head index                                            Head index                                            Head index                                              Head index                                              Head index                                            Head index





                                             0.0                                                        0.2                                                        0.4                                                         0.6                                                             0.8                                                                           1.0

                                                                                                                                                                         Head weight (sigmoid)



Figure 7. Visualization of sigmoid attention head mask weight σ(M) for all translation pairs (translate from left labels to top labels) on

Llama3.18B-inst . Heads with a value greater than 0.5 are selected in the final mask M.









                                                                                                                                                                                                            22


=== PDF PAGE 23 ===
            Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking

                                                                                                  0

C.3. More Removal Experiments

                                                                                                500





C.3.1. O NE - BY-O NE H EAD R EMOVAL                                                        1000



                                                                                            1500









                                                                                   Token rank

In the one-by-one head removal experiment depicted in Fig-                                  2000

ure 2, we unveil the model’s translation functionality by                                   2500

removing a certain amount of attention heads. We provide                                    3000                                                                                                              That

                                                                                                                                                                                                              It

more detailed results to enhance the conclusions that: (1) the                              3500

                                                                                                                                                                                                              L

                                                                                                                                                                                                              I

                                                                                                                                                                                                              However

model behavior change is not caused by removing certain                                     4000

                                                                                                            0         32         64      96         128         160     192         224    256         288     320

independent, influential attention heads; (2) the model can                                                                                           Removed heads



maintain its original behavior as long as the functional path-                                    0

way remains intact, even if the model loses more attention                                      500

heads.                                                                                      1000





Remove by influential order Figure 2 involves many                                          1500









                                                                                   Token rank

target token’s rank surges when removing certain attention                                  2000





heads, and we claim that removing heads in the order of                                     2500



                                                                                                                                                                                                              That

target token’s rank increments caused by each head will not                                 3000

                                                                                                                                                                                                              It

                                                                                                                                                                                                              L

                                                                                                                                                                                                              I

accelerate the switch in model behavior. To verify this point,                              3500

                                                                                                                                                                                                              However



we select the first 320 heads from the ascending order of the                               4000

                                                                                                            0         32         64      96         128         160     192         224    256         288     320

                                                                                                                                                      Removed heads

task head weight, and for these 320 heads, we re-order them

by the target token’s rank increment caused by each head                Figure 8. Prompt Llama3.18B-inst with “I see a llama sleeping in

in descending order. Then we remove these heads one by                  my backyard.”, and remove the first 320 attention heads from the

one and compare their token rank changes with the original              full model by head weight of en-zh translation task in different

order. The token rank changes are illustrated in Figure 8. In           orders. We use a gray vertical line to indicate where the target

this influential order, the model could indeed perform higher           token becomes the top-1 token. Top: In original ascending order

                                                                        of head weights. Bottom: In descending order of target token’s

target token rank in the early stage, but its domination is

                                                                        rank increments.

postponed to around 290 heads. Therefore, removing more

influential heads does not necessarily lead to a faster switch

                                                                                      0                                                                                                                              That

in the model behavior.                                                                                                                                                                                               It

                                                                                                                                                                                                                     L

                                                                                   500                                                                                                                               I

                                                                                                                                                                                                                     However

Remove on the negative initialized mask We provide                             1000



the token ranks and the model outputs of the negative ini-                     1500

                                                                      Token rank









tialized mask in Figure 9. The behavior switch of the model                    2000

happens at removing the 355th head, which is nearly 200

                                                                               2500

heads later than the results in Figure 2. Although it loses

                                                                               3000

more attention heads, the model can still maintain certain

                                                                               3500

instruction following behavior before the switch.

                                                                               4000

                                                                                                      0         64   128   192    256   320   384         448   512   576     640   704   768    832    896   960       1024

                                                                                                                                                     Removed heads

C.3.2. Q UERY-H EAD R EMOVAL

                                                                         # of removed                     Generated outputs

Equation (2) actually applies M on the value heads of the                                      0

                                                                                               1

                                                                                                          That’s quite a surprise! Llamas are not typically found in backyards, so it’s

                                                                                                          That’s quite a surprise! Llamas are not typically found in backyards, so it’s

MHA layer, and it ignores the attention scores calculated by                                  ...

                                                                                            235

                                                                                                          ...

                                                                                                          That’s a pretty interesting sight! I’ve seen a llama sleeping in my backyard before, but I

                                                                                            236           I see a llama sleeping in my backyard.

query and key heads. To explore whether such masks can                                        ...         ...

                                                                                            297           I see a llama sleeping in my backyard.

be applied to the attention scores, we move the mask value                                  298

                                                                                            312

                                                                                                          You’re not seeing a llama sleeping in your backyard, you’re seeing a llama sleeping in your backyard

                                                                                                          That’s a pretty surreal scene! A llama sleeping in your backyard! Maybe it’s just a visitor

inside the softmax function in Equation (1) to make it work                                 341

                                                                                            342

                                                                                                          You’re looking at a llama that’s sleeping in your backyard.

                                                                                                          I see a llama sleeping in my backyard.

                                                                                              ...         ...

on the query (also key) head outputs. In this configuration,                                354           I see a llama sleeping in my backyard.

                                                                                            355           我看到一只羊在我的后院睡觉。(I see a sheep sleeping in my backyard.)

masking out a head means that the head pays uniformly                                         ...

                                                                                            693

                                                                                                          ...

                                                                                                          我看到一只羊在我的后院睡觉。(I see a sheep sleeping in my backyard.)

                                                                                                          我看到一只在我家中睡眠。(I see a sleeping in my house.)

equal attention to all the input tokens. Nevertheless, the                                  694

                                                                                            695           我在我的后院看到睡牛。(I see sleeping ox in my backyard.)

                                                                                            742           我看到一只睡在我的后院的后院。见到一只睡在我的 (I see a backyard sleeping in my backyard. See a sleeping in my)

training of this query-head mask fails to steadily trigger the                              743

                                                                                            786

                                                                                                          I see a llama sleeping in my backyard.

                                                                                                          I see a llama sleeping in my backyard.user.sideassistant.help

model functionality on most of the tasks. As described in                                   798

                                                                                              ...

                                                                                                          user’s helpmate’s helpmate’s helper’s helper’s helper’s helper’s helper’s helper’s

                                                                                                          ...



Section 4, the attention head mask is not only a simple se-

lection of higher or lower attention scores, and even unused            Figure 9. In the negative initialization scenario, we prompt

heads are still working to focus on important tokens. This              Llama3.18B-inst with “I see a llama sleeping in my backyard.”,

can explain why the query-head mask fails to work. Table                and remove attention heads from the full model by head weight of

39 shows a case study of failed translations.                           en-zh translation task in ascending order. Use the same notations

                                                                        as in Figure 2.



                                                                 23


=== PDF PAGE 24 ===
            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-        Table 40. XNLI translation perplexity (PPL) on Llama3.18B-inst

moval scenario.                                                          when taking FFN layers (32 in total) in the mask. Translation pairs

                                                                         with yellow background use 31 FFN layers in M, others use all

 Case 1: Fail to translate                                               32 FFN layers. Attention heads are also selected in M.

 Input       Lots of people from England speak more than                          To

             one language.                                                              en      zh      fr      es      de      ru      ar

                                                                         From

 Output      Many people from England speak more than                        en          −     1.700   1.130   1.221   1.330   1.915   1.869

             one language.                                                   zh        1.990     −     1.537   1.701   4.143   1.828   2.523

                                                                             fr        1.698   1.934     −     1.437   1.543   1.936   2.042

 Case 2: Low quality translation

                                                                             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.                                                         ru        2.047   2.077   1.469   3.915   4.315     −     2.494

                                                                             ar        2.201   2.211   1.643   4.488   5.089   1.949     −

 Output      西方传统并不是唯一的好客。(Western tra-

             dition is not solely hospitable.)

                                                                         We take ml in each layer into the whole mask M, train it

 Case 3: Mix with other languages                                        together with attention heads on Llama3.18B-inst for XNLI

 Input       Due to our population, there are few virgin                 translation tasks, and results are shown in Table 40. After

             forests still left in the United States.                    training, most translation tasks still use all the FFN layers.

 Output      En realidad, debido a nuestra población, to-                Only 8 tasks remove only one FFN layer in M, and their

             davía quedan pocos bosques virgenes en los                  performance severely degrade compared to the head-only

             Estados Unidos.                                             mask in Table 12. Since taking FFN into the mask does not

                                                                         contribute to the study of model functionality, and the model

 Input       Japan and Sweden are members of the Auld                    itself tends to utilize all FFN layers, we do not remove the

             Alliance.                                                   FFN layers in the main experiments.

 Output      日本とスウェ デンはオ ル アライアンス

             のメンバです。                                                     C.4. A Probe of Layer Outputs

                                                                         For Figure 4, we provide a probing example of layer out-

From these cases, we discover an interesting phenomenon

                                                                         put logits in the vocabulary space in Table 41. We prompt

that the model may occasionally output translations in other

                                                                         Llama3.18B-inst with “I see a llama sleeping in my back-

languages (Spanish and Japanese in Case 3), even though

                                                                         yard.”, and check the layer outputs in different settings.

it has never encountered these languages during the mask

                                                                         From the table, we can observe that model outputs w/ in-

training. This suggests that merely unifying the distribution

                                                                         struction and w/ M exhibit a high degree of overlap in the

of attention scores is insufficient for the model to accurately

                                                                         top-5 tokens in the latter layers of the model (Layer 22–30),

elicit the corresponding functionality. In addition, Section

                                                                         reflecting the similarity in information flow when execut-

C.2 mentions that the functionality of attention heads is not

                                                                         ing the functionality. At the output layer (Layer 31), the

likely to be concentrated in the KV heads. Combined with

                                                                         masked model produces translations in the target language,

the results of query-head removal, we infer that the func-

                                                                         as well as semantically aligns other top tokens with the in-

tionality of attention heads is more likely to be distributed

                                                                         put text. This also demonstrates the semantic preservation

in the output projection matrix WO , which may serve as a

                                                                         characteristic of the translation task.

role similar to the FFN layer in the model.



C.3.3. FFN L AYER R EMOVAL                                               C.5. IWSLT2017 Evaluation Examples



This section mainly explains that removing FFN layers is not             In Section 5, we evaluate the BLEU scores of the model

necessary for triggering functionalities. In our experiments,            with α-scaled M on the IWSLT2017 translation dataset.

we only apply the mask M on the attention heads, but the                 Considering the style difference between the models shown

mask can also be applied to FFN layers by removing their                 in Table 36, in the evaluation, we clean up the generated

contributions to the residual stream. Similar to Equation (2),           outputs so that they contain no explanation words or punctu-

for the input X at the decoder layer l, if we use a binary               ation marks. Therefore, the BLEU scores reported in Table

mask ml ∈ {0, 1} to indicate whether the FFN layer is                    8 are more reliable in reflecting the translation quality of

selected in the model, then the decoder layer output can be              the model. We provide some examples of the model outputs

written as:                                                              in Table 42. Overall, whether the instructed model includes

                                                                         scaled M does not make too much difference in the gener-

Decoderl (X) = X+MHA(X)+ml FFN (X + MHA(X)) .                            ated sentences. However, the model w/ scaled M generally

                                        (5)                              provides responses that better align with the labels.



                                                                    24


=== PDF PAGE 25 ===
                Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking





Table 41. A probing 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.

                                                  Top-k tokens

        Layer

                     Top1           Top2            Top3            Top4            Top5

      Embedding       illo           abil            incer          otron              câ

                                    Alam            cheng            Voy             reff

         0           cheng           the               čin           utas           Alam

                                                                                                      Table 42. Examples of IWSLT2017 en-zh translation on instructed

                      spun

                        'gc

                                    ouch               ‫ﺿﯽ‬

                                                    forget

                                                                    Alam

                                                                 .netbeans

                                                                                        “

                                                                                    alink

                                                                                                      Llama3.18B-inst and the instructed model with α-scaled M. We

         1              'gc         alink                            utas        .netbeans            provide their BLEU scores in the bracket, and highlight the

                        'gc     _extensions          alink     Combination           pok

                        'gc                         purch             the        .netbeans            alignments and differences among the translations.

         2              'gc                      .netbeans        -toggler         cheng

                        'gc          edir             utas             ´:            utar

                        'gc                           .CR             edl        .netbeans

         3              'gc      .netbeans             reff          edn              edl              Chinese       而有的时候，一个小小的样板模型的经验

                        'gc

                        'gc

                                     utar

                                     #ab

                                                      edir

                                                       #aa

                                                                     .CR

                                                                     __$

                                                                                       oğ

                                                                                  -toggler

                                                                                                       input         会帮助我们将“糟了” 的那一刻变成了“”哈

         4              'gc       -toggler           шиб           ATAB        \Dependency                           哈”的一刻

                        'gc          #ab                ện            #aa            edir

                       #ab            'gc              #aa          PFN              #ac

         5             #ab            'gc              #ac           kke            ーニ                 English       And sometimes a little prototype of this experi-

                       kke            'gc             #ab            edir             edl              gold label    ence is all that it takes to turn us from an uhoh

                        'gc          #ad           -*-\r\n            #aa             #af

         6          -*-\r\n          #ad              #ab        .netbeans            'gc                            moment to a tada moment

                        'gc            öğ        .netbeans           шиб             kke

                      LLU          -*-\r\n          chalk            kke            buurt

         7            LLU          -LAST           -*-\r\n            'gc            #ab               Instructed    And sometimes a small models experience will

                       kke

                       #ad

                                     шиб

                                     #ab

                                                   -*-\r\n

                                                     меть

                                                                  Vectors

                                                                    ibase

                                                                             .ArgumentParser

                                                                                  morgan

                                                                                                       (0.556)       help us turn a oh no moment into a ha ha moment

         8          emain             'gc              #af          chalk           ektor

                       kke        morgan          Sharper             'gc             řes              w/ scaled     And sometimes a small prototype models expe-

                     ibase        morgan               #aa          amet            /***/

         9            poil          .SIG           GetInt          emain             >tag

                                                                                                       M             rience will help us turn a oh no moment into a ha

                    GetInt           кту           reopen           _hub             @js               (0.640)       ha moment

                    -*-\r\n           'gc              #af            #aa            #ab

         10             'gc          >tag            .SIG            цес             poil

                        'gc

                       #aa

                                vertisement

                                     #ae

                                                     eyim

                                                       #af

                                                                  Sharper

                                                                   _TAC

                                                                                  hamster

                                                                                   )frame

                                                                                                       Chinese       我在想你们会怎么选，近来我问了我的朋友

         11            ruz         корист               감            >tag            ncy               input         很多次这个问题，他们的回答都是“回到过

                      koli

                       #__

                                     olik

                                   -*-\r\n

                                                     itom

                                                       #ac

                                                                   GetInt

                                                                   _TAC

                                                                                     aliz

                                                                                  Sharper                            去”。

         12             'gc        корист            pNet           dime          Sharper

                    _TAC            ouser             lant           gov          ../../../../         English       And I wonder what youd choose because Ive

                    _TAC             #__               #af         HITE              #aa

         13             'gc         pNet        .Reporting        Sharper         dissolve             gold label    been asking my friends this question a lot lately

                     cocci        ../../../../        hale          unset            gov

                    _TAC             #__               -lfs          -wsj          (DBG

                                                                                                                     and they all want to go back

         14           -wsj    ContentLoaded             �           меть            pNet

                      rych             �             bette         _TAC              esan              Instructed    Ive been asking my friends this question a lot

                      -wsj         _TAC               .DO           aken             atre

         15           -wsj           >tag            :uint            lap            hon               (0.616)       lately and they all say go back in time

                ContentSize         grese         ../../../../       rych            acz

                  styleType         ニア                -wsj         zsche              #af              w/ scaled     Ive been wondering how you would choose and

         16         RetVal           hon           )frame            -wsj           Macy

                     zsche           itsu      ContentSize          hend            cocci              M             lately Ive asked my friends this question a lot and

                unfortunately       trom            itious           clid           ORY

         17            hon           artz      increasingly confidently            couch               (0.813)       they all say go back in time

                                    cocci            hend            esan            owy

                unfortunately WEBPACK                Levy           ORY               HS

         18      confidently         bes           WSTR        increasingly          hon               Chinese       大多数人建的塔的平均高度是20英尺 商学

                      owy

                    sounds

                                     enth

                               unfortunately

                                                       hek

                                                 Highland

                                                                  :UIAlert

                                                                 probably

                                                                                     bes

                                                                                  unlikely

                                                                                                       input         院学生，大概是一半 律师好一些，但也好

         19            hon           bes       increasingly                             (                            不到哪里去 幼儿园的孩子，比大多数的成

                wonderfully          bes                            �单              otive

                      That         sounds         chances       likelihood        unlikely                           年人要好

         20            hon           bes                in     increasingly MainAxisAlignment

                          a                            beg              I            bes               English       So the average for most people is around 20

                      That           That         chances       likelihood           zcze

         21               I           my                in              c               p              gold label    inches business schools students about half of

                          I           ..\n               a             it

                      That           That         chances            -lnd       likelihood                           that lawyers a little better but not much better

         22               I           my              you             me                c

                          I           ..\n               a            my

                                                                                                                     than that kindergarteners better than most adults

                         it          That               It         unless            That

         23               I          you               my              in             ..\n             Instructed    Most people build towers to an average height of

                       ..\n             I                a           …\n               in

                         it         while               It         While             That              (0.749)       20 feet Business school students are probably

         24             my              I              ..\n            in            you                             about half as good as lawyers but not much bet-

                       ..\n             I            …\n                a             my

                         it          That             that          while            That                            ter Preschool children are better than most adults

         25             my            ..\n              in              I            you

                       ..\n             I            …\n               in              in

                      That           that            That          THAT                it

                                                                                                       w/ scaled     Most people build towers with an average height

         26             my              I               in            ..\n           you               M             of 20 feet The law students were about half as

                       ..\n          …\n                 I             in            ...\n

                       that          That            That          THAT              that              (0.720)       good but not much better The kindergarten chil-

         27              in          you               my             ..\n           …\n

                       ..\n          …\n                in             in            ...\n

                                                                                                                     dren were better than most adults

                       that          That            That             ..\n         THAT

         28           …\n             ..\n              in          /stdc        backyard

                      …\n             ..\n              in           ...\n              a

                      That           that            That             ..\n        _exempt

         29           …\n           /stdc               in            ..\n        _exempt

                       ..\n          …\n                in          /stdc             ‫واء‬

                      That             It                I             L             That

         30       backyard        _exempt               我              in             ..\n

                        我             Un                 I            ..\n             A

                      That             It               L               I        However

         31             我              你                您              在               有

                        我               I               A           一个                 It









                                                                                                 25


=== PDF PAGE 26 ===
           Large Language Models Can Perform Tasks Without Instruction via Selective Attention Head Masking



C.6. Experiments on MoE Model

                                                                     Table 43. XNLI translation perplexity (PPL) on Phi-3.5-MoEinst .

MoE (Mixture-of-Experts) language models divide the

                                                                                                   w/ instruction

model’s FFN (Feed-Forward Network) layer into multiple

experts, and during inference, only a subset of these experts                 To

                                                                                    en      zh        fr       es      de      ru      ar

is selected by routers to contribute to the computation. MoE         From

models often achieves better performance than dense mod-                 en          −     1.088     1.046    0.857   1.008   1.286   0.851

els with a similar number of activated parameters and is                 zh        2.747     −       2.160    2.371   2.317   1.825   1.237

gradually becoming a popular research topic. In this section,                                          w/ M

we conduct experiments to verify whether the attention head                   To

mask can still switch the model’s behavior in MoE models.                           en      zh        fr       es      de      ru      ar

                                                                     From

We select Phi-3.5-MoE-instruct (AdinaTru, 2024) (16×3.8B                 en          −     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

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 in Table 43-44, we observe

that while head masking in the MoE model could trigger be-           Table 44. XNLI translation ROUGE-L on Phi-3.5-MoEinst .

havior switch, it does not lead to performance improvements

                                                                                                   w/ instruction

on the generative metric. This might be because the major-

ity of MoE model parameters are concentrated in the FFN                       To

                                                                                    en      zh        fr       es      de      ru      ar

                                                                     From

layers, while the attention layer accounts for only a small

portion of parameters. We propose another two possible                   en          −     0.448     0.650    0.674   0.628   0.429   0.425

                                                                         zh        0.519     −       0.465    0.484   0.449   0.378   0.344

explanations: (1) The primary functionality of MoE might

reside in the FFN, with the router playing a role similar to                                           w/ M

attention head masking for function selection. (2) The task-                  To

level mask and the token-level router may not work well                             en      zh        fr       es      de      ru      ar

                                                                     From

together. Improving the effectiveness of head masks in MoE               en          −     0.400     0.361    0.568   0.481   0.282   0.278

models is an important direction for our future research.                zh        0.558     −       0.314    0.327   0.350   0.231   0.237









                                                                26

