When Attention Collapses: How Degenerate Layers in LLMs Enable Smaller, Stronger Models

Sunny Sanyal, Ravid Shwartz-Ziv, Alexandros G. Dimakis, Sujay Sanghavi
4/12/2024
cs.CLcs.AIcs.LG

Official code: sanyalsunny111/LLM-Inheritune (126 stars, last commit 2026-03-06).

Abstract

Large Language Models (LLMs) rely on the transformer architecture and its self-attention mechanism to deliver strong performance across tasks. However, we uncover a structural inefficiency in standard pre-trained decoder-style LLMs: in many of the deeper layers, attention matrices frequently collapse to near rank-one, single-column patterns. We refer to these underutilized components as lazy layers, which are redundant and computationally inefficient. To address this, we propose Inheritune, a simple and effective training recipe for building smaller, more efficient, and high performing language models. Inheritune initializes a compact model by inheriting the useful early layers from a larger pre-trained model, then progressively retrains and expands it. Our experiments across multiple models and datasets show that Inheritune trained models, despite having significantly fewer layers, can match or even outperform their larger counterparts. This approach yields compact, performant models and offers a practical path for efficient language model compression. Code is available at https://github.com/sanyalsunny111/LLM-Inheritune

View on arXivView PDF

Code Implementations(1)

[TMLR 2025] When Attention Collapses: How Degenerate Layers in LLMs Enable Smaller, Stronger Models

12610Shell, PythonApr 9, 20247 months ago

Similar Papers

Cite this paper

@article{sanyal2024when,
  title  = {When Attention Collapses: How Degenerate Layers in LLMs Enable Smaller, Stronger Models},
  author = {Sunny Sanyal and Ravid Shwartz-Ziv and Alexandros G. Dimakis and Sujay Sanghavi},
  year   = {2024},
  eprint = {2404.08634},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2404.08634v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2404.08634.svg)](https://codeofpaper.com/paper/2404.08634)

Discussion