Scaling Laws and Representation Learning in Simple Hierarchical Languages: Transformers vs. Convolutional Architectures

Francesco Cagnetta, Alessandro Favero, Antonio Sclocchi, Matthieu Wyart
5/11/2025
cs.LGcond-mat.dis-nnstat.ML

No confident code implementation found for this paper. 4 possible matches can be shown below.

Abstract

How do neural language models acquire a language's structure when trained for next-token prediction? We address this question by deriving theoretical scaling laws for neural network performance on synthetic datasets generated by the Random Hierarchy Model (RHM) -- an ensemble of probabilistic context-free grammars designed to capture the hierarchical structure of natural language while remaining analytically tractable. Previously, we developed a theory of representation learning based on data correlations that explains how deep learning models capture the hierarchical structure of the data sequentially, one layer at a time. Here, we extend our theoretical framework to account for architectural differences. In particular, we predict and empirically validate that convolutional networks, whose structure aligns with that of the generative process through locality and weight sharing, enjoy a faster scaling of performance compared to transformer models, which rely on global self-attention mechanisms. This finding clarifies the architectural biases underlying neural scaling laws and highlights how representation learning is shaped by the interaction between model architecture and the statistical properties of data.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 4 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{cagnetta2025scaling,
  title  = {Scaling Laws and Representation Learning in Simple Hierarchical Languages: Transformers vs. Convolutional Architectures},
  author = {Francesco Cagnetta and Alessandro Favero and Antonio Sclocchi and Matthieu Wyart},
  year   = {2025},
  eprint = {2505.07070},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.07070v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2505.07070.svg)](https://codeofpaper.com/paper/2505.07070)

Discussion