Table of Contents
Fetching ...

Achieving Sparse Activation in Small Language Models

Jifeng Song, Kai Huang, Xiangyu Yin, Boyuan Yang, Wei Gao

TL;DR

This paper shows that the existing sparse activation schemes in LLMs that build on neurons' output magnitudes cannot be applied to SLMs, and activating neurons based on their attribution scores is a better alternative, and proposes a new attribution metric that can provably correct errors and achieve precise sparse activation.

Abstract

Sparse activation, which selectively activates only an input-dependent set of neurons in inference, is a useful technique to reduce the computing cost of Large Language Models (LLMs) without retraining or adaptation efforts. However, whether it can be applied to the recently emerging Small Language Models (SLMs) remains questionable, because SLMs are generally less over-parameterized than LLMs. In this paper, we aim to achieve sparse activation in SLMs. We first show that the existing sparse activation schemes in LLMs that build on neurons' output magnitudes cannot be applied to SLMs, and activating neurons based on their attribution scores is a better alternative. Further, we demonstrated and quantified the large errors of existing attribution metrics when being used for sparse activation, due to the interdependency among attribution scores of neurons across different layers. Based on these observations, we proposed a new attribution metric that can provably correct such errors and achieve precise sparse activation. Experiments over multiple popular SLMs and datasets show that our approach can achieve 80% sparsification ratio with <5% model accuracy loss, comparable to the sparse activation achieved in LLMs. The source code is available at: https://github.com/pittisl/Sparse-Activation.

Achieving Sparse Activation in Small Language Models

TL;DR

This paper shows that the existing sparse activation schemes in LLMs that build on neurons' output magnitudes cannot be applied to SLMs, and activating neurons based on their attribution scores is a better alternative, and proposes a new attribution metric that can provably correct errors and achieve precise sparse activation.

Abstract

Sparse activation, which selectively activates only an input-dependent set of neurons in inference, is a useful technique to reduce the computing cost of Large Language Models (LLMs) without retraining or adaptation efforts. However, whether it can be applied to the recently emerging Small Language Models (SLMs) remains questionable, because SLMs are generally less over-parameterized than LLMs. In this paper, we aim to achieve sparse activation in SLMs. We first show that the existing sparse activation schemes in LLMs that build on neurons' output magnitudes cannot be applied to SLMs, and activating neurons based on their attribution scores is a better alternative. Further, we demonstrated and quantified the large errors of existing attribution metrics when being used for sparse activation, due to the interdependency among attribution scores of neurons across different layers. Based on these observations, we proposed a new attribution metric that can provably correct such errors and achieve precise sparse activation. Experiments over multiple popular SLMs and datasets show that our approach can achieve 80% sparsification ratio with <5% model accuracy loss, comparable to the sparse activation achieved in LLMs. The source code is available at: https://github.com/pittisl/Sparse-Activation.
Paper Structure (20 sections, 3 theorems, 8 equations, 11 figures, 8 tables)

This paper contains 20 sections, 3 theorems, 8 equations, 11 figures, 8 tables.

Key Result

Lemma 3.1

The error of inter-layer dependency caused by deactivating neuron $i$ in $L_1$, as quantified in Eq. (eq:quantification_error), has a lower bound of 0, and an upper bound of $\left| S(F, \mathbf{X}) - S(F, \widetilde{\mathbf{X}}) \right|$, where $S(F, \mathbf{X}) = \frac{\partial{F}}{\partial{X}}\ma

Figures (11)

  • Figure 1: Sparse activation for run-time improvement of inference performance
  • Figure 1: List of notations
  • Figure 2: Accuracy-sparsity tradeoffs on different SLMs and LLMs with sparse activation based on neurons' output magnitudes
  • Figure 3: Accuracy-sparsity tradeoffs using the Phi-2 model on the TruthfulQA dataset
  • Figure 4: Interdependency of different neurons' attribution scores in sparse activation
  • ...and 6 more figures

Theorems & Definitions (5)

  • Lemma 3.1
  • Lemma 3.2
  • Theorem 3.3
  • proof
  • proof