Manuscript Offprint
arXiv:2610.29531Phase Transitions in Learning Driven by Extremal Data
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Ethan Levien and Trevor GrandPre
Department of Mathematics, Dartmouth College, Hanover, NH 03755, USA
Department of Physics, Washington University in St. Louis, St. Louis, MO 63130, USA
National Institute for Theory and Mathematics in Biology,
Northwestern University and The University of Chicago, Chicago, IL, USA
(Dated: October 22, 2026)
We study an extremal regression problem, an example of multiple instance learning (MIL), where the predictors are given as multisets, called bags. The bag elements (called instances) possess hidden labels which are pooled to produce an observed bag-level label. Max pooling is common in MIL applications, but gives rise to vanishing gradients. To handle this, modern MIL pipelines approximate the max with a softmax, treating the sharpness as a learnable parameter, denoted . When the max pooling model is the true data generating process, learning will be successful when is increased during gradient descent, thereby driving the dynamics into regions of parameter space with vanishing gradients. To understand the conditions under which gradient descent breaks down, we study a minimal model and derive a low dimensional projection of the gradient flow in the joint limit of large bags n and high dimension d with fixed. The flow has two distinct phase transitions: an intrinsic freezing transition related to the random energy model of disordered systems, and a retrieval transition occurring in modern Hopfield networks. Numerical simulation confirms both the phase diagram and the convergence of the finite-size training gradient to its predicted asymptotic form.
Introduction.—
Many supervised learning problems in the natural sciences can be formulated as having set valued inputs (sets of images, pieces of text, immune repertoire sequences) where the labels are determined by a small fraction, or even a single element in the set. For example, the strongest binding antibody sequence or image containing an object of interest. These are examples of Multiple Instance Learning (MIL) [1–5]. In the MIL literature, the sets are called bags and the elements of the bags are called instances. A label is assigned at the bag level by pooling over latent instance-level labels or scores [1, 6, 7]. Learning in MIL problems is challenging because the instance level labels are unobserved and the mapping from instance level to bag level labels is typically highly nonlinear.
We consider real valued bags, represented as matrixes whose rows are the instances, and take the true labels to be generated via
Figure 1 depicts an example. We assume that some bags are “positive,” meaning they contain the target direction in feature space, while others are sampled from a background distribution. In applications, such instances might correspond to a nondiagnostic tissue patch or a molecular conformation that does not mediate binding. To learn , the max is approximated with a softmax whose sharpness, is itself learnable. When does gradient descent actually recover ?
Using the REM correspondence of [8, 9], we obtain a low-dimensional description of the gradient descent dynamics as . This dynamics exhibits two phase transitions: One is a freezing transition inherited from the REM and the other is a retrieval transition arising from competition between the growth of the softmax weight on the planted instance in positive bags and the sum over the other weights.
As a result of these phase transitions the gradient dynamics become insensitive to the angle between the learned direction and until the dynamics enters the retrieval phase. Separately, the gradient of vanishes upon reaching the low-temperature branch of the REM transition. We show numerically both that this phase diagram of the limit system accurately predicts key attributes of the finite-size training trajectories and that the finite- training gradient itself converges to the asymptotic gradient-flow field we derive (Supplemental Material, Sec. S6).
Related work.—MIL was formalized by Dietterich et al. [1] and Maron and Lozano-Pérez presented a general framework built on the notion of a hidden concept point [6, 7]. Early algorithmic approaches include diverse-density/EM-DD [10], MI-SVM [11], and multi-instance kernels [12]. Theoretical results for learnability of classification MIL problems have been studied in [13–15]. We study multiple-instance regression specifically, which was studied beginning with Ray and Page [16] and Wagstaff and Lane [17] and subsequently extended in [18–21]. Softmax-smoothed pooling with a learnable temperature was introduced in [22] and applied to immune repertoire classification in [23]. Softmax pooling is also at the core of self-attention layers in transformers [24] and of modern Hopfield networks [25, 26]. The storage capacity for continuous pattern retrieval in Hopfield networks was analyzed via a random-energy-model (REM) correspondence by Lucibello and Mézard [8], building on the classical REM [9, 27, 28] and its sum-of-exponentials limit the-
Standard
supervised learning
Multiple
instance learning

