betaFeedback

WorksComputer Science

What's in a Tree ? Hierarchical nn-gram models as controlled approximators of language

Abstract

Hierarchical models have been proposed as synthetic settings for studying language. However, their relevance to realistic language corpora remains underexplored. In this work, we introduce tree-grams, autoregressive generative nn-gram models that build the conditional probability tensor p(xn∣x1:n−1)p(x_n \mid x_{1:n-1}) through a hierarchical composition of order-2 and order-3 tensors. nn controls the maximal context window, whereas a rank hyperparameter dd controls model capacity, yielding an interpretable and systematically scalable family of approximators of language. We show how tree-grams outperform existing nn-gram baselines, while remaining competitive with deep transformer-based language models. We demonstrate the utility of such controlled approximations by using tree-grams as generative models. In particular, we show that hyperparameter transfer under μμP can be made more robust when narrower models are tuned on simpler data, generated by tree-grams with moderate nn and dd. In addition, we show that entropy and effective range of correlations control performance gap after fine-tuning. This is because tree-grams allow us to explicitly control horizon and capacity. When allowed to route across candidate topologies, we observe emergent sparsity in tree-grams. Such concentrated routing permits pruning upto 95% of topologies without significant change in performance.

Introduction

Language is hypothesized to be hierarchically structured ([21, 22, 33, 42, 38]). Its statistical structure has been studied using classical and modern language models, including Markov-chain and nn-gram models ([80, 12, 4]). Synthetic datasets inspired by context-free grammars ([21, 45, 53, 52]) have also been proposed as tractable testbeds to understand language modeling. In particular, ([13]) propose a family of tree-like generative models where a hierarchy of latent nodes determines the probability distribution of the leaves. Tree-like generative models can successfully represent compositional dependencies and improve language modeling ([56] (Dyer et al. 2016)); however, learning linguistically meaningful tree structures directly from data remains difficult ([53, 52, 44]). It is also important to understand what tree-like properties are present in real data, which can be accomplished by creating trainable versions of such models.

In this work, we propose such a trainable model. In particular, we propose tree-grams, which are hybrid nn-gram models based on hierarchy and local connectivity. Tree-grams combine order-2/order-3

[†]: The code is released on Github. Saved models are released on Hugging Face, while generated datasets are released as Hugging Face datasets. tensor approximation with normalization layers, residual connections, and MLPs to approximate the order-nn transition tensor p(xn∣x1:n−1)p(x_n|x_{1:n-1}). The two hyper-parameters nn and dd are independent controls on tree-grams, while nn controls the horizon of the model, dd controls model capacity. A summary of our contributions is provided below.

Summary of contributions

  • We present tree-grams as generative models for controlled approximation of language. The approximation is controlled through a horizon parameter nn and a rank parameter dd. In contrast with context-free grammars, tree-grams learn the latent features from data. We train tree-grams on TinyStories [31] as a proof of concept, for which we demonstrate how tree-grams out-perform existing nn-gram estimators and remain competitive with deep neural references.

  • We demonstrate the utility of such controlled approximations by analyzing hyperparameter (HP) transfer and fine-tuning performance. In particular, we show that HP transfer is more robust when the smaller proxy is trained on lower-complexity synthetic data. We also investigate the effect of alignment between pre-training and finetuning data, where we show that performance has a stronger dependence on the finetuning distribution.

  • We observe concentrated topology-routing distributions when tree-grams are allowed to choose topologies at each layer through linear routers. We observe that the predictive performance changes very little even when we prune upto 95 % of topologies at each level.

We emphasize that the value of tree-grams is experimental. It allows us to rigorously test ideas about the structure of (language) data and learning. This is in contrast with empirical value as a model class that out-performs SOTA neural networks. Thus the focus in this work was to set up a basic version of tree-like models that scale better than existing nn-gram baselines.

Background and Motivation

Hierarchical models have been used to study synthetic datasets resembling language. [21, 24, 94, 13]. Justification for such hierarchical modelling comes from statistical property analysis [87], information theory [36, 93] and cognitive representations [25, 72, 30, 41]. However, all such models fix hidden features based on semantic or syntactic structures. Tree-grams are introduced as generative models where the hidden node features are directly learnt from data. In addition, it is useful to have independent knobs that control the complexity of the full corpus. Such an approximation can be made by either controlling the capacity or the horizon of the generative model [15]. Such approximations have been made by using traditional and smoothed nn-gram counts [17, 74, 63], hidden Markov models [3] or tensor-trains [68, 84]. However, these methods are difficult to scale beyond few words. On the other hand, the effect of various architectural hyper-parameters in transformers on model capacity is poorly understood. We introduce tree-grams in light of the above considerations. Detailed background and related works are presented in Appendix § 13.

The tree-gram architecture

We implement tree-grams as a hierarchical architecture (see Figure 1), with layers indexed by ℓ\ell. After an initial shared token embedding Emb,

Figure 1. (a) The tree-gram architecture. Tree-grams consist of hybrid blocks which are used to merge intermediate nodes, progressively reducing the number of nodes n(ℓ)n^{(\ell)} at each layer. Red edges are order-3 merges, blue edges denote order-2 merges. All upward merges (denoted with an upward-pointing arrow) are followed by LayerNorm and an MLP, shared across the first n(ℓ)−1n^{(\ell)}-1 nodes of the layer. Autoregressive prediction is done by masking (*) previous tokens. The last node outputs logits for next-token prediction. (b) Scaling with the horizon nn. cross-entropy of the next-token probability given exactly n−1n-1 tokens of context. Tree-grams (in red) outperform tested nn-gram estimators for large nn but fall short of deep transformers. (c) Scaling with the rank dd. Per-token loss as a function of the rank dd. We observe a smooth approach towards the empirical lower envelope of the available references as dd increases. The corresponding plots for Wiki-Text and FineWebEdu are presented in the Appendix I.

zi(0)=Emb⁡(xi)+pi∈Rd,(1)z_i^{(0)} = \operatorname{Emb}(x_i) + p_i \in\mathbb{R}^{d}, \tag*{(1)}

the new layer is formed via local order-2 and order-3 merges. pip_i is a (learnable) positional encoding. The Merge operation is defined as

