Exploring Internal Numeracy in Language Models: A Case Study on ALBERT

Ulme Wennberg, Gustav Eje Henter
4/25/2024
cs.CL

No confident code implementation found for this paper.

Abstract

It has been found that Transformer-based language models have the ability to perform basic quantitative reasoning. In this paper, we propose a method for studying how these models internally represent numerical data, and use our proposal to analyze the ALBERT family of language models. Specifically, we extract the learned embeddings these models use to represent tokens that correspond to numbers and ordinals, and subject these embeddings to Principal Component Analysis (PCA). PCA results reveal that ALBERT models of different sizes, trained and initialized separately, consistently learn to use the axes of greatest variation to represent the approximate ordering of various numerical concepts. Numerals and their textual counterparts are represented in separate clusters, but increase along the same direction in 2D space. Our findings illustrate that language models, trained purely to model text, can intuit basic mathematical concepts, opening avenues for NLP applications that intersect with quantitative reasoning.

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!

Similar Papers

Cite this paper

@article{wennberg2024exploring,
  title  = {Exploring Internal Numeracy in Language Models: A Case Study on ALBERT},
  author = {Ulme Wennberg and Gustav Eje Henter},
  year   = {2024},
  eprint = {2404.16574},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2404.16574v1}
}

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

Discussion