betaFeedback

WorksComputer Science

One-Layer Transformers Provably Learn In-Context K-Nearest Neighbor Prediction with Chain-of-Thought

Abstract

Chain-of-Thought (CoT) enables transformers to solve complex reasoning tasks by generating intermediate reasoning steps. Despite strong empirical success, the mechanisms by which such reasoning abilities emerge during training remain poorly understood, particularly from a theoretical perspective. In this work, we study this question in a stylized yet fully analyzable setting: in-context K\mathrm{K}-nearest-neighbor (K\mathrm{K}-NN) prediction with a one-layer transformer. Earlier work has demonstrated that one-layer transformers can be trained to perform 11-NN without CoT (Li et al., 2024a) by having the softmax attention attend to the nearest neighbor in context. However, this result on 11-NN cannot be extended to K\mathrm{K}-NN for K>1K>1, as softmax attention is much less naturally suited to attending to the 2nd through KK-th nearest neighbors. We first give a rigorous negative result showing that this limitation already appears on a well-separated class of binary classification tasks for odd K>1K>1. We then give an explicit construction of a one-layer transformer, and show that it can solve K\mathrm{K}-NN via CoT reasoning. We further prove that, under a stylized training setup, gradient descent can recover this construction, thereby showing that transformers can acquire the capability to solve K\mathrm{K}-NN through training. In addition, we show that the resulting trained model applies to a broader test class than that assumed in the training analysis. Our results shed light on how CoT expands the ability of transformers to learn and solve tasks that are otherwise hard to solve.

Introduction

Transformer-based Vaswani et al. [46] large language models (LLMs) have achieved remarkable success across various tasks, including natural language processing [4, 44 b], image and video generation [28], and multimodal learning [1, 36]. Notably, these models have also achieved state-of-the-art performance on complex reasoning tasks [22, 57, 9, 56]. A key factor driving this progress is Chain-of-Thought (CoT), which enables LLMs to generate intermediate reasoning steps autoregressively rather than producing only a final answer. This process enhances the models’ ability to solve complex problems. However, the mechanisms underlying CoT reasoning remain poorly understood, posing fundamental theoretical challenges.

Theoretical studies on transformers with CoT have recently progressed along three main directions: expressive power, statistical properties, and training theory. On the expressivity side, prior work shows that intermediate reasoning steps can expand the effective computational power. of transformers, enabling shallow architectures to solve problems beyond direct-answer prediction and establishing reasoning length as a key computational resource [12, 29, 26, 2]. On the statistical side, recent analyses formalize CoT as a structured decomposition of complex inference into simpler intermediate subproblems, leading to improvements in sample efficiency, robustness, and generalization [33] (Hu et al. 2024; Li et al. 2025). Complementing these results, a growing line of training-theoretic work characterizes how transformers learn multi-step reasoning capabilities under gradient-based optimization, focusing on tasks such as in-context linear regression, symbolic path finding, and synthetic state tracking [16, 49, 20].

Among these directions, the training-theoretic perspective is most closely aligned with practical LLM development, as it aims to explain how transformers acquire CoT-style multi-step reasoning capabilities through gradient-based training. Recent work has made encouraging progress in this direction by analyzing several structured settings, but current theoretical understanding remains limited. Following this perspective, we investigate the in-context K-nearest-neighbor (K-NN) problem. Prior work has shown that one-layer transformers can be trained to perform in-context 1-NN without CoT (Li et al., 2024a). However, this result does not directly extend to K-NN with K>1K > 1. We prove a proposition showing that direct inference already fails for odd K>1K > 1, which motivates our study of the CoT setting. We then show that a one-layer transformer admits an explicit construction for solving the K-NN problem via CoT by giving both an asymptotic expressivity guarantee and a finite-margin correctness statement. We further show that gradient descent can recover this construction, and that the resulting trained model applies to a broader test class than the one specified by the training distributional assumptions.