hi(ℓ)=Merge⁡up(z)={Wi(ℓ−1)zi(ℓ−1)(connection),Wi(ℓ−1)(zi(ℓ−1)⊙zi+1(ℓ−1))(connection),(2)h_i^{(\ell)} = \operatorname{Merge}_{\mathrm{up}}(z) = \begin{cases} W_i^{(\ell-1)}z_i^{(\ell-1)} & \text{(connection)},\\ W_i^{(\ell-1)}\left(z_i^{(\ell-1)} \odot z_{i+1}^{(\ell-1)}\right) & \text{(connection)}, \end{cases} \tag*{(2)}

where zj(ℓ)∈Rdz_j^{(\ell)} \in\mathbb{R}^{d}, Wj(ℓ−1)∈Rd×dW_j^{(\ell-1)} \in\mathbb{R}^{d \times d}, and ⊙\odot denotes elementwise multiplication. The order-3 merge is a CP-type (Hadamard) factorisation of an order-3 tensor, as in the tensor circuits introduced by (Loconte et al., 2025). The factorization above is a non-unique choice. It restricts the class of topologies, although the number of topologies is super-polynomial O(nn)O(n^{\sqrt{n}}). Moreover, it fixes the depth to be log⁡n\log n, which we call the principle of minimal depth. 8 Tree-grams belong to a more general class of hierarchical tensor decompositions with latent nodes [82, 78, 35]. Any factorization of the nodes represents a valid tree-gram architecture.

Given the horizon, or maximal context window, nn, the number of nodes in each layer is defined via a recursive relation

n(ℓ)=⌊n(ℓ−1)2⌋+1;n(0)=n,(3)n_{(\ell)} = \left\lfloor\frac{n_{(\ell-1)}}{2} \right\rfloor+ 1;\quad n_{(0)} = n, \tag*{(3)}

fixing the depth of the network is ⌈log⁡2(n−1)⌉\lceil\log_2(n-1)\rceil. For each layer, n(ℓ)n_{(\ell)} and n(ℓ+1)n_{(\ell+1)} constrain the total number of order-3 merges, but their position along the sequence can vary. The choice of positions at each layer determines the topology τ\tau of the tree-gram.

The merge operation is preceded by LayerNorm, and followed by the residual+MLP composition typical of transformer layers,

zˉi(ℓ−1)=LN⁡ℓ,proj(zi(ℓ−1)),qi(ℓ−1)=Merge⁡(zˉi(ℓ−1))+ρ2zires,ℓ−1,ziℓ=ρqi(ℓ−1)+MLP⁡ℓ(LN⁡ℓ,mlp(qi(ℓ−1))).(4)\begin{aligned} \bar{z}_i^{(\ell-1)} &= \operatorname{LN}_{\ell,\mathrm{proj}}(z_i^{(\ell-1)}),\qquad q_i^{(\ell-1)} = \operatorname{Merge}(\bar{z}_i^{(\ell-1)}) + \frac{\rho}{2}z_i^{\mathrm{res},\ell-1},\\ z_i^\ell&= \rho q_i^{(\ell-1)} + \operatorname{MLP}_{\ell}\left(\operatorname{LN}_{\ell,\mathrm{mlp}}(q_i^{(\ell-1)})\right). \tag*{(4)} \end{aligned}

where zires,ℓ−1=zˉiz_i^{\mathrm{res},\ell-1} = \bar{z}_i if ii has a single connection, and zires,ℓ−1=zˉi+zˉi+1z_i^{\mathrm{res},\ell-1} = \bar{z}_i + \bar{z}_{i+1} if it has a double connection. The LayerNorm (LN) and MLP are shared across nodes in a layer, while the tree-gram weight depends on the parent position. Unless stated otherwise, μ=1\mu= 1, the MLP uses GELU and hidden width 4d4d, and all reported tree-gram runs use learned positional embeddings to break the commutativity of the merge.

The downward pass occurs along the terminal nodes at each layer, with the same residual/MLP pattern as Eq. (4). The only difference is that Mergedown_{\text{down}} operation is modified as

hi(ℓ)=Merge⁡down(z)={(Wi(ℓ+1))Tzcℓ(ℓ+1)(connection),zcℓ,L(ℓ+1)⊙((Wi(ℓ+1))Tzcℓ,R(ℓ+1))(connection).(5)h_i^{(\ell)}=\operatorname{Merge}_{\text{down}}(z)= \begin{cases} \left(W_i^{(\ell+1)}\right)^{T}z_{c_\ell}^{(\ell+1)} & \text{(connection)},\\ z_{c_{\ell,L}}^{(\ell+1)}\odot\left(\left(W_i^{(\ell+1)}\right)^{T}z_{c_{\ell,R}}^{(\ell+1)}\right) & \text{(connection)}. \end{cases} \tag*{(5)}

The terminal node in the bottom layer serves as the predictive node, where an embedding-weight-tied softmax head maps it to next-token probabilities. Tree-grams perform autoregressive prediction by unfolding each sequence into its n−1n-1 left-padded prefixes, which activate different subtrees. The model was trained with the usual autoregressive cross-entropy loss. Appendix C provides further details on the architecture.

For the primary experiments reported in the main text, we train on a 529M-token subset of TinyStories, a synthetic language corpus [31], using a custom BPE tokenizer with vocabulary size V=8192V = 8192 [15]. Details on optimization are in Appendix F. We train on two additional datasets: (1) a 130M-token WikiText-103 [67] dataset, obtained by designing a custom BPE tokenizer with vocabulary size V=8192V = 8192 and (2) a 1.05B-token FineWeb-Edu [76] dataset, tokenized with the GPT-2 tokenizer and vocabulary size V=50,257V = 50{,}257.

Results

Comparison to existing baselines

Figure 1 b) compares tree-grams to different classes of nn-gram estimators, from raw counts to transformer-based LLMs. In particular, we consider classical smoothed counting models (raw count) [17, 75], unbounded suffix array calculations (infinigram) [63], weighted finite-automaton approximations obtained via spectral methods (spectral WFA) [3], tensor train approximations (tree TN, u-MPS, TTLM) [68, 84], MLP-based neural models (MLP, neural LM, neural LM + unigram) [16, 5, 9], transformer-based (GPT-2 (APE), GPT-2 (RoPE), Llama) and Selective-State-Space-Models-based (Mamba) language models. A detailed description of these baselines is found in Appendix D.

In the range of horizons probed, n≤32n \le32, the LLM baselines converge to the model-independent asymptotic conditional entropy of the true next-token distribution [15] (black dashed line in Figure 1b and Figure 1c). The model-independence is a strong indication that this is close to the true nn-gram entropy. [71, 55, 15] This will be referred to as the empirical entropy HnH_n in what follows. Tree-grams match the empirical nn-gram reference up to n≈8n \approx8, vastly outperforming all other baselines except LLMs (Figure 1b). Furthermore, increasing the capacity parameter dd reduces the performance gap to LLMs (Figure 1c)

Comparison with transformers

In order to understand the performance gap of tree-grams to LLMs more carefully, we compare tree-grams with transformers of different depth with the same parameter count, the same context length and trained with the same number of optimization steps, thereby highlighting the difference in their architectural biases. For each tree-gram target, we take a decoder-only transformer of depth L∈{1,2,3,4,5,6,10,12}L \in\{1, 2, 3, 4, 5, 6, 10, 12\}. Tree-grams perform better than the shallow matched transformers. This pattern holds until approximately n=8n = 8. At longer contexts, the tree-gram is unable to match deep transformers. The right panel shows that the excess loss monotonically decreases with dd. While shallow transformers plateau quickly, tree-grams monotonically decrease with a power-law curve, showing that they are more scalable than shallow transformers. In addition, the slope is not drastically different from the deepest transformers tested. It is worth emphasizing that this performance gap could simply be due to sub-optimal optimization routines for tree-grams. Developing better principles for optimizing tree-grams is left for future work. The per-position curves behind these endpoints are in Figure 10 (Appendix I), where the tree-gram tracks the transformer family for the first few positions and drifts away at long context, the same signature as in Figure 1.

Figure 10. Per-position cross-entropy for every tree-gram in the sweep against its parameter-matched transformers, for various depths LL. (top) nn varies at d=1024d = 1024; (bottom) dd varies at n=32n = 32. Grey annotations give the parameter count of the tree-gram in that panel (1M to 140M). The tree-gram tracks the transformer family exactly for the first few positions in every panel and peels away only at long context.

Tree-grams as Controlled Approximation of Language

We use the tree-grams as a source of synthetic data, with nn and dd independently controlling distinct modes of approximation of the synthetic corpus to the original training corpus. We emphasize that, unlike transformers, a single hyper-parameter dd controls the model capacity. In Appendix § 24 we present a qualitative analysis of the decoded text generated by tree-grams from the same prompt. Increasing nn (at sufficiently large dd) increases coherence from word-level (n=3n = 3) to sentence-level (n=32n = 32). On the other hand, increasing dd increases both coherence and quality of the generated text. We demonstrate the scientific utility of such finite-window and finite-capacity approximations by experimenting on hyper-parameter transfer under μP\mu\mathrm{P} and effect of pre-training and fine-tuning distribution shifts on fine-tuning performance.

Hyperparameter transfer under Maximal Update Parametrization

The standard recipe for hyperparameter (HP) transfer under the μP\mu\mathrm{P} (Maximal Update) parametrization Yang et al. (2022) involves two stages: tuning and transfer. The tuning stage involves training a small model, initialized according to μP\mu\mathrm{P} to find the optimal HP combination This optimal HPs are then transferred to a larger model through appropriate scaling. However, the complexity of the datasets in the tuning phase is only controlled implicitly, for example through the amount of pre-training data Björck et al. [8]; Li et al. [60], data deduplication Lee et al. [59]; Abbas et al. [1] or high-quality data pruning Sorscher et al. [83].

Using tree-grams as a generative model, we can control the data complexity explicitly. We observe that tuning HPs on a controlled-complexity approximation of the original dataset yields better transfer. Specifically, we tune the learning rate of 2- and 4-layer μP\mu\mathrm{P} decoder-only proxy transformers with widths d∈{64,…,256}d \in\{64,\ldots,256\}, then analyze the transfer to target transformers with various widths. We judge the transfer by the excess loss of the target model with transferred learning rate with respect to its own HP-tuned minimum. As shown in Figure 3, tuning ν⋆\nu^\star on the original data almost always yields the highest excess loss (black square). The converged loss has an asymmetric dependence around the optimal learning rate [54, 48, 34]. Thus, a drift in the optimal learning rate can lead to a higher excess loss. We show empirical evidence for this drift in Figure 3. The ν⋆\nu^\star from tuning on the real dataset however shows a non-monotonic effect with width, as shown by the black dashed line which sits lower than the optimal learning rate obtained from tuning on the real data. While a formal characterization of which proxy distribution to tune on, remains an open question - choosing the median learning rate over different proxy distributions can give robust transfer. It is worth emphasizing that the undershooting the learning rate is better only if the optimal learning rate at a narrower width is higher than that at larger width. In the Appendix, we show that this does not hold for FineWeb-Edu. The monotonic drift in optimal learning rate as a function of data complexity however still holds, which is the relevant phenomena.

Figure 3. Hyper-parameter (HP) transfer from narrow proxies trained on controlled synthetic approximations of the target corpus. The excess loss is the difference between the loss of a wide model (d=1024d=1024 at L=2L=2 and d=1408d=1408 at L=4L=4) in at the proxy’s optimal learning rate η∗\eta^{*} and the wide model’s own HP-tuned minimum. Tuning on different distributions gives different optimal learning rate. Almost all tuning with simpler proxy data gives a lower excess loss than if tuned on real data. In addition, we see a monotonic drift of the optimal learning rate with data complexity. The drift explains the excess loss because of the asymmetric loss curves around the optimal learning rate. Relative complexity is defined as Hreal/HH_{\mathrm{real}}/H, where HH stands for the entropy of a particular distribution.

A complete mechanistic understanding of this observation is beyond the scope of the present work. However, we present a simple toy model of data from tree-grams, which we show can give rise to a mechanism for the drift in the optimal learning rate η∗\eta^{*}. To keep notation simple, we will work in log-space ν∗≡log⁡2η∗\nu^{*} \equiv\log_{2}\eta^{*}. The model is a Gaussian surrogate of hierarchical features, in the spirit of the Random Hierarchy Model ([13]) and of multiscale Gaussian signal models ([90]). We start with a left-branching binary tree over the n−1n-1 context tokens. The node at level kk summarizes a block of 2k2^{k} tokens, so there is one node per level, k=0,…,Kk=0,\ldots,K. This sets the number of levels to be K≡⌊log⁡2[n−1]⌋K \equiv\lfloor\log_{2}[n-1]\rfloor. The power at level kk is πk=rk/ZK\pi_{k}=r^{k}/Z_{K} for some constant r<1r<1, where ZK=∑ℓ≤KrℓZ_{K}=\sum_{\ell\leq K}r^{\ell} fixes the total power to one for every nn. The importance of a node is controlled by the variance of its coefficient, βk,a∼N(0,πk/d)\beta_{k,a}\sim\mathcal{N}(0,\pi_{k}/d). We assume that the power of each node is diluted evenly over dd coordinates. If we get unit-norm vectors uk,a∈Rdu_{k,a}\in\mathbb{R}^{d}, then the next-token logits are

Figure 4. (a) The toy model for tree-gram data. (b), (c) We show that the dependence of the optimal learning rate on the measured allocated power share matches closely with the prediction from the toy model. Note that the bigram model is not a tree-gram and hence excluded from the fit.

g(S)=∑k=0K(n)∑a=1dSk,auk,a∈RV,(6)g(S) = \sum_{k=0}^{K(n)} \sum_{a=1}^{d} S_{k,a} u_{k,a} \in\mathbb{R}^{V}, \tag*{(6)}
Y∣S∼Categorical⁡(softmax⁡(g(S))).(7)Y \mid S \sim\operatorname{Categorical}\left(\operatorname{softmax}(g(S))\right). \tag*{(7)}

We also assume that the observed features are noisy versions of the true features

Φk,a=qSk,a+1−q Ξk,a\Phi_{k,a} = \sqrt{q} S_{k,a} + \sqrt{1-q}\,\Xi_{k,a}

where the noise term Ξk,a∼N(0,πk/d)\Xi_{k,a} \sim\mathcal{N}(0,\pi_k/d) is independent of (S,Y)(S,Y). The quality factor q(d)=d/(d+d0)q(d) = \sqrt{d}/(\sqrt{d}+\sqrt{d_0}) sets the signal-to-noise ratio q(d)/(1−q(d))=d/d0q(d)/(1-q(d)) = \sqrt{d/d_0}.

Solving a minimal quadratic model like that of [58] with aligned features, the single-step optimal learning rate has the following dependence:

νΛ⋆=ν∞⋆⏟asymptote+Δ(Λ)⏟data complexity(8)\nu^\star_{\Lambda} = \underbrace{\nu^\star_{\infty}}_{\text{asymptote}} + \underbrace{\Delta(\Lambda)}_{\text{data complexity}} \tag*{(8)}

Here Λ≡Λ(n,d)\Lambda\equiv\Lambda(n,d) is a quantity that characterizes the complexity of the synthetic data. Δ(Λ)\Delta(\Lambda) is a term that depends solely on the approximation parameters nn and dd. Δ(Λ)\Delta(\Lambda) increases monotonically with dd and nn, which provides a mechanism for a drift in the optimal learning rate. The full derivation is presented in Appendix § 16. We emphasize that the toy model presented is not intended to provide a causal mechanism for our empirical observations.

Pre-training and finetuning

The value of a pre-training distribution depends on how well it aligns with the fine-tuning distribution. [49] find that downstream quality improves monotonically with more pre-training data only when the two distributions are well aligned. Synthetic corpora have been used to ask which structure transfers to natural language: music and code [73], artificial languages with controlled dependency structure [79, 19], and formal languages with hierarchical dependencies [46] can all transfer, depending on the structure they carry. Tree-grams provide a structured manner to introduce, and to measure, misalignment between the pre-training and finetuning data, through either the context horizon nn or the model capacity dd.

We clarify that by fine-tuning we mean continued next-token training of all parameters on the target corpus, as in studies of transfer between text distributions Hernandez et al. [43]; Hu et al. [46]. Unlike a narrower downstream task, a target here can be more complex than its source, so we avoid low-rank adapters Biderman et al. [7]. We re-warm and cosine re-decay the learning rate from a fresh optimizer state Ibrahim et al. [47]; Gupta et al. [40], but without the replay that Ibrahim et al. [47] recommend. This is because replaying source data would mix the source into every target run and remove the same-distribution control on the diagonal. For a generator qq, we estimate its Bayes floor on the sampled path as

Hq=1N∑t=1N[−∑v∈Vq(v∣xt−n+1:t−1)log⁡q(v∣xt−n+1:t−1)](9)H_q = \frac{1}{N}\sum_{t=1}^{N}\left[-\sum_{v\in\mathcal{V}}q(v\mid x_{t-n+1:t-1})\log q(v\mid x_{t-n+1:t-1})\right] \tag*{(9)}

The conditional entropy at each sampled context is computed from the generator’s full softmax during generation — it is not inferred from the downstream model’s validation loss. Appendix H specifies the model ladder, data split and optimization schedule.

Figure 5 reports the result of this experiment. The final finetuning performance depends monotonically on the complexity of the finetuning distribution. The dependence on the pre-training distribution is more nuanced. If the pre-training data is too simple, we notice a monotonic worsening of performance with decreasing complexity. However, when fine-tuning distributions are simple, finetuning performance is almost independent of the pre-training distribution. Note that we separate the capacity-limited and horizon-limited modes Figure 5. This is because the monotonicity is a function of the entropy of the distribution within the same approximation mode (the figure sorted by entropy alone is reported in Appendix I, where the clean trend shown disappears.) Most of the gap is set by the target, through two properties that can be measured directly from its token statistics: its entropy rate and the effective range of correlations, measured by how quickly the mutual information between tokens decays with their separation, beyond the horizon. Entropy has the larger effect, but at comparable entropy a target with a longer effective range is consistently harder to reach. The joint effect of entropy and effective range of correlations was discussed in Cagnetta et al. [15]. We propose an ad hoc four-parameter law in these two quantities, plus a penalty when the source carries less information than the target, which accounts for 82–99% of the variance across all source–target pairs in every setting, and predicts the gap for held-out targets. Details are delegated to Appendix J.

Figure 5. Finetuning on controlled distributions after pre-training. We plot the relative difference between the final validation loss achieved after finetuning and the target Bayes floor of the target distribution. There is a monotonic worsening of performance as the fine-tuning target complexity increases. In addition, the performance monotonically worsens if we pre-train on too simple of a data. For brevity, we display the results of a 2-layer transformer only for TinyStories. The other plots are included in Appendix I.

Ablations

Role of topologies. We focus on three kinds of topologies: aligned, balanced, and anti-aligned. The aligned topologies contain all 🔗 connections on the left-hand side (topologies labelled τ0\tau_0, τ1\tau_1, τ2\tau_2 in Figure 6, while the anti-aligned topologies contain all connections on the right-hand side (labelled τ−1\tau_{-1}, τ−2\tau_{-2}). Balanced topologies have the connections in the middle (labelled τa\tau_a, τb\tau_b). With proper hyper-parameter tuning, all seven converge to nearly the same loss at the end of training. The difference in their per-token losses occurs only in the last few positions. We notice that the balanced and aligned topologies typically have a higher loss, while the anti-aligned topologies converge to a lower last-token loss. However, we perform experiments with τ0\tau_0 since it is an interpretable model, as outlined in § 6. There is some difference in the training dynamics, which is reported in Figure 6. The anti-aligned topologies start at a higher loss but converge to a lower loss and vice versa for the aligned topologies.

Figure 6. (a) Role of topologies. (Left) At convergence, the topologies show slight difference at long nn. (Right) The seven different topologies we experimented on. The anti-aligned topologies seem to significantly out-perform other topologies only for last-token prediction (losses in nats mentioned). (b) Role of MLPs. MLPs have a significant effect in reducing the loss even at matched parameter count. (c) MLPs help control the drift in the losses for different topologies, giving more stable training.

Role of MLPs MLPs have a significant effect on performance gap to transformers. We compare a n=32n = 32 tree-gram with MLPs to a parameter-matched tree-gram without MLPs. For either topology, removing the MLP worsens performance. This effect is more pronounced at higher values of the logit index. However, the comparison changes both the MLP/nonlinearity and the contraction rank to maintain parameter parity, so it does not isolate which factor causes the gap. We also observe that MLPs control the variation between different tree-gram topologies during training. We leave an in-depth investigation of the role of MLPs to future work. However, we would like to emphasize that even without MLPs, tree-grams can learn language structure.

Role of LayerNorm and Residual Connections LayerNorm and skip connections both help stabilize training. Removing either gave a worse loss (increase of 0.1 to 1.3 nats) for two topologies τ0\tau_0 and τ−1\tau_{-1}, see Table 1. Without either components, the initial gradients are essentially zero (median of order 10−1710^{-17} or below, against about 10−310^{-3} for the full model). Even the bare tree-gram (without normalization, residual streams or MLPs) have a median gradient of the order 10−1210^{-12} or less. Therefore, we did not run the latter two combinations at full scale.

TopologyFullNo LayerNormNo residualNo MLP
aligned τ0\tau_01.8472.567 (+0.72)†^\dagger1.946 (+0.10)1.970 (+0.12)
anti-aligned τ−1\tau_{-1}1.8052.025 (+0.22)3.142 (+1.34)1.935 (+0.13)

Table 1. Best validation loss for n=32n = 32, d=1024d = 1024 tree-gram on TinyStories. Parameter-matched ablations on various components of tree-grams. †^\daggerDiverges late in training.

Emergent sparsity through topology routing

To test whether the network develops a preference among topologies, we implement a dynamic tree-gram with one linear router at each merge layer. The routing decision is sequence-level, unlike token-level choice as in Mixture-of-Experts routing. At layer ℓ\ell, the router applies the same linear map to every active node state and then averages across active positions, in the style of Zaheer et al. [96]:

rg(ℓ)(x1:n−1)=1∣Aℓ∣∑t∈Aℓwℓ,gℓLN⁡(zt(ℓ)),p(ℓ)=softmax⁡(βr(ℓ)+a(ℓ)).(10)r_g^{(\ell)}(x_{1:n-1}) = \frac{1}{|A_\ell|} \sum_{t \in A_\ell} w_{\ell,g}^{\ell} \operatorname{LN}(z_t^{(\ell)}), \qquad p^{(\ell)} = \operatorname{softmax}(\beta r^{(\ell)} + a^{(\ell)}). \tag*{(10)}

Here AℓA_\ell is the active-node set, gg indexes the valid grouping patterns at that layer, and a(ℓ)a^{(\ell)} is a non-gradient bias trick adapted from DeepSeek-AI [27]. During training, a(ℓ)a^{(\ell)} is updated toward a slightly perturbed uniform selection target to reduce route collapse, which we switch off after 5% of training time for better performance. We select the hard top-mm indices under p(ℓ)p^{(\ell)} and mix their outputs using the corresponding differentiable softmax weights. Gradients flow through the selected weights. We report the path probabilities ppath=Ex[∏gℓ∈pathpgℓ(ℓ)]p_{\mathrm{path}} = \mathbb{E}_x \left[\prod_{g_\ell\in\mathrm{path}} p_{g_\ell}^{(\ell)}\right] where gℓg_\ell denotes the topology chosen at a layer ℓ\ell.

We observe that the network has a sharp cutoff in the probabilities, indicating that it has a strong preference for a few topologies. For the specific case of n=32n = 32, the top-100 (out of 36,720 topologies) carry a substantial O(1)O(1) fraction of the probability mass. This can also be seen through the fact that the tail is steeper than the head for both mm. Raising mm flattens both exponents together, and spreads the mass. These results are shown in Figure 7a. Although the concentration persists despite the balancing bias, current experiments are insufficient to rule out initialization or router-optimization effects as compared to learnt-language preference. The exact preferred topologies chosen is an effect of the random seed. We emphasize that we treat topology as an architectural prior. We do not infer linguistic meaning from the studied topologies, as cautioned by Williams et al. [89].

Figure 7. Emergent sparsity in tree-grams. Left. Tree-grams that are allowed to choose sequences through routing, demonstrate a preference for few topologies. The paths follow a power-law with a generalized exponential cutoff, with the tail showing a steeper decay. Right. Pruning merges at each level can preserve predictive performance even with significant fraction of merges removed.

We test the practical relevance of routing by pruning different fractions of the Merge operations at each level. As one would expect from the concentration of paths, we see that we can remove close to 95% of the Merge operations, without the tree-grams showing any meaningful change in performance, cf. Figure 7b. This experiment suggests that we can increase tree-gram capacity by training only sparse subsets of all topologies. We leave this to future work.

Conclusion, Limitations, Future Work

In this work, we present tree-grams, trainable and controllable nn-gram approximators of language. They match optimal nn-gram estimates at small nn. A noticeable gap from deep models remains at longer contexts. We find that controlled data approximations can aid hyper-parameter transfer under μ\muP. We also use them to study performance gaps after finetuning by distinguishing pre-training and fine-tuning distributions.

Since the focus in this work was experimental rather than empirical, our work consequently suffers from many limitations. It is not obvious whether our choice of architecture is optimal. We consider a narrow class of topologies, which is fixed by the layer recurrence relation 3 and the maximal order of the Merge operation. We implement a particular choice of tensor factorization in 5, inspired from Loconte et al. [64]. Computational constraints prevent scaling to longer context windows, particularly to n≈256n \approx256, which is the typical length of paragraphs in TinyStories. The O(Bn2d)O(Bn^{2}d) activation cost of prefix unfolding is a primary bottleneck, which could be reduced by sharing prefix states. In addition, the scope and scale of the models and data is limited. Understanding of different individual components of the tree-gram architecture also remains limited. In addition, a careful comparison of alternate HP tuning strategies was not performed.

Developing faster, stabler and robust optimization routines for tree-grams remains an open engineering problem. It would also be interesting to train tree-grams on distributions very different from language. We leave these and other directions mentioned in the text for future work.

Declaration of AI Usage

In this work, we used generative AI tools to design or provide feedback on research methodology or experiments, propose or refine hypotheses, help develop theoretical models or conceptual frameworks, formulate mathematical claims, provide critical ingredients for proving mathematical claims, assist in the writing of proofs, and to implement several baseline methods. We have not used generative AI tools to generate synthetic data sets. Additionally, we used generative AI tools to create or modify scientific figures or images, create or edit software code, draft parts of a research paper, summarize or analyse existing literature, discover research topics or identify gaps, suggest a structure for a research paper, and to propose a keywords for a research paper. All content, claims, and conclusions have been reviewed and verified by the authors to ensure accuracy and originality. In particular, we checked LLM-generated research ideas for potential plagiarism through a manual literature survey. LM-generated code was verified and tested for correctness by one author. LM-generated proofs were checked by one author. The key idea of developing tree-grams were originated by the authors, and AI was mainly used to implement it from scratch. We take responsibility for the final content of this work, including text, claims or artifacts produced with the aid of generative AI.

Ethics Statement

The authors pledge to adhere to the Code of Ethics. No human subjects were used in this project. All experiments are conducted exclusively on publicly available, standard benchmark datasets. Specifically, we trained on TinyStories, which is a GPT-generated text dataset WikiText (derived from verified Wikipedia articles) and FineWeb-Edu (an educational subset filtered from Common Crawl). No human subjects were involved, and no private, sensitive, or personally identifiable information (PII) was collected or processed beyond what exists in these public corpora.

Reproducibility Statement

Code to train tree-grams and reproduce the plots in the main text will be released publicly. Any unlawful or unethical use or distribution of the code is strictly prohibited.

Acknowledgements

A.D. acknowledges support from NSF DMR-2429246. F.C. acknowledges support by the European Union’s Horizon Europe program under the Marie Skłodowska-Curie grant agreement No. 101154584. D.D. acknowledges financial support from the Johns Hopkins University Data Science and AI Institute Fellowship. We acknowledge the University of Maryland supercomputing resources (http://hpcc.umd.edu) made available for conducting the research reported in this paper. Certain products, commercial and otherwise, are mentioned in this publication. These mentions are for informational purposes only, and do not imply recommendation or endorsement by NIST. Contributions to this work by NIST, an agency of the US government, are not subject to US copyright.

Model, Code and Data release

The tree-gram architecture and pre-trained models will be released under the Creative Commons Attribution 4.0 International (CC BY 4.0) license, allowing use, modification and redistribution with proper attribution.

The models will be released through a public Github or HuggingFace repository. As presented in the Supplementary Material, scripts describing the architecture and use will be uploaded, with clear instructions for reproducibility.

The Github repo will be additionally tracked to allow users to report and fix bugs. We will further invite the community to contribute to existing models through bug reports, suggestions for improvement and new dataset and feature suggestions. Each update will be accompanied by well-documented release notes, detailing changes and new requirements.

Detailed Background and Related Works

We provide a detailed description of previous and related works, to motivate tree-grams presented in this work.

Synthetic models of data Modelling language has been an area of study for a long time. The classic work of Chomsky, [21] used finite-state Markov models, phrase-structure grammars and transformational grammars. The theory of formal languages classifies grammars by their generative capacity Chomsky, [23]. In particular, context-free grammars use recursive production rules to generate hierarchical and nested structures, such as Dyck languages, that finite-state Markov models cannot represent Chomsky & Schützenberger, [24]. Later work extended context-free grammars into stochastic models by assigning probabilities to production rules Booth, [10]; Lari & Young [57], while synthetic grammatical data became a controlled setting for studying whether neural networks can learn hierarchical structure Elman, [32]. More recently, there has been a growing interest in understanding models of data with randomly chosen underlying rules, eg. the Random Language Model DeGiuli, [28] and the Random Hierarchy Model Cagnetta et al., [13]. The justification for such hierarchical structures comes from theoretical studies (Chomsky, [22]), statistical analysis (Thurner et al., [87]; Goodfellow et al. [38]), information theory (Futrell & Hahn, [36]; Yang et al. [93]) and cognitive representations (Crain & Nakayama, [25]; Pallier et al. [72]; Ding et al. [30]; Hale et al. [41]). Tree-grams are a natural extension of such hierarchical and exponentially expressive models of language-like data. By making these models trainable, we allow tree-grams to capture necessary features from the data, without explicit interpretation of hidden nodes.

nn-gram estimators Language modeling is essentially an nn-gram estimation task. Recall that the nn-gram estimation amounts to estimating the conditional probability tensor p(xn∣x1:n−1)p(x_n \mid x_{1:n-1}). The frequentist method quickly becomes infeasible due to an exponential dependence on sample complexity and memory requirements. However, numerous empirical studies indicate that this tensor is extremely sparse, which gives rise to different algorithms. Smoothing re-distributes the probability mass through a linear interpolation (Chen & Goodman, [17]); PLRE takes advantages of conditional factorization into lower-rank tensors (Parikh et al., [74]); Some algorithms use back-off (Goodman, [39]; Nakamura & Shikano [69]) or scales by brute force (Brants et al., [11]) up to the unbounded suffix-array construction of infini-gram (Liu et al., [63])

A different method is to approximate this with factorized tensor sequence models, MPS and tensor-train models. (Pestun & Vlassopoulos, (2017); Miller et al. [68]; Su et al. [84]) We use (Loconte et al., 2025) as a primary motivation for our rank-3 tensor factorization.

Neural networks can also be used for a parametric estimation. This has been tried by (Castro et al., [16]) with MLPs and one-hot encodings, (Bengio et al., [5]) with MLPs and learnable encodings, (Blat et al., [9]) with interpolation with unigrams.

Modern recurrent networks or sequence-to-sequence models take advantage of implicit biases or statistical or nested properties of language to directly model the nn-gram probabilities. (Nguyen, [71]; Krishnan et al. [55]; Cagnetta et al. [15, 14])

Controlled approximation of languages nn-gram estimators provide a truncated-horizon approximation of language data. In addition, several model families introduce monotonic measures of capacity. Weighted automata uses finite Hankel rank (Denis et al., [29]). MPS uses bond dimension (Pestun & Vlassopoulos, (2017); Miller et al. [68]; Su et al. [84]) (Yang et al., [92]) uses latent state size, while (Parikh et al., [74]) use matrix and tensor ranks to represent intermediate levels of dependence between successive nn-gram orders.

Studying transformers on such controlled languages / n-grams There have been attempts to study transformers on synthetic formal grammars. In addition, nn-gram models of data has also been formulated as a learning problem by (Svete et al., [85]) and (Varre et al., [88]) in an in-context setting. (Yüksel et al., [95]) show that transformer incremental learn higher order Markov structure. However, to the best of our knowledge, such controlled approximations have never been applied for understanding practical situations like HP transfer, due to the limitation posed by scalability and fidelity to a realistic text corpora.

Trainable tree-structured models Differentiable tree structures exist. In particular, Tree-LSTMs consume a given parse (Tai et al., [86]) while (Choi et al., [20]) learns the composition order (tree) with a Gumbel relaxation. (Shen et al., [81]) forces a soft hierarchy into a recurrent net’s gates. A key tension arises with (Williams et al., [89]), who caution that the structures such models learn need not be the linguistically meaningful ones. Transformer architectures also take advantage of trees, eg. (Madaan et al., [65]) uses a decision-tree index over keys.

Details of the architecture

Analytic expressions for various properties of the network

Write nkn_k for the number of nodes at level kk, so that n0=nn_0=n and nk+1=⌊nk/2⌋+1n_{k+1}=\lfloor n_k/2\rfloor+1. Unrolling the recursion gives the closed form

nk=2+⌊n−22k⌋(11)n_k = 2 + \left\lfloor\frac{n-2}{2^k} \right\rfloor \tag*{(11)}

The expressions for the depth dnd_n, number of nodes sns_n and the number of different topologies tnt_n are as follows

dn=⌈log⁡2(n−1)⌉∼log⁡2n(12)d_n = \left\lceil\log_2(n-1) \right\rceil\sim\log_2 n \tag*{(12)}
sn=∑k=0dnnk=n+2dn+∑k=1dn⌊n−22k⌋∼2n+O(log⁡n)(13)s_n = \sum_{k=0}^{d_n} n_k = n + 2d_n + \sum_{k=1}^{d_n} \left\lfloor\frac{n-2}{2^k} \right\rfloor\sim2n + O(\log n) \tag*{(13)}
tn=∏k=0dn−1(nk+1nk−nk+1)∼nlog⁡n+O(1)(14)t_n = \prod_{k=0}^{d_n-1} \binom{n_{k+1}}{n_k-n_{k+1}} \sim n^{\log\sqrt{n}+O(1)} \tag*{(14)}

Only the dnd_n levels above the leaves carry weight matrices, so the total number of parameters is

Ptree-gram(n,r)≈Vd+d2(1+∑k=1dnnk+2df(2dn+1))(15)P_{\mathrm{tree\text{-}gram}}(n,r) \approx Vd + d^2\left(1+\sum_{k=1}^{d_n}n_k+2d_f(2d_n+1)\right) \tag*{(15)}

If MLPs are not included then df=0d_f=0.

Description of n-gram baselines used for comparison

Raw count A raw count nn-gram model estimates p(xn∣x1:n−1)p(x_n \mid x_{1:n-1}) by normalizing counts for each observed nn-tuple of tokens. Smoothed raw count models redistribute probability mass to unseen events and shorter histories through interpolation and absolute discounting, while low-rank ensembles control the correlation of nn-grams through low-rank matrices [17, 75]. We report classical raw-count, smoothed-count, and low-rank count baselines only for n=2n=2 to n=8n=8. This is because at n=8n=8, we already observe that 60% of the nn-grams appear only once. Tree-grams match these tested count baselines at small nn and out-perform them for larger nn.

Infini-gram Infini-gram uses a suffix array to retrieve continuation counts for the longest matching suffix of the available history and backs off when longer matches are unavailable [63]. In our finite-context comparison, we cap this search at n−1n-1 tokens and interpolate with a smoothed unigram (infinigram + unigram) or a neural LM (infinigram + neural LM). On TinyStories, infinigram + unigram improves through n=4n=4, but its loss worsens and then plateaus at larger nn as long exact suffix matches become rare. Infinigram + neural LM improves but plateaus by n≈8n\approx8. In contrast, tree-grams improve throughout the tested range and outperform infinigram at every shared value of nn.

Spectral automaton models A spectral weighted-finite-automaton (spectral WFA) estimator constructs empirical Hankel blocks of substring probabilities and uses a truncated singular-value decomposition to recover a finite-dimensional state and token-transition operators [3]. After tuning the rank and Hankel window W∈{3,…,6}W\in\{3,\ldots,6\}, the resulting curve remains nearly flat as nn increases and performs worse even compared to the raw trigram. Tree-grams outperform the spectral estimator at every shared order, with the gap increasing toward larger nn.

Tensor train approximations We compare to three tensor-network language models. The uniform matrix product state (u-MPS) of [68] is a Born machine, p(xn∣x1:n−1)∝∣αTAx1⋯Axnω∣2p(x_n \mid x_{1:n-1}) \propto\left|\alpha^\mathsf{T} A_{x_1}\cdots A_{x_n}\omega\right|^2, with a single core A∈R∣V∣×D×DA\in\mathbb{R}^{|V|\times D\times D} shared across positions. The tree tensor network (tree TN) of [18] is a Born machine on a balanced binary tree over the context, with a learned ∣V∣→v|V|\to v feature map at the leaves and one order-3 tensor at each internal node; we train it end to end by gradient descent rather than by DMRG sweeps. TTLM-Large (TTLM) (Su et al., [84]) is a tensor-train recurrence in which a token-dependent factor updates the state multiplicatively, followed by a softmax readout tied to the input embedding tensor. At every nn, the bond dimension DD, the tree width vv and the rank RR are set to match the parameter count of the d=1024d = 1024 tree-gram (D=47D = 47–131131, v=164v = 164–316316, R=46R = 46–128128). The tree TN is best at n=3n = 3 (3.36 nats) and falls to near the unigram level from n=8n = 8 on. Tree-grams outperform all three at every shared order, by 0.19 nats at n=3n = 3 and 0.95 nats at n=32n = 32 against the strongest of them, TTLM.

Neural network approximation of nn-grams A neural nn-gram model embeds a fixed window of n−1n - 1 preceding tokens and uses an MLP with a softmax output to estimate the next-token distribution. This may be done with one-hot encodings (Castro et al., [16]) (MLP) or through learnable embedding structure (Bengio et al., [5]) (neural LM). Later works combined MLP with a unigram model (Blat et al., [9]) which we adapt here as the MLP + unigram model with the learnable embedding MLP. The parameter-matched neural baseline improves through n=16n = 16 but worsens at n=32n = 32. However, it has consistently higher cross-entropy than tree-grams. Thus, tree-grams outperform all tested finite-window neural nn-gram estimators at every shared order.

Deep neural sequence models Well-trained deep sequence models provide a stronger estimate of nn-gram statistics at large nn (Nguyen, [71]; Krishnan et al., [55]; Cagnetta et al., [15]). In this case, we compare tree-grams to GPT-2 with absolute positional embeddings (GPT-2 (APE)) and rotary positional embeddings (GPT-2 (RoPE)), Llama-3.2 (Llama), and Mamba (Mamba). These are converged multi-epoch runs, which use approximately six times the token budget. In Figure 1b, tree-grams track these estimators through approximately n=8n = 8, while the deep references remain lower at larger nn. However, in Figure 1(c), cross-entropy decreases monotonically as the rank dd increases over the tested range.

A Toy Model for Tree-gram data

We provide details of the toy model that we defined in the main text, which suggests a plausible mechanism for the HP transfer experiment results we observe empirically.

This model is based primarily on the random hierarchy model (Cagnetta et al., [13]) and the wavelet analysis of (Wornell & Oppenheim, [91]; Mallat, [66]). The toy model for the data has two layers. A finite dyadic hierarchy allocates predictive power across look-back scales. A Gaussian channel limits how well each latent feature can be recovered. Each of these layers are used to implement a different mode of control that tree-grams offer. We discuss this in more detail below. We make an attempt to highlight every assumption that a conclusion depends on through the labels (A1) – (A10). Figure 8 gives an intuitive picture.

Figure 8. Why does the optimal step size drift with the context length nn and the channel count dd? The figure follows one next-token example through the toy model and then reads off the curvature that a quadratic learner would see. (a) Each doubling of the look-back window reveals one new block of context (colour), and each block becomes one level kk that carries dd independent channels. Each channel has variance πk/d\pi_k/d, shown by the Gaussian spread. The level powers decay geometrically and sum to one. Adding a level redistributes this fixed budget. The label depends on the clean features SS alone; the learner sees only the noisy copy Φ\Phi. No arrow joins different levels or channels, so each channel is estimated on its own. Drawn for α=1/2\alpha= 1/2, K=3K = 3, d=4d = 4. (b) One channel in rescaled coordinates, with equal fixed lengths for SS and Φ\Phi. Their angle satisfies cos⁡2θ=q(d)\cos^2 \theta= q(d). The projection is S^=q Φ\hat{S} = \sqrt{q}\,\Phi, with power πk/(d+d d0)\pi_k/(d + \sqrt{d}\,d_0). (c) The Hessian eigenvalue of each channel, stacked by multiplicity, for α=1/2\alpha= 1/2, d0=2d_0 = 2, λ=0.01\lambda= 0.01, γ=1\gamma= 1 (grey: ridge-only directions). Under the toy model, adding a level or adding channels moves the stiffest eigenvalue UU to the left, and ηGD∗\eta^*_{\mathrm{GD}} rises; the shift from dd is much larger than the shift from nn.

:::

Scales and signal strength

Let X=(xt−n+1,…,xt−1)X = (x_{t-n+1}, \ldots, x_{t-1}) be a context of n−1n - 1 tokens, and let g(X)=log⁡p(⋅∣X)−V−1∑ylog⁡p(y∣X)g(X) = \log p(\cdot\mid X) - V^{-1}\sum_{y} \log p(y \mid X) be its centered Bayes logit vector. We assume p(y∣X)>0p(y \mid X) > 0 and E∥g∥2<∞\mathbb{E}\lVert g\rVert^{2} < \infty. The dyadic suffix window WkW_k holds the 2k2^k most recent tokens, so W0⊂W1⊂⋯W_0 \subset W_1 \subset\cdots. Passing from Wk−1W_{k-1} to WkW_k reveals the tokens at distances 2k−1+1,…,2k2^{k-1} + 1,\ldots,2^k; for k=0k = 0, it reveals xt−1x_{t-1}. This is the coarse-to-fine organization of multiresolution analysis (Mallat, [66]). Let Wk\mathcal{W}_k be the σ\sigma-algebra generated by WkW_k, and let W−1\mathcal{W}_{-1} be the trivial one. The level-kk increment and its signal strength are

Δk=E[g∣Wk]−E[g∣Wk−1],sk=E[ΔkTF0Δk],(16)\Delta_k = \mathbb{E}[g \mid\mathcal{W}_k] - \mathbb{E}[g \mid\mathcal{W}_{k-1}], \qquad s_k = \mathbb{E}[\Delta_k^{\mathsf T} F_0 \Delta_k], \tag*{(16)}

where F0=diag⁡(p0)−p0p0TF_0 = \operatorname{diag}(p_0) - p_0p_0^{\mathsf T} is the categorical Fisher matrix at the uniform distribution p0p_0. It is positive definite on centered vectors, and we write ∥v∥F02=vTF0v\lVert v\rVert_{F_0}^2 = v^{\mathsf T}F_0v. The increments are martingale differences. For a constant metric they are therefore orthogonal, E[ΔjTF0Δk]=0\mathbb{E}[\Delta_j^{\mathsf T}F_0\Delta_k] = 0 for j≠kj \ne k, and their powers add: ∑k≤Ksk=E∥g∣WK∥F02−E∥g∥F02\sum_{k \le K}s_k = \mathbb{E}\lVert g \mid\mathcal{W}_K\rVert_{F_0}^2 - \mathbb{E}\lVert g\rVert_{F_0}^2. The strength sks_k is signal power, not a Hessian eigenvalue.

(A1) Modelling the effect of horizon and capacity equivalents The horizon nn and the channel count dd are hyperparameters of the data distribution. In our experiments, they stand for the

context window and the width of the tree-gram that generated a corpus. Here, we attempt to model the dependence of the distribution on these hyper-parameters through the toy model that we describe above. nn sets a finite context window by an abrupt cutoff on the lookback distance K(n)=⌊log⁡2(n−1)⌋K(n)=\lfloor\log_{2}(n-1)\rfloor. dd controls the fidelity of the different modes through a quality factor q(d)q(d) which we define later.

(A2) Suffix windows, one summary per level. The model keeps one dd-channel summary per level and ignores the internal organization of each new block.

Scale powers

A hierarchy alone does not determine sks_k. Suppose that the level-kk increment has amplitude Ck=C0∏ℓ=1kAℓC_k=C_0\prod_{\ell=1}^{k}A_\ell, with sk=E[Ck2]s_k=\mathbb{E}[C_k^2].

(A3) Self-similar branch law. The factors C0C_0, A1A_1, A2A_2, …\ldots are mutually independent, and E[Aℓ2]=2−α\mathbb{E}[A_\ell^2]=2^{-\alpha} for every ℓ\ell.

Then sk=E[C02] 2−αks_k=\mathbb{E}[C_0^2]\,2^{-\alpha k}. Such a power law was also obtained in [62]. The empirically relevant case is α>0\alpha>0. Only the levels whose window fits in the context are active:

K(n)=⌊log⁡2(n−1)⌋.(17)K(n)=\lfloor\log_{2}(n-1)\rfloor. \tag*{(17)}

This sets the context approximation in (A1). Hence KK is constant for n∈{2K+1,…,2K+1}n\in\{2^K+1,\ldots,2^{K+1}\}, and the tokens at distances 2K(n)+1,…,n−12^{K(n)}+1,\ldots,n-1 are dropped.

(A4) Fixed total budget. For every nn, the total clean power is one: ∑ksk=1\sum_k s_k=1.

With r=2−αr=2^{-\alpha}, the level powers are

πk(n)=rkZK(n)1[k≤K(n)],ZK=∑ℓ=0Krℓ={(1−rK+1)/(1−r),r≠1,K+1,r=1.(18)\pi_k(n)=\frac{r^k}{Z_{K(n)}}\mathbf{1}[k\le K(n)],\qquad Z_K=\sum_{\ell=0}^{K}r^\ell= \begin{cases} (1-r^{K+1})/(1-r), & r\ne1,\\ K+1, & r=1. \end{cases} \tag*{(18)}

The largest level power is πmax⁡(K)=1/ZK\pi_{\max}(K)=1/Z_K for α≥0\alpha\ge0 and rK/ZK=1/∑j=0Kr−jr^K/Z_K=1/\sum_{j=0}^{K}r^{-j} for α<0\alpha<0. It decreases strictly with KK and tends to 1−r1-r, 00, and 1−1/r1-1/r for α>0\alpha>0, α=0\alpha=0, and α<0\alpha<0. Assumption (A4) deserves care. For one fixed source, the increments 16 do not depend on nn, so a longer context adds levels without weakening the old ones. The normalization therefore describes a family of teachers, one for each nn, each scaled to unit predictable power. It is also the only source of nn-dependence in the spectral edge below. Without it, max⁡krk\max_k r^k is independent of nn for α≥0\alpha\ge0 and grows with nn for α<0\alpha<0.

The feature–label generator

For each sample, each active level kk, and each channel a=1,…,da=1,\ldots,d, draw

Sk,a, Ξk,a∼iidN(0,πk(n)d),Φk,a=q Sk,a+1−q Ξk,a,q(d)=dd+d0.(19)S_{k,a},\ \Xi_{k,a}\mathrel{\overset{\mathrm{iid}}{\sim}}\mathcal{N}\left(0,\frac{\pi_k(n)}{d}\right),\qquad \Phi_{k,a}=\sqrt{q}\,S_{k,a}+\sqrt{1-q}\,\Xi_{k,a},\qquad q(d)=\frac{\sqrt{d}}{\sqrt{d}+\sqrt{d_0}}. \tag*{(19)}

Choose centered logit directions uk,a∈RVu_{k,a}\in\mathbb{R}^{V} that are orthonormal in the F0F_0 metric, which requires d(K(n)+1)≤V−1d(K(n)+1)\le V-1. Generate

g(S)=∑k=0K(n)∑a=1dSk,auk,a,Y∣S∼Categorical⁡(softmax⁡(g(S))).(20)g(S)=\sum_{k=0}^{K(n)}\sum_{a=1}^{d}S_{k,a}u_{k,a},\qquad Y\mid S\sim\operatorname{Categorical}\bigl(\operatorname{softmax}(g(S))\bigr). \tag*{(20)}

The dataset contains (Φ,Y)(\Phi,Y), not SS or Ξ\Xi. The index kk labels the level and aa labels its channels. Each channel has its own direction uk,au_{k,a}, so the dd features of a level stay distinguishable in their effect on the prediction, and dd is the number of resolved features per level. The latent summaries play the role of the context in Section E.1: Δk=∑aSk,auk,a\Delta_k=\sum_a S_{k,a}u_{k,a} and sk=πk(n)s_k=\pi_k(n). The base logit is zero, so p0p_0 is uniform. A non-uniform unigram distribution would enter as a fixed logit offset.

(A5) Independent, balanced Gaussian channels. All Sk,aS_{k,a} and Ξk,a\Xi_{k,a} are jointly Gaussian and independent, and the dd channels of a level share its power equally.

(A6) Scale-uniform recovery. The recovery fraction q(d)=d/(d+d0)q(d)=\sqrt{d}/(\sqrt{d}+\sqrt{d_0}) is the same at every level and does not depend on nn. Its deficit satisfies 1−q(d)∼d0/d1-q(d)\sim\sqrt{d_0}/d as d→∞d\to\infty.

The per-channel signal-to-noise ratio is q/(1−q)=d/d0q/(1-q)=\sqrt{d/d_0}. Because the channel is Gaussian, Sk,a∣Φk,a∼N(q Φk,a,(1−q)πk/d)S_{k,a}\mid\Phi_{k,a}\sim\mathcal{N}(\sqrt{q}\,\Phi_{k,a},(1-q)\pi_k/d), and by independence E[Sk,a∣Φ]=E[Sk,a∣Φk,a]\mathbb{E}[S_{k,a}\mid\Phi]=\mathbb{E}[S_{k,a}\mid\Phi_{k,a}]. The posterior mean and its power are

S^k,a=q Φk,a,ωk(n,d)≡Var⁡(S^k,a)=q(d)πk(n)d=πk(n)d+dd0.(21)\widehat{S}_{k,a}=\sqrt{q}\,\Phi_{k,a},\qquad\omega_k(n,d)\equiv\operatorname{Var}(\widehat{S}_{k,a})=q(d)\frac{\pi_k(n)}{d}=\frac{\pi_k(n)}{d+\sqrt{d d_0}}. \tag*{(21)}

The recoverable covariance is Σrec=diag⁡{ωk}=q(d)ΣΦ\Sigma_{\mathrm{rec}}=\operatorname{diag}\{\omega_k\}=q(d)\Sigma_\Phi, with trace q(d)q(d). More capacity recovers more total signal, but each channel carries less of it: ωk\omega_k falls with dd while tr⁡Σrec\operatorname{tr}\Sigma_{\mathrm{rec}} rises. The total recoverable power tr⁡Σrec=q(d)\operatorname{tr}\Sigma_{\mathrm{rec}}=q(d) tends to zero as d→0d\to0. The normalized spectrum ωk/tr⁡Σrec=πk/d\omega_k/\operatorname{tr}\Sigma_{\mathrm{rec}}=\pi_k/d is known in closed form, and no corpus statistic enters it.

A matched quadratic learner

We now provide a minimal quadratic model to set up the learner for the data distribution above.

The learner has one coordinate θk,a\theta_{k,a} for every channel it can represent, including channels that are inactive at the current (n,d)(n,d). It predicts fθ(Φ)=γ∑k,aθk,aS^k,auk,af_\theta(\Phi)=\sqrt{\gamma}\sum_{k,a}\theta_{k,a}\widehat{S}_{k,a}u_{k,a}. Take a fixed regression target g†(Φ)g^\dagger(\Phi), such as E[g(S)∣Φ]=∑k,aS^k,auk,a\mathbb{E}[g(S)\mid\Phi]=\sum_{k,a}\widehat{S}_{k,a}u_{k,a}. The population objective and its Hessian are

Q(θ)=12E∥fθ(Φ)−g†(Φ)∥F02+λ2∥θ∥2,H=λI+γΣrec,hk,a=λ+γωk(n,d).(22)Q(\theta)=\frac{1}{2}\mathbb{E}\left\|f_\theta(\Phi)-g^\dagger(\Phi)\right\|_{F_0}^{2}+\frac{\lambda}{2}\|\theta\|^{2},\qquad H=\lambda I+\gamma\Sigma_{\mathrm{rec}},\qquad h_{k,a}=\lambda+\gamma\omega_k(n,d). \tag*{(22)}

The off-diagonal entries γE[S^k,aS^k′,a′]uk,aTF0uk′,a′\gamma\mathbb{E}[\widehat{S}_{k,a}\widehat{S}_{k',a'}]u_{k,a}^{\mathsf{T}}F_0u_{k',a'} vanish because the output directions are F0F_0-orthonormal, even if the features are correlated. Inactive coordinates have S^≡0\widehat{S}\equiv0 and curvature λ\lambda. Data features and optimization modes therefore align by construction. The target moves the optimum but not the Hessian.

(A7) Matched features. The learner reads S^=q Φ\widehat{S}=\sqrt{q}\,\Phi, not Φ\Phi. This is a strong assumption. We justify it here by assuming that the warmup phase of learning aligns the model’s features with the data features, so that the optimal learning rate is driven in this pseudo-constant phase where the learner model has aligned features.

(A8) Weak signal. Because fθf_\theta is linear in θ\theta, the regularized cross-entropy objective has the exact Hessian HCE(θ)=E[JTF(pθ(⋅∣Φ))J]+λIH_{\mathrm{CE}}(\theta)=\mathbb{E}[J^{\mathsf{T}}F(p_\theta(\cdot\mid\Phi))J]+\lambda I, with J=∂fθ/∂θJ=\partial f_\theta/\partial\theta and pθ=softmax⁡(fθ)p_\theta=\operatorname{softmax}(f_\theta). (22) replaces F(pθ)F(p_\theta) by F0F_0. This assumes that predictions stay near the reference distribution, that is, that the total clean power σ2\sigma^2 is small in F0F_0 units. Assumption (A4) sets σ2=1\sigma^2=1, and a smaller σ2\sigma^2 is absorbed into γ\gamma.

The replacement is exact at θ=0\theta=0. At any θ\theta, the correction that is first order in the logits vanishes in expectation, because it is odd under (S,Ξ)→(−S,−Ξ)(S,\Xi)\to(-S,-\Xi). The error is therefore of relative order σ2\sigma^2. Numerically, use the square-root recovery law q(d)=d/(d+d0)q(d)=\sqrt{d}/(\sqrt{d}+\sqrt{d_0}) with V=16V=16, K=2K=2, d=3d=3, d0=2d_0=2, r=1/2r=1/2, γ=1\gamma=1, and λ=10−3\lambda=10^{-3}. For each of 24 random draws of the uk,au_{k,a}, we use 60,000 Gaussian feature draws and minimize the sample-average cross-entropy plus the ridge penalty. At the numerical optimum, the median of ∥HCE−H∥F/∥H∥F\|H_{\mathrm{CE}}-H\|_F/\|H\|_F is 1.00%, 10.61%, and 25.98% at σ2=0.1\sigma^2=0.1, 1, and 4, respectively. Both Hessians are evaluated on the same samples. The unit budget corresponds to about half a nat of divergence from the uniform distribution, since KL⁡(softmax⁡(g)∥p0)≈12∥g∥F02\operatorname{KL}(\operatorname{softmax}(g)\Vert p_0)\approx\frac{1}{2}\|g\|_{F_0}^{2}. The quadratic model is exact for a Gaussian regression target Y~=g(S)+ε\widetilde{Y}=g(S)+\varepsilon with independent centered noise, since the 12E∥ ⁣fθ−Y~ ⁣∥F02=12E∥ ⁣fθ−E[g∣Φ] ⁣∥F02+const\frac{1}{2}\mathbb{E}\|\!f_\theta-\widetilde{Y}\!\|_{F_0}^{2}=\frac{1}{2}\mathbb{E}\|\!f_\theta-\mathbb{E}[g\mid\Phi]\!\|_{F_0}^{2}+\mathrm{const}.

Spectral edges and the optimal learning rate

(A9) Ridge-only directions. At least one learner coordinate has no data curvature, for example an inactive channel, so L=λL=\lambda. Otherwise, L=λ+γπmin⁡/(d+dd0)L=\lambda+\gamma\pi_{\min}/(d+\sqrt{d d_0}) also moves with (n,d)(n,d).

(A10) Deterministic, non-adaptive optimizer. The optimizer takes full-batch steps on QQ with constant parameters. Minibatch noise, schedules, and Adam-type preconditioning are outside the model.

The upper edge is

U(n,d)=λ+γπmax⁡(K(n))d+dd0.(23)U(n,d)=\lambda+\gamma\frac{\pi_{\max}(K(n))}{d+\sqrt{d d_0}}. \tag*{(23)}

For a spectrum in [L,U][L,U], gradient descent θt+1=θt−η∇Q(θt)\theta_{t+1}=\theta_t-\eta\nabla Q(\theta_t) has the minimax step ηGD⋆=2/(L+U)\eta^\star_{\mathrm{GD}}=2/(L+U). This step equalizes 1−ηL=ηU−11-\eta L=\eta U-1 and contracts at rate (U−L)/(U+L)(U-L)/(U+L). The heavy-ball update θt+1=θt−η∇Q(θt)+β(θt−θt−1)\theta_{t+1}=\theta_t-\eta\nabla Q(\theta_t)+\beta(\theta_t-\theta_{t-1}) has ηHB⋆=4/(U+L)2\eta^\star_{\mathrm{HB}}=4/(\sqrt{U}+\sqrt{L})^2 and βHB⋆=((U−L)/(U+L))2\beta^\star_{\mathrm{HB}}=((\sqrt{U}-\sqrt{L})/(\sqrt{U}+\sqrt{L}))^2 [77, 26]. Nesterov’s method, yt=θt+β(θt−θt−1)y_t=\theta_t+\beta(\theta_t-\theta_{t-1}) and θt+1=yt−η∇Q(yt)\theta_{t+1}=y_t-\eta\nabla Q(y_t), commonly uses η=1/U\eta=1/U and β=(U−L)/(U+L)\beta=(\sqrt{U}-\sqrt{L})/(\sqrt{U}+\sqrt{L}) [2]. With L=λL=\lambda, the gradient-descent rate decomposes exactly as

νGD⋆(n,d)=log⁡2ηGD⋆=log⁡21λ⏟ν∞⋆−log⁡2(1+γπmax⁡(K(n))2λ(d+dd0))⏟capacity term≥0.(24)\nu^\star_{\mathrm{GD}}(n,d)=\log_2\eta^\star_{\mathrm{GD}}=\underbrace{\log_2\frac{1}{\lambda}}_{\nu^\star_\infty}-\underbrace{\log_2\left(1+\frac{\gamma\pi_{\max}(K(n))}{2\lambda(d+\sqrt{d d_0})}\right)}_{\text{capacity term}\ge0}. \tag*{(24)}

The capacity term decreases strictly in dd and stepwise in nn. It vanishes as d→∞d\to\infty and saturates in nn for α≠0\alpha\ne0. When U≫LU\gg L and α≥0\alpha\ge0, Eq. (24) becomes νGD⋆≃1−log⁡2γ+log⁡2(d+dd0)+log⁡2ZK(n)\nu^\star_{\mathrm{GD}}\simeq1-\log_2\gamma+\log_2(d+\sqrt{d d_0})+\log_2 Z_{K(n)}. More generally, νA⋆=CA−log⁡2U+o(1)\nu^\star_A=C_A-\log_2 U+o(1), with CGD=1C_{\mathrm{GD}}=1, CHB=2C_{\mathrm{HB}}=2, and CNAG=0C_{\mathrm{NAG}}=0. The heavy-ball correction is only O(L/U)O(\sqrt{L/U}). The stability threshold 2/U2/U has the same scaling, so the prediction concerns the dependence on UU rather than the optimality criterion.

The monotone drift uses (A1), (A4), (A5), and (A9), together with two facts: new levels receive positive power, and recovery grows sublinearly, so that q(d)/d=1/(d+dd0)q(d)/d=1/(d+\sqrt{d d_0}) decreases and dilution beats recovery. The drift can fail if the total power grows with depth, if recovery improves faster than linearly over some range of dd, or if an unrelated direction sets UU.

From the solvable learner to a transformer

Equation 22 makes the data features and the Hessian eigenvectors coincide by design. Applying Eq. (24) to a transformer requires a hypothesis in three parts. (H1) The dominant Hessian eigendirections align approximately with the multiscale predictive features. (H2) The top eigenvalue belongs to such a direction and equals an (n,d)(n,d)-independent gain times its recoverable power. (H3) The lower spectral edge does not depend on (n,d)(n,d).

For a well-specified softmax model at a population optimum, the cross-entropy Hessian reduces to its Gauss–Newton part,

HCE=EX[JθTF(pθ(⋅∣X))Jθ],(25)H_{\mathrm{CE}}=\mathbb{E}_X\left[J_\theta^\mathsf{T}F(p_\theta(\cdot\mid X))J_\theta\right], \tag*{(25)}

because the residual term EX[∑y(pθ(y∣X)−p(y∣X))∇θ2fθ,y(X)]\mathbb{E}_X\left[\sum_y(p_\theta(y\mid X)-p(y\mid X))\nabla^2_{\theta}f_{\theta,y}(X)\right] vanishes there. The strengths sks_k determine neither the singular vectors nor the singular values of the learned logit Jacobian JθJ_\theta. A transformer can rotate the features, mix scales, and add unrelated high-curvature directions. The Fisher factor adds a corpus dependence of its own: F(pθ)F(p_\theta) shrinks as predictions sharpen, so the gain in (H2) can itself depend on (n,d)(n,d). The learned Jacobian is the unresolved first-principles bottleneck.

Tree-gram experimental details and comparison to transformers

We performed experiments with 4 NVIDIA A100 GPUs. The 529.2M-token run for the n=32n = 32, d=1024d = 1024 model (with MLP) takes 5 hours of wall-clock time. A total of 11,000 A100 GPU hours were used for all pre-training experiments on tree-grams reported in this paper.

We train on the 529.2M-token training split of TinyStories, tokenized with a custom BPE tokenizer [15], and validate on a 1.05M-token subset of its 5.34M-token validation split.

Every run trains for a single epoch over the 529.2M training tokens, cut into non-overlapping windows of nn tokens with 1024 windows per batch, using AdamW at its default moments. The learning rate warms up linearly from the initial to the peak value over the first 1% of steps and then follows a cosine decay to 1% of the peak. Unless stated otherwise the architecture uses LayerNorm, a residual stream of unit strength, GELU, dff=4dd_{\mathrm{ff}} = 4d and tied embeddings. We used a 1.05M validation set.

We tuned the peak learning rate and the weight decay for every cell. The nn-sweep used ηmax⁡∈{3×10−5,10−4,3×10−4,10−3,3×10−3}\eta_{\max} \in\{3 \times10^{-5}, 10^{-4}, 3 \times10^{-4}, 10^{-3}, 3 \times10^{-3}\} and λ∈{10−3,10−2,10−1,1}\lambda\in\{10^{-3}, 10^{-2}, 10^{-1}, 1\}, and the dd-sweep added ηmax⁡=10−2\eta_{\max} = 10^{-2}; the n=32n = 32, d=1024d = 1024 cell pools this grid with an earlier one that reaches ηmax⁡=3×10−2\eta_{\max} = 3 \times10^{-2} and λ=10−4\lambda= 10^{-4}. The initial learning rate was 10−510^{-5} except for τ−1\tau_{-1} and τ−2\tau_{-2}. The topology ablations used smaller grids to test for learning rate transfer: ηmax⁡∈{3×10−4,10−3,3×10−3}\eta_{\max} \in\{3 \times10^{-4}, 10^{-3}, 3 \times10^{-3}\}, with λ∈{10−3,…,1}\lambda\in\{10^{-3}, \ldots, 1\} for τ1\tau_1, τ2\tau_2 and λ∈{10−2,10−1,1}\lambda\in\{10^{-2}, 10^{-1}, 1\} for τa\tau_a, τb\tau_b. The anti-aligned τ−1\tau_{-1} and τ−2\tau_{-2} need smaller rates and were swept over initial rates {10−6,10−5}\{10^{-6}, 10^{-5}\}, ηmax⁡∈{10−5,…,10−3}\eta_{\max} \in\{10^{-5}, \ldots, 10^{-3}\} and λ∈{10−4,…,10−1}\lambda\in\{10^{-4}, \ldots, 10^{-1}\} (τ−2\tau_{-2}: ηmax⁡∈{10−4,3×10−4,10−3}\eta_{\max} \in\{10^{-4}, 3 \times10^{-4}, 10^{-3}\}, λ∈{10−2,10−1}\lambda\in\{10^{-2}, 10^{-1}\}). Without MLPs only τ0\tau_0 and τ−1\tau_{-1} were swept; the other five topologies were run at a single setting (ηmax⁡=10−3\eta_{\max} = 10^{-3}, λ=0.1\lambda= 0.1). Cells were scored by the minimum validation loss over the run, averaged over two seeds. At the selected settings of the cells with MLPs, the seed-to-seed standard deviation is at most 0.0025 nats (d=64d = 64), and at most 0.0004 nats for the other nn- and dd-sweep cells; it reaches 0.06 nats for the untuned topologies without MLPs. We ran 2 random seeds for each HP configuration of the nn- and dd-sweeps and then ran a total of 4 random seeds for the model with the best HP configuration. Data generation took 200 GPU hours.

For μ\muP transformers comparison, we scanned 10 peak learning rates while holding the weight decay fixed at 0.01, and kept the rate with the lowest validation loss on a single seed. We ran a total of 3 seeds for the transformers with the best value of the hyper-parameter combination. These were also trained with AdamW at batch 1024 for one epoch on the same windows as the tree-grams, with the same 1% warmup from 10−510^{-5}, decaying to 10% of the peak, and with dropout 0.0. The transformers were based on Kalra [50].

Tree-grams were trained on WikiText-103 (130 MT) and FineWeb-Edu (1.05BT subset) as well. The training was done by choosing the best hyper-parameter for the relevant models for the TinyStories corpus, without additional hyper-parameter tuning. Training time was approximately linear in total token count, except for the n=32n = 32, d=1024d = 1024 tree-gram model which could not be fit into 4 A100 GPUs. As a result we used gradient accumulation, which made the total wall-clock time to be closer to 20 hours, rather than the expected 10 hours. The additional experiments reported for these datasets needed an additional 8,000 GPU hours. At the time of writing, the pre-training, fine-tuning results on FineWeb-Edu are yet to run, and they need an estimated 2,000 GPU hours more.

Cost of generating a corpus. We timed the generation costs for the largest generators in the paper: 139.5 million parameters over an 8,192-token vocabulary (TinyStories and WikiText) and 182.6 million parameters over a 50,257-token vocabulary (FineWeb-Edu). On four threads of a single CPU (an Apple M4 Pro), sampling 512 sequences in parallel, they produce about 1.15 thousand and 0.65 thousand tokens per second. Generating WikiText (131.8 million tokens), TinyStories (529.2 million) and FineWeb-Edu (1.05 billion) therefore takes about 32, 128 and 448 hours on one worker. The deepest KV-cached transformers typically take around 2x less time for generation.

We also measured the estimated generation times on a cluster with dual AMD 7763 CPUs. The times are mentioned below in Table 2. As can be observed, the maximum time for generation even for the 1.05BT subset is roughly 90 hours. The mean times are well within a day for WikiText and TinyStories, and is equal to one and a half days for FineWeb-Edu (which has a larger vocabulary size).

CoresModelWT (130 MT)TS (529 MT)FWE (1.05 BT)
medianmeanmaxmedianmeanmaxmedianmeanmax
1Tree-gram58.391.53202323621,2539561,0972,985
Transformer40.450.41251632034997797781,543
16Tree-gram3.96.221.215.724.383.670.280.2205
Transformer2.83.48.312.014.635.158.258.0104
32Tree-gram2.33.712.39.414.046.441.248.9124
Transformer1.72.04.66.67.718.033.233.358.4
64Tree-gram1.72.99.26.810.332.531.336.288.7
Transformer1.41.53.34.24.911.124.324.640.0

Table 2. Wall-clock time for corpus generation on dual AMD 7763 CPU cores. Times are in units of hours. Transformers are typically around 1.5–2x faster.

Parameter-matched transformer configurations

Table 3 gives the transformer width DD used for each tree-gram and transformer depth in Figure 2. All transformers use eight heads, MLP width 4D4D, GELU, RoPE, tied embeddings, and the same context and token budget as the corresponding tree-gram. Parameter counts are matched to the nearest available width. Thus, width varies with depth and the sweep does not isolate depth.

Figure 2. Last-token loss of a fixed tree-gram (red) against matched transformers of varying depth LL, matched to the tree-gram in parameter count, context and optimization steps. (left) Scaling with horizon nn at d=1024d = 1024: tree-grams perform better at small nn, but are outperformed by the deeper transformers at longer contexts. (right) Scaling with tree-gram rank dd at n=32n = 32. Transformers plateau earlier at smaller depth. Tree-gram loss continues to decrease with dd over the tested range, while shallow transformers plateau. Thus tree-grams appear to be scalable. HnH_n is the (empirical) nn-gram entropy.

tree-gramTree paramsTransformer width DD by depth LL
nndd1234561012
3102436,709,37614401072896800720656512480
4102456,637,4401856137611521008912832656592
8102478,665,72822401648137612001072992784704
161024104,892,416264019201600139212481152896832
32641,039,74411296968080806464
321283,103,488272224208176176160128128
3225610,302,976640512432384352320256240
3251236,989,95214401088912800720656528480
321024139,515,9043088224018561616145613441040960

Table 3. Exact parameter-matched transformer widths. Tree parameters include embeddings.

HP transfer experiment details

Learning rate sweeps

For the hyper-parameter-transfer study in Figure 3, all transformers use eight heads, dff=4dd_{\mathrm{ff}} = 4d, GELU, RoPE, tied embeddings, no dropout, sequence length 128 and batch 256 (32,768 tokens per step). Every proxy and every target trains for one epoch over the full 529.2M-token training split of its corpus (16,024 steps), so a proxy trained on real data differs from its target only in width. We use AdamW with (β1,β2)=(0.9,0.95)(\beta_1, \beta_2) = (0.9, 0.95), ϵ=10−8\epsilon= 10^{-8} and weight decay 0.01, a linear warmup from 10−510^{-5} over the first 1% of steps, and a cosine decay to 10% of the peak.

Proxy widths are d∈{64,96,128,160,192,256}d \in\{64, 96, 128, 160, 192, 256\} at L∈{2,4}L \in\{2, 4\}, each trained on all eleven corpora of Figure 5. Targets are trained on real TinyStories only, at d∈{384,512,640,832,1024,1280,1600,2048}d \in\{384, 512, 640, 832, 1024, 1280, 1600, 2048\} for L=2L = 2 and d∈{288,384,480,608,768,928,1152,1408}d \in\{288, 384, 480, 608, 768, 928, 1152, 1408\} for L=4L = 4; the main text reports d=1024d = 1024 (L=2L = 2) and d=1408d = 1408 (L=4L = 4). Peak rates lie on the lattice ηk=0.0039⋅10k/8\eta_k = 0.0039 \cdot10^{k/8}. For the proxies, seed 0 spans [0.0039,3.9][0.0039, 3.9] at d=64d = 64 and [0.00925,1.64][0.00925, 1.64] at the wider widths, and seeds 1 and 2 span [0.052,1.64][0.052, 1.64]. This was done to ensure that the optimal learning rate is obtained at the basin of the loss vs learning rate curve. Targets use three seeds on [0.052,6.94][0.052, 6.94], or on [0.0123,2.19][0.0123, 2.19] for the two widest targets at each depth, plus two to four off-lattice rates per target inserted near its divergence onset.

Continuous η⋆\eta^\star from a smoothing spline

In order to get a more precise estimate of η⋆\eta^\star we use a cubic smoothing spline as discussed in [51]. Writing ν=log⁡η\nu= \log\eta, we discard points with L>1.35L⋆L > 1.35L^\star, fit a cubic smoothing spline to L(ν)L(\nu) with smoothing parameter s=0.1 N Var⁡(L)s = 0.1\,N\,\operatorname{Var}(L), evaluate it at 400 uniformly spaced ν\nu in the retained range, and take its minimizer.

Two adaptations are needed here. First, the 1.35L⋆1.35L^\star window was calibrated on sweeps with a different loss scale; with L⋆≈1.48L^\star\approx1.48 nats the bar sits near 2.0 and admits points already far up the divergence cliff. A single such point inflates Var⁡(L)\operatorname{Var}(L), hence ss, and the cubic cannot turn fast enough to follow the cliff, so it smears it back across the basin. We therefore truncate the window at the divergence onset, cutting at the first increment above max⁡(3h,0.05)\max(3h, 0.05) nats, where hh is the median ∣ΔL∣|\Delta L| along the descending branch; across all 412 sweeps no descending increment exceeds 0.045 nats while the smallest increment the rule flags is 0.062, so it separates basin from cliff without ever truncating a basin, and the median residual falls to 0.0009 nats. Second, we use the spline only to locate optima. A proxy may recommend an η\eta far up the target’s cliff — tuning on the real corpus does exactly that — and there the measured loss is precisely the quantity of interest, so we score the target with a shape-preserving (PCHIP) interpolant of its full curve rather than with the spline. That interpolant cannot itself locate an optimum, since it sets a zero derivative at every data extremum and its minimiser is the grid argmin again; only a smoothing spline moves η⋆\eta^\star off the lattice.

The re-estimate leaves our conclusions unchanged and sharpens two of them. The median-over-synthetics rule stays within one grid point of each target’s own optimum with no grid involved: ηmedian⋆/ηtarget⋆\eta^\star_{\mathrm{median}}/\eta^\star_{\mathrm{target}} is 0.87–1.05 at L=2L=2 and 1.11–1.22 at L=4L=4, against a rung of 4/3.

Finetuning experiment details

Methodology and optimization

For the finetuning experiment the downstream models are (L,d)=(2,1024)(L,d)=(2,1024) and (4,768)(4,768). We evaluate every ordered pair among the bigram corpus, the five horizon-sweep corpora {n3,n4,n8,n16,n32}d=1024\{n3,n4,n8,n16,n32\}_{d=1024}, the five capacity-sweep corpora n32d∈{64,128,256,512,1024}n32_{d\in\{64,128,256,512,1024\}}, and real TinyStories: an 11×1111 \times11 matrix for each depth and three seeds. Fine-tuned models are validated on a 1.05M-token subset of the target’s validation split.

Pre-training. Each source is pre-trained for one epoch over its 80% segment (12,819 steps). Its peak rate ηPT⋆\eta^\star_{\mathrm{PT}} is the argmin, on one seed, over seven lattice rates centred on that corpus’s optimum at d=256d=256 in the HP-transfer sweep, a 5.6×5.6\times window; no selected rate lies on the edge of its window. This gives 11×2×3=6611 \times2 \times3 = 66 pre-trained checkpoints.

Fine-tuning. All parameters are updated from the pre-trained weights with a fresh AdamW state; the learning rate is re-warmed from 10−510^{-5} over the first 1% of steps and cosine-decayed to 10% of its peak [40 ); {citep}]Ibrahim et al. [47], with no replay of source data. The fine-tuning peak rate is set per (source, target) pair: $\eta_{\mathrm{FT}}(s \to t)=\eta^\star_{\mathrm{PT}}(t)\cdot\eta^\star_{\mathrm{FT}(s\to\mathrm{real})}/\eta^\star_{\mathrm{FT}(\mathrm{real})}$, snapped to the lattice, where $\eta^\star_{\mathrm{FT}(s\to\mathrm{real})}$ comes from a one-seed sweep over a shared 22-point window. Tuning the rate per model follows {citet}Isik et al. [49]; re-warming to the pre-training peak instead trades adaptation against forgetting {citep}Gupta et al. [40]`, and we score only the target.

Budgets and references. The matrix is read after the full 105.8M fine-tuning tokens (3,205 steps). For a synthetic target, the floor is its generator’s entropy rate HqH_q (Eq. (9)). For real TinyStories we use 1.242 nats, the converged loss of the 12-layer, d=1024d=1024 GPT-2 of Cagnetta et al., [15] at T=128T=128, which is an empirical reference rather than a Bayes floor. Each cell reports the median over the three seeds of the final validation loss. As a no-pre-training reference, the same models trained from scratch on the same 105.8M real tokens, at 0.52 (within one lattice step of their own optimum on this budget), reach 1.688 nats at L=2L=2 and 1.600 nats at L=4L=4 (medians of three seeds), that is 0.36 and 0.29 on the scale of Figure 5(c,Figure 5d).

Additional plots

We provide additional plots alluded to in the main text. In order:

  • Comparison of tree-grams ran on Wiki-Text and FineWebEdu, with deep neural baselines (Figure 9).

  • A per-position cross-entropy comparison of every tree-gram in the sweep against its parameter-matched transformers, at every depth (Figure 10).

  • The HP tuning results on FineWeb-Edu (Figure 11).

  • The transfer phase diagram over every (proxy width, target width) pair, contrasting the median-over-synthetics rule with tuning on the real corpus (Figure 12).

  • The raw loss-versus-learning-rate curves for different widths on different datasets, with the spline-function interpolated values. (Figure 13).

  • Plots of the optimal learning rate for proxy widths as a function of the entropy of the distribution is presented in Figure 14. The non-monotonic behavior of the optimal learning rate as a function of the width for the real dataset is presented in Figure 15.

  • The pre-training and fine-tuning transfer matrices for both TinyStories and Wiki-Text dataset (Figure 16).

  • The pre-training transfer matrix with both axes re-sorted by entropy rates, which is where the two synthetic sweeps are seen to interleave (Figure 17).

Figure 9. Comparison of tree-grams with transformers on Wiki-Text and FineWeb-Edu. We notice that tree-grams are competitive with these deep neural architectures, like TinyStories discussed in the main text. We use a deep well-trained transformer as a proxy for the true empirical nn-gram entropy.

Figure 11. The HP transfer plot for FineWeb-Edu. We notice that in this case, the synthetic corpora do not provide a better approximation of the target.

Figure 12. The HP transfer phase diagram. (Left) We plot the excess loss obtained when transferring the median optimal learning rate ν∗\nu^{*} from a source width dsource,tfrd_{\mathrm{source,tfr}} to a target width dtarget,tfrd_{\mathrm{target,tfr}}. (Right) The same plot when we tune a proxy on the real data. Rows are depth L=2L = 2 (top) and L=4L = 4 (bottom). The synthetic rule is more robust as compared to tuning on the real data (the standard recipe).

Figure 13. Converged losses as a function of the peak learning rates. The solid dots represent the actual runs while the dashed lines represent the interpolated losses using a spline function.

Figure 14. Optimal learning rate ν⋆≡log⁡2η⋆\nu^\star\equiv\log_2 \eta^\star as a function of the entropy of the generated distributions. We see a monotonic decrease with increase in entropy. However the width-dependence is extremely weak.

Figure 15. Optimal learning rate η⋆\eta^\star for the real dataset as a function of width. We observe a non-monotonic trend.

Figure 16. The pre-training transfer matrix for L=2L = 2 transformer on WikiText and L=4L = 4 transformers on WikiText and TinyStories respectively. We see the same qualitative trend as that of the main-text figure.

Figure 17. The pre-training transfer matrices with both axes re-sorted by entropy rate of the synthetic corpus, instead of grouped by mode of approximation. The green boxes are the same-distribution diagonal. We observe that the monotonic trend we observed in the main text, is no longer present. In addition, horizon-limited modes perform worse than capacity-limited modes, even when they have similar entropy rate.

Pre-training Fine-tuning Performance Gap

Which source–target pairs are hard to fine-tune is decided almost entirely by the target, through two properties measured directly on its token statistics. The first is its entropy rate: targets with a lower Bayes floor are harder to reach relative to that floor. The second is its effective range, which is how far apart two tokens can be and still carry information about each other. Entropy has the larger effect, but at comparable entropy a target with a longer effective range is consistently harder to reach. Generators that change the width at a fixed window sit above generators that change the window, at the same entropy (Figure 18, top). The source matters mainly when it carries less information than the target. A four-parameter law in these quantities, linear in the target’s entropy and in the logarithm of its range, plus a penalty for a source whose entropy rate exceeds the target’s, accounts for 82–99% of the variance across all 81 source–target pairs in each setting. It predicts the gap for held-out targets with comparable error (Figure 18, bottom). The range term has the same sign and nearly the same size in all four settings.

Figure 18. Do targets with longer-range correlations have a larger fine-tuning gap at the same entropy? The gap is the final validation loss divided by the target’s Bayes floor, minus one. Top: median gap over sources against the target’s Bayes floor, for generators that vary the context window at d=1024d = 1024 (blue) and generators that vary the width at n=32n = 32 (orange); numbers give each target’s mean lag kˉ\bar{k}. If range matters beyond entropy, the orange curve lies above the blue one at matched entropy, which it does in every panel. Bottom: observed against fitted gap for all 81 source–target pairs under the law shown, coloured by target; stars mark source = target, where the penalty term vanishes. Held-out error is computed by leaving out each target in turn. Points on the diagonal mean the law captures the pair. The one clear miss (WikiText-103, L=2L = 2, the narrowest-width target trained on itself) is a run that became unstable late in training.

To measure the effective range, we estimate the mutual information between two tokens kk positions apart in text sampled from each generator. We use a bias-corrected plug-in estimator and subtract a null computed on shuffled pairs. Beyond the generator’s context window (k>nk > n), the logarithm of this mutual information falls linearly with kk, so the information decays exponentially. We take the slope of that line, keffk_{\mathrm{eff}}, as the decay rate, so a small ∣keff∣\lvert k_{\mathrm{eff}}\rvert means a long range. Each curve is fitted only up to the lag where the mutual information first falls into the noise floor of the estimator. For display, the top row labels each target with its mean lag kˉ\bar{k}, the lag averaged with weights given by the mutual information, which orders the targets the same way.

Effective Receptive Fields for Tree-grams

The aligned topology labelled τ0\tau_0 (Figure 6) has the unique property that terminal nodes in different layers ”focus” on different parts of the context. On the other hand, the anti-aligned topology τ−1\tau_{-1} mixes information from the whole context. We use a linear probe to uncover input tokens from latent activations of the terminal nodes in tree-grams. We observe that for τ0\tau_0, different terminal nodes in different layers recover each input token in its scope. The accuracy rises as we move down the layers, which indicates the difficulty of reconstruction increases as we pass through multiple non-linear passes. In contrast, for τ−1\tau_{-1} and transformers, recovery peaks at the last token, given the full context. This highlights that the aligned topology has effective receptive fields for each node in the downward pass, in contrast with anti-aligned topologies and transformers. Activation patching also confirms this causally (Figure 19). Restoring a single node recovers the prediction exactly when the swapped token lies in its scope and not at all otherwise. We emphasize that we do not claim that transformers are implementing a τ−1\tau_{-1} topology. Recovery of trees from transformers needs careful investigation due to known biasing effects from the parsing algorithm, feature definition as well as inherent architectural biases ([61]). In addition, we contrast this token recovery pattern in four different network ablations: trained and untrained tree-grams with or without residual connections (Figure 20). The windowed receptive fields of τ0\tau_0 are already present in an untrained tree-gram with residual connections: each terminal node recovers the tokens in its scope above the majority-class baseline at initialization, so the windows come from the wiring of the topology rather than from training. Training sharpens these windows and removes the leakage of the earliest tokens into the lower nodes. Residual connections are what carry token identity through depth. Without them, an untrained tree-gram loses the tokens that pass through more than a few merges, and a trained one keeps the narrow windows near the end of the context but loses most of the wide early ones. τ−1\tau_{-1} shows no windows in any of the four conditions: untrained, its nodes hold a weak, nearly uniform trace of the whole context, and trained, all of them peak at the last token. We emphasize that the purpose of these experiments were to show that τ0\tau_0 and τ−1\tau_{-1} provide alternate mechanisms for model computation. The corresponding experiments with transformers show that this is distinct from the usual model computation, which are closer to the anti-aligned topology τ−1\tau_{-1} as opposed to τ0\tau_0.

Figure 19. Effective receptive fields. Columns: tree-gram with the aligned topology τ0\tau_0, tree-gram with the anti-aligned topology τ−1\tau_{-1}, and a 12-layer transformer. Top: the architecture, with the probed terminal nodes (trees) or last-position layers (transformer) marked in the colors used below; the tree leaves are aligned to the token axis. Middle: we train linear probes to predict input tokens from latent activations of these nodes (top-1 accuracy; dotted: majority-class baseline). Accuracy for τ0\tau_0 peaks at different intermediate context windows for different tree-gram layers, while the accuracy peaks at the last context position for all layers for τ−1\tau_{-1} and transformers. This suggests that different layers in an aligned topology preserve information about different context windows, while the anti-aligned topology and transformers mix features for last-token prediction. Bottom: receptive fields of individual nodes, recovered by activation patching. The token at each position is swapped, one position at a time, for the token another validation sequence holds there (1024 sequences), and every activation is compared with the unswapped run. We plot the mean squared change of each node’s Merge (solid) and MLP (dashed) activation (attention and MLP for the transformer), normalized by twice the activation’s variance (Jansen total-effect index, log scale). Outside a node’s scope its activations are exactly unchanged (no line). Triangles mark where the linear probe of the middle row peaks; shaded bands mark the disjoint context windows of τ0\tau_0. For τ0\tau_0, each node responds only to tokens up to the end of its window and most to the window it adds, peaking in the same windows as the probe; x0x_0 reaches the down nodes only below 10−810^{-8}, outside the plotted range. In τ−1\tau_{-1}, no individual context windows are observed: every node’s change rises smoothly towards the last token. The transformer behaves the same way at every layer.

Figure 20. Do the effective receptive fields of τ0\tau_0 come from training, from the topology, or from the residual connections? Linear-probe token recovery (as in Figure 19, middle row) for the six terminal nodes of τ0\tau_0 (top row) and τ−1\tau_{-1} (bottom row), in trained and untrained tree-grams with and without residual connections; dotted: majority-class baseline; shaded bands: the disjoint context windows of τ0\tau_0. If the windows come from the wiring, they appear in the untrained τ0\tau_0 but never in τ−1\tau_{-1}. They do: with residual connections, the untrained τ0\tau_0 already recovers each window at its own node, and training sharpens the windows and removes the leakage of the first token into the lower nodes. Without residual connections, the untrained tree-gram loses tokens that pass through more than a few merges, and the trained one keeps only the narrow late windows. τ−1\tau_{-1} peaks at the last token, or nowhere, in every condition. Panels show the mean of two seeds for untrained tree-grams with residual connections and trained tree-grams without them, and a single model otherwise. The trained τ−1\tau_{-1} without residual connections is only partly trained (final losses of 3.44 and 2.85 nats for the two seeds).

Goodness of fit for ranked path probabilities

We sort the exact path probabilities and normalize each candidate on the finite rank support, r=1,…,36720r = 1,\ldots,36720. The probability of a path is the token average of its per-token joint probability, p(path)=Eℓ[∏ℓp(yℓ∣xℓ)]p(\mathrm{path}) = \mathbb{E}_{\ell}[\prod_{\ell} p(y_{\ell} \mid x_{\ell})], over 192,448 validation tokens. We fit each router and seed separately, by least squares on log⁡p(r)\log p(r). This gives equal weight to each rank and resolves the low-probability tail. The primary measures are log-RMSE and Δ\DeltaAICc. AICc assumes Gaussian log residuals. KS and DKL(p∥q)D_{\mathrm{KL}}(p\|q) are secondary descriptive checks.

For m=1m = 1 the power law with a generalized exponential cutoff is best on every measure for both seeds, with log-squared R2=0.9959R^2 = 0.9959 and 0.9948. For m=2m = 2, the broken power law has the lowest log-RMSE and AICc for both seeds (R2=0.9953R^2 = 0.9953 and 0.9929), while the generalized cutoff has the lowest KS and KL. Both place the bend at r≈6,000r \approx6{,}000–9,0009{,}000, one as a sharp break and one smoothly. Under the generalized cutoff, p(r)∝r−αe−(r/rc)βp(r) \propto r^{-\alpha}e^{-(r/r_c)^\beta}, the cutoff scale separates the two routers, rc=541r_c = 541 and 777 for m=1m = 1 against 6,860 and 8,170 for m=2m = 2, while α\alpha (1.16–1.33) and β\beta (0.53–0.81) vary about as much between the two seeds of one router as between routers. The 100 most probable paths carry 88% and 85% of the mass for m=1m = 1 and 70% and 91% for m=2m = 2, but their identity does not reproduce: the two seeds of a router share none of their 100 most probable paths, and only 3 (m=1m = 1) and 0 (m=2m = 2) of their top 500, against about 7 expected by chance. Pareto and power law are the same finite rank model here. Double Pareto and sharp broken power law are also the same rank curve. The smooth cutoff agrees with the transition from power-law-like ranks to faster tails discussed by [70].

Modellog-RMSE s0log-RMSE s1Δ\DeltaAICc s0Δ\DeltaAICc s1KS s0KS s1KL s0KL s1
m=1m = 1
Exponential2.9652.972191424.8175489.60.8390.8093.5973.513
Generalized exponential0.4330.39350186.326910.60.3730.3400.5800.590
Power law / Pareto1.6221.940147131.1144180.50.4310.4590.6820.880
PL with exponential cutoff0.3510.37134644.722679.10.2660.2790.2000.259
PL with GEC0.2190.2720.00.00.0870.1200.0680.128
Broken PL / double Pareto0.2810.46718371.939542.00.2710.2860.2110.272
DGBD / beta-rank0.9391.007106993.496049.90.3750.3980.4430.559
m=2m = 2
Exponential1.7362.288179757.3192998.30.7430.8792.7974.086
Generalized exponential0.3690.73566086.3109589.80.3410.5650.4170.956
Power law / Pareto0.8520.554127501.088814.80.3170.2440.3330.161
PL with exponential cutoff0.2080.25524092.631735.50.1270.1550.0660.090
PL with GEC0.2010.24221497.127930.40.0950.1200.0440.074
Broken PL / double Pareto0.1500.1650.00.00.1780.1540.1140.090
DGBD / beta-rank0.5120.39290046.163404.00.2410.2090.1930.125

Table 4. Goodness of fit for the ranked path-probability curves, fitted separately to the two seeds (s0, s1) of each router. Lower is better in every column, and the best value in each column of a block is in bold. PL denotes power law. GEC denotes generalized exponential cutoff. DGBD denotes the discrete generalized Beta distribution discussed in [70].

Examples of generated text

Samples from fixed tree-grams on TinyStories (BPE-8192) at temperature 1, with a fixed context and generation seed. Within each block every model receives the same validation prompt, truncated to its own context length n−1n - 1; the token stream is lightly de-tokenised (punctuation re-attached) for readability, and [EOS] marks the end-of-story token.

Width sweep — dd varies at n=32n = 32

n=32n = 32, d=64d = 64 (31 context tokens, hpred=2.537h_{\mathrm{pred}} = 2.537 nats/token)

Prompt. camp. [EOS] One day, a little girl named Lucy found a shoe in her room. It was a big shoe, much too big for her foot.

Continuation. Mia tried to climb up, but she couldn’t. She felt so cold and strong. She did not shiver anymore. Her music made her. It made her bow back on the ground. The lemonade tasted like Mr. Hina’s face turned into a small sc run. The fit and introduced all her was out to dry and decided to show it to her, making a pile castle. She had some money from

n=32n = 32, d=128d = 128 (31 context tokens, hpred=2.247h_{\mathrm{pred}} = 2.247 nats/token)

Prompt. camp. [EOS] One day, a little girl named Lucy found a shoe in her room. It was a big shoe, much too big for her foot.

Continuation. Mia wanted to comfort Fluffy, but she was scared. She did not know what to play with. Kitty’s mom saw her feeling sad and did not want to help. So, she hid the medicine in the kitchen. [EOS] One day, a colorful bird named Bob flew in a big tree. March was a happy place to be. He was very happy to find the sun. Bobo flew to a big park where people

n=32n = 32, d=256d = 256 (31 context tokens, hpred=1.938h_{\mathrm{pred}} = 1.938 nats/token)

Prompt. camp. [EOS] One day, a little girl named Lucy found a shoe in her room. It was a big shoe, much too big for her foot.

Continuation. Lucy tried to fix the shoe, but it couldn’t pinch her dress. Amy asked her mom, “Mom, what is this jacket?” Her mom said, “I don’t know, Sue. Maybe they can use a glove to talk to someone.” Finally, Tim’s mom mentioned the coin to Tim. But when they went back home, Tim forgot about Spot. She gave it back to Tim and said

n=32n = 32, d=512d = 512 (31 context tokens, hpred=1.890h_{\mathrm{pred}} = 1.890 nats/token)

Prompt. camp. [EOS] One day, a little girl named Lucy found a shoe in her room. It was a big shoe, much too big for her foot.

Continuation. She tried to pull it, but she couldn’t. She felt frustrated. Amy asked her mom, “Mom, what is this round thing?” Her mom smiled and said, “This is a special seat, Amy. It tells us things A test is when we drive around the front to the whole world. We can learn this and learn how to count to 10, to the beauty end. How does that sound?”

n=32n = 32, d=1024d = 1024 (31 context tokens, hpred=1.756h_{\mathrm{pred}} = 1.756 nats/token) Prompt. camp. [EOS] One day, a little girl named Lucy found a shoe in her room. It was a big shoe, much too big for her foot.

Continuation. She wanted to repair it, but she did not know how. “Mom, can I reverse our shoe?” Sam requested. His mom smiled and said, “Of course we can! I’ll hold it for you.” [EOS] One day, a colorful bird named Bob flew to a big tree. He wanted to settle there to rest and rest. While he was sitting, he heard a loud laugh. Rob opened his eyes

Context Sweep — nn varies at d=1024d = 1024

n=3n = 3, d=1024d = 1024 (2 context tokens, hpred=2.843h_{\mathrm{pred}} = 2.843 nats/token)

Prompt. too big

Continuation. for you. Do you want to buy the blue ball. One sunny day, a boy named Tom came to the war and be friends and her white dress. She ran back home. They played together and had fun. Would you like.“Bob wanted to bake with her toys and games. They agreed and they both loved the doll.” You can’t need to sleep. [EOS] Once upon a time, there was a

n=4n = 4, d=1024d = 1024 (3 context tokens, hpred=2.537h_{\mathrm{pred}} = 2.537 nats/token)

Prompt. much too big

Continuation. for you. Do you want to buy the blue ball. One sunny day, a boy named Tom came to Sam’s orange collar and her white boots. She ran back home to play together. [EOS] Once upon a time, there was a rabbit. She had seen the wind’s joy and introduced himself. The cat was busy and decided to show it to all her friends. She gave Lily a big hug and said

n=8n = 8, d=1024d = 1024 (7 context tokens, hpred=2.085h_{\mathrm{pred}} = 2.085 nats/token)

Prompt. a big shoe, much too big

Continuation. and old. John felt frustrated. He yelled,’But the parrot wouldn’t listen. He came closer and saw what was happening. She did not want to be rude. Tom looked at Sam and said, “Would you like some more?” But Tom could not hear Tim’s voice and shake the hole. A big dog came to the castle. The dog did not like the decorations. He wanted some money from

n=16n = 16, d=1024d = 1024 (15 context tokens, hpred=1.818h_{\mathrm{pred}} = 1.818 nats/token)

Prompt. in her room. It was a big shoe, much too big for her

Continuation. mouth. Sue didn’t want her spaghetti, but her mom said, “Don’t worry, we can make another one later.” After that, they played a game where Tom squeezed the bowl and made a loud noise. “Boo!” A sound came out. “Wow, you fit us! You are good at hiding. You can escape through the hole to sleep.” Tim followed Max to a big park where there

n=32n = 32, d=1024d = 1024 (31 context tokens, hpred=1.756h_{\mathrm{pred}} = 1.756 nats/token)

Prompt. camp. [EOS] One day, a little girl named Lucy found a shoe in her room. It was a big shoe, much too big for her foot. Continuation. She wanted to repair it, but she did not know how. “Mom, can I reverse our shoe?” Sam requested. His mom smiled and said, “Of course we can! I’ll hold it for you.” [EOS] One day, a colorful bird named Bob flew to a big tree. He wanted to settle there to rest and rest. While he was sitting, he heard a loud laugh. Rob opened his eyes

References

  1. [1]Amro Abbas, Kushal Tirumala, Dániel Simig, Surya Ganguli, and Ari S. Morcos. Semdedup: Data-efficient learning at web-scale through semantic deduplication, 2023. URL https://arxiv.org/abs/2303.09540.
  2. [2]Mahmoud Assran and Mike Rabbat. On the convergence of Nesterov’s accelerated gradient method in stochastic settings. In Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pp. 410–420, 2020.arxiv.org/abs/2002.12414
  3. [3]Borja Balle, Ariadna Quattoni, and Xavier Carreras. Spectral learning techniques for weighted automata, transducers, and grammars. Tutorial at the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), 2014. URL https://borjaballe.github.io/emnlp14-tutorial/. Accessed: 2026-08-29.
  4. [4]Yoshua Bengio, Réjean Ducharme, Pascal Vincent, and Christian Jauvin. A neural probabilistic language model. Journal of Machine Learning Research, 3:1137–1155, 2003a.
  5. [5]Yoshua Bengio, Réjean Ducharme, Pascal Vincent, and Christian Jauvin. A neural probabilistic language model. Journal of Machine Learning Research, 3:1137–1155, 2003b. URL https://www.jmlr.org/papers/v3/bengio03a.html.
  6. [6]Thomas Berg. Branching direction in recursive structures. English Language and Linguistics, 16 (3):385–401, 2012. doi: 10.1017/S1360674312000160.DOI
  7. [7]Dan Biderman, Jacob Portes, Jose Javier Gonzalez Ortiz, Mansheej Paul, Philip Greengard, Connor Jennings, Daniel King, Sam Havens, Vitaliy Chiley, Jonathan Frankle, Cody Blakeney, and John P. Cunningham. LoRA learns less and forgets less. Transactions on Machine Learning Research, 2024. URL https://arxiv.org/abs/2405.09673.
  8. [8]Johan Bjorck, Alon Benhaim, Vishray Chaudhary, Furu Wei, and Xia Song. Scaling optimal lr across token horizons, 2025. URL https://arxiv.org/abs/2409.19913.
  9. [9]Fernando Blat, María José Castro, Salvador Tortajada, and Joan Andreu Sánchez. A hybrid approach to statistical language modeling with multilayer perceptrons and unigrams. In Proceedings of the 8th International Conference on Text, Speech and Dialogue (TSD 2005), pp. 195–202. Springer, 2005. doi: 10.1007/11551874_25.DOI
  10. [10]Taylor L. Booth. Probabilistic representation of formal languages. In 10th Annual Symposium on Switching and Automata Theory, pp. 74–81. IEEE, 1969. doi: 10.1109/SWAT.1969.7.
  11. [11]T. Brants, Ashok Popat, Peng Xu, Franz Josef Och, and Jeffrey Dean. Large language models in machine translation. In Conference on Empirical Methods in Natural Language Processing, 2007. URL https://api.semanticscholar.org/CorpusID:633992.
  12. [12]Peter F. Brown, Vincent J. Della Pietra, Peter V. deSouza, Jennifer C. Lai, and Robert L. Mercer. Class-based n-gram models of natural language. Computational Linguistics, 18(4):467–479, 1992. Preprint. Under review.DOI
  13. [13]Francesco Cagnetta, Leonardo Petrini, Umberto M. Tomasini, Alessandro Favero, and Matthieu Wyart. How deep neural networks learn compositional data: The random hierarchy model. Phys. Rev. X, 14:031001, Jul 2024. doi: 10.1103/PhysRevX.14.031001. URL https://link.aps.org/doi/10.1103/PhysRevX.14.031001.DOI
  14. [14]Francesco Cagnetta, Alessandro Favero, Antonio Sclocchi, and Matthieu Wyart. Scaling laws and representation learning in simple hierarchical languages: Transformers vs. convolutional architectures, 2025. URL https://arxiv.org/abs/2505.07070.
  15. [15]Francesco Cagnetta, Allan Raventós, Surya Ganguli, and Matthieu Wyart. Deriving neural scaling laws from the statistics of natural language. https://github.com/fracagnetta/small-language-modelling, 2026. arXiv:2602.07488.arxiv.org/abs/2602.07488
  16. [16]M.J. Castro, F. Prat, and F. Casacuberta. MLP emulation of n-gram models as a first step to connectionist language modeling. In 1999 Ninth International Conference on Artificial Neural Networks ICANN 99. (Conf. Publ. No. 470), volume 2, pp. 910–915 vol.2, 1999. doi: 10.1049/cp:19991228.DOI
  17. [17]Stanley F. Chen and Joshua Goodman. An empirical study of smoothing techniques for language modeling. In Proceedings of the 34th Annual Meeting of the Association for Computational Linguistics, pp. 310–318. Association for Computational Linguistics, 1996. doi: 10.3115/981863.981904. URL https://aclanthology.org/P96-1041/.DOI
  18. [18]Song Cheng, Lei Wang, Tao Xiang, and Pan Zhang. Tree tensor networks for generative modeling. Physical Review B, 99(15):155131, 2019. doi: 10.1103/PhysRevB.99.155131.DOI
  19. [19]Cheng-Han Chiang and Hung-yi Lee. On the transferability of pre-trained language models: A study from artificial datasets. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, 2022.arxiv.org/abs/2109.03537
  20. [20]Jihun Choi, Kang Min Yoo, and Sang-goo Lee. Learning to compose task-specific tree structures. In AAAI, 2018.arxiv.org/abs/1707.02786
  21. [21]Noam Chomsky. Three models for the description of language. IRE Transactions on Information Theory, 2(3):113–124, 1956. doi: 10.1109/TIT.1956.1056813.
  22. [22]Noam Chomsky. Syntactic Structures. Mouton, The Hague, 1957.
  23. [23]Noam Chomsky. On certain formal properties of grammars. Information and Control, 2(2):137–167, 1959. doi: 10.1016/S0019-9958(59)90362-6.
  24. [24]Noam Chomsky and Marcel-Paul Schützenberger. The algebraic theory of context-free languages. In Computer Programming and Formal Systems, volume 35 of Studies in Logic and the Foundations of Mathematics, pp. 118–161. North-Holland, 1963. doi: 10.1016/S0049-237X(08)72023-8.
  25. [25]Stephen Crain and Mineharu Nakayama. Structure dependence in grammar formation. Language, 63(3):522–543, 1987. doi: 10.2307/415004.DOI
  26. [26]Marina Danilova and Grigory Malinovsky. Averaged heavy-ball method. Computer Research and Modeling, 14(2):277–308, 2022. doi: 10.20537/2076-7633-2022-14-2-277-308.DOI
  27. [27]DeepSeek-AI. DeepSeek-V3 technical report, 2025. URL https://arxiv.org/abs/2412.19437.
  28. [28]E. DeGiuli. Random language model. Phys. Rev. Lett., 122:128301, Mar 2019. doi: 10.1103/PhysRevLett.122.128301. URL https://link.aps.org/doi/10.1103/PhysRevLett.122.128301.DOI
  29. [29]François Denis, Mattias Gybels, and Amaury Habrard. Dimension-free concentration bounds on Hankel matrices for spectral learning. Journal of Machine Learning Research, 17(31):1–32, 2016. URL https://www.jmlr.org/papers/v17/14-501.html.
  30. [30]Nai Ding, Lucia Melloni, Hang Zhang, Xing Tian, and David Poeppel. Cortical tracking of hierarchical linguistic structures in connected speech. Nature Neuroscience, 19(1):158–164, 2016. doi: 10.1038/nn.4186. Chris Dyer, Adhiguna Kuncoro, Miguel Ballesteros, and Noah A. Smith. Recurrent neural network grammars. In Proceedings of NAACL-HLT, pp. 199–209, 2016. doi: 10.18653/v1/N16-1024.
  31. [31]Ronen Eldan and Yuanzhi Li. TinyStories: How small can language models be and still speak coherent English?, 2023. URL https://arxiv.org/abs/2305.07759.
  32. [32]Jeffrey L. Elman. Distributed representations, simple recurrent networks, and grammatical structure. Machine Learning, 7:195–225, 1991. doi: 10.1007/BF00114844.DOI
  33. [33]Martin B. H. Everaert, Marinus A. C. Huybregts, Noam Chomsky, Robert C. Berwick, and Johan J. Bolhuis. Structures, not strings: Linguistics as part of the cognitive sciences. Trends in Cognitive Sciences, 19(12):729–743, 2015. doi: 10.1016/j.tics.2015.09.008.DOI
  34. [34]Oleg Filatov, Jan Ebert, Jiangtao Wang, and Stefan Kesselheim. Time transfer: On optimal learning rate and batch size in the infinite data limit, 2025. URL https://openreview.net/forum?id=MLhquJb1qN.arxiv.org/abs/2410.05838
  35. [35]Zach Furman, Stephan Wäldchen, Yangda Bei, and Liam Hodgkinson. Benign loss landscapes can coexist with worst-case hardness, 2026. URL https://arxiv.org/abs/2609.13057.
  36. [36]Richard Futrell and Michael Hahn. Linguistic structure from a bottleneck on sequential information processing. Nature Human Behaviour, 10:589–600, 2026. doi: 10.1038/s41562-025-02336-w.DOI
  37. [38]Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep Learning. MIT Press, 2016.
  38. [39]Joshua Goodman. A bit of progress in language modeling, 2001. URL https://arxiv.org/abs/cs/0108005.
  39. [40]Kshitij Gupta, Benjamin Thérien, Adam Ibrahim, Mats L. Richter, Quentin Anthony, Eugene Belilovsky, Irina Rish, and Timothée Lesort. Continual pre-training of large language models: How to (re)warm your model? In ES-FoMo Workshop, International Conference on Machine Learning, 2023. URL https://arxiv.org/abs/2308.04014.
  40. [41]John Hale, Chris Dyer, Adhiguna Kuncoro, and Jonathan Brennan. Finding syntax in human encephalography with beam search. In Iryna Gurevych and Yusuke Miyao (eds.), Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 2727–2736, Melbourne, Australia, July 2018. Association for Computational Linguistics. doi: 10.18653/v1/P18-1254. URL https://aclanthology.org/P18-1254/.DOI
  41. [42]Marc D. Hauser, Noam Chomsky, and W. Tecumseh Fitch. The faculty of language: What is it, who has it, and how did it evolve? Science, 298(5598):1569–1579, 2002. doi: 10.1126/science.298.5598.1569.DOI
  42. [43]Danny Hernandez, Jared Kaplan, Tom Henighan, and Sam McCandlish. Scaling laws for transfer. arXiv preprint arXiv:2102.01293, 2021. URL https://arxiv.org/abs/2102.01293.
  43. [44]John Hewitt and Christopher D. Manning. A structural probe for finding syntax in word representations. In Proceedings of NAACL-HLT, pp. 4129–4138, 2019. doi: 10.18653/v1/N19-1419.DOI
  44. [45]John E. Hopcroft and Jeffrey D. Ullman. Introduction to Automata Theory, Languages, and Computation. Addison-Wesley, 1979.
  45. [46]Michael Y. Hu, Jackson Petty, Chuan Shi, William Merrill, and Tal Linzen. Between circuits and Chomsky: Pre-training on formal languages imparts linguistic biases. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), 2025.arxiv.org/abs/2502.19249
  46. [47]Adam Ibrahim, Benjamin Thérien, Kshitij Gupta, Mats L. Richter, Quentin Anthony, Timothée Lesort, Eugene Belilovsky, and Irina Rish. Simple and scalable strategies to continually pre-train large language models. Transactions on Machine Learning Research (TMLR), 2024. URL https://openreview.net/forum?id=DimPeeCxK0. Preprint. Under review.arxiv.org/abs/2403.08763
  47. [48]Satoki Ishikawa, Rio Yokota, and Ryo Karakida. Measuring the local shape of learning-rate transfer curves, 2026. URL https://arxiv.org/abs/2610.21814.
  48. [49]Berivan Isik, Natalia Ponomareva, Hussein Hazimeh, Dimitris Paparas, Sergei Vassilvitskii, and Sanmi Koyeyo. Scaling laws for downstream task performance in machine translation. In International Conference on Learning Representations (ICLR), 2025. URL https://arxiv.org/abs/2402.04177.
  49. [50]Dayal Singh Kalra. nanoGPT-mup. https://github.com/dayal-kalra/nanoGPT-mup, 2025. (Slight modifications made by authors).
  50. [51]Dayal Singh Kalra and Maissam Barkeshli. Quantifying hyperparameter transfer and the importance of embedding layer learning rate, 2026. URL https://arxiv.org/abs/2605.21486.
  51. [52]Yoon Kim, Chris Dyer, and Alexander M. Rush. Compound probabilistic context-free grammars for grammar induction. In Proceedings of ACL, pp. 2369–2385, 2019. doi: 10.18653/v1/P19-1228.DOI
  52. [53]Dan Klein and Christopher D. Manning. Corpus-based induction of syntactic structure: Models of dependency and constituency. In Proceedings of the 42nd Annual Meeting of the Association for Computational Linguistics, 2004. doi: 10.3115/1218955.1219019.
  53. [54]Atli Kosson, Jeremy Welborn, Yang Liu, Martin Jaggi, and Xi Chen. Weight decay may matter more than μp for learning rate transfer in practice. In The Fourteenth International Conference on Learning Representations, 2026. URL https://openreview.net/forum?id=PvTxIdZc1E.arxiv.org/abs/2510.19093
  54. [55]Aravind Krishnan, Jesujoba Alabi, and Dietrich Klakow. On the n-gram approximation of pre-trained language models, 2023. URL https://arxiv.org/abs/2306.06892.
  55. [56]Adhiguna Kuncoro, Chris Dyer, Laura Rimell, Stephen Clark, and Phil Blunsom. LSTMs can learn syntax-sensitive dependencies well, but modeling structure makes them better. In Proceedings of ACL, pp. 1426–1436, 2018. doi: 10.18653/v1/P18-1132.DOI
  56. [57]Karim Lari and Steve J. Young. The estimation of stochastic context-free grammars using the inside-outside algorithm. Computer Speech & Language, 4(1):35–56, 1990. doi: 10.1016/0885-2308(90)90022-X.
  57. [58]Yann LeCun, Ido Kanter, and Sara A. Solla. Eigenvalues of covariance matrices: Application to neural-network learning. Phys. Rev. Lett., 66:2396–2399, May 1991. doi: 10.1103/PhysRevLett.66.2396. URL https://link.aps.org/doi/10.1103/PhysRevLett.66.2396.DOI
  58. [59]Katherine Lee, Daphne Ippolito, Andrew Nystrom, Chiyuan Zhang, Douglas Eck, Chris Callison-Burch, and Nicholas Carlini. Deduplicating training data makes language models better. In Smaranda Muresan, Preslav Nakov, and Aline Villavicencio (eds.), Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 8424–8445, Dublin, Ireland, May 2022. Association for Computational Linguistics. doi: 10.18653/v1/2022.acl-long.577. URL https://aclanthology.org/2022.acl-long.577/.DOI
  59. [60]Houyi Li, Wenzhen Zheng, Qiufeng Wang, Hanshan Zhang, Zili Wang, Shijie Xuyang, Yuantao Fan, Zhenyu Ding, Haoying Wang, Ning Ding, Shuigeng Zhou, Xiangyu Zhang, and Daxin Jiang. Predictable scale: Part i, step law – optimal hyperparameter scaling law in large language model pretraining, 2025. URL https://arxiv.org/abs/2503.04715.
  60. [61]Huayang Li, Lemao Liu, Guoping Huang, and Shuming Shi. On the branching bias of syntax extracted from pre-trained language models, 2020. URL https://arxiv.org/abs/2010.02448.
  61. [62]Henry W. Lin and Max Tegmark. Critical behavior in physics and probabilistic formal languages. Entropy, 19(7):299, 2017. doi: 10.3390/e19070299.DOI
  62. [63]Jiacheng Liu, Sewon Min, Luke Zettlemoyer, Yejin Choi, and Hannah Hajishirzi. Infini-gram: Scaling unbounded n-gram language models to a trillion tokens, 2025. URL https://arxiv.org/abs/2401.17377. Preprint. Under review. Lorenzo Loconte, Antonio Mari, Gennaro Gala, Robert Peharz, Cassio de Campos, Erik Quaeghebeur, Gennaro Vessio, and Antonio Vergari. What is the relationship between tensor factorizations and circuits (and how can we exploit it?), 2025. URL https://arxiv.org/abs/2409.07953.
  63. [64]Lorenzo Loconte et al. Multiplicative interactions and low-rank tensor approximations. arXiv preprint arXiv:2409.07953, 2024.
  64. [65]Lovish Madaan, Srinadh Bhojanapalli, Himanshu Jain, and Prateek Jain. Treeformer: Dense gradient trees for efficient attention computation. In ICLR, 2023.arxiv.org/abs/2208.09015
  65. [66]Stéphane G. Mallat. A theory for multiresolution signal decomposition: The wavelet representation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 11(7):674–693, 1989. doi: 10.1109/34.192463.DOI
  66. [67]Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models. In International Conference on Learning Representations, 2017. URL https://openreview.net/forum?id=Byj72udxe.arxiv.org/abs/1609.07843
  67. [68]Jacob Miller, Guillaume Rabusseau, and John Terilla. Tensor networks for probabilistic sequence modeling. In AISTATS, 2021.arxiv.org/abs/2003.01039
  68. [69]Masaaki Nakamura and Kiyoshi Shikano. A study of English word category prediction based on neural networks. In Proceedings of the International Conference on Acoustics, Speech, and Signal Processing (ICASSP), pp. 731–734, Glasgow, Scotland, 1989.DOI
  69. [70]Gerardo G. Naumis and Germinal Cocho. The tails of rank-size distributions due to multiplicative processes: from power laws to stretched exponentials and beta-like functions. New Journal of Physics, 9(8):286, 2007. doi: 10.1088/1367-2630/9/8/286. URL https://doi.org/10.1088/1367-2630/9/8/286.
  70. [71]Timothy Nguyen. Understanding transformers via n-gram statistics. In A. Globerson, L. Mackey, D. Belgrave, A. Fan, U. Paquet, J. Tomczak, and C. Zhang (eds.), Advances in Neural Information Processing Systems, volume 37, pp. 98049–98082. Curran Associates, Inc., 2024. doi: 10.52202/079017-3112. URL https://proceedings.neurips.cc/paper_files/paper/2024/file/b1c446eebd9a317dd0e96b1690c821a-Paper-Conference.pdf.DOI
  71. [72]Christophe Pallier, Anne-Dominique Devauchelle, and Stanislas Dehaene. Cortical representation of the constituent structure of sentences. Proceedings of the National Academy of Sciences, 108(6):2522–2527, 2011. doi: 10.1073/pnas.1018711108. URL https://www.pnas.org/doi/abs/10.1073/pnas.1018711108.DOI
  72. [73]Isabel Papadimitriou and Dan Jurafsky. Learning music helps you read: Using transfer to study linguistic structure in language models. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), 2020.arxiv.org/abs/2004.14601
  73. [74]Ankur P. Parikh, Avneesh Saluja, Chris Dyer, and Eric Xing. Language modeling with power low rank ensembles. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 1487–1498, Doha, Qatar, 2014a. Association for Computational Linguistics. doi: 10.3115/v1/D14-1158. URL https://aclanthology.org/D14-1158/.DOI
  74. [75]Ankur P. Parikh, Avneesh Saluja, Chris Dyer, and Eric Xing. Language modeling with power low rank ensembles. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 1487–1498. Association for Computational Linguistics, 2014b. doi: 10.3115/v1/D14-1158. URL https://aclanthology.org/D14-1158/.DOI
  75. [76]Guilherme Penedo, Hynek Kydlíček, Loubna Ben allal, Anton Lozhkov, Margaret Mitchell, Colin Raffel, Leandro Von Werra, and Thomas Wolf. The fineweb datasets: Decanting the web for the finest text data at scale. In The Thirty-eighth Conference on Neural Information Processing Systems Datasets and Benchmarks Track, 2024. URL https://openreview.net/forum?id=n6SCkn2QaG. Preprint. Under review.
  76. [77]Boris T. Polyak. Some methods of speeding up the convergence of iteration methods. USSR Computational Mathematics and Mathematical Physics, 4(5):1–17, 1964. doi: 10.1016/0041-5553(64)90137-5.DOI
  77. [78]Noam Razin, Asaf Maman, and Nadav Cohen. Implicit regularization in hierarchical tensor factorization and deep convolutional neural networks, 2022. URL https://arxiv.org/abs/2201.11729.
  78. [79]Ryokan Ri and Yoshimasa Tsuruoka. Pretraining with artificial language: Studying transferable knowledge in language models. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), 2022.arxiv.org/abs/2203.10326
  79. [80]Claude E. Shannon. Prediction and entropy of printed English. Bell System Technical Journal, 30 (1):50–64, 1951. doi: 10.1002/j.1538-7305.1951.tb01366.x.DOI
  80. [81]Yikang Shen, Shawn Tan, Alessandro Sordoni, and Aaron Courville. Ordered neurons: Integrating tree structures into recurrent neural networks. In ICLR, 2019.arxiv.org/abs/1810.09536
  81. [82]Le Song, Mariya Ishteva, Ankur Parikh, Eric Xing, and Haesun Park. Hierarchical tensor decomposition of latent tree graphical models. In Sanjoy Dasgupta and David McAllester (eds.), Proceedings of the 30th International Conference on Machine Learning, volume 28 of Proceedings of Machine Learning Research, pp. 334–342, Atlanta, Georgia, USA, 17–19 2013. PMLR. URL https://proceedings.mlr.press/v28/song13.html.
  82. [83]Ben Sorscher, Robert Geirhos, Shashank Shekhar, Surya Ganguli, and Ari S. Morcos. Beyond neural scaling laws: beating power law scaling via data pruning, 2023. URL https://arxiv.org/abs/2206.14486.
  83. [84]Zhan Su, Yuqin Zhou, Fengran Mo, and Jakob Grue Simonsen. Language modeling using tensor trains. arXiv preprint arXiv:2405.04590, 2024.arxiv.org/abs/2405.04590
  84. [85]Anej Svete, Nadav Borenshtein, Mike Zhou, Isabelle Augenstein, and Ryan Cotterell. Can transformers learn n-gram language models? In Yaser Al-Onaizan, Mohit Bansal, and Yun-Nung Chen (eds.), Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing, pp. 9851–9867, Miami, Florida, USA, November 2024. Association for Computational Linguistics. doi: 10.18653/v1/2024.emnlp-main.550. URL https://aclanthology.org/2024.emnlp-main.550/.DOI
  85. [86]Kai Sheng Tai, Richard Socher, and Christopher D. Manning. Improved semantic representations from tree-structured long short-term memory networks. In ACL, 2015.arxiv.org/abs/1503.00075
  86. [87]Stefan Thurner, Rudolf Hanel, Bo Liu, and Bernat Corominas-Murtra. Understanding Zipf’s law of word frequencies through sample-space collapse in sentence formation. Journal of the Royal Society Interface, 12(108):20150330, 2015. doi: 10.1098/rsif.2015.0330.
  87. [88]Aditya Varre, Gizem Yüce, and Nicolas Flammarion. Learning in-context n-grams with transformers: Sub-n-grams are near-stationary points. In Proceedings of the 42nd International Conference on Machine Learning, volume 267 of Proceedings of Machine Learning Research, pp. 60924–60963. PMLR, 2025.arxiv.org/abs/2508.12837
  88. [89]Adina Williams, Andrew Drozdov, and Samuel R. Bowman. Do latent tree learning models identify meaningful structure in sentences? Transactions of the Association for Computational Linguistics, 6:253–267, 2018.arxiv.org/abs/1709.01121
  89. [90]Gregory W. Wornell and Alan V. Oppenheim. Estimation of fractal signals from noisy measurements using wavelets. IEEE Transactions on Signal Processing, 40(3):611–623, 1992a. doi: 10.1109/78.120804.DOI
  90. [91]G.W. Wornell and A.V. Oppenheim. Estimation of fractal signals from noisy measurements using wavelets. IEEE Transactions on Signal Processing, 40(3):611–623, 1992b. doi: 10.1109/78.120804. Preprint. Under review.
  91. [92]Songlin Yang, Yanpeng Zhao, and Kewei Tu. PCFGs can do better: Inducing probabilistic context-free grammars with many symbols. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 1487–1498, Online, 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.naacl-main.117. URL https://aclanthology.org/2021.naacl-main.117/.DOI
  92. [93]Xiulin Yang, Heidi Getz, and Ethan Gotlieb Wilcox. Function words as statistical cues for language learning, 2026. URL https://arxiv.org/abs/2601.21191.
  93. [94]Shunyu Yao, Binghui Peng, Christos Papadimitriou, and Karthik Narasimhan. Self-attention networks can process bounded hierarchical languages. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 3770–3785, Online, August 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.acl-long.292. URL https://aclanthology.org/2021.acl-long.292/.DOI
  94. [95]Oğuz Kaan Yüksel, Rodrigo Alvarez Lucendo, and Nicolas Flammarion. Incremental learning of sparse attention patterns in transformers, 2026. URL https://arxiv.org/abs/2602.19143.
  95. [96]Manzil Zaheer, Satwik Kottur, Siamak Ravanbakhsh, Barnabas Poczos, Ruslan Salakhutdinov, and Alexander Smola. Deep sets. In Advances in Neural Information Processing Systems, 2017. Preprint. Under review.

Paper details

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

views · 0

downloads · 0

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

  • Computer Science

generative AI tools

View statement
Looking for related papers…
Contents