arXiv:2610.30118cs.LGOct 2026

Manuscript Offprint

arXiv:2610.30118

The role of locality and weight sharing in convolutional neural networks

Francesco Mori, Melanie Weber

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

The success of convolutional neural networks is often attributed to locality and weight sharing. However, how these two properties separately shape learning, and how their effects depend on the spatial correlations of natural images, remain poorly understood. We address these questions in a teacher–student model with a convolutional teacher acting on P input positions with correlation c between positions. We compare convolutional and locally connected students trained by online stochastic gradient descent, and derive ordinary differential equations that describe their dynamics exactly in the limit of large feature dimension D. For uncorrelated positions (c = 0), the two students follow the same learning trajectory, with the convolutional student learning exactly P times faster. We also find that locality affects the sample complexity: a student that matches the kernel size of the teacher recovers it from OD(D)\mathcal{O}_D(D) samples, whereas OD(Dlog⁡D)\mathcal{O}_D(D \log D) samples are needed with a larger kernel. For c > 0, spatial correlations can reduce the advantage of weight sharing. The asymptotic error of the convolutional student grows with c, whereas that of the locally connected student is independent of c and overall lower when evaluated at the same learning rate. When the learning rate is instead tuned to the training horizon, however, the locally connected student wins at early times and the convolutional student at late times, with a transition that we predict analytically.

1 Introduction

The ability of neural networks to learn from a limited number of examples depends on their inductive biases, i.e., on the assumptions about the task that are built into the architecture and the training algorithm. A natural source of inductive bias is symmetry. When a task is invariant under a group of transformations of the input, a model that respects this invariance does not need to learn the same features separately for every transformed version of the input. Weight sharing is the standard way to build such symmetries into a network (Shawe-Taylor, 1989; Cohen and Welling, 2016; Ravanbakhsh et al., 2017; Kondor and Trivedi, 2018), and it is expected to reduce the number of samples needed to learn and to speed up training.

The main success story of this approach is the convolutional neural network (CNN), widely used in image classification and other computer vision tasks (LeCun et al., 1998; Krizhevsky et al., 2012). CNNs exploit two structural properties of natural images, each encoded by a distinct architectural choice: Weight sharing across positions encodes the approximate invariance of image statistics.

under translations, while small filters encode the locality of the relevant features. Additionally, natural images are strongly correlated across space (Ruderman and Bialek, 1994), and the labels used for training are often noisy, resulting in a complex interplay between architectural constraints and the noise of stochastic gradient descent (SGD).

From a theoretical perspective, building symmetries into a model is known to reduce the number of samples needed to learn, typically by a factor of the order of the size of the symmetry group (Bietti et al., 2021; Mei et al., 2021; Tahmasebi and Jegelka, 2023; Elesedy and Zaidi, 2021; Lahoti et al., 2024; Waber et al., 2026). However, disentangling the effects of locality and weight sharing remains a largely open challenge, especially in the feature-learning regime. Moreover, most analyses assume independent inputs, thereby neglecting the spatial correlations of natural images. It is therefore unclear to what extent the advantage of weight sharing survives in the presence of correlations and noise.

In this work, we address these questions in a teacher–student model whose learning dynamics can be described exactly. The teacher is a two-layer convolutional network with kernel size ktk_t, acting on inputs made of PP positions that each carry DD features, with correlation cc between positions. We train convolutional and locally connected students with kernel size ks≥ktk_s \geq k_t by online SGD. The two students have the same receptive fields and differ only in weight sharing, while varying ksk_s probes the role of locality. In the limit of large feature dimension DD, the dynamics is described exactly by ordinary differential equations (ODEs) for a few summary statistics, which extend the classical analysis of online learning in two-layer networks (Saad and Solla, 1995; Biehl and Schwarze, 1995; Goldt et al., 2019).

Contributions. Our main contribution is an exact description of how weight sharing and locality shape the online SGD dynamics of convolutional networks, which separates their effects. More precisely:

  • In the limit of large feature dimension D and with Gaussian inputs, we derive analytically a closed set of ODEs for the summary statistics of convolutional and locally connected students, for arbitrary kernel sizes and input covariance (Result 3.1).

  • For uncorrelated positions, we show analytically that the locally connected network follows exactly the same training trajectory as the convolutional network, but needs exactly P times more SGD steps (Result 3.2). This is an exact dynamical counterpart of the reduction in sample complexity by a factor of the order of the group size found in previous works.

  • By integrating the ODEs numerically, we find that locality affects the sample complexity of the problem. Indeed, a convolutional student with the right degree of locality, ks=ktk_s = k_t, learns the teacher from OD(D)\mathcal{O}_D(D) samples, while OD(Dlog⁡D)\mathcal{O}_D(D \log D) samples are required for ks>ktk_s > k_t (Result 3.3). The additional logarithmic factor originates from a saddle point that is symmetric under reflection of the kernel, which the dynamics escapes through the fluctuations of the random initialization.

  • We show that spatial correlations can reduce the advantage of weight sharing. With a perturbative expansion at small learning rate, we find that the asymptotic error of the convolutional network grows with the correlation strength c, while that of the locally connected network is independent of c and lower than that of the convolutional network for any c > 0 when evaluated at the same learning rate (Result 4.2). However, when the learning rate of each network

is tuned to the training horizon, we find numerically that the locally connected network has the lower error at early times but the convolutional network wins at late times (Section 4.3), with a transition time that we predict analytically from an early-time expansion of the ODEs (Result 4.1).

The code used in the paper is available at https://github.com/francescomori/CNN_theory.

Outline. The paper is organized as follows. Section 2 introduces the model. Section 3 presents the ODEs and the effects of weight sharing and locality for uncorrelated positions. Section 4 studies the effect of spatial correlations, and Section 5 discusses limitations and future directions. Related works are discussed in Section 1.1, and derivations and additional results are given in the appendices.