  Humans and animals can recognize latent structures in their environment and
apply this information to efficiently navigate the world. However, it remains
unclear what aspects of neural activity contribute to these computational
capabilities. Here, we develop an analytical theory linking the geometry of a
neural population's activity to the generalization performance of a linear
readout on a set of tasks that depend on a common latent structure. We show
that four geometric measures of the activity determine performance across
tasks. Using this theory, we find that experimentally observed disentangled
representations naturally emerge as an optimal solution to the multi-task
learning problem. When data is scarce, these optimal neural codes compress less
informative latent variables, and when data is abundant, they expand these
variables in the state space. We validate our theory using macaque ventral
stream recordings. Our results therefore tie population geometry to multi-task
learning.