Contributions. We summarize the main contributions of this work as follows.

  • We prove that a one-layer transformer without CoT cannot perform K-NN via direct inference for odd K>1K > 1 (Proposition 3.2). In contrast, a one-layer transformer admits an explicit construction for solving the K-NN problem via CoT (Theorem 4.1 and Proposition 4.2). Together, these results provide a concrete example, in a controlled theoretical setting, of how CoT can expand the computational capabilities of transformers.

  • We further provide a convergence analysis of the population loss for a one-layer transformer trained by gradient descent (Theorem 5.2), showing that gradient descent recovers the construction in Theorem 4.1. This extends the in-context 1-NN result of Li et al. (2024a) to K-NN prediction with CoT. Combining the training and construction analyses further shows that the resulting trained model applies beyond the distributional assumptions used in the training analysis.

  • Our work contributes to a more comprehensive theoretical understanding of how Transformers with CoT can perform complex tasks. Prior work has shown that CoT can implement gradient descent for in-context linear regression [16], repeatedly apply transition rules to update a state [20], and autoregressively trace paths between nodes in trees [49]. In contrast, our work theoretically identifies and formalizes a distinct CoT mechanism based on iterative token selection and masking, thereby broadening the current theoretical understanding of CoT.

  • Our work introduces several proof ideas and techniques that may be of independent interest. We identify a mechanism where the conventionally non-sequential K-NN task can be refor-

mulated as a sequential procedure based on iterative token selection and masking, thereby enabling CoT-based prediction, as formalized in Lemma 4.3. We also develop technical tools for analyzing softmax-attention training, including contradiction and compactness arguments that establish coefficient divergence (Appendix § 12.§ 3) and drift and crossing arguments that characterize the precise limiting ratios among the coefficients (Appendix § 12.§ 6). Together, these tools reveal how a model can simultaneously learn token selection and masking.

Notation. For a scalar xx, let sign⁡(x)=1\operatorname{sign}(x)=1 if x>0x>0, 00 if x=0x=0, and −1-1 otherwise. For a vector v∈Rd\mathbf{v}\in\mathbb{R}^{d} and a matrix A∈Rm×n\mathbf{A}\in\mathbb{R}^{m\times n}, let ∥v∥\lVert\mathbf{v}\rVert denote the ℓ2\ell_{2}-norm of v\mathbf{v} and ∥A∥\lVert\mathbf{A}\rVert the spectral norm of A\mathbf{A}. We write A:,j∈Rm\mathbf{A}_{:,j}\in\mathbb{R}^{m} and Ai,:∈Rn\mathbf{A}_{i,:}\in\mathbb{R}^{n} for the jj-th column and ii-th row of A\mathbf{A}, respectively. The symbols 0n\mathbf{0}_{n} and 0m×n\mathbf{0}_{m\times n} denote the zero vector in Rn\mathbb{R}^{n} and the zero matrix in Rm×n\mathbb{R}^{m\times n}, respectively. We denote by Id\mathbf{I}_{d} the dd-dimensional identity matrix, and by I\mathbf{I} the identity matrix when the dimension is clear. For an integer nn, we define [n]={1,2,…,n}[n]=\{1,2,\ldots,n\}. For two sequences {an}\{a_{n}\} and {bn}\{b_{n}\}, we denote an=O(bn)a_{n}=O(b_{n}) if there exists a constant C>0C>0 such that ∣an∣≤C∣bn∣|a_{n}|\leq C|b_{n}| for all large enough nn. We denote an=Ω(bn)a_{n}=\Omega(b_{n}) if bn=O(an)b_{n}=O(a_{n}). We say an=Θ(bn)a_{n}=\Theta(b_{n}) if both an=O(bn)a_{n}=O(b_{n}) and an=Ω(bn)a_{n}=\Omega(b_{n}) hold.

Related Work

In-context learning. In-context learning describes the ability of transformers to perform previously unseen tasks without updating their model parameters. Bai et al. [3] demonstrated the in-context learning capacities of transformers by constructing multi-head ReLU transformers capable of performing a variety of learning methods, including ridge regression, lasso regression, generalized linear models, and learning with shallow neural networks. Zhang et al. [54] studied the gradient-flow dynamics of a linear self-attention model. Huang et al. [18] analyzed linear prediction tasks using a softmax-attention layer trained via gradient descent. Li et al. (2024a) investigated how transformers perform in-context learning when solving one-nearest-neighbor selection problems. Zhang et al. [55] showed that the MLP component of a transformer block can learn to simulate the initialization step of in-context gradient descent. Chen et al. [7] investigated the gradient-flow dynamics of training multi-head softmax attention and showed that all heads exhibit distinct patterns and interact jointly to solve in-context linear regression. Zhang and Cao [50] showed that softmax transformers can perform in-context logistic regression via normalized gradient descent by recurrently applying a trained self-attention layer.