FIG. 1. Standard supervised learning maps each feature vector to a label . In MIL, bags of instances are mapped to a single label produced by an unobserved selection rule (e.g. the max). The goal is to learn from pairs alone without ever observing which instance determined the label.
orems [29]. Supplemental Material Sec. S4 makes the correspondence between our retrieval transition and pattern retrieval in these models precise. See also [30] for a general mathematical treatment of attention.
Data generating process.—We consider a dataset with and given by Eq. (1). The background population is modeled iid Gaussian, . For a fraction of bags, one instance is of is then planted in the bags. It will be useful to separate the direction of the learned regression vector from its norm; thus, we write and the learned regression vector as with .
Motivated by real MIL data sets where there can be hundreds of thousands of instances per bag, we will take the large limit. The dimension is often controlled by the model architecture; specifically, how the raw data such as image patches or sequences are embedded as real vectors. For iid Gaussian instances, this embedding dimension must scale with the bag size for the to be learnable, and the scaling is dictated by the order of the extremes, since this competes with the planted instances. A basic result in the theory of extremal statistics states that for iid standard Gaussian , almost surely [31, Lemma 9.1.1]. In our notation, , motivating us to define , so that
The positive bags are identifiable (i.e. the planted instance realizes the true maximum) only when . We work in this identifiable regime
(a)
(b)

FIG. 2. Training loss against epoch, for gradient descent from a grid of initial overlaps (colorbar) at two bag sizes. (a) , and (b) , . Parameters are , , , , , with learning rate 0.1.
throughout thereby isolating questions about what happens during gradient descent.
Training.—The is the central obstruction to fitting by gradient descent is the max and it is handled in one of two ways in practice. Classical MIL algorithms treat the label-determining instance as a latent variable and estimate it and jointly with an EM-type procedure, such as EM-DD [10]. However modern attention-based architectures instead use gradient descent and jointly learn the direction and temperature [22, 23]. We therefore find it natural to ask:
How does gradient decent breakdown as the bag size and embedding dimension grow?
We will write the learned parameter as , with constrained to the sphere , and fit using the smooth approximation
with the row-wise softmax, , and a learnable inverse temperature. This interpolates between the hard max and a unweighted average as tends towards and 0 respectively. Gradient descent is then performed jointly in , , and , on the loss
where is the average over bags. Evaluating the softmax on the normalized scores ensures that measures the softmax sharpness independently of the learned scale . We define as the normalized overlap between the learned and true directions.
Figure 2 illustrates that, as expected, the loss stalls as d is increased with fixed . Moreover, depending on the initial overlap u, the trajectories have a qualitatively different convergence pattern, the signature of which is seen at smaller and .
Loss asymptotics.—We now derive the limit of the normalized loss with fixed . The normalization is motivated by the fact that all asymptotic of scale with , thus , as will be made clear from the calculations below. Our asymptotic are based on a replacement of and with their almost sure limits. This approach allows us to explain some of the key phenomena exhibited by the trajectories in spite of the fact that (1) the convergences breaks down at both phase transitions and (2) the convergence rate of makes it difficult to realize the limit numerically. We discuss this limitations and the precise nature of the convergence in the SI.
Since depends on only through , we write it as , and split it according to whether the bag contains the planted instance,
To evaluate we need the large- limit of on a positive bag, at overlap with the planted pattern. Without loss of generality, let the first instance be the planted one, . The softmax weight of the planted instance is
using . Eq. (6) shows that the behavior is governed by the competition between the growth of and the planted instance's weight, . To this end, we define
Following [8], can be computed exactly based on a mapping to the Random Energy Model (REM), a model of an equilibrium system so disordered that the energies can be treated as independent random variables. The energies are modeled as iid Gaussian random variables, giving rise to a sum over log-normal random variables, exactly as in (since the planted term has been removed). is thus the scaled free energy of the REM. This free energy is known to exhibit a freezing transition between a regime where and one where the sum is dominated by the extremal terms.
Specifically, it can be shown that (see Supplemental Material Sec. S2)
(H),
(L),
(8)
where is the critical inverse temperature and and refer respectively to the high and low temperature phases.
| Phase | ||||
|---|---|---|---|---|
| HR | ||||
| LR | ||||
| HN | ||||
| LN | ||||
| Exact |
TABLE I. Asymptotic normalized bag output in each of the four phases (H/L × R/N), the corresponding large- limit of the target , which is set by the true generative process alone and so is identical across all four phases, and the resulting per-bag-type residuals . The color of the cells is used to highlight which quantities are the same.
Comparing Eq. (7) to (the exponent of the planted instance) yields two phases for the limiting softmax weight corresponded to the retrieval and non-retrieval phase in [8]
(R),
(N),
where R and N denote the retrieval and non-retrieval phases. In the retrieval phase, all the softmax weight is on the planted instance, so . In the non-retrieval phase, the high-temperature branch instead behaves like an ordinary Gaussian average; using standard Gaussian integrals, we have
The low-temperature branch is instead dominated by the single largest term, which we have already argued grows as , giving . Negative bags contain no planted instance and therefore admit only the two non-retrieval forms. Writing for the resulting positive/negative-bag output, the H/L and R/N transitions are independent and combine into the four phases of Table I. In each phase, the conditional loss can be written as the square of a corresponding residual, .
Gradient flow ODEs.—The continuous gradient flow is
where projects onto the tangent space of the sphere at . Using that is self-adjoint,
depends on only through , so . Using then gives .
For the partial derivatives of are approximated as
with the residual from Table I relevant to that phase and bag type, resulting in a system of piecewise smooth ODEs. The complete set of equations are given in Supplemental Material Sec. S2.
We now consider the fate of a trajectory beginning in the H phase. For a trajectory initially in the HN phase, , resulting in a two-dimensional system for and :
and . Note that since , is conserved along trajectories. The positive fixed points are the hyperbola
restricted to the HN region. If , the trajectory equilibrates in HN with still fixed at its initial value. If , it reaches the temperature boundary first and enters LN, where .
If the trajectory starts in HR instead, all three variables evolve:
For an interior fixed point, the two residuals must vanish:
Thus the HR fixed set is the curve , , restricted to the part lying inside HR.
Numerical results.— This analysis suggests that as the gradient flow exhibits two qualitatively distinct failure modes depending on whether they begin in the R vs N phase. Figure 2 illustrates that this behavior by plotting the loss as a function of time (the epoch) gradient descent for different . In this numerical experiments, we are able to see the phase transition is present even at moderate size. In particular, in panel (a) where , it is see that trajectories exhibit qualitatively distinct dynamics depending on whether they begin in R or N phase. In panel (b) is increased and our simulations also show that for fixed the loss plateaus for all initial , consistent with the theory.
To further illustrate that the limit ODEs indeed capture the dynamics of gradient descent for a trajectory beginning in H, we show the trajectories themselves in Figure 3 in the -u and - planes. The invariant manifolds from Eqs. 15 and 19 are shown as dashed lines. As predicted by our theory, as d grows, we can clearly see the transition between the HN and HR initial conditions. Surprisingly, even though the limit ODEs are a

FIG. 3. Gradient-descent trajectories with different (colorbar). The top row shows the dynamics in space with the H/L and R/N phase boundaries shown. The bottom panels show trajectories in space, with the H/L boundary shows. The dashed lines denote the invariant manifold defined by Eqs. 15 and 19. Parameters are , , , , , run to flow time (learning rate 0.1).
crude approximation, the fixed lines appear to explain much of the variation in the long-time behavior for the trajectories beginning in HN.
In the SI, we show that away from the phase transition, the error in the ODEs scales as ; however, the pre-factor diverges as we approach the phase transition. As more direct comparisons of the asymptotic theory to the gradient itself, we have shown the initial gradient as a function u in Figure 4. In this figure, we can see that the limit ODEs predict the gradients with respect to and u (away from the phase boundary). The gradient with respect to is qualitatively similar, being a step function (away from the phase boundary).
Discussion.—We have studied learning dynamics in a minimal model of multiple instance learning, where there is an extremal selection rule for a planted instance. This problem is meant to exemplify the challenges of applying gradient descent to models where the strength of the nonlinearity (the temperature) is learned, and learning naturally happens into regimes of vanishing gradients. Using tools from disordered systems – namely the random energy model – and applying previous results on Hopfield networks, we have derived limiting ODEs for the low dimensional dynamics of the temperature and

