How Deep Neural Networks Learn Compositional Data: The Random Hierarchy Model
Francesco Cagnetta, Leonardo Petrini, Umberto M. Tomasini, Alessandro Favero, Matthieu Wyart
TL;DR
The paper introduces the Random Hierarchy Model (RHM) to study how deep neural networks learn hierarchical, compositional data and to quantify the required number of examples. It shows shallow networks face the curse of dimensionality with a data requirement scaling as $P_{ ext{max}} = n_c m^{(d-1)/(s-1)}$ while deep networks achieve a polynomial $P^* \approx n_c m^L$, with $d = s^L$, highlighting depth as a mechanism to harness structure. The authors connect this efficiency to the emergence of synonymic invariances and detectable local correlations between low-level features and labels, arguing that $P_c \approx P^*$ and that invariances reduce effective dimensionality; clustering can further improve sample efficiency. They demonstrate how removing correlations reintroduces the curse, underscoring the critical role of data structure in learnability and offering a framework to estimate data needs for hierarchical tasks. Overall, the work provides a quantitative, testable account of why depth helps in representation learning and suggests avenues for extending these ideas to gradient dynamics and self-supervised learning.
Abstract
Deep learning algorithms demonstrate a surprising ability to learn high-dimensional tasks from limited examples. This is commonly attributed to the depth of neural networks, enabling them to build a hierarchy of abstract, low-dimensional data representations. However, how many training examples are required to learn such representations remains unknown. To quantitatively study this question, we introduce the Random Hierarchy Model: a family of synthetic tasks inspired by the hierarchical structure of language and images. The model is a classification task where each class corresponds to a group of high-level features, chosen among several equivalent groups associated with the same class. In turn, each feature corresponds to a group of sub-features chosen among several equivalent ones and so on, following a hierarchy of composition rules. We find that deep networks learn the task by developing internal representations invariant to exchanging equivalent groups. Moreover, the number of data required corresponds to the point where correlations between low-level features and classes become detectable. Overall, our results indicate how deep networks overcome the curse of dimensionality by building invariant representations, and provide an estimate of the number of data required to learn a hierarchical task.