Transformers as more general algorithm learners. Beyond standard in-context learning settings, a growing body of work studies how transformers learn more general algorithmic procedures. A line of work studies transformers on Markovian or Markov-like sequence models. Edelman et al. [11] empirically demonstrated that transformers trained on samples generated by a Markov chain in a bigram setting can develop statistical induction heads. Nichani et al. [30] proved that gradient descent can train transformers to learn a generalized induction head on latent causal structures. Chen et al. [8] analyzed a modified two-layer transformer on nn-gram Markov data. Shi and Cao [35] showed that gradient-trained softmax attention acts as a token selector for random-walk prediction. A complementary body of work examines optimization in more specialized transformer architectures and training regimes. This includes analyses of vision transformers and their sample complexity (Jelassi et al. [21]), the role of adaptive optimizers in transformer training (Pan and Li [31]; Zhang et al. [53]), the mechanisms through which transformers acquire semantic or topical structure (Li et al. (2023)), and the optimization of looped transformer architectures, where Wu et al. (2026) proved that gradient descent on looped linear transformers with layer normalization converges to solutions implementing the power method for principal-component prediction. Other studies investigate the joint training dynamics of attention, decoder, and MLP components [41, 42], characterize the implicit bias of softmax attention by linking its optimization dynamics to max-margin or SVM-like solutions (Tarzanagh et al., 2023a,b; Huang et al., 2025b). Finally, several recent results demonstrate the capability of trained softmax transformers to perform token selection and identify task-relevant structure: Wang et al. [47] proved that a one-layer transformer trained by gradient descent can learn sparse token selection, while Zhang et al. [51, 52] established optimal variable selection in group-sparse classification and teacher-student learning setups.

Understanding Chain-of-Thought Reasoning. Recently, several studies have sought to understand CoT from both experimental and theoretical perspectives. Sprague et al. [37] conducted a large-scale meta-analysis showing that CoT is most effective on mathematical, symbolic, and algorithmic tasks, whereas Stechly et al. [38] showed, in planning domains, that the gains from CoT rely heavily on problem-specific demonstrations, casting doubt on whether CoT yields robust procedural generalization. Liu et al. [27] identified task regimes in which CoT can systematically degrade performance. Chen et al. [6] proposed a reasoning-boundary framework to quantify CoT capability and analyze how different CoT strategies affect reasoning performance. Ton et al. [43] developed an information-theoretic framework for evaluating the contribution of individual reasoning steps and diagnosing CoT failure modes without requiring annotated intermediate traces. Hou et al. [14]; Cabannes et al. [5] investigated CoT through the lens of mechanistic interpretability. On the theoretical side, most existing studies have examined how CoT enhances transformer expressiveness [12, 29, 2] (Li et al. 2024b) and have explored CoT through its statistical properties [33] (Hu et al. 2024; Li et al. 2025). Other works have characterized the intrinsic limits of CoT-based reasoning, showing that transformers face inherent barriers to compositional computation and that some problems provably require long CoT traces [32]. Complementing these results, Huang et al. [16]; Yang et al. [49]; Huang et al. [20] characterized how transformers learn multi-step reasoning capabilities under gradient-based optimization, focusing on tasks such as in-context linear regression, symbolic path finding, and synthetic state tracking.

Preliminaries

In this section, we first define the K-NN problem and introduce the transformer architecture studied in this paper. Based on these definitions, we then show that direct inference by a one-layer transformer already fails on a well-separated class of inputs for odd K>1K > 1.

K-Nearest Neighbor Problem

Given a dataset D={(xi,yi)}i=1N\mathcal{D} = \{(\mathbf{x}_i,y_i)\}_{i=1}^{N}, where xi∈Rd\mathbf{x}_i \in\mathbb{R}^{d} is the input feature vector and yi∈Yy_i \in\mathcal{Y} is the corresponding label, and a query instance xq∈Rd\mathbf{x}_q \in\mathbb{R}^{d}, we define the K-NN problem as follows.

