Papers
Topics
Authors
Recent
Search
2000 character limit reached

Scaling limit of the Random Language Model

Published 26 Jun 2026 in cond-mat.dis-nn, cond-mat.stat-mech, and cs.CL | (2606.28105v1)

Abstract: We develop a quantitative theory of the Random LLM (RLM), an ensemble of stochastic context-free grammars, in a scaling limit where the number of hidden symbols $N \to \infty$ while the grammar temperature $\tildeε_d \to 0$ at fixed $x = {\tildeε}_d \log N$. In this limit, the model admits a controlled description based on a large-deviation principle over rule-usage patterns. A semi-annealed approximation maps the problem to a class of Random Energy Models with nontrivial combinatorics. We show that the RLM exhibits a condensation transition at a critical value $x_c=1/8$, below which rule usage concentrates and language statistics acquire a nontrivial dependence on corpus length. A second characteristic scale at $x=1/2$ marks the onset of entropy reduction from its maximal value. Across these regimes, we derive explicit scaling laws for the number of distinct rules, entropy, and related observables, identifying distinct scaling, saturation, and critical regimes controlled by the interplay of grammar size, corpus length, and temperature. The theory resolves previous ambiguities regarding the existence of a thermodynamic transition and explains the slow approach to the large-$N$ limit as a consequence of the dependence on $\log N$. It further provides a unified framework in which universal statistical properties of language emerge from typical realizations of generative grammars, with implications for both natural language statistics and the behavior of LLMs.

Authors (1)

Summary

  • The paper demonstrates a condensation transition at x_c=1/8, where grammar rule usage shifts from sparse to uniform in the RLM.
  • It employs a semi-annealed saddle-point approach combining large-deviation theory and REM analogies to derive scaling laws for rule usage and entropy.
  • Numerical simulations validate predictions, linking theory to language statistics and implications for LLM design.

Scaling Limit and Condensation Transitions in the Random LLM

Overview of the Random LLM Framework

The paper "Scaling limit of the Random LLM" (2606.28105) presents a thorough theoretical analysis of the Random LLM (RLM)—an ensemble of stochastic context-free grammars (SCFGs) with disorder governed by Gaussian randomness in the rule weights. The study focuses on a double scaling limit in which the number of hidden symbols (NN) diverges while the grammar variance (the "grammar temperature" ϵ\epsilon) vanishes, such that x=ϵlogNx = \epsilon \log N is held fixed. This scaling regime permits a nontrivial interplay between the diversity of grammar rules and the statistical structure of generated languages.

By leveraging connections to large-deviation theory and the Random Energy Model (REM), the work offers an analytical framework for describing the statistical mechanics of the RLM across multiple regimes, identifying order parameters and deriving explicit scaling laws for observables such as the number of distinct rules used (pp), entropy rate (HH), and the scaling of vocabulary size with corpus length (Heaps’ law).

Analytical Approach: Scaling Limit and Semi-Annealed Approximation

The methodology centers on reformulating the RLM partition function as a sum over patterns—configurations controlling the multiplicity with which grammar rules are employed in derivations. Each pattern is characterized by a spectrum of rule usage and is associated with both a combinatorial entropy term and an effective energy, the latter arising from disorder-averaged contributions of grammar weights constrained to patterns of fixed occupancy.

A semi-annealed approximation is introduced: pattern frequencies are determined by a saddle-point minimization of the free energy, with an annealed disorder average taken within each pattern class but retaining constraints arising from finite NN and the structure of derivations. This approach is rigorously justified in the NN \rightarrow \infty, ϵ0\epsilon \rightarrow 0 limit at fixed xx, where self-averaging holds for dominant patterns due to large sample effects but nontrivial corrections arise when the law of large numbers (LLN) breaks down.

Crucially, the author demonstrates that the critical behavior of the RLM is isomorphic to the REM, with the role of "energy levels" played by rule log-weights and combinatorial degeneracies arising from context-free tree topologies.

Main Results: Emergence of Thermodynamic Phases and Scaling Laws

A central outcome is the identification of a condensation transition at xc=1/8x_c = 1/8 (ϵ\epsilon0). The thermodynamic limit is singular: for ϵ\epsilon1, rule utilization condenses and the entropy rate becomes ϵ\epsilon2, reflecting highly structured languages dominated by a small subset of grammar rules; for ϵ\epsilon3, rule usage is delocalized, entropy is maximal (ϵ\epsilon4), and the language output is effectively random.

