Tokens as Computational Units in Data Science and Machine Learning: Mathematical Foundations, Transformer Architecture, Inference Economy, and Caching Systems in Foundational Models
Pedro Emílio Amador Salomão
Universidade Federal dos Vales do Jequitinhonha e Mucuri
Key points
From the paper's conclusion- We begin by tracing the evolution of tokenization from classical Natural Language Processing (NLP) to its sophisticated forms in deep learning, examining its mathematical representation through high-dimensional vectors (embeddings) and the computational complexities arising from attention mechanisms, which scale quadratically (O(n²)) with sequence length.
Abstract
The concept of the "token" has evolved from a simple linguistic unit to a fundamental computational primitive that underpins the architecture, performance, and economics of modern artificial intelligence systems. This paper provides a comprehensive and in-depth analysis of tokens as computational units across Data Science and Machine Learning, with a particular focus on Transformer-based foundational models. We begin by tracing the evolution of tokenization from classical Natural Language Processing (NLP) to its sophisticated forms in deep learning, examining its mathematical representation through high-dimensional vectors (embeddings) and the computational complexities arising from attention mechanisms, which scale quadratically (O(n²)) with sequence length. The article then explores the economic dimension of tokens, analyzing the "token economy" that governs API-based access to large language models (LLMs) and the resulting drive for inference optimization. A significant portion of this work is dedicated to a detailed investigation of advanced caching architectures—including KV Cache, prefix caching, semantic caching, and distributed inference caching—that are critical for mitigating latency and computational costs. Furthermore, we discuss emerging trends such as token pruning, sparse attention, and long-context optimization, which are pushing the boundaries of model efficiency and capability. The paper culminates in the proposal of an original conceptual framework, the Token Efficiency Index (TEI), a novel metric designed to provide a standardized measure for evaluating the computational and economic efficiency of tokenization strategies and model architectures. This work synthesizes mathematical theory, architectural insights, and economic analysis to offer a holistic, token-centric perspective on the current state and future directions of large-scale AI.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- TokenGate: Adapting LLMs for Fast and Memory-Efficient Prefill with Learned Token PruningarXiv · 2026
- KV$^2$: A Self-Refining KV CachearXiv · 2026
- What Does a Token Cost? A Mixture-of-Agents Measurement of Sufficient Per-Token ComputearXiv · 2026
- LowRAM: Low-Rank Keys and Amortised Values for Composable KV Cache Compression at Test-TimearXiv · 2026
- Reasoning in Fewer Tokens: Concept-Normalized Multilingual Scratchpads and Reversible Model-Adaptive Reasoning CodesarXiv · 2026
- Counting and Min-Cost Encoding for Tokenization in Large Language ModelsarXiv · 2026