Definition 3.1 (K-nearest neighbor ordering and classification). Given a query xq\mathbf{x}_q and a dataset D={(xi,yi)}i=1N\mathcal{D} = \{(\mathbf{x}_i,y_i)\}_{i=1}^{N}, a permutation π:[N]→[N]\pi: [N] \to[N] is said to order the dataset points by increasing distance to xq\mathbf{x}_q if

∥xq−xπ(1)∥<∥xq−xπ(2)∥<⋯<∥xq−xπ(N)∥.\lVert\mathbf{x}_q - \mathbf{x}_{\pi(1)} \rVert< \lVert\mathbf{x}_q - \mathbf{x}_{\pi(2)} \rVert< \cdots< \lVert\mathbf{x}_q - \mathbf{x}_{\pi(N)} \rVert.

Then xπ(k)\mathbf{x}_{\pi(k)} is the kk-th nearest neighbor of xq\mathbf{x}_q. The K-NN problem is to predict the label of xq\mathbf{x}_q from the labels of its top-KK nearest neighbors. Formally, the K-NN target is defined as arg⁡max⁡c∈Y∑k=1K1{yπ(k)=c}\arg\max_{c\in\mathcal{Y}}\sum_{k=1}^{K}\mathbb{1}\{y_{\pi(k)}=c\}, namely the majority label among the top-KK nearest neighbors.

In the definition above, we implicitly assume that ∥xq−xi∥≠∥xq−xj∥\lVert\mathbf{x}_q-\mathbf{x}_i\rVert\ne\lVert\mathbf{x}_q-\mathbf{x}_j\rVert for all i≠ji\ne j, so that the ordering permutation π\pi is well defined. This assumption is satisfied almost surely whenever (x1,…,xN,xq)(\mathbf{x}_1,\ldots,\mathbf{x}_N,\mathbf{x}_q) are independent and continuously distributed, because the event of a distance tie then has probability zero. In this work, we focus on the binary-label case Y={±1}\mathcal{Y}=\{\pm1\}. In this case, the K-NN target reduces to sign⁡(∑k=1Kyπ(k))\operatorname{sign}\left(\sum_{k=1}^{K}y_{\pi(k)}\right), where we take sign⁡(0)=0\operatorname{sign}(0)=0 to represent abstention when the top-KK set has no strict majority.

Transformer Architecture

In this subsection, we introduce the stochastic positional encoding module, the input embedding matrix, and the transformer model considered in our analysis. We also give a negative result for using transformers without CoT to solve K-NN tasks.

Stochastic positional encodings. Let {ej}j=1N+1\{e_j\}_{j=1}^{N+1} denote the canonical basis of RN+1\mathbb{R}^{N+1}. During each training epoch and at test time, a new set of stochastic positional encodings is generated as follows:

  1. a uniformly random permutation τ∼Unif⁡(SN+1)\tau\sim\operatorname{Unif}(S_{N+1});

  2. independent Rademacher signs s1,…,sN+1∼i.i.d.Rad⁡(±1)s_1,\ldots,s_{N+1}\overset{\mathrm{i.i.d.}}{\sim}\operatorname{Rad}(\pm1).

Here, SN+1S_{N+1} denotes the set of all permutations of [N+1][N+1], so that τ(i)\tau(i) specifies the permuted position assigned to the token ii. We then define the one-hot signed positional vectors by

pi:=sieτ(i)(i∈[N+1]).\mathbf{p}_i := s_i e_{\tau(i)} \quad(i\in[N+1]).

Stochastic positional encodings have been employed in several prior works Shen et al. [34]; Wang et al. [47]; Dwivedi et al. [10]. Most closely related to our work, Wang et al. [47] theoretically analyzes the training dynamics of one-layer transformers with near-orthogonal stochastic positional encodings, showing that these encodings improve length generalization while inducing distributional symmetries that simplify the characterization of gradient-descent trajectories. Our construction similarly induces a signed-permutation symmetry, which we exploit in Appendix § 12.§ 2 to characterize the training dynamics. Importantly, stochastic positional encodings are not essential to our expressive power guarantees (Theorem 4.1 and Proposition 4.2); these results extend directly to any set of mutually orthogonal positional encodings.

