TensorX
返回文献探索

Paper · arXiv 2410.02724

Large Language Models as Markov Chains

Oussama Zekri, Ambroise Odonnat, Abdelhakim Benechehab, Linus Bleistein, Nicolas Boullé, Ievgen Redko

33 upvotesOctober 3, 2024arXiv 预印本
AI 摘要

Theoretical analysis of large language models explores their inference capabilities and generalization through equivalence with Markov chains, providing pre-training and in-context bounds.

autoregressive language modelsMarkov chainsstationary distributionspeed of convergencetemperaturepre-trainingin-context generalization

Abstract

Large language models (LLMs) have proven to be remarkably efficient, both across a wide range of natural language processing tasks and well beyond them. However, a comprehensive theoretical analysis of the origins of their impressive performance remains elusive. In this paper, we approach this challenging task by drawing an equivalence between generic autoregressive language models with vocabulary of size T and context window of size K and Markov chains defined on a finite state space of size O(T^K). We derive several surprising findings related to the existence of a stationary distribution of Markov chains that capture the inference power of LLMs, their speed of convergence to it, and the influence of the temperature on the latter. We then prove pre-training and in-context generalization bounds and show how the drawn equivalence allows us to enrich their interpretation. Finally, we illustrate our theoretical guarantees with experiments on several recent LLMs to highlight how they capture the behavior observed in practice.

北京市昌平区探索星信息技术及软件开发工作室

京ICP备2026059466号
Large Language Models as Markov Chains | TensorX