Towards a theory of how the structure of language is acquired by deep neural networks
<|reference_start|>Towards a theory of how the structure of language is acquired by deep neural networks: How much data is required to learn the structure of a language via next-token prediction? We study this question for synthetic datasets generated via a Probabilistic Context-Free Grammar (PCFG) -- a tree-like generative model that captures many of the hierarchical structures found in natural languages. We determine token-token correlations analytically in our model and show that they can be used to build a representation of the grammar's hidden variables, the longer the range the deeper the variable. In addition, a finite training set limits the resolution of correlations to an effective range, whose size grows with that of the training set. As a result, a Language Model trained with increasingly many examples can build a deeper representation of the grammar's structure, thus reaching good performance despite the high dimensionality of the problem. We conjecture that the relationship between training set size and effective range of correlations holds beyond our synthetic datasets. In particular, our conjecture predicts how the scaling law for the test loss behaviour with training set size depends on the length of the context window, which we confirm empirically in Shakespeare's plays and Wikipedia articles.<|reference_end|>
@article{cagnetta2024towards,
    title={Towards a theory of how the structure of language is acquired by deep
  neural networks},
    author={Francesco Cagnetta, Matthieu Wyart},
    journal={arXiv preprint arXiv:2406.00048},
    year={2024},
    archivePrefix={arXiv},
    eprint={2406.00048},
    primaryClass={cs.CL cond-mat.dis-nn cs.LG}
}