Topos Theory for Generative AI and LLMs
Not on the map. Why?
Abstract (arXiv)
We propose the design of novel categorical generative AI architectures (GAIAs) using topos theory, a type of category that is ``set-like": a topos has all (co)limits, is Cartesian closed, and has a subobject classifier. Previous theoretical results on the Transformer model have shown that it is a universal sequence-to-sequence function approximator, and dense in the space of all continuous functions with compact support on the Euclidean space of embeddings of tokens. Building on this theoretical result, we explore novel architectures for LLMs that exploit the property that the category of LLMs, viewed as functions, forms a topos. Previous studies of large language models (LLMs) have focused on daisy-chained linear architectures or mixture-of-experts. In this paper, we use universal constructions in category theory to construct novel LLM architectures based on new types of compositional structures. In particular, these new compositional structures are derived from universal properties of LLM categories, and include pullback, pushout, (co) equalizers, exponential objects, and subobject classifiers. We theoretically validate these new compositional structures by showing that the category of LLMs is (co)complete, meaning that all diagrams have solutions in the form of (co)limits. Building on this completeness result, we then show that the category of LLMs forms a topos, a ``set-like" category, which requires showing the existence of exponential objects as well as subobject classifiers. We use a functorial characterization of backpropagation to define a potential implementation of an LLM topos architecture.
Key facts. Cited by 2 papers in the map (data through 14 Oct 2026). Builds on 13 of its 27 references that are in the map. First posted on arXiv 5 Aug 2025.
Builds on
13 of 27 references.
References · 13
- 2017Attention Is All You Needcited by 60,361
- 2021Efficiently Modeling Long Sequences with Structured State Spacescited by 2,465
- 2018Self-Attention with Relative Position Representationscited by 1,120
- 2023Faith and Fate: Limits of Transformers on Compositionalitycited by 503
- 2019Theoretical Limitations of Self-Attention in Neural Sequence Modelscited by 288
- 2021Saturated Transformers are Constant-Depth Threshold Circuitscited by 139
- 2019An Attentive Survey of Attention Modelscited by 124
- 2023Tighter Bounds on the Expressivity of Transformer Encoderscited by 66
- 2019A synthetic approach to Markov kernels, conditional independence and theorems on sufficient statisticscited by 56
- 2017Backprop as Functor: A compositional perspective on supervised learningcited by 44
- 2024Position: Categorical Deep Learning is an Algebraic Theory of All Architecturescited by 32
- 2021An enriched category theory of language: from syntax to semanticscited by 22
1 more
Built on by
Citing papers per year: 2026: 2.
2 papers.
Similar, not cited
Close in wording, no citation either way
- 2023An Automated Survey of Generative Artificial Intelligence: Large Language Models, Architectures, Protocols, and Applications
- 2023Towards Efficient Generative Large Language Model Serving: A Survey from Algorithms to Systems
- 2025Speed Always Wins: A Survey on Efficient Architectures for Large Language Models
- 2024LLM Augmented LLMs: Expanding Capabilities through Composition
- 2025Developing a Foundation of Vector Symbolic Architectures Using Category Theory
- 2025Detailed balance in large language model-driven agents
- 2024Designing Algorithms Empowered by Language Models: An Analytical Framework, Case Studies, and Insights
- 2023Beyond Words: A Mathematical Framework for Interpreting Large Language Models