Embedding construction. We construct the context matrix H∈RD×N\mathbf{H}\in\mathbb{R}^{D\times N} and the initial query vector q(0)∈RD\mathbf{q}^{(0)}\in\mathbb{R}^{D} by concatenating the features, labels, and positional encodings. Specifically, for each training set {(xi,yi)}i=1N\{(\mathbf{x}_i,y_i)\}_{i=1}^{N} and query input xq\mathbf{x}_q, the embedding hi\mathbf{h}_i (the ii-th column of H\mathbf{H}) and the initial query vector q(0)\mathbf{q}^{(0)} are given by hi=[xiT,yi,piT]T\mathbf{h}_i=[\mathbf{x}_i^{\mathsf{T}},y_i,\mathbf{p}_i^{\mathsf{T}}]^{\mathsf{T}} and q(0)=[xqT,0,pN+1T]T\mathbf{q}^{(0)}=[\mathbf{x}_q^{\mathsf{T}},0,\mathbf{p}_{N+1}^{\mathsf{T}}]^{\mathsf{T}}, respectively. Consequently, the initial input embedding matrix is in the following format:

Z(0)=[H,q(0)]=[x1⋯xNxqy1⋯yN0p1⋯pNpN+1]∈RD×(N+1).(1)\mathbf{Z}^{(0)}=[\mathbf{H},\mathbf{q}^{(0)}]= \begin{bmatrix} \mathbf{x}_1 & \cdots& \mathbf{x}_N & \mathbf{x}_q\\ y_1 & \cdots& y_N & 0\\ \mathbf{p}_1 & \cdots& \mathbf{p}_N & \mathbf{p}_{N+1} \end{bmatrix}\in\mathbb{R}^{D\times(N+1)}. \tag*{(1)}

One-layer self-attention transformer. Following the setup of Wang et al. [47]; Huang et al. [16]; Yang et al. [49], we consider a one-layer self-attention transformer in which the projection and value matrices are combined into V∈RD×D\mathbf{V}\in\mathbb{R}^{D\times D}, and the key and query matrices are combined into W∈RD×D\mathbf{W} \in\mathbb{R}^{D \times D}. The transformer layer, parameterized by θ=(V,W)\boldsymbol{\theta} = (\mathbf{V},\mathbf{W}), is defined by

TF⁡(Z,θ)=Z+VZ⋅softmax⁡(ZTWZ),(2)\operatorname{TF}(\mathbf{Z},\boldsymbol{\theta}) = \mathbf{Z} + \mathbf{V}\mathbf{Z} \cdot\operatorname{softmax}\left(\mathbf{Z}^{\mathsf{T}}\mathbf{W}\mathbf{Z}\right), \tag*{(2)}

where softmax⁡(A)\operatorname{softmax}(\mathbf{A}) applies the softmax operator on each column of the matrix A\mathbf{A}, i.e., [softmax⁡(A)]ij=exp⁡(Aij)/∑iexp⁡(Aij)[\operatorname{softmax}(\mathbf{A})]_{ij} = \exp(A_{ij}) / \sum_i \exp(A_{ij}).

The transformer definition in (2) is slightly simplified relative to practical implementations, most notably in its use of merged key and query matrices. These simplifications reflect the limitations of our theoretical framework. However, similar simplifications are common in theoretical analyses of transformers [47, 49] (Li et al. 2024a). Among these existing works, Li et al. (2024a) showed that transformers with frozen V=I\mathbf{V} = \mathbf{I} can be trained to perform 1-NN prediction in context via direct inference. However, their result cannot be directly extended to the case of K-NN with K>1K > 1, as softmax attention is much less naturally suited to attending to the 2nd through KK-th nearest neighbors than to attending to the single nearest neighbor.