Detailed scaling laws are provided for key observables:

  • Number of distinct rules ϵ\epsilon5: In the low-temperature/frozen regime (ϵ\epsilon6), ϵ\epsilon7 with ϵ\epsilon8, ϵ\epsilon9 (x=ϵlogNx = \epsilon \log N0: number of branches), and a nontrivial novelty exponent x=ϵlogNx = \epsilon \log N1, which undergoes a crossover near criticality. In the high-temperature regime (x=ϵlogNx = \epsilon \log N2), all rules are used distinctly and x=ϵlogNx = \epsilon \log N3.
  • Entropy rate x=ϵlogNx = \epsilon \log N4: For x=ϵlogNx = \epsilon \log N5, x=ϵlogNx = \epsilon \log N6, saturating to a finite value as x=ϵlogNx = \epsilon \log N7. For x=ϵlogNx = \epsilon \log N8, x=ϵlogNx = \epsilon \log N9, with entropy scaling as pp0.
  • Heaps' law: The scaling pp1 (number of unique lexical rules vs corpus length pp2) is quantitatively captured, and the predicted exponent pp3 in the transition regime matches empirical results in natural language, confirming the descriptive power of the model.
  • Rule usage with corpus length: The rate at which novel rules appear with corpus growth exhibits a crossover: for small pp4, novelty decays sublinearly with corpus size, while in the high-temperature phase it is linear.

The analysis resolves previous ambiguities in the literature regarding the existence and nature of a thermodynamic phase transition in random grammars, demonstrating that the slow convergence to the pp5 limit stems from the explicit pp6 dependence.

Numerical Validation and Agreement

All theoretical predictions are validated against extensive numerical simulations of the RLM, exhibiting quantitative agreement for the rule spectrum, the entropy rate as a function of grammar temperature and corpus length, and the location of the condensation transition. Notably, the continuum of crossover and critical behaviors observed numerically for accessible pp7 map directly onto scaling forms in the analytical treatment.

Implications for Language Statistics and LLMs

By formulating a generative statistical mechanics for random SCFGs, the paper bridges structural approaches to language with observed coarse statistics. The emergence of universal statistical laws, such as vocabulary growth exponents and entropy rate scaling, is shown to result from ensemble properties of context-free grammars. The theory accommodates observed empirical scaling in natural languages (via Heaps’ and Zipf’s law) and rationalizes power-law growth of vocabulary with corpus length as a universal emergent property close to the critical point.

Of particular note is the demonstration that the entropy rate’s slow decrease with context length, as recently measured in LLMs, can be quantitatively fit by the frozen-phase prediction pp8, supporting the hypothesis that LLMs operate in a phase characterized by condensed grammar usage and nontrivial context dependence—an insight with significant theoretical and practical consequences for the design and interpretation of large-scale generative models.

Theoretical and Practical Implications, Future Directions

The work lays the foundation for a general statistical mechanical framework for generative sequence models with latent structure. The identification of scaling variables and order parameters enables direct comparison to empirical data and the application to diverse sequence modeling tasks.

The results suggest several avenues for further research:

  • Extension to richer grammar classes (e.g., context-sensitive grammars, Markov grammars).
  • Analysis of dynamic phenomena and learning trajectories for neural architectures in the pp9 regime.
  • Incorporation of grammatical priors and phylogenetic structure, potentially shedding light on typological variation in natural languages.
  • Detailed investigation of quenched disorder effects beyond the semi-annealed approximation.

The statistical mechanics perspective articulated here provides a rigorous bridge connecting random generative ensembles, observed statistical regularities in natural language, and the behavior of large neural sequence models. The condensation transition clarifies how universal properties can emerge from generic random generative processes, irrespective of fine structural details.

Conclusion

This paper establishes the scaling theory and condensation transition in the Random LLM, demonstrating that universal statistical regularities—vocabulary growth, entropy rate scaling, and rule usage—arise as emergent phenomena from self-averaging in ensembles of random grammars. The theoretical apparatus developed here not only unifies previous numerical and heuristic findings but also extends to predict and explain behaviors in state-of-the-art LLMs, natural language corpora, and potentially other complex generative systems. This sets a high standard for future theoretical studies of structural statistical physics in linguistic and artificial generative models.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.