One-Layer Transformers Provably Learn In-Context K-Nearest Neighbor Prediction with Chain-of-Thought
Update NeurIPS 2026 submission KRMF9RmzSJ: 16 notes
@openreview[bot] · 2026-11-24 15:49 UTC · e926e39dc90c ·
reviews/openreview/krmf9rmzsj/notes/ajb4b2nqdt.json added
+++ b/reviews/openreview/krmf9rmzsj/notes/ajb4b2nqdt.json@@ -0,0 +1,15 @@+{+ "schema": "review/1",+ "id": "aJB4B2NQdt",+ "replyTo": "C8ALchglk9",+ "kind": "comment",+ "invitation": "Official_Comment",+ "signature": "Reviewer ffVj",+ "content": {+ "comment": "Thank you for your response. Most of my concerns have been addressed. The additional experiments look great. Regarding stochastic positional encoding, it makes sense to list several existing works as the motivation for the formulation. However, only some papers consider this. Is it because the problem or the task itself is a good fit for stochastic positional encoding? Moreover, I still think using first-step supervision is strange. From the training objective, we only have the first-step outcome, and $K$ never appears, but the target is to learn the $K$-th nearest neighbors. If training with the first-step outcome is enough for K-NN inference, does it mean that one can also use ICL to learn 1-NN and then recursively implement the inference for $K$ times to find the $K$-th nearest neighbor? If so, the theoretical contribution is weakened, since you are learning 1-NN, which is the same as the existing work on 1-NN."+ },+ "createdAt": "2026-08-03T19:11:10.820Z",+ "modifiedAt": "2026-11-19T17:07:32.018Z",+ "url": "https://openreview.net/forum?id=KRMF9RmzSJ¬eId=aJB4B2NQdt",+ "license": "CC-BY-4.0"+}
reviews/openreview/krmf9rmzsj/notes/c8alchglk9.json added
+++ b/reviews/openreview/krmf9rmzsj/notes/c8alchglk9.json@@ -0,0 +1,15 @@+{+ "schema": "review/1",+ "id": "C8ALchglk9",+ "replyTo": "pAEHB8iEFQ",+ "kind": "comment",+ "invitation": "Official_Comment",+ "signature": "Authors",+ "content": {+ "comment": "Dear Reviewer ffVj,\n\nWe sincerely appreciate the time and effort you have devoted to reviewing our work. As the discussion period is ending in less than one day, we would like to take this opportunity to follow up on our responses and ensure that we have adequately addressed your comments and concerns. If any points remain unclear or require further explanation, we will try our best to provide additional clarification.\n\nIn addition, we would like to present some additional experiments conducted during the discussion period in response to **Reviewer USTL**’s follow-up questions, as these experiments provide a further complement to our responses **A1** and **A4** to your comments and questions.\n\nThese additional experiments are designed to further evaluate the performance of models with multiple heads or multiple layers, and to compare direct-inference models with CoT models. Specifically, for $N=40$ and $d=10$, we train a separate direct-inference baseline for each $K\\in\\\\{1,3,5\\\\}$ for $10000$ iterations. During training, each model receives only the initial input and is supervised to predict the final $K$-NN target state $q^{(K)}=[x_q^\\top,\\sum_{i=1}^{K}y_{\\pi(i)},p_{N+1}^\\top+\\sum_{i=1}^{K}p_{\\pi(i)}^\\top]^\\top$ directly in a single forward pass.\n\nAt inference time, each trained direct-inference model performs only a single forward pass on the initial input, without intermediate-state generation or autoregressive rollout. We evaluate each direct model on the test task corresponding to the value of $K$ for which it was trained. In addition, for the models trained with $K=3$ and $K=5$, we also evaluate their predictions on the $K=1$ test set. This additional evaluation allows us to examine whether models trained for larger $K$ nevertheless retain behavior close to $1$-NN prediction.\n\nWe summarize the new experiments and compare them with the CoT results in the following table.\n\n| Model | Training setup | Inference | Test acc. $K=1$ | Test acc. $K=3$ | Test acc. $K=5$ |\n| :- | :- | :- | :-: | :-: | :-: |\n| 4-head, 1-layer | CoT | CoT rollout | 100.0 | 99.7 | 98.2 |\n| 4-head, 1-layer | Direct model trained for $K=1$ | Single-pass | 100.0 | $\\diagdown$ | $\\diagdown$ |\n| 4-head, 1-layer | Direct model trained for $K=3$ | Single-pass | 100.0 | 75.1 | $\\diagdown$ |\n| 4-head, 1-layer | Direct model trained for $K=5$ | Single-pass | 99.9 | $\\diagdown$ | 68.5 |\n| 1-head, 2-layer | CoT | CoT rollout | 100.0 | 99.1 | 92.8 |\n| 1-head, 2-layer | Direct model trained for $K=1$ | Single-pass | 100.0 | $\\diagdown$ | $\\diagdown$ |\n| 1-head, 2-layer | Direct model trained for $K=3$ | Single-pass | 100.0 | 74.7 | $\\diagdown$ |\n| 1-head, 2-layer | Direct model trained for $K=5$ | Single-pass | 97.9 | $\\diagdown$ | 69.2 |\n| 1-head, 1-layer | CoT | CoT rollout | 100.0 | 99.8 | 98.3 |\n| 1-head, 1-layer | Direct model trained for $K=1$ | Single-pass | 100.0 | $\\diagdown$ | $\\diagdown$ |\n| 1-head, 1-layer | Direct model trained for $K=3$ | Single-pass | 100.0 | 74.7 | $\\diagdown$ |\n| 1-head, 1-layer | Direct model trained for $K=5$ | Single-pass | 99.6 | $\\diagdown$ | 68.8 |\n\nBased on these experiments, we have several observations: \n\nFirst, direct-inference learning of $K$-NN remains difficult even with additional heads or layers: the direct models solve $1$-NN well, but their accuracies remain far below those of the CoT models for $K=3$ and $K=5$.\n\nSecond, the training of direct-inference models converges toward suboptimal $1$-NN-like solutions. Specifically, these models achieve nearly perfect $1$-NN accuracy but low $3$-NN and $5$-NN accuracies, even when supervised by $3$-NN or $5$-NN prediction rules. Since we use i.i.d. $\\\\{\\pm 1\\\\}$ labels in the experiments, we can verify that the theoretical accuracies of a $1$-NN predictor on the $3$-NN and $5$-NN prediction tasks are $75\\\\%$ and $68.75\\\\%$, respectively. These values are close to our experimental results and explain the test accuracies achieved by the direct-inference models on the $3$-NN and $5$-NN tasks.\n\nThese results suggest that, during training, direct-inference models with additional heads or layers may continue to attend to the same context data point rather than retrieve multiple distinct neighbors. In contrast, CoT not only provides a natural sequential mechanism for the models to express $K$-NN prediction rules, but also helps training successfully converge to such predictors. These results are consistent with both our expressive-power results and our training guarantees.\n\nWe find these additional experimental results particularly informative and will include them, together with a more detailed discussion, in the revised manuscript. For further details, please also refer to our discussion with **Reviewer USTL**.\n\nThank you again for your time and consideration.\n\nBest regards,\n\nAuthors of Submission 30429"+ },+ "createdAt": "2026-08-03T15:30:41.671Z",+ "modifiedAt": "2026-11-19T17:07:31.876Z",+ "url": "https://openreview.net/forum?id=KRMF9RmzSJ¬eId=C8ALchglk9",+ "license": "CC-BY-4.0"+}
reviews/openreview/krmf9rmzsj/notes/d6civ18crd.json added
+++ b/reviews/openreview/krmf9rmzsj/notes/d6civ18crd.json@@ -0,0 +1,15 @@+{+ "schema": "review/1",+ "id": "d6CIV18CRD",+ "replyTo": "nxrm5OHbak",+ "kind": "comment",+ "invitation": "Official_Comment",+ "signature": "Reviewer USTL",+ "content": {+ "comment": "I thank the authors for the additional theoretical results; however, I could not see how their baseline (i.e., 1-head, 1-layer) performs for $K = \\{1, 3, 5\\}$ without CoT. Can they provide that result as well? It is important to see the difference between the larger models and the simple model to properly assess the experimental results. Thank you."+ },+ "createdAt": "2026-08-02T08:07:16.976Z",+ "modifiedAt": "2026-11-19T17:07:32.166Z",+ "url": "https://openreview.net/forum?id=KRMF9RmzSJ¬eId=d6CIV18CRD",+ "license": "CC-BY-4.0"+}
reviews/openreview/krmf9rmzsj/notes/f3gsfstxcv.json added
+++ b/reviews/openreview/krmf9rmzsj/notes/f3gsfstxcv.json@@ -0,0 +1,15 @@+{+ "schema": "review/1",+ "id": "f3GSfStXcV",+ "replyTo": "pq25pl53mo",+ "kind": "comment",+ "invitation": "Official_Comment",+ "signature": "Authors",+ "content": {+ "comment": "Thank you for the thoughtful follow-up questions.\n\nWe believe that in-context $K$-NN is a challenging task, even for larger models. Indeed, previous work [1] shows that transformers can perform $1$-NN by exploiting the fact that softmax can approximate a hardmax operation, thereby selecting the nearest neighbor among the context data points. However, this property of the softmax function does not easily extend to selecting the top $K$ nearest neighbors. Softmax more naturally performs a weighted average over all context tokens, rather than selecting only the top $K$ tokens and assigning them equal weights.\n\nEven when a model has multiple heads or layers, selecting the top $K$ nearest neighbors remains highly nontrivial. This is because it is also nontrivial for a softmax-based attention module to select only the $K$-th nearest neighbor. Intuitively, to identify the $K$-th nearest neighbor, the model must be able to distinguish it from both the $K-1$ closer points and all the farther points, and effectively exclude them from selection. This is difficult to achieve by simply reusing the softmax-based selection mechanism: without an explicit way to mask or suppress already selected closer points, different attention heads or layers may continue to attend to the same nearest point rather than recover distinct neighbors in order.\n\nIn fact, upon further investigation of our direct-training results for the 1-head 1-layer, 4-head 1-layer, and 1-head 2-layer models on $3$-NN and $5$-NN tasks, we found that these models likely converge to poor local minima corresponding to $1$-NN predictors, despite being supervised by $3$-NN or $5$-NN prediction rules.\n\nSpecifically, under the i.i.d. $\\\\{\\pm1\\\\}$ label distribution used in our experiments, it is easy to compute that the $1$-NN predictor has population accuracy of $75\\\\%$ with respect to the $3$-NN prediction rule and of $68.75\\\\%$ with respect to the $5$-NN prediction rule. These theoretical values are remarkably close to the accuracies obtained in our direct-training experiments. This explains why direct-inference models of different sizes achieve similar accuracies in our experiments. We have also conducted additional experiments verifying that models supervised by the $3$-NN or $5$-NN prediction rules can indeed achieve nearly $100\\\\%$ $1$-NN prediction accuracy:\n\n| Model | Training setup | Inference | Test acc. $K=1$ | Test acc. $K=3$ | Test acc. $K=5$ |\n| :- | :- | :- | :-: | :-: | :-: |\n| 4-head, 1-layer | CoT | CoT rollout | 100.0 | 99.7 | 98.2 |\n| 4-head, 1-layer | Direct model trained for $K=1$ | Single-pass | 100.0 | $\\diagdown$ | $\\diagdown$ |\n| 4-head, 1-layer | Direct model trained for $K=3$ | Single-pass | **100.0** | 75.1 | $\\diagdown$ |\n| 4-head, 1-layer | Direct model trained for $K=5$ | Single-pass | **99.9** | $\\diagdown$ | 68.5 |\n| 1-head, 2-layer | CoT | CoT rollout | 100.0 | 99.1 | 92.8 |\n| 1-head, 2-layer | Direct model trained for $K=1$ | Single-pass | 100.0 | $\\diagdown$ | $\\diagdown$ |\n| 1-head, 2-layer | Direct model trained for $K=3$ | Single-pass | **100.0** | 74.7 | $\\diagdown$ |\n| 1-head, 2-layer | Direct model trained for $K=5$ | Single-pass | **97.9** | $\\diagdown$ | 69.2 |\n| 1-head, 1-layer | CoT | CoT rollout | 100.0 | 99.8 | 98.3 |\n| 1-head, 1-layer | Direct model trained for $K=1$ | Single-pass | 100.0 | $\\diagdown$ | $\\diagdown$ |\n| 1-head, 1-layer | Direct model trained for $K=3$ | Single-pass | **100.0** | 74.7 | $\\diagdown$ |\n| 1-head, 1-layer | Direct model trained for $K=5$ | Single-pass | **99.6** | $\\diagdown$ | 68.8 |\n\nThese results support our interpretation that the directly trained models converge to a suboptimal $1$-NN solution, even when supervised by $3$-NN or $5$-NN labels. We find this observation very interesting and sincerely appreciate your questions, which helped us identify and clarify this phenomenon. We will include the additional experimental results, along with a detailed discussion, in the revision.\n\nThe suboptimal performance of direct-inference models further indicates that the sequential retrieval mechanism we identify is important for transformers to perform $k$-NN. It also suggests that the CoT formulation plays a crucial role in enabling models to learn such a mechanism during training.\n\n[1] One-Layer Transformer Provably Learns One-Nearest Neighbor In Context. NeurIPS 2024"+ },+ "createdAt": "2026-08-03T10:29:28.453Z",+ "modifiedAt": "2026-11-19T17:07:31.951Z",+ "url": "https://openreview.net/forum?id=KRMF9RmzSJ¬eId=f3GSfStXcV",+ "license": "CC-BY-4.0"+}
reviews/openreview/krmf9rmzsj/notes/fydnygn2ku.json added
+++ b/reviews/openreview/krmf9rmzsj/notes/fydnygn2ku.json@@ -0,0 +1,15 @@+{+ "schema": "review/1",+ "id": "FyDnYgN2kU",+ "replyTo": "u6v4RBcsxN",+ "kind": "comment",+ "invitation": "Official_Comment",+ "signature": "Authors",+ "content": {+ "comment": "Thank you for your reply. We address your comments as follows. Due to character limitations, we provide our responses in two parts.\n\n**Q1**. Proof idea and conceptual approach have already been covered in earlier literature\n\n**A1**. We respectfully disagree. \n\n* The fact that [1] shows that CoT can perform gradient descent does not imply that all subsequent work studying CoT as a mechanism for implementing iterative algorithms is non-novel. Rather, [1] supports the relevance and naturalness of the one-layer, one-head transformer setting for analyzing iterative computation with CoT. Moreover, we believe it is unfair to use [1], which studies linear-attention transformers, to deny the novelty of our work on softmax-attention transformers. \n\n* Our proof ideas are also novel. \n\n - The core of our proof is to show that softmax attention can simultaneously learn two coupled mechanisms: token selection and masking. Specifically, we prove that the training dynamics remain on the invariant manifold $W^{(t)}=\\operatorname{diag}(\\alpha^{(t)} I,0,\\beta^{(t)} I)$, where $\\alpha^{(t)}>0$ drives selection of the nearest context point, while $\\beta^{(t)}<0$ penalizes previously selected tokens and hence implements a learned mask. A key novelty of our analysis is to prove the coupled asymptotic behavior of these two coefficients: $\\alpha^{(t)}\\to+\\infty$ and $\\beta^{(t)}\\to-\\infty$, together with a precise characterization of their limiting ratio. This joint characterization is essential for showing that CoT implements $K$-NN.\n\n - This characterization requires arguments that are absent from prior work. The GD updates in our setting do not have a closed-form solution, so we prove divergence using contradiction and compactness arguments, and then establish the limiting ratio via drift and crossing arguments. This is fundamentally different from [1], whose convergence analysis is based on PL-condition optimization guarantees. Thus, our proof techniques and the resulting asymptotic characterization are not subsumed by [1] and, to our knowledge, are novel."+ },+ "createdAt": "2026-08-04T08:09:02.507Z",+ "modifiedAt": "2026-11-19T17:07:31.794Z",+ "url": "https://openreview.net/forum?id=KRMF9RmzSJ¬eId=FyDnYgN2kU",+ "license": "CC-BY-4.0"+}
reviews/openreview/krmf9rmzsj/notes/lkjcygs5bm.json modified
+++ b/reviews/openreview/krmf9rmzsj/notes/lkjcygs5bm.json@@ -5,11 +5,12 @@"kind": "meta_review","invitation": "Meta_Review","signature": "Area Chair AyxU","content": {- "metareview": "Initial Meta-Review\n\nI would like the rebuttal to focus on the following prioritized points:\n- ffVj-W1 (one-layer Transformer) ~USTL-W3\n - I think it is acceptable, but provide some discussion.\n- ffVj-W2 (stochastic position encoding) ~RhHp-W1, USTL-W2\n - All reviewers identified this as a significant weakness. Please provide a discussion addressing this concern. \n- ffVj-W3 (limited convergence analysis)\n - Please provide some discussion.\n- RhHp-W2/3 (restrictive assumptions: Fixing V; training distribution)\n - This is also a crucial point. Please provide more discussion.\n- RhHp-W4 (multiclass setup)\n - I think it is acceptable to focus on the binary setting, but please provide some discussion on a multiclass setup.\n- USTL-W1 (Need for broader comparison with prior work)\n - Please provide a broader comparison with prior work.\n\n---\nFinal Meta-Review\n\nThe most important reason for the decision is that this paper establishes an expressiveness gap between direct inference and CoT: a one-layer transformer without CoT cannot perform K-NN via direct inference, whereas the same architecture can solve K-NN via CoT. \nThe authors well responded to the concerns raised by the reviewers, particularly as described below. Overall I recommend accept.\n- ffVj-W2 (stochastic position encoding) ~RhHp-W1, USTL-W2\n- RhHp-W2/3 (restrictive assumptions: Fixing V; training distribution)\n - After the rebuttal, the reviewers think the settings and the assumptions are overall necessary or acceptable as they are used to simplify the complicated theoretical analysis of GD with transformers."+ "metareview": "Initial Meta-Review\n\nI would like the rebuttal to focus on the following prioritized points:\n- ffVj-W1 (one-layer Transformer) ~USTL-W3\n - I think it is acceptable, but provide some discussion.\n- ffVj-W2 (stochastic position encoding) ~RhHp-W1, USTL-W2\n - All reviewers identified this as a significant weakness. Please provide a discussion addressing this concern. \n- ffVj-W3 (limited convergence analysis)\n - Please provide some discussion.\n- RhHp-W2/3 (restrictive assumptions: Fixing V; training distribution)\n - This is also a crucial point. Please provide more discussion.\n- RhHp-W4 (multiclass setup)\n - I think it is acceptable to focus on the binary setting, but please provide some discussion on a multiclass setup.\n- USTL-W1 (Need for broader comparison with prior work)\n - Please provide a broader comparison with prior work.\n\n---\nFinal Meta-Review\n\nThe most important reason for the decision is that this paper establishes an expressiveness gap between direct inference and CoT: a one-layer transformer without CoT cannot perform K-NN via direct inference, whereas the same architecture can solve K-NN via CoT. \nThe authors well responded to the concerns raised by the reviewers, particularly as described below. Overall I recommend accept.\n- ffVj-W2 (stochastic position encoding) ~RhHp-W1, USTL-W2\n- RhHp-W2/3 (restrictive assumptions: Fixing V; training distribution)\n - After the rebuttal, the reviewers think the settings and the assumptions are overall necessary or acceptable as they are used to simplify the complicated theoretical analysis of GD with transformers.",+ "final_justification": "See the Meta-Review."},"createdAt": "2026-07-22T03:53:33.673Z",- "modifiedAt": "2026-11-18T15:25:09.111Z",+ "modifiedAt": "2026-11-19T05:03:15.146Z","url": "https://openreview.net/forum?id=KRMF9RmzSJ¬eId=LkJCYgS5BM","license": "CC-BY-4.0"}
reviews/openreview/krmf9rmzsj/notes/nxrm5ohbak.json added
+++ b/reviews/openreview/krmf9rmzsj/notes/nxrm5ohbak.json@@ -0,0 +1,15 @@+{+ "schema": "review/1",+ "id": "nxrm5OHbak",+ "replyTo": "Sl36LIixH5",+ "kind": "comment",+ "invitation": "Official_Comment",+ "signature": "Authors",+ "content": {+ "comment": "Thank you for your response and suggestion. Below, we compare the performance of the four-head, one-layer model and the single-head, two-layer model in our updated experiments, with and without CoT training.\n\nSpecifically, for $N=40$, $d=10$, we train a separate direct-prediction baseline for each $K\\in\\\\{1,3,5\\\\}$ for $10000$ iterations. During training, each model receives only the initial input and is supervised to predict the final $K$-NN target state $q^{(K)}=[x_q^\\top,\\sum_{i=1}^{K}y_{\\pi(i)},p_{N+1}^\\top+\\sum_{i=1}^{K}p_{\\pi(i)}^\\top]^\\top$ directly in a single forward pass.\n\nAt inference time, each trained model performs only a single forward pass on the initial input, without intermediate-state generation or autoregressive rollout. Each model is tested only at the value of $K$ for which it was trained, using the same test protocol as in the CoT experiments.\n\nWe summarize the new experiments and compare them with the CoT results in the following table.\n\n| Model | Training setup | Inference | Test acc. $K=1$ | Test acc. $K=3$ | Test acc. $K=5$ |\n| :- | :- | :- | :-: | :-: | :-: |\n| 4-head, 1-layer | CoT | CoT rollout | 100.0 | 99.7 | 98.2 |\n| 4-head, 1-layer | Direct model trained for $K=1$ | Single-pass | 100.0 | $\\diagdown$ | $\\diagdown$ |\n| 4-head, 1-layer | Direct model trained for $K=3$ | Single-pass | $\\diagdown$ | 75.1 | $\\diagdown$ |\n| 4-head, 1-layer | Direct model trained for $K=5$ | Single-pass | $\\diagdown$ | $\\diagdown$ | 68.5 |\n| 1-head, 2-layer | CoT | CoT rollout | 100.0 | 99.1 | 92.8 |\n| 1-head, 2-layer | Direct model trained for $K=1$ | Single-pass | 100.0 | $\\diagdown$ | $\\diagdown$ |\n| 1-head, 2-layer | Direct model trained for $K=3$ | Single-pass | $\\diagdown$ | 74.7 | $\\diagdown$ |\n| 1-head, 2-layer | Direct model trained for $K=5$ | Single-pass | $\\diagdown$ | $\\diagdown$ | 69.2 |\n\nThese comparisons show a clear advantage of CoT training and rollout over direct single-pass training for both architectures. Although all models solve the $1$-NN task perfectly, a substantial performance gap emerges at $K=3$ and $K=5$. In particular, despite being trained separately for a specific value of $K$, the direct baselines exhibit markedly lower accuracy as $K$ increases. By contrast, a single CoT-trained model maintains high accuracy across different values of $K$ by varying only the rollout length. This suggests that CoT enables models to use a sequential retrieval mechanism for $K$-NN prediction that generalizes across reasoning depths. Moreover, both this mechanism and the overall $K$-NN task for $K\\ge3$ appear difficult to handle via direct inference alone.\n\nWe hope these additional experimental results help resolve your concerns, and we would be happy to address any further questions. Thank you again for your careful review of our paper."+ },+ "createdAt": "2026-08-01T12:50:11.601Z",+ "modifiedAt": "2026-11-19T17:07:32.149Z",+ "url": "https://openreview.net/forum?id=KRMF9RmzSJ¬eId=nxrm5OHbak",+ "license": "CC-BY-4.0"+}
reviews/openreview/krmf9rmzsj/notes/ocaniqhzla.json added
+++ b/reviews/openreview/krmf9rmzsj/notes/ocaniqhzla.json@@ -0,0 +1,15 @@+{+ "schema": "review/1",+ "id": "oCaNiqHzla",+ "replyTo": "d6CIV18CRD",+ "kind": "comment",+ "invitation": "Official_Comment",+ "signature": "Authors",+ "content": {+ "comment": "We appreciate this helpful suggestion. Below, we compare the performance of the single-head, single-layer model with and without CoT training for $N=40$ and $d=10$.\n\n| Model | Training setup | Inference | Test acc. $K=1$ | Test acc. $K=3$ | Test acc. $K=5$ |\n| :- | :- | :- | :-: | :-: | :-: |\n| 1-head, 1-layer | CoT | CoT rollout | 100.0 | 99.8 | 98.3 |\n| 1-head, 1-layer | Direct model trained for $K=1$ | Single-pass | 100.0 | $\\diagdown$ | $\\diagdown$ |\n| 1-head, 1-layer | Direct model trained for $K=3$ | Single-pass | $\\diagdown$ | 74.7 | $\\diagdown$ |\n| 1-head, 1-layer | Direct model trained for $K=5$ | Single-pass | $\\diagdown$ | $\\diagdown$ | 68.8 |\n\nWe will add these new experimental results to the revision. Please let us know if you have any further questions. Thank you."+ },+ "createdAt": "2026-08-02T09:15:03.095Z",+ "modifiedAt": "2026-11-19T17:07:32.110Z",+ "url": "https://openreview.net/forum?id=KRMF9RmzSJ¬eId=oCaNiqHzla",+ "license": "CC-BY-4.0"+}
reviews/openreview/krmf9rmzsj/notes/pq25pl53mo.json added
+++ b/reviews/openreview/krmf9rmzsj/notes/pq25pl53mo.json@@ -0,0 +1,15 @@+{+ "schema": "review/1",+ "id": "pq25pl53mo",+ "replyTo": "oCaNiqHzla",+ "kind": "comment",+ "invitation": "Official_Comment",+ "signature": "Reviewer USTL",+ "content": {+ "comment": "I thank the authors for the baseline results. However, given that the performance of the baseline method (1-head, 1-layer) is very similar to the larger models used in the experiments (4-head, 1-layer and 1-head, 2-layer) for $K = 3, 5$, could the authors clarify why scaling does not seem to help here? Is it because the networks used in the experiments are not large enough, or are there more fundamental reasons for this?"+ },+ "createdAt": "2026-08-03T00:55:37.243Z",+ "modifiedAt": "2026-11-19T17:07:31.952Z",+ "url": "https://openreview.net/forum?id=KRMF9RmzSJ¬eId=pq25pl53mo",+ "license": "CC-BY-4.0"+}
reviews/openreview/krmf9rmzsj/notes/riesmgvoxa.json added
+++ b/reviews/openreview/krmf9rmzsj/notes/riesmgvoxa.json@@ -0,0 +1,15 @@+{+ "schema": "review/1",+ "id": "rIEsMgVoXa",+ "replyTo": "u6v4RBcsxN",+ "kind": "comment",+ "invitation": "Official_Comment",+ "signature": "Authors",+ "content": {+ "comment": "**Q2**. The paper's primary potential contribution should lie in the context of implementing and learning $K$-NN.\n\n**A2**. Here we clarify our main contributions.\n\nFirst, we prove that simple one-layer, one-head softmax transformers can be trained to perform $K$-NN with CoT. We note that the authors of the earlier work [2] stated on their paper’s OpenReview page that:\n\n> **Authors of [2]**: We believe the extension of our results to $K$-NN is non-trivial, and cannot be easily achieved with one single attention layer even with multiple heads, as the softmax operator only allows an easy approximation for choosing the closest/most distant $x_i$ in the context with $W_{11}$ goes to infinity, but cannot directly approximate tokens selectors of other orders. We would like to leave the interesting question of learning $K$-NN with multi-head multi-layer transformers to future works.\n\nTherefore, our work directly answers an open question left by the authors of [2]. Notably, we show that CoT enables even a simple one-layer, one-head softmax transformer to perform the otherwise challenging task of $K$-NN prediction. \n\nSecond, our study highlights an interesting phenomenon: supervising the model to perform $1$-NN target-state prediction suffices to ensure that the trained model implements $K$-NN with CoT. We do not claim that one-step supervision is universally sufficient for CoT, but we believe it is useful to give a concrete theoretical demonstration of the existence of such behavior in certain settings. \n\nThird, our work contributes to a more comprehensive theoretical understanding of how transformers with CoT can perform complex tasks. While [1] shows that CoT can implement gradient descent updates, our work reveals a distinct CoT mechanism based on iterative token selection and masking. Our contribution is to theoretically identify and formalize this alternative mechanism, thereby broadening the current theoretical understanding of CoT.\n\nFourth, we also give a negative result showing that one-layer, one-head transformers without CoT cannot perform $K$-NN via direct inference when $K>1$ is odd (Proposition 2.2). Together with our positive results, this provides, **in a controlled theoretical setting**, a concrete example demonstrating the essential role of CoT in expanding the computational capabilities. We further emphasize that, even if larger-scale transformers may have sufficient expressive power to perform $K$-NN without CoT, this does not diminish our contribution under the controlled setting.\n\nFifth, from a technical perspective, our work introduces several novel proof ideas and techniques that we believe are of independent interest:\n\n- We demonstrate how the conventionally non-sequential $K$-NN task can be reformulated as a sequential procedure, thereby enabling CoT-based prediction.\n\n- We develop novel technical tools, including contradiction and compactness arguments that establish coefficient divergence, together with drift and crossing arguments that characterize the precise limiting ratios among the coefficients. These tools are tailored to the challenging setting of softmax attention training and reveal how models can simultaneously learn token selection and masking.\n\n\n**Q3**. I find it difficult to believe that scaling up the model does not help in learning $K$-NN for larger values of $K$ in practice. Therefore, it is still not obvious to me how the CoT approach implemented here will help at a larger scale.\n\n**A3**. We appreciate our discussion which leads to more interesting experimental results. However, we sincerely hope that such discussions and additional results do not distract you from our main contributions listed above in **A2**. \n\nWe want to emphasize again that the study of the one-layer, one-head setting is a standard theoretical setting [1,2]. Our positive and negative results provide rigorous theoretical insights into the impact of CoT within this controlled setting. In particular, showing how CoT enables simple transformers to perform $K$-NN is of independent interest and directly addresses the open question raised by the authors of [2], regardless of what may be possible for larger-scale models.\n\nOur additional experiments also demonstrate that multi-head or multi-layer models may still suffer from challenges in optimization, and may converge to a $1$-NN suboptimal solution even if they are directly trained to perform $K$-NN.\n\nAlthough universal approximation results suggest that sufficiently large models may be able to represent the $K$-NN prediction rule in principle, such results do not imply that gradient-based training will discover this mechanism, nor that the learned model will reliably generalize to test data. Such large-scale models are beyond the scope of this work.\n\n[1] Transformers Learn to Implement Multi-step Gradient Descent with Chain of Thought. ICLR 2025\n\n[2] One-Layer Transformer Provably Learns One-Nearest Neighbor In Context. NeurIPS 2024"+ },+ "createdAt": "2026-08-04T08:10:44.862Z",+ "modifiedAt": "2026-11-19T17:07:31.955Z",+ "url": "https://openreview.net/forum?id=KRMF9RmzSJ¬eId=rIEsMgVoXa",+ "license": "CC-BY-4.0"+}
reviews/openreview/krmf9rmzsj/notes/sl36liixh5.json added
+++ b/reviews/openreview/krmf9rmzsj/notes/sl36liixh5.json@@ -0,0 +1,15 @@+{+ "schema": "review/1",+ "id": "Sl36LIixH5",+ "replyTo": "tNDiVMuGbr",+ "kind": "comment",+ "invitation": "Official_Comment",+ "signature": "Reviewer USTL",+ "content": {+ "comment": "I thank the authors for their detailed responses. Regarding **A3**, before I finalize my score, could the authors compare how the models in their updated experiment perform with and without CoT training? Currently, it is difficult to assess from the provided table exactly how CoT contributes to generalization."+ },+ "createdAt": "2026-07-31T19:09:02.234Z",+ "modifiedAt": "2026-11-19T17:07:32.039Z",+ "url": "https://openreview.net/forum?id=KRMF9RmzSJ¬eId=Sl36LIixH5",+ "license": "CC-BY-4.0"+}
reviews/openreview/krmf9rmzsj/notes/syo3iks0uc.json added
+++ b/reviews/openreview/krmf9rmzsj/notes/syo3iks0uc.json@@ -0,0 +1,15 @@+{+ "schema": "review/1",+ "id": "sYo3iks0Uc",+ "replyTo": "LkJCYgS5BM",+ "kind": "comment",+ "invitation": "Official_Comment",+ "signature": "Authors",+ "content": {+ "comment": "Dear AC,\n\nThank you for your effort in handling our paper. We have posted our rebuttal responses.\n\nWe understand the concerns regarding our single-layer, fixed-$V$ setting. But we note that this is a common setting in theoretical studies [3,4,8].\n\nEven in this setting, the study of $K$-NN via CoT remains highly nontrivial. We develop novel proof techniques, including contradiction and compactness arguments for proving parameter divergence without closed-form GD updates, and asymptotic drift/crossing arguments for characterizing limiting ratios among diverging parameters. To our knowledge, these technical tools are unique in the literature.\n\nWhile we agree that more general settings are important future directions, we sincerely hope that our work can be evaluated based on its technical novelty and within the context of comparable theoretical studies.\n\nBelow we briefly summarize our response to the six prioritized points.\n\n* **one-layer Transformer**\n - The one-layer setting is consistent with the most closely related training-theoretic studies of CoT reasoning [1-3] and in-context 1-NN prediction [4], and provides a natural framework for isolating the mechanism investigated in this work. We also add experiments for multi-head or multi-layer models, demonstrating that the proposed mechanism is not empirically limited to our specific theoretical setting.\n* **stochastic position encoding**\n - Our use of stochastic positional encodings follows [5,6], and our analysis builds on the same principle as in [6]. We use signed-permutation symmetry to show that gradient descent remains on an invariant manifold; hence, our training guarantees rely on stochastic positional encodings. However, our expressive-power guarantees (Theorem 3.1 and Proposition 3.2) extend directly to any mutually orthogonal positional encodings.\n* **limited convergence analysis**\n - Several key steps in our proof rely on qualitative arguments that do not provide finite-time estimates. Developing finite-time estimates would be challenging, given the complexity of our current asymptotic proof, and would likely require additional theoretical tools.\n* **restrictive assumptions: Fixing V, training distribution** \n - Fixed $V$ is also considered in [3,4,7,8]. The CoT mechanism identified in our work is governed primarily by $W$, and therefore the central learning problem is preserved when $V$ is fixed. Our experiments in Appendix F also give results when $W$ and $V$ are jointly trained, suggesting that fixing $V$ serves primarily as an analytical device rather than an empirical requirement.\n - Our assumptions are adapted from the related work on in-context 1-NN prediction [4]. Moreover, the $K$-NN problem remains valid even when $x_i$ and $y_i$ are independent, as the $K$-NN prediction rule is defined by feature proximity, not feature-label correlation. Covering such a case is also important, since it cleanly excludes prediction rules combining correlation-based in-context regression and proximity-based in-context $K$-NN prediction.\n* **multiclass setup**\n - The CoT expressivity results in Theorem 3.1 and Proposition 3.2 extend naturally to multiclass classification by replacing binary labels with one-hot vectors. Extending the training theorem would require replacing binary sign-flip symmetry with class-permutation symmetry and rederiving the reduced dynamics.\n* **Need for broader comparison with prior work [1]**\n - We give a detailed comparison with [1]. First, [1] directly unrolls the naturally iterative gradient-descent updates, whereas our work identifies a nontrivial sequential mechanism that implements the nominally non-iterative $K$-NN rule. Second, [1] supervises each CoT step, whereas we show that supervising only the first target vector for 1-NN and then applying CoT already achieves $K$-NN, an observation that we find interesting. Moreover, [1] studies linear attention, while we study softmax attention, and our proof techniques are substantially different.\n\nWe believe that our responses have clarified the reviewers’ concerns, and we are happy to provide further clarification during the discussion period.\n\n[1] Transformers Learn to Implement Multi-step Gradient Descent with Chain of Thought. ICLR 2025\n\n[2] Transformers Provably Learn Chain-of-Thought Reasoning with Length Generalization. NeurIPS 2025\n\n[3] Multi-head Transformers Provably Learn Symbolic Multi-step Reasoning via Gradient Descent. NeurIPS 2025\n\n[4] One-Layer Transformer Provably Learns One-Nearest Neighbor In Context. NeurIPS 2024\n\n[5] Positional description matters for transformers arithmetic. ArXiv 2023\n\n[6] Transformers Provably Learn Sparse Token Selection While Fully-Connected Nets Cannot. ICML 2024\n\n[7] Can Looped Transformers Learn to Implement Multi-step Gradient Descent for In-context Learning? ICML 2024\n\n[8] How transformers learn diverse attention correlations in masked vision pretraining. ICML 2024 Workshop"+ },+ "createdAt": "2026-07-29T18:10:45.003Z",+ "modifiedAt": "2026-11-19T17:07:32.113Z",+ "url": "https://openreview.net/forum?id=KRMF9RmzSJ¬eId=sYo3iks0Uc",+ "license": "CC-BY-4.0"+}
reviews/openreview/krmf9rmzsj/notes/u5twltn0wu.json added
+++ b/reviews/openreview/krmf9rmzsj/notes/u5twltn0wu.json@@ -0,0 +1,15 @@+{+ "schema": "review/1",+ "id": "U5TwLTn0WU",+ "replyTo": "uD5o0VPV0m",+ "kind": "comment",+ "invitation": "Official_Comment",+ "signature": "Reviewer RhHp",+ "content": {+ "comment": "I thank the authors for the detailed response. Based on the rebuttal, discussions from the other reviews, and my initial evaluation, I stand by my score. The added experimental results are very much appreciated."+ },+ "createdAt": "2026-08-03T23:50:33.766Z",+ "modifiedAt": "2026-11-19T17:07:31.789Z",+ "url": "https://openreview.net/forum?id=KRMF9RmzSJ¬eId=U5TwLTn0WU",+ "license": "CC-BY-4.0"+}
reviews/openreview/krmf9rmzsj/notes/u6v4rbcsxn.json added
+++ b/reviews/openreview/krmf9rmzsj/notes/u6v4rbcsxn.json@@ -0,0 +1,15 @@+{+ "schema": "review/1",+ "id": "u6v4RBcsxN",+ "replyTo": "f3GSfStXcV",+ "kind": "comment",+ "invitation": "Official_Comment",+ "signature": "Reviewer USTL",+ "content": {+ "comment": "I thank the authors for the additional experiments and for responding to my additional questions. Based on our discussion, I have decided to keep my score the same. My justification is as follows:\n\n* From what I could follow, the proof idea and the conceptual approach (implementing iterative methods with CoT) have already been covered in earlier literature, which means that the paper's primary potential contribution should lie in the context of implementing and learning $k$-NN.\n\n* Regarding the discussion on $k$-NN, I find it difficult to believe that scaling up the model does not help in learning $k$-NN for larger values of $k$ in practice. Therefore, it is still not obvious to me how the CoT approach implemented here will help at a larger scale. Ultimately, the discussion and the experiments need to be expanded to establish a clearer picture of how CoT improves $k$-NN."+ },+ "createdAt": "2026-08-03T21:46:49.683Z",+ "modifiedAt": "2026-11-19T17:07:31.855Z",+ "url": "https://openreview.net/forum?id=KRMF9RmzSJ¬eId=u6v4RBcsxN",+ "license": "CC-BY-4.0"+}
reviews/openreview/krmf9rmzsj/notes/wutoqwkrnb.json added
+++ b/reviews/openreview/krmf9rmzsj/notes/wutoqwkrnb.json@@ -0,0 +1,15 @@+{+ "schema": "review/1",+ "id": "wuToqWKRnB",+ "replyTo": "aJB4B2NQdt",+ "kind": "comment",+ "invitation": "Official_Comment",+ "signature": "Authors",+ "content": {+ "comment": "Thank you for confirming that most of your concerns have been addressed. Below we answer your follow-up questions.\n\n**Q1**. Is it because the problem or the task itself is a good fit for stochastic positional encoding?\n\n**A1**. We do not view stochastic positional encoding as an intrinsic requirement of $K$-NN. As we mentioned, our expressive power guarantees can be directly extended to any mutually orthogonal positional encodings.\n\nHowever, we do believe that stochastic positional encoding is a good fit for our problem. Stochasticity in the positional encodings induces a signed-permutation symmetry in the positional block. As shown in Appendix E.2, this symmetry ensures that gradient descent remains confined to a low-dimensional invariant manifold, thereby making the training dynamics tractable.\n\n**Q2**. I still think using first-step supervision is strange. From the training objective, we only have the first-step outcome, and $K$ never appears, but the target is to learn the $K$-th nearest neighbors. One can also use ICL to learn $1$-NN and then recursively implement the inference for $K$ times to find the $K$-th nearest neighbor? If so, the theoretical contribution is weakened, since you are learning 1-NN, which is the same as the existing work on 1-NN.\n\n**A2**. We believe this is a misunderstanding. \n\n1\\. We would like to clarify that our setting is indeed an ICL task. In our formulation, CoT serves as an explicit mechanism for carrying out multi-step in-context inference. Therefore, we do not view the CoT formulation as separate from ICL.\n\n2\\. “Using the models to learn $1$-NN target-state prediction and then recursively implementing the inference $K$ times can identify the $K$-th nearest neighbor” is precisely one of our key findings. Therefore, this observation itself constitutes part of our contribution, rather than a reason to discount our contribution.\n\nMore specifically, our work highlights an interesting phenomenon: supervising the model to perform $1$-NN target-state prediction suffices to ensure that the trained model implements $K$-NN with CoT. We do not claim that one-step supervision is universally sufficient for CoT, but we believe it is useful to give a concrete theoretical demonstration of the existence of such behavior in certain settings.\n\n\n3\\. We want to clarify that our finding in 2. does not weaken our theoretical contribution. Our setting is different from existing work on 1-NN [1], and the results in [1] cannot naturally imply that autoregressive implementations of the model performs $K$-NN: \n\n- A key difference from [1] in the problem setting is that we supervise the target state vector $[x_q^\\top, y_{\\pi(1)}, p_{N+1}^\\top + p_{\\pi(1)}^\\top]^\\top$, rather than only the scalar target $y_{\\pi(1)}$. This is crucial for implementing the CoT process: in addition to predicting the correct nearest-neighbor label, the model must also learn the correct positional component, which is needed to penalize neighbors selected in earlier reasoning steps. Moreover, we consider the initialization $W = 0$, while [1] requires that one of the entries in $W$ is initialized with a small enough negative value. These differences make our analysis more challenging. \n\n- More importantly, our work introduces a sequential mechanism that reformulates the conventionally non-sequential $K$-NN task as a sequential procedure, thereby enabling CoT-based prediction. This is clearly not covered in the study of 1-NN in [1].\n\n- From a technical perspective, demonstrating that transformers can perform $K$-NN requires showing that softmax attention can simultaneously implement two coupled mechanisms: selecting the relevant token and masking previously selected tokens. This differs substantially from the $1$-NN task, which primarily requires only the nearest-neighbor selection mechanism.\n\n- Our proof shows that the training dynamics remain on the invariant manifold $W^{(t)}=\\operatorname{diag}(\\alpha^{(t)} I,0,\\beta^{(t)} I)$, where $\\alpha^{(t)}>0$ drives selection of the nearest context point, while $\\beta^{(t)}<0$ penalizes previously selected tokens and hence implements a learned mask. A key novelty of our analysis is to prove the coupled asymptotic behavior of these two coefficients: $\\alpha^{(t)}\\to+\\infty$ and $\\beta^{(t)}\\to-\\infty$, together with a precise characterization of their limiting ratio. This joint characterization is essential for showing that CoT implements $K$-NN, and notably, the results in [1] are not sufficient to show this.\n\n- We prove the divergence of $\\alpha^{(t)},\\beta^{(t)}$ using contradiction and compactness arguments, and then establish the limiting ratio between them via drift and crossing arguments. These proof techniques are novel and not covered in [1] either. \n\nWe hope that our clarification above addresses your concerns. Thank you for your careful reading and helpful feedback.\n\n[1] One-Layer Transformer Provably Learns One-Nearest Neighbor In Context. NeurIPS 2024"+ },+ "createdAt": "2026-08-04T09:34:02.475Z",+ "modifiedAt": "2026-11-19T17:07:31.603Z",+ "url": "https://openreview.net/forum?id=KRMF9RmzSJ¬eId=wuToqWKRnB",+ "license": "CC-BY-4.0"+}
reviews/openreview/krmf9rmzsj/notes/xkyhw4zgsk.json added
+++ b/reviews/openreview/krmf9rmzsj/notes/xkyhw4zgsk.json@@ -0,0 +1,15 @@+{+ "schema": "review/1",+ "id": "xKYHW4zGSK",+ "replyTo": "U5TwLTn0WU",+ "kind": "comment",+ "invitation": "Official_Comment",+ "signature": "Authors",+ "content": {+ "comment": "Thank you for your support and for taking the time to respond to our rebuttal. We also greatly appreciate your positive assessment of the additional experimental results. We sincerely value the time and effort you have devoted to reviewing our work and engaging in the discussion."+ },+ "createdAt": "2026-08-04T09:30:27.913Z",+ "modifiedAt": "2026-11-19T17:07:31.949Z",+ "url": "https://openreview.net/forum?id=KRMF9RmzSJ¬eId=xKYHW4zGSK",+ "license": "CC-BY-4.0"+}