paper-with-me

홈 › Papers

What Matters in Transformers? Not All Attention is Needed

2024-06-22 · Shwai He, Guoheng Sun, Zheyu Shen, Ang Li

While scaling Transformer-based large language models (LLMs) has demonstrated promising performance across various tasks, it also introduces redundant architectures, posing efficiency challenges for real-world deployment. Despite some recognition of redundancy in LLMs, the variability of redundancy across different architectures in transformers, such as MLP and Attention layers, is under-explored. In this work, we investigate redundancy across different modules within Transformers, including Blocks, MLP, and Attention layers, using a similarity-based metric. Surprisingly, despite the critical role of attention layers in distinguishing transformers from other architectures, we found that a large portion of these layers exhibit excessively high similarity and can be pruned without degrading performance. For instance, Llama-2-70B achieved a 48.4\% speedup with only a 2.4\% performance drop by pruning half of the attention layers. Furthermore, by tracing model checkpoints throughout the training process, we observed that attention layer redundancy is inherent and consistent across training stages. Additionally, we further propose a method that jointly drops Attention and MLP layers, allowing us to more aggressively drop additional layers. For instance, when dropping 31 layers (Attention + MLP), Llama-2-13B still retains 90\% of the performance on the MMLU task. Our work provides valuable insights for future network architecture design. The code is released at: \url{https://github.com/Shwai-He/LLM-Drop}.

📄 PDF Abstract BibTeX arXiv:2406.15786

Code (2)

case-lab-umd/llm-drop 공식 구현 pytorch
shwai-he/llm-drop 공식 구현 pytorch

Tasks

AllMMLU

Methods 이 논문이 사용한 방법론

Softmax The Softmax output function transforms a previous layer's output into a vector of probabilities. It is commonly used for multiclass classification. Given an input vector $x$…
Attention 설명 없음
Pruning 설명 없음

Similar Papers 제목 키워드 기반

Machine Learning that Matters

2012-06-18 · Kiri Wagstaff

Much of current machine learning (ML) research has lost its connection to problems of import to the larger world of science and society. From this perspective, there exist glaring limitations in the data sets we investig…

BIG-bench Machine Learning

Individual Parameters in Weight-Sparse Transformers Appear Interpretable

2026-07-03 · Arnau Marin-Llobet, Stefan Heimersheim arxiv

A central goal of mechanistic interpretability is to understand how neural networks work and what each individual component does. Dominant circuit-finding approaches focus on a specific behavior and reverse-engineer the …

Attend what matters: Leveraging vision foundational models for breast cancer classification using mammograms

2026-04-21 · Samyak Sanghvi, Piyush Miglani, Sarvesh Shashikumar, Kaustubh R Borgavi 외 arxiv

Vision Transformers $(\texttt{ViT})$ have become the architecture of choice for many computer vision tasks, yet their performance in computer-aided diagnostics remains limited. Focusing on breast cancer detection from ma…

Medical Image ClassificationBreast Cancer DetectionCancer ClassificationContrastive Learning

Mask What Matters: Mitigating Object Hallucinations in Multimodal Large Language Models with Object-Aligned Visual Contrastive Decoding

2026-02-12 · Boqi Chen, Xudong Liu, Jianing Qiu arxiv

We study object hallucination in Multimodal Large Language Models (MLLMs) and improve visual contrastive decoding (VCD) by constructing an object-aligned auxiliary view. We leverage object-centric attention in self-super…

Forget Attention: Importance-Aware Attention Is All You Need

2026-06-01 · Suhyeong Shin, Yeongwook Yang arxiv

Combining attention's global retrieval with the sequential importance signal of state space models (SSMs) is the open challenge of hybrid language modeling. Transformers see everywhere but cannot prioritize; SSMs know wh…