References

  1. [1]Achiam, J., Adler, S., Agarwal, S., Ahmad, L., Akkaya, I., Aleman, F. L., Almeida, D., Altenschmidt, J., Altman, S., Anadakat, S. et al. (2023). Gpt-4 technical report. arXiv preprint arXiv:2303.08774.arxiv.org/abs/2303.08774
  2. [2]Amiri, A., Huang, X., Rofin, M. and Hahn, M. (2025). Lower bounds for chain-of-thought reasoning in hard-attention transformers. arXiv preprint arXiv:2502.02393.arxiv.org/abs/2502.02393
  3. [3]Bai, Y., Chen, F., Wang, H., Xiong, C. and Mei, S. (2023). Transformers as statisticians: Provable in-context learning with in-context algorithm selection. Advances in neural information processing systems 36 57125–57211.arxiv.org/abs/2306.04637
  4. [4]Brown, T., Mann, B., Ryder, N., Subbiah, M., Kaplan, J. D., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A. et al. (2020). Language models are few-shot learners. Advances in neural information processing systems 33 1877–1901.arxiv.org/abs/2005.14165
  5. [5]Cabanes, V., Arnal, C., Bouaziz, W., Yang, A., Charton, F. and Kempe, J. (2024). Iteration head: A mechanistic study of chain-of-thought. Advances in Neural Information Processing Systems 37 109101–109122.
  6. [6]Chen, Q., Qin, L., Wang, J., Zhou, J. and Che, W. (2024a). Unlocking the capabilities of thought: A reasoning boundary framework to quantify and optimize chain-of-thought. Advances in Neural Information Processing Systems 37 54872–54904.arxiv.org/abs/2410.05695
  7. [7]Chen, S., Sheen, H., Wang, T. and Yang, Z. (2024b). Training dynamics of multi-head softmax attention for in-context learning: Emergence, convergence, and optimality. In The Thirty Seventh Annual Conference on Learning Theory. PMLR.arxiv.org/abs/2402.19442
  8. [8]Chen, S., Sheen, H., Wang, T. and Yang, Z. (2024c). Unveiling induction heads: Provable training dynamics and feature learning in transformers. Advances in Neural Information Processing Systems 37 66479–66567.arxiv.org/abs/2409.10559
  9. [9]Chowdhery, A., Narang, S., Devlin, J., Bosma, M., Mishra, G., Roberts, A., Barham, P., Chung, H. W., Sutton, C., Gehrmann, S. et al. (2023). Palmi: Scaling language modeling with pathways. Journal of machine learning research 24 1–113.arxiv.org/abs/2204.02311
  10. [10]Dwivedi, V. P., Jaladi, S., Shen, Y., López, F., Kanatsoulis, C., Puri, R., Fey, M. and Leskovec, J. (2026). Relational graph transformer. In International Conference on Learning Representations, vol. 2026.arxiv.org/abs/2505.10960
  11. [11]Edelman, E., Tsilivis, N., Edelman, B., Malach, E. and Goel, S. (2024). The evolution of statistical induction heads: In-context learning markov chains. Advances in neural information processing systems 37 64273–64311.arxiv.org/abs/2402.11004
  12. [12]Feng, G., Zhang, B., Gu, Y., Ye, H., He, D. and Wang, L. (2023). Towards revealing the mystery behind chain of thought: a theoretical perspective. Advances in Neural Information Processing Systems 36 70757–70798.arxiv.org/abs/2305.15408
  13. [13]Gatmiry, K., Saunshi, N., Reddi, S. J., Jegelka, S. and Kumar, S. (2024). Can looped transformers learn to implement multi-step gradient descent for in-context learning? In Forty-first International Conference on Machine Learning.arxiv.org/abs/2410.08292
  14. [14]Hou, Y., Li, J., Fei, Y., Stolfo, A., Zhou, W., Zeng, G., Bosselut, A. and Sachan, M. (2023). Towards a mechanistic interpretation of multi-step reasoning capabilities of language models. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing.
  15. [16]Huang, J., Wang, Z. and Lee, J. D. (2025a). Transformers learn to implement multi-step gradient descent with chain of thought. In The Thirteenth International Conference on Learning Representations.arxiv.org/abs/2502.21212
  16. [18]Huang, Y., Cheng, Y. and Liang, Y. (2024a). In-context convergence of transformers. In Proceedings of the 41st International Conference on Machine Learning, vol. 235 of Proceedings of Machine Learning Research. PMLR.arxiv.org/abs/2310.05249
  17. [19]Huang, Y., Wen, Z., Chi, Y. and Liang, Y. (2024b). How transformers learn diverse attention correlations in masked vision pretraining. In ICML 2024 workshop on theoretical foundations of foundation models.
  18. [20]Huang, Y., Wen, Z., Singh, A., Chi, Y. and Chen, Y. (2025c). Transformers provably learn chain-of-thought reasoning with length generalization. In The Thirty-ninth Annual Conference on Neural Information Processing Systems.arxiv.org/abs/2511.07378
  19. [21]Jelassi, S., Sander, M. and Li, Y. (2022). Vision transformers provably learn spatial structure. Advances in Neural Information Processing Systems 35 37822–37836.arxiv.org/abs/2210.09221
  20. [22]Kojima, T., Gu, S. S., Reid, M., Matsuo, Y. and Iwasawa, Y. (2022). Large language models are zero-shot reasoners. Advances in neural information processing systems 35 22199–22213.arxiv.org/abs/2205.11916
  21. [26]Li, Z., Liu, H., Zhou, D. and Ma, T. (2024b). Chain of thought empowers transformers to solve inherently serial problems. In The Twelfth International Conference on Learning Representations.arxiv.org/abs/2402.12875
  22. [27]Liu, R., Geng, J., Wu, A. J., Sucholutsky, I., Lombrozo, T. and Griffiths, T. L. (2025). Mind your step (by step): Chain-of-thought can reduce performance on tasks where thinking makes humans worse. In Forty-second International Conference on Machine Learning.arxiv.org/abs/2410.21333
  23. [28]Liu, Y., Zhang, K., Li, Y., Yan, Z., Gao, C., Chen, R., Yuan, Z., Huang, Y., Sun, H., Gao, J. et al. (2024). Sora: A review on background, technology, limitations, and opportunities of large vision models. arXiv preprint arXiv:2402.17177.arxiv.org/abs/2402.17177
  24. [29]Merrill, W. and Sabharwal, A. (2023). The expressive power of transformers with chain of thought. arXiv preprint arXiv:2310.07923.arxiv.org/abs/2310.07923
  25. [30]Nichani, E., Damian, A. and Lee, J. D. (2024). How transformers learn causal structure with gradient descent. In Proceedings of the 41st International Conference on Machine Learning, vol. 235 of Proceedings of Machine Learning Research. PMLR.arxiv.org/abs/2402.14735
  26. [31]Pan, Y. and Li, Y. (2023). Toward understanding why adam converges faster than sgd for transformers. arXiv preprint arXiv:2306.00204.arxiv.org/abs/2306.00204
  27. [32]Peng, B., Narayanan, S. and Papadimitriou, C. (2024). On limitations of the transformer architecture. In First conference on language modeling.arxiv.org/abs/2402.08164
  28. [33]Prystawski, B., Li, M. and Goodman, N. (2023). Why think step by step? reasoning emerges from the locality of experience. Advances in Neural Information Processing Systems 36 70926–70947.arxiv.org/abs/2304.03843
  29. [34]Shen, R., Bubeck, S., Eldan, R., Lee, Y. T., Li, Y. and Zhang, Y. (2023). Positional description matters for transformers arithmetic. arXiv preprint arXiv:2311.14737.arxiv.org/abs/2311.14737
  30. [35]Shi, W. and Cao, Y. (2025). Towards understanding transformers in learning random walks. In The Thirty-ninth Annual Conference on Neural Information Processing Systems.arxiv.org/abs/2511.23239
  31. [36]Singh, A., Fry, A., Perelman, A., Tart, A., Ganesh, A., El-Kishky, A., McLaughlin, A., Low, A., Ostrow, A., Ananthram, A. et al. (2025). Openai gpt-5 system card. arXiv preprint arXiv:2601.03267.arxiv.org/abs/2601.03267
  32. [37]Sprague, Z. R., Yin, F., Rodriguez, J. D., Jiang, D., Wadhwa, M., Singhal, P., Zhao, X., Ye, X., Mahowald, K. and Durrett, G. (2025). To cot or not to cot? chain-of-thought helps mainly on math and symbolic reasoning. In The Thirteenth International Conference on Learning Representations.arxiv.org/abs/2409.12183
  33. [38]Stechly, K., Valmeekam, K. and Kambhampati, S. (2024). Chain of thoughtlessness? an analysis of cot in planning. Advances in Neural Information Processing Systems 37 29106–29141.arxiv.org/abs/2405.04776
  34. [41]Tian, Y., Wang, Y., Chen, B. and Du, S. S. (2023). Scan and snap: Understanding training dynamics and token composition in 1-layer transformer. Advances in neural information processing systems 36 71911–71947.arxiv.org/abs/2305.16380
  35. [42]Tian, Y., Wang, Y., Zhang, Z., Chen, B. and Du, S. S. (2024). Joma: Demystifying multilayer transformers via joint dynamics of mlp and attention. In The Twelfth International Conference on Learning Representations.
  36. [43]Ton, J.-F., Taufiq, M. F. and Liu, Y. (2025). Understanding chain-of-thought in LLMs through information theory. In Forty-second International Conference on Machine Learning.arxiv.org/abs/2411.11984
  37. [44]Touvron, H., Lavril, T., Izacard, G., Martinet, X., Lachaux, M.-A., Lacroix, T., Rozière, B., Goyal, N., Hambro, E., Azhar, F. et al. (2023a). Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971.arxiv.org/abs/2302.13971
  38. [46]Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, L. and Polosukhin, I. (2017). Attention is all you need. Advances in neural information processing systems 30.arxiv.org/abs/1706.03762
  39. [47]Wang, Z., Wei, S., Hsu, D. and Lee, J. D. (2024). Transformers provably learn sparse token selection while fully-connected nets cannot. In Proceedings of the 41st International Conference on Machine Learning, vol. 235 of Proceedings of Machine Learning Research. PMLR.
  40. [49]Yang, T., Huang, Y., Liang, Y. and Chi, Y. (2025). Multi-head transformers provably learn symbolic multi-step reasoning via gradient descent. In The Thirty-ninth Annual Conference on Neural Information Processing Systems.
  41. [50]Zhang, C. and Cao, Y. (2026). Transformers efficiently perform in-context logistic regression via normalized gradient descent. In Forty-third International Conference on Machine Learning.
  42. [51]Zhang, C., Meng, X. and Cao, Y. (2025). Transformer learns optimal variable selection in group-sparse classification. In International Conference on Learning Representations, vol. 2025.
  43. [52]Zhang, C., Zhao, Q., Gu, Q. and Cao, Y. (2026). Transformers trained via gradient descent can provably learn a class of teacher models. In The Fourteenth International Conference on Learning Representations.
  44. [53]Zhang, J., Karimireddy, S. P., Veit, A., Kim, S., Reddi, S., Kumar, S. and Sra, S. (2020). Why are adaptive methods good for attention models? Advances in Neural Information Processing Systems 33 15383–15393.arxiv.org/abs/1912.03194
  45. [54]Zhang, R., Frei, S. and Bartlett, P. L. (2024a). Trained transformers learn linear models in-context. Journal of Machine Learning Research 25 1–55.
  46. [55]Zhang, R., Wu, J. and Bartlett, P. L. (2024b). In-context learning of a linear transformer block: benefits of the mlp component and one-step gd initialization. arXiv preprint arXiv:2402.14951 .
  47. [56]Zhong, T., Liu, Z., Pan, Y., Zhang, Y., Zhang, Z., Zhou, Y., Liang, S., Wu, Z., Lyu, Y., Shu, P. et al. (2024). Evaluation of openai o1: Opportunities and challenges of agi. arXiv preprint arXiv:2409.18486.arxiv.org/abs/2409.18486
  48. [57]Zhou, D., Schärli, N., Hou, L., Wei, J., Scales, N., Wang, X., Schuurmans, D., Cui, C., Bousquet, O., Le, Q. et al. (2022). Least-to-most prompting enables complex reasoning in large language models. arXiv preprint arXiv:2205.10625.arxiv.org/abs/2205.10625

Paper details

vlnc:W_6k3fabn5
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 6

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents