Optimal Representation Size: High-Dimensional Analysis of Pretraining and Linear Probing
Abstract
Data-efficient generalisation is a central objective in both artificial and biological learning. A common strategy is extracting reusable structure from abundant unlabelled data, enabling efficient adaptation to new tasks using limited supervision. This two-stage paradigm underlies modern training pipelines, in which pretraining is followed by fine-tuning or linear probing. We provide an analytical model of this process, formalising structure extraction as principal component analysis on unlabelled data and downstream learning as linear regression on a separate labelled dataset. In the high-dimensional regime, we derive exact expressions for training and generalisation errors, characterising their dependence on representation dimensionality, unlabelled and labelled sample sizes, and task alignment. Our results show that pretrained representations strongly influence downstream generalisation, and we characterize the optimal representation size across data regimes. With abundant pretraining but scarce downstream data, maximally compressed representations are optimal, whereas with limited pretraining data, higher-dimensional representations generalise better. Furthermore, we establish an exact trade-off between pretraining and supervision, quantifying how much unlabelled data is required to replace a single labelled sample. Beyond our idealised model, we observe similar phenomenology in autoencoders and pretrained LLMs. Altogether, we highlight that optimising representation size is critical for downstream generalisation and identify when compression during pretraining is beneficial.