AVSS: Layer Importance Evaluation in Large Language Models via Activation Variance-Sparsity Analysis

Zichen Song, Yuxin Wu, Sitan Huang, Zhongfeng KangarXiv 2024 · DOI

Introduction

As Large Language Models (LLMs) continue to scale, the computational costs associated with their deployment and inference have become a significant bottleneck. Layer pruning—the removal of redundant or less impactful layers—offers a promising path toward efficiency. However, identifying which layers are truly essential remains a challenge. Traditional methods often rely on computationally expensive gradient calculations or static metrics that fail to capture the dynamic information flow within the network.

This paper introduces the Activation Variance-Sparsity Score (AVSS), a lightweight yet robust metric designed to rank layer importance by analyzing internal activation distributions. By leveraging the relationship between activation variance and sparsity, the authors demonstrate that LLMs can be significantly compressed with minimal impact on performance.

The AVSS Methodology

The core innovation of this work is the AVSS metric, which evaluates each layer ($L_i$) based on two distinct signals derived from its activation states:

  1. Activation Variance ($\sigma^2$): This captures the diversity of features processed by a layer. High variance indicates that a layer is performing complex transformations and capturing intricate data patterns.
  2. Activation Sparsity ($S$): This measures the proportion of inactive neurons (outputs near zero). High sparsity suggests that a layer is underutilized or redundant within the model's architecture.
The AVSS workflow: (a) Input layers, (b) Analysis of activation distribution to derive variance and sparsity, and (c) Calculation of the final AVSS importance score.

The AVSS is defined as the ratio of variance to sparsity: $$AVSS(L_i) = \frac{\sigma^2(L_i)}{S(L_i)}$$

By rewarding high variance and penalizing high sparsity, the metric identifies layers that are both informative and active. These scores are then normalized to create a cumulative impact ranking, allowing for the systematic pruning of the lowest-contributing layers.

Experimental Setup

The effectiveness of AVSS was evaluated across three primary NLP tasks using a variety of model architectures, including DistilBERT, Llama (1B, 7B, 8B), and Stablelm-3B:

  • Sentiment Classification: Evaluated on the SST-2 dataset.
  • Language Modeling: Measured via perplexity on the HackerNews and The Pile datasets.
  • Question Answering: Evaluated using F1-scores on the SQuAD dataset.

Key Results and Discussion

The AVSS method consistently outperformed established baselines, including Gradient-Based Importance Scores (GBIS), Layer-wise Relevance Propagation (LRP), and the Comprehensive Importance Metric (CIM).

Performance comparison of AVSS against baseline pruning methods across Sentiment Classification, Language Modeling, and Question Answering tasks.

Performance Retention

As shown in the results table, AVSS allows for substantial parameter reduction while maintaining high accuracy. For instance, on the SST-2 task, the Stablelm-3B model retained an accuracy of 0.9032 even after a 25% reduction in parameters. In the Question Answering domain, AVSS achieved an F1-score of 0.5121 for Llama-8B at a 12.5% reduction level, significantly higher than the 0.4813 achieved by the next-best baseline (CIM).

Insights into Model Redundancy

The success of AVSS suggests that modern LLMs are significantly over-parameterized in terms of depth. The ability to remove up to a quarter of a model's layers with minimal performance loss indicates that many layers may be performing redundant refinements or identity-like transformations. Furthermore, the superiority of AVSS over gradient-based methods suggests that internal activation states are a more reliable and efficient indicator of functional importance than gradient sensitivity.

Conclusion and Future Work

AVSS provides a computationally efficient and accurate metric for identifying layer importance in LLMs. By focusing on the intrinsic properties of activation distributions, it enables effective pruning that preserves model performance across diverse tasks.

Future research could extend this work by investigating automated thresholds for optimal pruning levels and benchmarking actual wall-clock inference speedups across different hardware configurations. Additionally, exploring the applicability of AVSS to non-Transformer architectures, such as state-space models, remains an open area for investigation.

Summary updated

BibTeX
@misc{song2024avss,
  author = {Zichen Song and Yuxin Wu and Sitan Huang and Zhongfeng Kang},
  title = {{AVSS: Layer Importance Evaluation in Large Language Models via Activation Variance-Sparsity Analysis}},
  year = {2024},
  eprint = {2411.02117},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2411.02117},
}
Figure