The magnitude of categories of texts enriched by language models
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
- 2017Attention Is All You Needcited by 60,361
- 2021An enriched category theory of language: from syntax to semanticscited by 22
- 2023Meaning Representations from Trajectories in Autoregressive Modelscited by 18
- 2021Weighting vectors for machine learning: numerical harmonic analysis applied to boundary detectioncited by 6
- 2021The magnitude vector of imagescited by 4
- 2024Directed Metric Structures arising in Large Language Modelscited by 2
Built on by
Citing papers per year: 2025: 3; 2026: 2.
5 papers.
- 2025Token embeddings violate the manifold hypothesiscited by 16
- 2025Probing the topology of the space of tokens with structured promptscited by 3
- 2026The Homogenization Problem in LLMs: Towards Meaningful Diversity in AI Safetycited by 2
- 2025TokenBlowUp: Resolving Representational Singularities in LLM Token Spaces via Monoidal Transformationscited by 0
- 2026Measuring What Persists: Conditioning Mechanisms and a Geometric Framework for AI Agent Identitycited by 0
- 2026Measuring What Persists: Conditioning Mechanisms and a Geometric Framework for AI Agent Identity20 Jun 2026
- 2026The Homogenization Problem in LLMs: Towards Meaningful Diversity in AI Safety3 Jan 2026
- 2025TokenBlowUp: Resolving Representational Singularities in LLM Token Spaces via Monoidal Transformations26 Jul 2025
- 2025Token embeddings violate the manifold hypothesis1 Apr 2025
- 2025Probing the topology of the space of tokens with structured prompts19 Mar 2025