Modelos de Linguagem Grandes como Cadeias de Markov
Large Language Models as Markov Chains
October 3, 2024
Autores: Oussama Zekri, Ambroise Odonnat, Abdelhakim Benechehab, Linus Bleistein, Nicolas Boullé, Ievgen Redko
cs.AI
Resumo
Os grandes modelos de linguagem (LLMs) têm demonstrado ser notavelmente eficientes, tanto em uma ampla gama de tarefas de processamento de linguagem natural quanto além delas. No entanto, uma análise teórica abrangente das origens de seu desempenho impressionante ainda é esquiva. Neste artigo, abordamos essa tarefa desafiadora estabelecendo uma equivalência entre modelos de linguagem autoregressivos genéricos com um vocabulário de tamanho T e janela de contexto de tamanho K e cadeias de Markov definidas em um espaço de estados finitos de tamanho O(T^K). Derivamos várias descobertas surpreendentes relacionadas à existência de uma distribuição estacionária de cadeias de Markov que capturam o poder de inferência dos LLMs, sua velocidade de convergência a ela e a influência da temperatura nesta última. Em seguida, demonstramos limites de pré-treinamento e generalização no contexto e mostramos como a equivalência estabelecida nos permite enriquecer sua interpretação. Por fim, ilustramos nossas garantias teóricas com experimentos em vários LLMs recentes para destacar como eles capturam o comportamento observado na prática.
English
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.Summary
AI-Generated Summary