Papers › Attend First, Consolidate Later: On the Importance of Attention in Different LLM Layers

Attend First, Consolidate Later: On the Importance of Attention in Different LLM Layers

5 Sep 2024arXiv:2409.03621archive 2025-07-28

Amit Ben-Artzy, Roy Schwartz

In decoder-based LLMs, the representation of a given layer serves two purposes: as input to the next layer during the computation of the current token; and as input to the attention mechanism of future tokens. In this work, we show that the importance of the latter role might be overestimated. To show that, we start by manipulating the representations of previous tokens; e.g. by replacing the hidden states at some layer k with random vectors. Our experimenting with four LLMs and four tasks show that this operation often leads to small to negligible drop in performance. Importantly, this happens if the manipulation occurs in the top part of the model-k is in the final 30-50% of the layers. In contrast, doing the same manipulation in earlier layers might lead to chance level performance. We continue by switching the hidden state of certain tokens with hidden states of other tokens from another prompt; e.g., replacing the word "Italy" with "France" in "What is the capital of Italy?". We find that when applying this switch in the top 1/3 of the model, the model ignores it (answering "Rome"). However if we apply it before, the model conforms to the switch ("Paris"). Our results hint at a two stage process in transformer-based LLMs: the first part gathers input from previous tokens, while the second mainly processes that information internally.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2409.03621")

Code

Syntology Ran 6 of 15 code samples harvested from 1 repository linked to this paper; 9 have no recorded run. Of those that ran: 6 ran with no contract checked.

By repository: official repository: 15 samples from 1 repository, 6 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

schwartz-lab-NLP/Attend-First-Consolidate-Later officialmentioned in papermentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

15 samples harvested; 6 ran; 0 honoured the contract we drafted; 9 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

6ran
9unverified

Licence: 15 of the 15 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from schwartz-lab-NLP/Attend-First-Consolidate-Later. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

llama_manipulate_casualLM_forward schwartz-lab-NLP/Attend-First-Consolidate-Later/convert_models/llama_manipulate.py official repository ran no licence file found · pointer only · c77ced1c95818050 · report
llama_skip_casualLM_forward schwartz-lab-NLP/Attend-First-Consolidate-Later/convert_models/llama_skip.py official repository ran no licence file found · pointer only · b06edc31230f8c63 · report
llama_skip_decoder_forward schwartz-lab-NLP/Attend-First-Consolidate-Later/convert_models/llama_skip.py official repository ran no licence file found · pointer only · faf27efb24417c61 · report
llama_skip_model_forward schwartz-lab-NLP/Attend-First-Consolidate-Later/convert_models/llama_skip.py official repository ran no licence file found · pointer only · 38da980c937dd416 · report
mistral_skip_decoder_forward schwartz-lab-NLP/Attend-First-Consolidate-Later/convert_models/mistral_skip.py official repository ran no licence file found · pointer only · 1d312572a2b534cf · report
mistral_skip_model_forward schwartz-lab-NLP/Attend-First-Consolidate-Later/convert_models/mistral_skip.py official repository ran no licence file found · pointer only · 1d96b3096bdd4609 · report
add_argument schwartz-lab-NLP/Attend-First-Consolidate-Later/convert_models/convert_models.py official repository unverified no licence file found · pointer only · bca7d43f1dfa3090 · report
enable_manipulated_gen schwartz-lab-NLP/Attend-First-Consolidate-Later/convert_models/convert_models.py official repository unverified no licence file found · pointer only · afad9c2c0ce6ae44 · report
enable_skip_attention schwartz-lab-NLP/Attend-First-Consolidate-Later/convert_models/convert_models.py official repository unverified no licence file found · pointer only · 505d78eeb35e450d · report
get_injection_data schwartz-lab-NLP/Attend-First-Consolidate-Later/information_injection_demo.py official repository unverified no licence file found · pointer only · ef50b4a8b49827d4 · report
get_next_token schwartz-lab-NLP/Attend-First-Consolidate-Later/information_injection_demo.py official repository unverified no licence file found · pointer only · 25fec94220fb4524 · report
llama_manipulate_model_forward schwartz-lab-NLP/Attend-First-Consolidate-Later/convert_models/llama_manipulate.py official repository unverified no licence file found · pointer only · de3c8559ca6e9a7d · report
mistral_model_causalLM_manipulated_forward schwartz-lab-NLP/Attend-First-Consolidate-Later/convert_models/mistral_manipulated.py official repository unverified no licence file found · pointer only · 1572d250024e9631 · report
mistral_model_manipulated_forward schwartz-lab-NLP/Attend-First-Consolidate-Later/convert_models/mistral_manipulated.py official repository unverified no licence file found · pointer only · 4fec8ca69367d057 · report
mistral_skip_causalLM_forward schwartz-lab-NLP/Attend-First-Consolidate-Later/convert_models/mistral_skip.py official repository unverified no licence file found · pointer only · 3a66a57c55207487 · report

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

AttentionHINTSoftmax

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections