mlsanityData to 14 Oct 2026

The magnitude of categories of texts enriched by language models

arXiv 2501.06662 ↗First posted 11 Jan 2025math.CT cs.CLcited by 5

Not on the map. Why?

Abstract (arXiv)

The purpose of this article is twofold. Firstly, we use the next-token probabilities given by a language model to explicitly define a category of texts in natural language enriched over the unit interval, in the sense of Bradley, Terilla, and Vlassopoulos. We consider explicitly the terminating conditions for text generation and determine when the enrichment itself can be interpreted as a probability over texts. Secondly, we compute the M"obius function and the magnitude of an associated generalized metric space of texts. The magnitude function of that space is a sum over texts (prompts) of the t-logarithmic (Tsallis) entropies of the next-token probability distributions associated with each prompt, plus the cardinality of the model's possible outputs. A suitable evaluation of the magnitude function's derivative recovers a sum of Shannon entropies, which justifies seeing magnitude as a partition function. Following Leinster and Shulman, we also express the magnitude function of the generalized metric space as an Euler characteristic of magnitude homology and provide an explicit description of the zeroeth and first magnitude homology groups.

Key facts. Cited by 5 papers in the map (data through 14 Oct 2026). Builds on 6 of its 35 references that are in the map. First posted on arXiv 11 Jan 2025.

Builds on

6 of 35 references.

References · 6

  1. 2017Attention Is All You Needcited by 60,361
  2. 2021An enriched category theory of language: from syntax to semanticscited by 22
  3. 2023Meaning Representations from Trajectories in Autoregressive Modelscited by 18
  4. 2021Weighting vectors for machine learning: numerical harmonic analysis applied to boundary detectioncited by 6
  5. 2021The magnitude vector of imagescited by 4
  6. 2024Directed Metric Structures arising in Large Language Modelscited by 2

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 3; 2026: 2.

5 papers.