Measuring Feature Sparsity in Language Models

Mingyang Deng, Lucas Tao, Joe Benton
10/11/2023
cs.LG

No confident code implementation found for this paper.

Abstract

Recent works have proposed that activations in language models can be modelled as sparse linear combinations of vectors corresponding to features of input text. Under this assumption, these works aimed to reconstruct feature directions using sparse coding. We develop metrics to assess the success of these sparse coding techniques and test the validity of the linearity and sparsity assumptions. We show our metrics can predict the level of sparsity on synthetic sparse linear activations, and can distinguish between sparse linear data and several other distributions. We use our metrics to measure levels of sparsity in several language models. We find evidence that language model activations can be accurately modelled by sparse linear combinations of features, significantly more so than control datasets. We also show that model activations appear to be sparsest in the first and final layers.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Cite this paper

@article{deng2023measuring,
  title  = {Measuring Feature Sparsity in Language Models},
  author = {Mingyang Deng and Lucas Tao and Joe Benton},
  year   = {2023},
  eprint = {2310.07837},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2310.07837v2}
}

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/2310.07837.svg)](https://codeofpaper.com/paper/2310.07837)

Discussion