arXiv:cs.LG· Kimia Kazemian, Menghan Xu, John Thickstun, Sarah Dean·· 3 小时前AI 评分43
Spatial Induction Heads:Transformer 如何在多维元胞自动机中实现上下文学习
Spatial Induction Heads: In-Context Learning of Multidimensional Cellular Automata
AI 导读
研究提出"空间归纳头"(spatial induction heads)两层电路机制,揭示 Transformer 如何在多维元胞自动机中克服序列化导致的空间邻居分散问题:第一层重建空间邻域,第二层将配置与先前出现位置匹配。
正文
Abstract:Induction heads provide a mechanistic account of in-context learning in sequential data, but existing theory largely assumes that the context relevant to a prediction forms a contiguous block. In multidimensional data, serialization breaks this assumption by scattering spatial neighbors across distant positions in the token sequence. We study how transformers overcome this routing problem in multidimensional stochastic and deterministic cellular automata, where each trajectory is generated by an unknown local rule and presented as a flattened sequence without an explicit coordinate-based spatial inductive bias. We introduce spatial induction heads, two-layer gather-and-match circuits in which the first layer reconstructs the relevant spatial neighborhood and the second matches the resulting configuration against earlier occurrences. We give two explicit realizations of the gather and show that the positional dimension required for spatial routing depends only on the local neighborhood and spatial dimension, not on grid volume or trajectory horizon. We further construct a matching layer which implements Bayesian counting. The end-to-end circuit can approximate the Bayesian posterior arbitrarily closely for stochastic rules and can predict exactly for deterministic rules. Empirically, trained two-layer transformers generalize to unseen rules in one and two dimensional settings, achieving near-perfect deterministic rollouts and less than 0.005 nats KL from the Bayes-optimal predictor on stochastic rules. Attention patterns and layerwise probes align with the predicted gather-and-match computation, providing mechanistic evidence for spatial induction in trained transformers.
| Comments: | Under review at ICLR 2027. Project page: this https URL |
| Subjects: | Machine Learning (cs.LG); Artificial Intelligence (cs.AI) |
| Cite as: | arXiv:2610.09124 [cs.LG] |
| (or arXiv:2610.09124v1 [cs.LG] for this version) | |
| https://doi.org/10.48550/arXiv.2610.09124 arXiv-issued DOI via DataCite (pending registration) |
Submission history
From: Kimia Kazemian [view email]
[v1]
Tue, 6 Oct 2026 21:16:24 UTC (4,068 KB)
来源:arXiv:cs.LG · arxiv.org