{
  "abstract": "We argue that pattern recognition and step-by-step reasoning are two ends of a spectrum. A large language model (LLM) learns to reason step-by-step when data is structured such that the next token depends on a small amount of preceding context. Inference in LLMs resembles pattern recognition when the next token depends on a large amount of preceding context. If the next token depends on only the $c$ most recent tokens, reasoning traces are paths on a De Bruijn graph whose nodes are $c$-length contexts and edges are next-token transitions between contexts. The set of reasoning traces of a task forms a directed acyclic subgraph of the De Bruijn graph. An LLM that has learned all edges of this subgraph can compose them to solve longer, unseen tasks, i.e., it reasons step-by-step. We prove that the number of edges is vanishingly small compared to the number of reasoning traces. Empirically, the number of training samples a transformer needs is a power law in the number of edges, so learning to reason step-by-step is sample efficient. We can induce De Bruijn structure in any task by maintaining a ``state'' that makes future reasoning independent of the past. The frequency of states in the reasoning trace determines $c$. We show, by fine-tuning Qwen2.5-1.5B-Instruct to solve equations and answer questions about stories, that frequent states (small $c$) result in higher accuracy but greater fragility to perturbations at test time. LLMs trained with a large $c$ are only as good as models that perform pattern recognition without reasoning. A moderate density of states balances accuracy and robustness. We show that real-world data has De Bruijn structure: Qwen3-14B and Qwen3-32B retain over 75% of their accuracy on GSM8K, MATH-500 and GPQA-Diamond when attention is restricted to a sliding window less than 15% as long as the full reasoning trace.",
  "abstract_shown": true,
  "affiliations": [],
  "article_type": null,
  "arxiv": "2610.09186",
  "author_total": 3,
  "authors": [
    {
      "name": "Amrut Nadgir"
    },
    {
      "name": "Vijay Balasubramanian"
    },
    {
      "name": "Pratik Chaudhari"
    }
  ],
  "bibtex": "https://research.draconitic.com/paper/d5f58vs07gbjt.bib",
  "cited_by": 0,
  "doi": "10.48550/arxiv.2610.09186",
  "fulltext_url": null,
  "id": "d5f58vs07gbjt",
  "issns": [],
  "landing_url": "https://arxiv.org/abs/2610.09186",
  "language": null,
  "licence": "CC-BY-4.0",
  "licence_label": "CC BY 4.0",
  "licence_source": "article",
  "licence_url": "http://creativecommons.org/licenses/by/4.0/",
  "metadata_licence": "CC0-1.0",
  "native_subjects": [
    [
      "arxiv",
      "cond-mat.dis-nn"
    ],
    [
      "arxiv",
      "cs.LG"
    ],
    [
      "openalex",
      "1702|Topic Modeling"
    ]
  ],
  "openalex": "W7221017156",
  "pdf_url": "https://arxiv.org/pdf/2610.09186",
  "pmcid": null,
  "pmid": null,
  "published": "2026-10-17",
  "publisher": null,
  "ris": "https://research.draconitic.com/paper/d5f58vs07gbjt.ris",
  "sources": [
    {
      "first_seen": "2026-10-30T12:30:52Z",
      "native_id": "2610.09186",
      "source": "arxiv",
      "url": "https://arxiv.org/abs/2610.09186"
    }
  ],
  "subjects": [
    {
      "field": "physics",
      "origin": "arxiv:cond-mat.dis-nn",
      "subfield": "condensed-matter"
    }
  ],
  "title": "The Dichotomy Between Pattern Recognition and Step-by-Step Reasoning",
  "title_text": "The Dichotomy Between Pattern Recognition and Step-by-Step Reasoning",
  "type": "preprint",
  "updated_at": "2026-10-30T12:33:41Z",
  "url": "https://research.draconitic.com/paper/d5f58vs07gbjt",
  "venue": "arXiv",
  "versions": []
}