Modeling Reasoning as Markov Decision Processes: A Theoretical Investigation into NLP Transformer Models
Transformer-based models have achieved state-of-the-art performance across a broad spectrum of natural language processing (NLP) tasks, including translation, summarization, and question answering. Despite this success, a theoretical understanding of how these models perform reasoning over multiple steps remains elusive. This paper introduces a novel perspective: reasoning within transformers can be formally framed as a Markov Decision Process (MDP). By treating hidden states as MDP states, token predictions as actions, and attention-guided transitions as state dynamics, we reinterpret the transformer architecture through the lens of sequential decision-making. We develop a theoretical formulation of this mapping, propose multiple task-agnostic reward functions to quantify reasoning quality, and explore the internal attention patterns as a proxy for policy learning. Using synthetic and natural datasets involving multi-step logical inference, we show that certain transformer behaviors align with MDP planning policies. Our framework offers new tools for analyzing, evaluating, and potentially improving transformer reasoning, serving as a bridge between reinforcement learning and deep NLP.
Authors
- Zhenyu Gao (ORCID: https://orcid.org/0000-0002-8177-7123)
Institutions
- JPMorgan Chase & Co (United States) (US)
Publication Details
- Published
- 2025-06-20
- DOI
- https://doi.org/10.1109/icecai66283.2025.11170436
- Citations
- 9
- Primary Topic
- Bayesian Modeling and Causal Inference
- Type
- article
- Field-Weighted Citation Impact
- 22.33