Paper commentary
Optimal Autoregressive Chain-of-Thought Learning via Bagging
- Problem Learning a next-token generator from full chain-of-thought demonstrations is known to need sample complexity that does not grow with the chain length T, but the learner that achieves the optimal rate is computationally intractable.
- Method Train N CoT-consistent generators on bootstrap samples of prefixes of the training data, and generate each token by a majority vote of the N generators, with N = O(log(T/δ)).
- Results Reaches a CoT risk of O((dG + log(1/δ))/n), independent of T, which matches the optimal rate for binary alphabets; for finite alphabets it is optimal up to a log|Σ| factor.

Table 1 : Sample complexity of realizable learning with chain-of-thought supervision. Here d, dG, dL, and
Original paper · CC BY 4.0 · Awni Altabaa, John Lafferty, Omar Montasser · Optimal Autoregressive Chain-of-Thought Learning via Bagging · Original paper figure · Extracted the figure area from page 2 of the original PDF.Learning generators from full chains of thought
A next-token generator f maps a prompt x in Σ⋆ to one token, and it is run autoregressively: the token it emits is appended to the prompt and the generator is called again. After T calls the generated tokens form a chain of thought, and its last token is read as the answer. The learner receives n prompt and chain pairs drawn from a distribution that is realizable by some generator in F, meaning that a generator in F reproduces the full chain on every draw.
Quality is scored by the CoT risk, which is the probability that the predictor, run autoregressively, produces a wrong token at some step of the chain. Formally, the CoT risk is \(\Pr_{(x,y)\sim P}[\exists t\in[T] : \hat f^{(t)}(x)\neq y_t]\). This is stricter than the end-to-end risk, which checks only the final answer, and guarantees for the two risks need not coincide.
Where earlier sample complexity bounds stand
Joshi et al. obtained a bound of order d log T from one invocation of a consistent oracle, so the cost grows with the chain length.
Hanneke, Mehalel, and Moran removed the log T factor with a majority-vote compression scheme, but the price is the dual VC dimension, which can be exponentially larger than d.
Doron-Arad, Mehalel, and Mossel reached a bound independent of T through online learning, stated in terms of the Littlestone dimension, a quantity that may be infinite for simple classes such as thresholds on the line.
Li settled the optimal rate, with sample complexity O((dDS + log(1/δ))/ε) independent of T, where dDS is the DS dimension.
Table 1 collects these bounds with their alphabet types and learners, and it adds the bound proved here and Li's lower bound for comparison.
How the bagging ensemble is trained and used
Each of the N base learners first draws a size k uniformly from the index set Jn = {⌈n/4⌉, ..., n−1}, then draws k examples with replacement from the first k training examples, and calls the CONS CoT oracle on that bootstrap sample. The oracle returns a generator in F that reproduces every chain in its input, so each base generator is CoT-consistent with its bootstrap sample.
Inference runs token by token. For the first token, the ensemble takes the most frequent first-token prediction of the N generators on the prompt; for each later step t, it takes the most frequent prediction on the prompt extended by the tokens already chosen, with a fixed tie-breaking rule. The number of base learners is N = max{4, ⌈log2(2T/δ)⌉}, so it is O(log(T/δ)), and a chain of length T costs N·T evaluations of generators in F.
As in bagging generally, training and inference can both be run in parallel across the N members.
Why the worst step controls the error
The central quantity is the worst-step error of a random base generator, \(a(x,y)=\max_{1\le t\le T}\Pr_{S\sim P^n}[\hat f_S(x\circ y_{1:t-1})\neq y_t]\), where \(\hat f_S\) is the CoT-consistent generator trained on a sample S. Lemma 1 bounds the second moment of this quantity over test examples: \(\mathbb{E}_{(x,y)\sim P}[a(x,y)^2]\le C\, d_G/n\), where C is a universal constant.
The worst step is not the same for every generator, but the proof fixes it for each example in advance. Each example is then mapped to one next-token example, so the question reduces to the error of a single token prediction.
The error regions of the generators, relative to this map, form a class whose VC dimension is at most dG, because the token-level error regions of F have VC dimension dG. The selector that returns the error region of the oracle's output selects a set disjoint from the sample, since the oracle reproduces every training chain. A second-moment bound for consistent learners over VC classes then gives the lemma, and the second moment avoids the extra log(n/dG) factor that a first-moment bound would add.
Each example needs the predictor to be right only at its own worst step, and the predictors that fail may differ from one step to the next, which is why the bound does not grow with T.
From fresh samples to bootstraps
Lemma 1 concerns predictors trained on fresh samples, while the algorithm trains on bootstraps of one sample, so the analysis passes through an idealized bagging predictor that averages over all ordered bootstraps. Its bagging score is \(\hat B_S(y\mid x)=\Pr_{S'\sim \mathrm{Unif}(S)^{|S|}}[\hat f_{S'}(x)=y]\), the fraction of the ordered bootstraps whose generator outputs y on x.
A bootstrap of size n−1 omits example i with probability (1−1/n)^{n−1}, which is at least 1/e, and conditioned on omitting i it is a bootstrap of the sample without i. Comparing the bagging score on the full sample with its score on the sample without i shows that the leave-one-out failure probability is at most e times the failure probability on the full sample.
Averaging over the examples gives the leave-one-out bound \(\frac{1}{n}\sum_{i=1}^n \max_t(1-\hat B_{S-i}(y_{i,t}\mid x_i\circ y_{i,1:t-1}))^2 \le 2e^2C\, d_G/n\).
High-probability guarantee and the suffix-bagging predictor
Suffix averaging of Aden-Ali et al. averages the bagging predictors over prefixes of the sample with lengths in Jn, which turns the leave-one-out bound into a high-probability one. The resulting suffix-bagging predictor has score \(\hat g_S(y\mid x)=\frac{1}{|J_n|}\sum_{k\in J_n}\hat B_{S_{\le k}}(y\mid x)\). With probability at least 1−δ over S, its expected squared worst-step error satisfies \(\mathbb{E}_{(x,y)\sim P}[\max_t(1-\hat g_S(y_t\mid x\circ y_{1:t-1}))^2]\le 19.28e^{2C}(d_G/n+(1/n)\log(2/\delta))\) for n ≥ 4.
Jensen's inequality passes from the average of the bagging losses to the loss of the averaged score. The suffix-bagging predictor averages over all ordered bootstraps of every prefix, which is exponentially many in n, and each term needs an oracle call, so it cannot be computed directly. The algorithm therefore replaces its token votes with a majority vote over N sampled members, which is a Monte Carlo approximation of the suffix-bagging predictor.
Why N = O(log(T/δ)) sampled generators suffice
Examples whose squared worst-step error is at least 1/256 are set aside. For the others, at a fixed target step the mistakes of the sampled generators are independent Bernoulli variables with the same mean p, and p is below 1/16.
Moran and Yehudayoff's sparsification instead gives N = O(d⋆ + log(1/δ)) members, independent of T but depending on the dual VC dimension d⋆. The dual VC dimension can be exponentially larger than dG, which is why the algorithm uses the squared worst-step route instead.
The main bound and its optimality
A union bound gives the result, and for dG ≥ 1 the constant is 256·19.28(1+log 4)e^{2C}; when dG = 0 every generator agrees on each next token and the CoT risk is zero.
For binary alphabets the Graph dimension is the VC dimension, so the bound matches the lower bound for PAC learning that holds already for T = 1, and it matches Li's optimal rate. For finite alphabets, dG ≤ 4.67 dN log2|Σ| with dN the Natarajan dimension, so the bound is optimal up to a log|Σ| factor, since multiclass learning requires samples of order (dN + log(1/δ))/ε.
Limits for infinite alphabets
For infinite alphabets the answer to whether aggregating predictors from F can reach the optimal rate is no, and the obstruction already appears when T = 1, where the problem is multiclass learning. Impossibility results for aggregations of proper learners imply that majorities of consistent learners can need Ω((dG + log(1/δ))/ε) samples on some classes, and the authors conclude that the Graph-dimension dependence of Theorem 1 is tight for this algorithm.
Distilling the ensemble into one generator
The remedy is sequence-level distillation: draw fresh unlabeled prompts, label each with the chain of thought produced by the majority-vote ensemble, and fit one generator in F to the labeled prompts. Since the ensemble need not belong to F, the labeled sample may not be realizable, so the student is chosen by an ERM CoT oracle that minimizes the empirical CoT risk over F.
With the ensemble from Algorithm 1 run on n ≥ 4 samples and with nu ≥ n log(nT) unlabeled prompts, the student's CoT risk is O((dG + log(1/δ))/n) with probability at least 1−2δ. The dependence on T moves from every inference step, where the ensemble size grows, to a one-time cost in unlabeled prompts.
The teacher need not be realizable, but it is nearly realizable, because it disagrees with the target only where it errs, and this gives the fast 1/nu rate. A worst-case agnostic analysis would give only a 1/√nu rate, and the authors contrast this with a related distillation procedure whose bound scales as 1/ε² rather than 1/ε.
Why the student keeps the rate
The student's guarantee must hold uniformly over F, and a relative deviation bound gives a fast rate when the empirical risk is small: \(\mathbb{E}[\ell]\le \frac{2}{m}\sum_i \ell(z_i)+5\frac{\log\Gamma_{\mathcal L}(2m)+\log(4/\delta)}{m}\). The derivation uses a Bernstein-type deviation step and the algebraic fact that A ≤ B + C√A implies A ≤ B + C²/2 + C√B.
The growth function of the CoT loss class is at most \((kT+1)^{d_G}\), because a generator follows the target chain until its first mistake, so the pattern is fixed by token-level errors on kT next-token examples. The Sauer–Shelah lemma then bounds the number of such patterns by \((kT+1)^{d_G}\).
The teacher-labeled distribution differs from the true distribution only on prompts where the teacher errs, so the true generator has teacher-labeled CoT risk at most ε̂. Bernstein's inequality then bounds the empirical CoT risk of the true generator by about 2ε̂ plus a term of order log(2/δ)/nu.
The student minimizes empirical CoT risk, so its empirical risk is at most that of the true generator, and the relative deviation bound converts this into the bound 5ε̂ plus a term of order (dG log(nuT) + log(1/δ))/nu. Since the logarithm divided by nu is at most 3/n when nu ≥ n log(nT), the second term is O((dG + log(1/δ))/n).
Limitations
For finite alphabets the bound is optimal only up to a factor of log|Σ|. For infinite alphabets, aggregation of finitely many predictors from F cannot attain the optimal sample complexity, according to the impossibility results cited.
The guarantees assume realizability by some generator in F, and they concern the CoT risk rather than the end-to-end risk.
Before distillation, inference costs N generator evaluations per token, and the distilled student requires nu ≥ n log(nT) unlabeled prompts and an ERM CoT oracle. The high-probability constant 256·19.28(1+log 4)e^{2C} depends on the universal constant C, which the paper states only as C ≥ 1.
Paper info
- Authors
- Awni Altabaa, John Lafferty, Omar Montasser
- Venue
- arXiv · Preprint
- First published
- 2026-11-16
- Added
- 2026-11-18
- Updated
- 2026-11-16
- Version
- v1
- arXiv
- 2611.21597
- Category
- cs.LG · stat.ML
- Original paper terms
- CC BY 4.0
- What we show
- Paper info, commentary and permitted figures from the original paper
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Abstract
We study how to learn an autoregressive next-token generator $f\colonΣ^\star\toΣ$ from a class $\mathcal{F}$, given chain-of-thought (CoT) demonstrations of length $T$ generated by $f$. We present a simple algorithm based on bagging, which outputs a majority vote of generators that are trained to be CoT-consistent on bootstrap samples of the training data. For binary token sets, it achieves the optimal sample complexity of $O((d_{\mathrm{VC}}+\log(1/δ))/ε)$, independent of the CoT length $T$, where $d_{\mathrm{VC}}$ is the VC dimension of $\mathcal{F}$. For finite token sets $Σ$, the VC dimension is replaced by a multiclass analogue, the Graph dimension $d_{\mathrm{G}}$, and the sample complexity is optimal up to a $\log|Σ|$ factor. The number of generators in the majority-vote ensemble is $O(\log(T/δ))$, and we show that the ensemble can be distilled into a single generator in $\mathcal{F}$ at the expense of $n\log(nT)$ unlabeled prompts.
Quote from the paper
Awni Altabaa, John Lafferty, Omar Montasser (2026). Optimal Autoregressive Chain-of-Thought Learning via Bagging. arXiv:2611.21597v1. https://arxiv.org/abs/2611.21597v1
BibTeX
@misc{altabaa2026optimal,
title = {{Optimal Autoregressive Chain-of-Thought Learning via Bagging}},
author = {Awni Altabaa and John Lafferty and Omar Montasser},
year = {2026},
eprint = {2611.21597},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2611.21597v1}
}