FIG. 4. Convergence of the finite-size training gradient to the asymptotic gradient-flow field. Empirical compared to the theory (dashed line). Parameters are , , , , . The vertical line marks .
regression coefficients. Our analysis, which accurately predicts numerical experiments with Gaussian data, suggests that one expects to find abrupt transitions in the speed of learning for this system depending on the misalignment of the initial regression coefficients. This suggests it would be worthwhile exploring other methods besides gradient descent for more efficiently tuning the regression coefficients during the early stages of learning. For example, coupling gradient descent with EM-based approaches [21].
Code availability.— The code is available at https://github.com/elevien/extremal-mil.
E.L. and T.G. acknowledge support from the National Institute for Theory and Mathematics in Biology through the National Science Foundation (grant number DMS-2235451) and the Simons Foundation (grant number MP-TMPS-00005320). E.L. acknowledges support from the National Science Foundation (grant number DMS-2527337) and a Dartmouth College Burke Research Initiation Award.
[1] T. G. Dietterich, R. H. Lathrop, and T. Lozano-Pérez, Artificial Intelligence 89, 31 (1997).
[2] M.-A. Carbonneau, V. Cheplygina, E. Granger, and G. Gagnon, Pattern Recognition 77, 329 (2018).
[3] A. N. Jain, K. Koile, and D. Chapman, Journal of Medicinal Chemistry 37, 2315 (1994).
[4] G. Sliwoski, S. Kothiwale, J. Meiler, and E. W. Lowe Jr, Pharmacological Reviews 66, 334 (2014).
[5] D. Zankov, T. Madzhidov, A. Varnek, and P. Polishchuk, Wiley Interdisciplinary Reviews: Computational Molecular Science 14, e1698 (2024).
[6] O. Maron and T. Lozano-Pérez, in Advances in Neural Information Processing Systems, Vol. 10 (MIT Press,
1998).
[7] O. Maron, in Advances in Neural Information Processing Systems, Vol. 11 (1998).
[8] C. Lucibello and M. Mézard, Physical Review Letters 132, 077301 (2024).
[9] M. Mezard and A. Montanari, Information, Physics, and Computation (Oxford University Press, 2009).
[10] Q. Zhang and S. A. Goldman, in Advances in Neural Information Processing Systems, Vol. 15 (MIT Press, 2002).
[11] S. Andrews, I. Tsochantaridis, and T. Hofmann, in Advances in Neural Information Processing Systems, Vol. 15 (2002) pp. 561–568.
[12] T. Gärtner, P. A. Flach, A. Kowalczyk, and A. J. Smola, in Proceedings of the Nineteenth International Conference on Machine Learning (2002) pp. 179–186.
[13] D. I. Diochnos, R. H. Sloan, and G. Turán, Information Processing Letters 112, 933 (2012).
[14] G. Doran and S. Ray, Journal of Machine Learning Research 17, 1 (2016).
[15] Z. Szabó, A. Gretton, B. Póczos, and B. Sriperumbudur, in Artificial Intelligence and Statistics (PMLR, 2015) pp. 948–957.
[16] S. Ray and D. Page, in Proceedings of the International Conference on Machine Learning (ICML) (2001) pp. 425–432.
[17] K. L. Wagstaff and T. Lane, Proc. of International Conference on Machine Learning (ICML) Workshop (2007).
[18] D. R. Dooly, Q. Zhang, S. A. Goldman, and R. A. Amar, Journal of Machine Learning Research 3, 651 (2002).
[19] D. R. Dooly, S. A. Goldman, and S. S. Kwek, Journal of Computer and System Sciences 72, 1 (2006).
[20] K. Chauhan, R. Saket, L. Applebaum, A. Badanidiyuru, C. Giri, and A. Raghuveer, in Proceedings of Uncertainty in Artificial Intelligence (UAI) (2024).
[21] E. Levien, arXiv preprint arXiv:2607.17404 (2026).
[22] M. Ilse, J. M. Tomczak, and M. Welling, in Proceedings of the 35th International Conference on Machine Learning (PMLR, 2018) pp. 2127–2136.
[23] M. Widrich, B. Schäfl, M. Pavlović, H. Ramsauer, L. Gruber, M. Holzleitner, J. Brandstetter, G. K. Sandve, V. Greiff, S. Hochreiter, and G. Klambauer, in Advances in Neural Information Processing Systems, Vol. 33 (2020) pp. 18832–18845.
[24] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. Kaiser, and I. Polosukhin, in Advances in Neural Information Processing Systems, Vol. 30 (Curran Associates, Inc., 2017).
[25] H. Ramsauer, B. Schäfl, J. Lehner, P. Seidl, M. Widrich, T. Adler, L. Gruber, M. Holzleitner, M. Pavlović, G. K. Sandve, et al., arXiv preprint arXiv:2008.02217 (2020).
[26] J. J. Hopfield, Proceedings of the National Academy of Sciences 79, 2554 (1982).
[27] B. Derrida, Physical Review Letters 45, 79 (1980).
[28] B. Derrida, Physical Review B 24, 2613 (1981).
[29] G. Ben Arous, L. V. Bogachev, and S. A. Molchanov, Probability Theory and Related Fields 132, 579 (2005).
[30] J. Vuckovic, A. Baratin, and R. Tachet des Combes, arXiv preprint arXiv:2007.02876 (2020).
[31] A. Bovier, Statistical mechanics of disordered systems: a mathematical perspective, Vol. 18 (Cambridge University Press, 2006).
[32] M. R. Leadbetter, G. Lindgren, and H. Rootzén, Extremes and Related Properties of Random Sequences and Processes (Springer, New York, 1983).
[33] D. Soudry, E. Hoffer, M. S. Nacson, S. Gunasekar, and N. Srebro, Journal of Machine Learning Research 19, 1 (2018), arXiv:1710.10345.
Supplemental Material
S2. Gradient Flow Equations 9
A. Setup and normalization 9
- True output second moment 9
- Model output 9
- Cross term 11
- Phase table 11
B. Gradient flow 11
S3. Robustness to noise in labeling and selection 12
S4. Connection to pattern retrieval in associative memory 13
S5. Extension to a classification loss 13
A. The logistic (cross-entropy) case 14
S6. Numerical tests of the gradient-flow limit 14
S7. LLM disclosure 14
S1. BACKGROUND: REM AND EVT
In this section we present background on the Random Energy Model and extremal value statistics.
A. Extreme value statistics
Let be i.i.d. Normal and let . A classical result of extreme value statistics is the following [32].
Theorem 1 (Almost sure growth of the maximum). As ,
The generalized extreme value theorem (Fisher–Tippett–Gnedenko) describes the fluctuations around it [32].
Theorem 2 (Generalized extreme value theorem). As ,
where
That is, converges to a Gumbel random variable.
The fluctuations of have width , which is small compared to the location . However, the residual , so the approach to the almost sure limit of Theorem 1 is slow. In our setting and the variance grows with . Writing the scores as times standard normals and applying the theorems with gives with Gumbel fluctuations of order one and a relative correction of order .
B. The random energy model
Random energy models (REM) [27, 28] are toy models of highly disordered systems – ones where the energy landscape has many local minima. To study generic properties of such systems, the idea is to randomly sample the energies. This so-called quenched disorder in the energy landscape is another level of randomness on top of the statistical ensemble itself. These two forms of randomness correspond to the distribution of bags and the within-bag distribution, respectively.
We consider the simplest REM, where the energies are iid Normal. The partition function for this model takes the form
This model has the free energy [27]
with . The transition at separates a high-temperature (H) phase in which the sum is dominated by the exponentially many configurations, from a low-temperature phase (L) in which it is dominated by the single lowest-energy configuration.
One can derive the transition in Eq. (S5) as the point where the average of grows as fast as the maximum weight. By Theorem 1, , so this happens when
that is, when .
Another important quantity in REM theory, which appears in our analysis below, is the replica overlap. Let be the Gibbs weights of , and define the overlap
is the probability that two independent draws from the Gibbs weights pick the same configuration, i.e. the mass at 1 of the replica overlap distribution. It is useful that the derivative of with respect to the inverse temperature is related to the overlap by the following Lemma, Gaussian integration by parts.
Lemma 1 ([31, Proposition 9.5.1]). For every N and ,
The limit of the overlap is known for the REM.
Theorem 3.
C. Weak self-averaging transition
Subsequent work [29] describes the limiting law of in more detail. This is closely related to, and in fact can be viewed as a special case of, classical limit theorems for triangular arrays. The limit laws of such sums are -stable distributions. The simplest case is that of a power-law sum, where the generalized central limit theorem describes two transitions: one where the CLT breaks down but the LLN still holds and the fluctuations scale as , and one where the LLN breaks down, which corresponds to the freezing transition in the REM. The second phase transition is derived by comparing the growth of the second moment to the growth of the max. The sum of the second moments of the weights grows as
while the square of the maximum weight grows as . These rates coincide when .
S2. GRADIENT FLOW EQUATIONS
A. Setup and normalization
Recall that we represent a bag as a matrix and sample the entries from iid standard normal and then replacing a row with with probability , yielding a “positive” bag. We fix without loss of generality, where is the first coordinate vector, and parameterize the learned direction as , with , , and . The loss
We consider each of the terms , and .
1. True output second moment
By Theorem 2, the max over background instances has the limit
where G is a standard Gumbel random variable defined by Theorem 2.
In the identifiable regime , Eq. (S12) gives
in probability, so the planted instance realizes the maximum of a positive bag with probability tending to one. Hence on positive bags and on negative bags. We write to indicate the expectation over positive (respectively negative) bags.
We then have
where is the Euler–Mascheroni constant, which comes from a standard result about the Gumbel distribution.
2. Model output
Following the main text, we define the auxiliary partition function
where on a positive bag is the planted instance. Using , the softmax weight on the planted instance is
The model output is then
On negative bags, is a background instance and the output is
The limiting behavior comes from mapping to . Matching the number of terms, , and the exponents, in distribution, gives the correspondence to the REM in Table S1.
| REM | MIL Model | |
|---|---|---|
| System size | ||
| Number of terms | ||
| Exponents | ||
| Inverse temperature | ||
| Freezing transition | ||
| CLT transition | ||
| Partition function |
TABLE S1. Correspondence between the REM of Sec. S1 B and the off-target partition function . The sign of the exponents is immaterial because their distribution is symmetric.
With the softmax weights of the off-target instances, Lemma 1 under this correspondence gives
where the limit follows from Theorem 3. For the softmax average is spread over exponentially many instances, and the fluctuations of are exponentially small. Note that this holds on both sides of the second transition at , which changes the fluctuations of but not those of the output.
For , is dominated by a few instances near the maximum, and the finer expansion is
where the term is the Poisson–Dirichlet average of the gaps below the maximum [31, Ch. 9].
On positive bags, it remains to determine the limit of . This is set by the growth rate of . Under the correspondence of Table S1, the REM free energy Eq. (S5) gives
Comparing to the exponent of the planted instance gives
Hence is exponentially small in the R phase and is exponentially small in the N phase. As we then have
3. Cross term
On positive bags , so
On negative bags and both have fluctuations of order , so their covariance is and
4. Phase table
Splitting the loss by bag type,
and
Writing on positive and negative bags, the conditional losses therefore converge to squared residuals,
where and are the limits of on positive and negative bags. The output limits are in H and in L. On positive bags, in R, and in N it equals . Combining the H/L criterion with the R/N criterion of Eq. (S22) gives the four phases of Table I in the main text.
B. Gradient flow
The continuous gradient flow is with the tangent projection onto . Since depends on only through , and using gives . For ,
where are the residuals in the row of Table I for the current phase. Explicitly, in each phase:
HR (high temperature, retrieval).
The marked instance already dominates the softmax on positive bags, so is independent of and is driven purely by the negative-bag mismatch .
LR (low temperature, retrieval).
Once the softmax on negative bags has also collapsed onto its single largest instance, no longer depends on , so there is no gradient signal left to move the temperature: identically. This is the freezing mechanism behind the main text's account of how evolves.
HN (high temperature, non-retrieval).
Neither bag type has selected out a single instance, so is independent of and the overlap is completely frozen. Since and with the same proportionality factor, is conserved, so moves along a hyperbola toward the point where the bracketed residual vanishes.
LN (low temperature, non-retrieval).
Both and are frozen; only evolves, adjusting to bring the predicted extremal scale into agreement with the true extremal statistics on both bag types.
S3. ROBUSTNESS TO NOISE IN LABELING AND SELECTION
We address the question of whether the results are sensitive noise. Noise can be added before and after labeling, hence we consider
where is instance-level noise and is independent bag-level noise. The scalings are so that the noise is comparable to the background-score and bag-label scales noise will vanish in our asymptotics. Since neither noise effects the learned model , the retrieval and H/L boundaries and the outputs in Table I are unchanged and only the target residuals can change. This reduces the calculation to finding the two noisy limits of .
For , averaging over the bag level noise gives
Here denotes the noise-free loss for which the large-d limit is the corresponding entry of Table I. The cross-term vanishes because is mean zero and independent of both the label and the prediction. Therefore, post-max noise raises the population loss by a constant, leaving the gradient flow unchanged.
Now consider the opposite limit by setting and define
On a negative bag the independent signal and noise variances add, so the scores are i.i.d. Normal . Therefore
On a positive bag, the label of the planted instance is , where has fluctuations of order , and hence . It competes with an instance background maximum having the same limit as above. Assuming the identifiability condition , the marked instance remains identifiable when
Above this threshold, positive and negative labels have the same leading-order limit, so the labels no longer identify the planted instance. We restrict the following statements to the identifiable regime below the threshold. There the positive-bag target remains , while . Hence only the negative-bag residual in Table I changes:
Replacing by these expressions in Sec. S2B gives the complete noisy flow. In particular, the phase boundaries, in HN/LN, and in LR/LN are unchanged: these properties follow from the pooled prediction, whose dependence on is unaffected by the noisy targets.
Conditioning on the pre-max noise does not effect the argument leading to Eq. (S43). Therefore, the effects simply add and instance level noise noise makes the substitutions in Eq. (S47), while independent mean-zero post-max noise contributes only the constant to the loss.
S4. CONNECTION TO PATTERN RETRIEVAL IN ASSOCIATIVE MEMORY
The connection to modern Hopfield networks is the common softmax competition between one distinguished pattern and exponentially many background patterns. We write the associative-memory problem in the notation of the MIL model. The instances of a bag play the role of stored patterns, the query plays the role of the network state, and is the inverse temperature. The continuous Hopfield energy is
A unit gradient-descent step gives the vector-valued attention readout
Associative-memory retrieval means that iterating this map from a state near converges to a fixed point exponentially close to that stored pattern [8, 25].
The MIL predictor uses these attention weights but has a scalar output. The definition in main-text Eq. (3) gives the identity
Our pooling operation is therefore a projection of the Hopfield readout onto the query. In a positive bag, the weight on the planted instance is set by a signal-versus-noise comparison that mirrors associative-memory retrieval. Its exponential weight competes with the REM partition function in Eq. (S16).
S5. EXTENSION TO A CLASSIFICATION LOSS
Here we show how the results generalize to a classification problem. Every quantity in Sec. S1 up through Eq. (S22) and Table I's column is a statement about the large-d limit of the pooled score alone – in particular, these results never reference the loss function. For any loss built from the normalized pooled score and a label , the chain rule gives
where is a scalar depending only on the loss and the label, and is the same architecture-determined Jacobian entry read off Table I in either case. The phase boundaries and parameter dependence of the pooled scores follow entirely from the three asymptotic forms , , and . Thus, any loss built from the same pooled score inherits the same four phases: is frozen in the non-retrieval phases HN and LN, while is frozen in the low-temperature phases LR and LN because the pooled scores are independent of . The choice of loss affects only the residuals driving the flow, and hence the fixed points within each phase.
A. The logistic (cross-entropy) case
Concretely, take the label (the same containment event that already defines positive/negative bags), model with the logistic sigmoid and a fixed threshold, and minimize the cross-entropy . The standard fact gives
in place of the regression problem's linear residuals . We now substitute these residuals into Eq. (S51) phase by phase.
HN and LN. The fixed point remains closed form: in HN and in LN, provided . Otherwise, the flow runs to the boundary. The conserved hyperbola of the HN phase is unchanged.
LR. The residual is strictly positive, so throughout the phase and runs to the boundary rather than to an interior overlap. The stationarity condition for , , is transcendental because the residuals are now sigmoidal in the score.
HR. In HR, the cross-entropy gradient gives
so decreases. However, the trajectory cannot remain in the retrieval phase as , because diverges while retrieval requires . The trajectory therefore crosses the retrieval boundary at
and enters HN, provided remains positive. The absence of a finite optimum is familiar from cross-entropy on separable data [33]. The consequence for the dynamics is specific, however: the route through HR into LR by which the regression flow reaches is closed.
Under cross-entropy, the four phases and the freezing of outside retrieval and of in the low-temperature phases remain unchanged. However, the tuning of to is lost. In the regression problem, the target contains the extremal scale , which drives upward through HR. A binary label contains no corresponding scale, so instead decreases in HR and the flow approaches fixed points determined by the classification threshold , rather than by .
S6. NUMERICAL TESTS OF THE GRADIENT-FLOW LIMIT
The figures below compare the finite-size empirical gradient against the asymptotic field of Eq. (S29), with the residuals of Table I. The gradient is evaluated at a point in , so this doesn't incorporate any accumulated bias of the learned parameters, which can in principle lead to higher dimensional dynamics in the limit.
Figure S1 sweeps the overlap at , , and . Row (a) varies at , with , 150 and 75 so that throughout. Row (b) fixes and varies the initial temperature. in row (b), so and 0.2 lie in the high-temperature phase and in the low-temperature phase, where have no dependence and the asymptotic is identically zero. The retrieval threshold is , 0.292 and 0.264 respectively.
The other sweep is over . Over a fixed stays in throughout only if , and in throughout only if . The two panels take and .
S7. LLM DISCLOSURE
Anthropic’s Claude models (Claude Opus 5, Opus 5.5, Sonnet 5 and Fable 5), accessed through the Claude Code agent, were used for coding, for mathematical derivations, and assisting in writing the text. Substantial edits to the text (anything beyond formatting and grammar) and the generation of large sections of code were managed with git. In particular, we posted a issues on GitHub describing the required change and prompted Claude Code to address them in pull requests which we reviewed. This workflow allowed us to track and review all substantial LLM-generated material.
(a)

--- theory
…… u*
(b)

--- theory
…… u*
FIG. S1. Empirical (solid) and the asymptotic prediction (dashed, same color) against the overlap , at , , , and throughout. (a) Three values of at , with , 150 and 75. (b) Three initial temperatures at and . Dotted vertical lines mark .

-- gradient flow (theory)
FIG. S2. against at fixed overlap, for increasing (with ), and the asymptotic prediction (dashed). Parameters are , , , , . Left: , in N throughout. Right: , in R throughout. The vertical line is .

FIG. S3. Error in the initial vs. , for and , at , , , , , . runs from 22 to 270 ( to ), marked on the top axis. Grey points are individual datasets, black their mean with the standard error: eight datasets per up to , four above. Dashed line: through the origin and the smallest- point.