From Perturbation Correction to Geometry-Aware Sampling: Sharpness-Guided Equilibrium Sampling for Balanced Flat Minima in Long-Tailed Learning

arXiv cs.LG Papers

Summary

Introduces Sharpness-Guided Equilibrium Sampling (SGS) that dynamically adjusts sampling probabilities using sharpness estimates to achieve balanced flat minima in long-tailed learning, achieving significant gains on CIFAR-100 LT and ImageNet-LT.

arXiv:2607.21999v1 Announce Type: new Abstract: Long-tailed learning couples two sources of poor generalization: head classes dominate training exposure, while under-represented classes often converge to sharper regions of the loss landscape. Conventional re-sampling addresses the former without considering geometry, whereas existing long-tailed sharpness-aware minimization (SAM) methods modify losses or perturbations only after biased mini-batches have been drawn. We introduce Sharpness-Guided Equilibrium Sampling (SGS), which treats the sampling distribution as an active control variable for optimization geometry. SGS dynamically adjusts subsequent mini-batches by increasing the sampling probability of less frequently sampled classes while suppressing classes with large SAM-induced loss changes, using only cumulative class counts and EMA sharpness estimates obtained from the standard SAM update, without class-wise perturbations or additional backward passes. We characterize this sampling process through a continuous-time stochastic differential equation and a sampling-dependent PAC-Bayes analysis, explaining how frequency-sharpness feedback can move training toward a more balanced flatness profile. On CIFAR-100 LT with an imbalance ratio of 100, SGS-SAM improves Focal-SAM by 10.85 points in tail accuracy and 3.56 points overall. On ImageNet-LT, it improves ImbSAM by 6.59 points on tail classes and 1.20 points overall. Its training time is only $1.02\times$ that of vanilla SAM. Beyond these gains, SGS establishes a sampling-side route to loss-landscape control, suggesting that future long-tailed methods can jointly regulate data exposure and optimization geometry rather than treating either as fixed.
Original Article
View Cached Full Text

Cached at: 07/27/26, 07:43 AM

# From Perturbation Correction to Geometry-Aware Sampling: Sharpness-Guided Equilibrium Sampling for Balanced Flat Minima in Long-Tailed Learning
Source: [https://arxiv.org/html/2607.21999](https://arxiv.org/html/2607.21999)
###### Abstract

Long\-tailed learning couples two sources of poor generalization: head classes dominate training exposure, while under\-represented classes often converge to sharper regions of the loss landscape\. Conventional re\-sampling addresses the former without considering geometry, whereas existing long\-tailed sharpness\-aware minimization \(SAM\) methods modify losses or perturbations only after biased mini\-batches have been drawn\. We introduce Sharpness\-Guided Equilibrium Sampling \(SGS\), which treats the sampling distribution as an active control variable for optimization geometry\. SGS dynamically adjusts subsequent mini\-batches by increasing the sampling probability of less frequently sampled classes while suppressing classes with large SAM\-induced loss changes, using only cumulative class counts and EMA sharpness estimates obtained from the standard SAM update, without class\-wise perturbations or additional backward passes\. We characterize this sampling process through a continuous\-time stochastic differential equation and a sampling\-dependent PAC\-Bayes analysis, explaining how frequency\-sharpness feedback can move training toward a more balanced flatness profile\. On CIFAR\-100 LT with an imbalance ratio of 100, SGS\-SAM improves Focal\-SAM by 10\.85 points in tail accuracy and 3\.56 points overall\. On ImageNet\-LT, it improves ImbSAM by 6\.59 points on tail classes and 1\.20 points overall\. Its training time is only1\.02×1\.02\\timesthat of vanilla SAM\. Beyond these gains, SGS establishes a sampling\-side route to loss\-landscape control, suggesting that future long\-tailed methods can jointly regulate data exposure and optimization geometry rather than treating either as fixed\.

## Introduction

Deep neural networks have achieved remarkable success in visual recognition tasks such as image classification\(Wanget al\.[2023a](https://arxiv.org/html/2607.21999#bib.bib14)\)and object detection\(Wanget al\.[2024](https://arxiv.org/html/2607.21999#bib.bib15)\)\. However, their performance often relies on balanced and well\-curated training data, whereas real\-world visual data commonly follows a long\-tailed distribution, with a few head classes containing abundant samples and many tail classes being severely underrepresented\. Training with standard empirical risk minimization on such imbalanced data can bias the model toward head classes and degrade overall generalization\(Caoet al\.[2019](https://arxiv.org/html/2607.21999#bib.bib21)\)\. To address this issue, existing methods mainly focus on re\-sampling\(Budaet al\.[2018](https://arxiv.org/html/2607.21999#bib.bib17)\), re\-balancing\(Wanget al\.[2023b](https://arxiv.org/html/2607.21999#bib.bib18); Liet al\.[2025](https://arxiv.org/html/2607.21999#bib.bib16)\), robust representation learning\(Cuiet al\.[2023](https://arxiv.org/html/2607.21999#bib.bib19)\), and foundation\-model fine\-tuning\(Shiet al\.[2024](https://arxiv.org/html/2607.21999#bib.bib20)\)\.

Existing approaches address different parts of this problem\. Re\-sampling and class\-prior correction improve tail exposure, but they are geometry\-agnostic: oversampling can repeatedly reuse scarce tail examples and amplify gradient variance, whereas undersampling discards informative head data\(Budaet al\.[2018](https://arxiv.org/html/2607.21999#bib.bib17)\)\. Sharpness\-Aware Minimization \(SAM\)\(Foretet al\.[2021](https://arxiv.org/html/2607.21999#bib.bib22)\)and its long\-tailed variants, including ImbSAM\(Zhouet al\.[2023a](https://arxiv.org/html/2607.21999#bib.bib23)\), CC\-SAM\(Zhouet al\.[2023b](https://arxiv.org/html/2607.21999#bib.bib24)\), and Focal\-SAM\(Liet al\.[2025](https://arxiv.org/html/2607.21999#bib.bib16)\), instead regulate optimization geometry through class\-dependent perturbations or penalties\. However, these corrections are applied after a biased mini\-batch has been drawn\. The original long\-tailed distribution therefore continues to decide which classes and geometric regions dominate training\. This separation leaves a central question unanswered: can data exposure and optimization geometry be controlled jointly through the sampler itself?

We answer this question with Sharpness\-Guided Equilibrium Sampling \(SGS\), which shifts geometry control from post\-sampling perturbation correction to mini\-batch construction\. SGS reuses the perturbed loss gap already produced by standard SAM as an efficient sharpness signal\. After each update, SGS records the cumulative exposure and EMA sharpness of each class, uses these statistics to recompute the sampling probabilities, and constructs the next mini\-batches accordingly\. Under\-sampled classes receive more optimization opportunities, whereas classes with large perturbation responses are temporarily down\-weighted to avoid repeatedly emphasizing unstable regions\. The resulting mini\-batches update the model and produce new frequency and sharpness statistics, which are then used for the next sampling decision\. Thus, the sampling distribution evolves jointly with the model rather than remaining fixed throughout optimization, without requiring class\-wise perturbations or additional backward passes\.

We characterize this adaptive sampling process through continuous\-time stochastic dynamics and a sampling\-dependent PAC\-Bayes analysis\. The stochastic view separates the deterministic competition induced by class frequency and sharpness from the fluctuations caused by mini\-batch sampling\. The PAC\-Bayes analysis further identifies conditions under which the resulting distribution improves class balance and yields a tighter generalization bound than ordinary long\-tailed SAM\. Experiments on CIFAR\-LT and ImageNet\-LT show consistent improvements for medium and tail classes under severe imbalance, while experiments with foundation\-model fine\-tuning demonstrate the applicability of SGS to a different adaptation pipeline\. Importantly, SGS preserves the standard SAM optimization procedure and introduces only lightweight class\-statistic and sampling\-probability updates, resulting in nearly the same training cost as vanilla SAM\. Our contributions are

- •We propose SGS, a geometry\-aware sampling method that uses the cumulative exposure and SAM\-induced loss response of each class to update future mini\-batch composition\. SGS reallocates optimization opportunities before parameter updates without class\-wise perturbations or additional backward passes\.
- •We connect the discrete sampling process to continuous\-time stochastic dynamics and a sampling\-dependent PAC\-Bayes bound, explaining how frequency\-sharpness competition, mini\-batch noise, and adaptive class exposure jointly affect long\-tailed generalization\.
- •We validate SGS on CIFAR\-LT, ImageNet\-LT, and foundation\-model fine\-tuning\. SGS substantially improves medium\- and tail\-class performance under severe imbalance while retaining nearly the same training efficiency as vanilla SAM, with only approximately2%2\\%additional training time on CIFAR\-LT\.

## Related Works

### Long\-Tailed Learning

Long\-tailed learning has been widely studied to mitigate the bias induced by imbalanced class distributions\. Existing methods can be roughly divided into data re\-balancing, data augmentation, loss and logit adjustment, representation learning, decoupled training, and ensemble learning\. Data re\-balancing methods adjust the sampling frequency of different classes, while augmentation methods synthesize or enrich tail samples to alleviate data scarcity\(Kanget al\.[2019](https://arxiv.org/html/2607.21999#bib.bib25); Renet al\.[2020](https://arxiv.org/html/2607.21999#bib.bib26); Wanget al\.[2020](https://arxiv.org/html/2607.21999#bib.bib27)\)\. Loss and logit adjustment methods incorporate class priors into the training objective, such as margin\-based losses\(Caoet al\.[2019](https://arxiv.org/html/2607.21999#bib.bib21)\), balanced softmax\(Renet al\.[2020](https://arxiv.org/html/2607.21999#bib.bib26)\), and logit correction\(Menonet al\.[2020](https://arxiv.org/html/2607.21999#bib.bib28)\)\. Representation learning methods improve feature separability for tail classes through contrastive objectives\(Cuiet al\.[2021](https://arxiv.org/html/2607.21999#bib.bib32)\), prototypes\(Weiet al\.[2022](https://arxiv.org/html/2607.21999#bib.bib31)\), or feature augmentation\(Honget al\.[2022](https://arxiv.org/html/2607.21999#bib.bib33)\)\. Decoupled training methods separate representation learning from classifier calibration, showing that balanced classifier learning is crucial for long\-tailed recognition\(Zhonget al\.[2021](https://arxiv.org/html/2607.21999#bib.bib34)\)\.

Although these methods have achieved promising results, most of them are driven by class frequency or class priors\. Such quantity\-based correction is effective for reducing head\-class dominance, but it does not explicitly describe whether the sampled instances lie in sharp regions of the loss landscape\. SGES complements existing long\-tailed learning paradigms by connecting sampling control with local curvature, dynamically allocating optimization effort according to both class imbalance and sharpness information\.

### Sharpness\-Aware Minimization in Long\-Tailed Learning

SAM\(Foretet al\.[2021](https://arxiv.org/html/2607.21999#bib.bib22)\)improves generalization by seeking flat minima, which is particularly relevant in long\-tailed learning because rare and difficult classes often suffer from compressed decision regions and poor robustness\. Several long\-tailed SAM variants have therefore been proposed\. ImbSAM\(Zhouet al\.[2023a](https://arxiv.org/html/2607.21999#bib.bib23)\)adopts a coarse\-grained strategy by restricting SAM perturbations to tail classes\. While this partially protects the tail, it may sharpen the head\-class landscape and degrade overall performance when paired with standard rebalancing algorithms\. CC\-SAM\(Zhouet al\.[2023b](https://arxiv.org/html/2607.21999#bib.bib24)\)introduces class\-conditional perturbation radii for fine\-grained control, but it requires costly class\-wise perturbation computations\. Focal\-SAM\(Liet al\.[2025](https://arxiv.org/html/2607.21999#bib.bib16)\)improves the efficiency\-control trade\-off by applying focal\-like weights to class\-wise sharpness penalties, thereby strengthening tail\-class smoothness without the burden of extra class\-wise backpropagation\.

These methods provide important evidence that optimization geometry matters for long\-tailed recognition\. However, they mainly intervene after mini\-batches have been drawn, by changing perturbation directions, perturbation radii, or sharpness penalties\. In contrast, SGES shifts the control point from the loss/perturbation rule to the sampling distribution itself\. SGES reshapes the mini\-batch stream according to both frequency and curvature, without requiring class\-wise perturbations or additional backward passes\.

## Method

### Frequency and Sharpness Guided Sampling

LetNcN\_\{c\}be the number of training samples in classcc,N=∑j=1CNjN=\\sum\_\{j=1\}^\{C\}N\_\{j\}, andPcb​a​s​e=Nc/NP\_\{c\}^\{base\}=N\_\{c\}/Nbe the empirical class prior\. In long\-tailed training,Pcb​a​s​eP\_\{c\}^\{base\}makes head classes dominate both gradient updates and SAM perturbations\. SGS constructs a dynamic sampling distribution by combining frequency feedback and sharpness feedback\.

Frequency sampling indicator\.Letmc​\(t\)m\_\{c\}\(t\)denote the cumulative number of sampled instances from classccup to steptt\. We define the empirical sampling share aspc​\(t\)=mc​\(t\)/\(∑jmj​\(t\)\+ξ\)p\_\{c\}\(t\)=m\_\{c\}\(t\)/\(\\sum\_\{j\}m\_\{j\}\(t\)\+\\xi\), whereξ\>0\\xi\>0is a small constant introduced for numerical stability and to avoid division by zero\. A smallerpc​\(t\)p\_\{c\}\(t\)indicates that classcchas contributed less often to optimization updates\. We therefore define the inverse\-frequency indicator as follows:

wcf​r​e​q=1/\(pc​\(t\)\+ξ\),\\displaystyle w\_\{c\}^\{freq\}=1/\(p\_\{c\}\(t\)\+\\xi\),\(1\)which assigns larger scores to classes with small cumulative sampling shares\.

Sharpness proxy\.Direct Hessian estimation or class\-wise SAM perturbation is expensive\. SGS instead reuses the perturbation from the standard SAM step\. For instancexix\_\{i\}and model weightsww, we define:

Δ​Lxi=\|Lxi​\(w\+ϵ\)−Lxi​\(w\)\|\.\\displaystyle\\Delta L\_\{x\_\{i\}\}=\|L\_\{x\_\{i\}\}\(w\+\\epsilon\)\-L\_\{x\_\{i\}\}\(w\)\|\.\(2\)A largeΔ​Lxi\\Delta L\_\{x\_\{i\}\}indicates high sensitivity to the SAM adversarial direction\. A local Taylor expansion givesLxi​\(w\+ϵ\)−Lxi​\(w\)≈∇Lxi​\(w\)⊤​ϵ\+12​ϵ⊤​∇2Lxi​\(w\)​ϵL\_\{x\_\{i\}\}\(w\+\\epsilon\)\-L\_\{x\_\{i\}\}\(w\)\\approx\\nabla L\_\{x\_\{i\}\}\(w\)^\{\\top\}\\epsilon\+\\frac\{1\}\{2\}\\epsilon^\{\\top\}\\nabla^\{2\}L\_\{x\_\{i\}\}\(w\)\\epsilon, where the quadratic term captures directional curvature aroundww\. Thus,Δ​Lxi\\Delta L\_\{x\_\{i\}\}serves as an efficient update\-aware sharpness proxy\.

Sharpness sampling indicator\.Although tail classes require additional exposure, repeatedly sampling samples from sharp regions may amplify gradient noise and harm generalization\. Therefore, SGS uses the sharpness proxy in Eq\. \([2](https://arxiv.org/html/2607.21999#Sx3.E2)\) to construct a stable class\-level sharpness indicator\.

For a mini\-batchBBat steptt, letBcB\_\{c\}denote the samples of classcc\. When\|Bc\|\>0\|B\_\{c\}\|\>0, we compute the batch\-level class sharpness as

Δ​Lc=1\|Bc\|​∑xi∈BcΔ​Lxi\.\\Delta L\_\{c\}=\\frac\{1\}\{\|B\_\{c\}\|\}\\sum\_\{x\_\{i\}\\in B\_\{c\}\}\\Delta L\_\{x\_\{i\}\}\.\(3\)To reduce the stochasticity of mini\-batch estimates, we maintain an exponential moving average for each class:

hc\(t\)=\{β​hc\(t−1\)\+\(1−β\)​Δ​Lc,\|Bc\|\>0,hc\(t−1\),\|Bc\|=0,h\_\{c\}^\{\(t\)\}=\\begin\{cases\}\\beta h\_\{c\}^\{\(t\-1\)\}\+\(1\-\\beta\)\\Delta L\_\{c\},&\|B\_\{c\}\|\>0,\\\\ h\_\{c\}^\{\(t\-1\)\},&\|B\_\{c\}\|=0,\\end\{cases\}\(4\)whereβ=0\.9\\beta=0\.9or0\.990\.99\. The EMA reduces the noise caused by infrequent tail\-class observations\.

We then normalize the class\-wise estimates ash~c=hc/\(∑j=1Chj\+ξ\)\\tilde\{h\}\_\{c\}=\{h\_\{c\}\}/\(\{\\sum\_\{j=1\}^\{C\}h\_\{j\}\+\\xi\}\)and define the sharpness sampling weight by

wcsharp=1/\(h~cκ\+ξ\),w\_\{c\}^\{\\mathrm\{sharp\}\}=\{1\}/\(\{\\tilde\{h\}\_\{c\}^\{\\kappa\}\+\\xi\}\),\(5\)whereκ\>0\\kappa\>0controls the strength of sharpness feedback andξ\>0\\xi\>0avoids division by zero\. The inverse form assigns lower sampling weight to classes with larger perturbation responses, thereby preventing the sampler from over\-emphasizing sharp and unstable regions\.

Joint sampling weight\.The joint class scorew~c\\tilde\{w\}\_\{c\}combines both sampling indicators:

w~c=wcf​r​e​q⋅wcs​h​a​r​p\\displaystyle\\tilde\{w\}\_\{c\}=w^\{freq\}\_\{c\}\\cdot w^\{sharp\}\_\{c\}\(6\)We apply mean normalization to ensure numerical stability, yielding the normalized class sampling weightwcw\_\{c\}:

wc=w~c1C​∑j=1Cw~j\+ξ\\displaystyle\\quad w\_\{c\}=\\frac\{\\tilde\{w\}\_\{c\}\}\{\\frac\{1\}\{C\}\\sum\_\{j=1\}^\{C\}\\tilde\{w\}\_\{j\}\+\\xi\}\(7\)whereCCrepresents the total number of classes\.

Instance\-Level Probability Allocation\.The calibrated class score isSc=Pcb​a​s​e​wc=\(Nc/N\)​wcS\_\{c\}=P\_\{c\}^\{base\}w\_\{c\}=\(N\_\{c\}/N\)w\_\{c\}\. To preserve intra\-class fairness, every instance in classccshares this score equally\. Thus an instancexix\_\{i\}withyi=cy\_\{i\}=chas unnormalized scoresxi=Sc/Nc=wc/Ns\_\{x\_\{i\}\}=S\_\{c\}/N\_\{c\}=w\_\{c\}/N\. The final probability is

Pxi\\displaystyle P\_\{x\_\{i\}\}=sxi∑j=1Nsxj=wyiN​∑c=1CPcb​a​s​e​wc\.\\displaystyle=\\frac\{s\_\{x\_\{i\}\}\}\{\\sum\_\{j=1\}^\{N\}s\_\{x\_\{j\}\}\}=\\frac\{w\_\{y\_\{i\}\}\}\{N\\sum\_\{c=1\}^\{C\}P\_\{c\}^\{base\}w\_\{c\}\}\.\(8\)Equation \([8](https://arxiv.org/html/2607.21999#Sx3.E8)\) specifies how the dynamic class weight is translated into the target sampling distribution\. SGS reweights the long\-tailed prior by the frequency\-sharpness score\. The frequency term raisesqc​\(t\)q\_\{c\}\(t\)for classes that have been sampled less often, while the sharpness term lowersqc​\(t\)q\_\{c\}\(t\)for classes whose perturbation response is currently large, preventing the next mini\-batches from being dominated by unstable high\-sharpness updates\. After each mini\-batch,mc​\(t\)m\_\{c\}\(t\)andhc​\(t\)h\_\{c\}\(t\)are updated, so the sampler forms a closed\-loop control: under\-sampled classes are pulled back into the batch stream, whereas classes with excessive perturbation sensitivity are temporarily relaxed\. The factor1/Nc1/N\_\{c\}assigns this class\-level probability uniformly to instances within the class, preserving intra\-class fairness\.

Algorithm 1SGS Training0:Training set

𝒟\\mathcal\{D\}, model

fθf\_\{\\theta\}, epochs

TT, batch size

BB, warm\-up ratio

rwr\_\{w\}, mixing schedule

α​\(e\)\\alpha\(e\), maximum ratio

αmax\\alpha\_\{\\max\}, SAM radius

ρ\\rho, EMA momentum

β\\beta, sharpness exponent

κ\\kappa, constant

ξ\\xi
0:Trained model parameters

θT\\theta\_\{T\}
1:Initialize

mc←1m\_\{c\}\\leftarrow 1,

hc←1h\_\{c\}\\leftarrow 1,

Pxi←Pxib​a​s​eP\_\{x\_\{i\}\}\\leftarrow P^\{base\}\_\{x\_\{i\}\}, and

Ew=⌊rw​T⌋E\_\{w\}=\\lfloor r\_\{w\}T\\rfloor
2:for

e=1e=1to

TTdo

3:Set

α​\(e\)\\alpha\(e\)according to the warm\-up schedule

4:foreach mini\-batchdo

5:By Eq\. \([9](https://arxiv.org/html/2607.21999#Sx3.E9)\), draw

Bbase​\(e\)B\_\{\\mathrm\{base\}\}\(e\)samples from

Pxib​a​s​eP^\{base\}\_\{x\_\{i\}\}and

BSGS​\(e\)B\_\{\\mathrm\{SGS\}\}\(e\)samples from

PxiP\_\{x\_\{i\}\}to form

BtB\_\{t\}
6:Perform the SAM ascent–descent update and record

Δ​Lxi=\|ℓi​\(θ\+ϵt\)−ℓi​\(θ\)\|\\Delta L\_\{x\_\{i\}\}=\|\\ell\_\{i\}\(\\theta\+\\epsilon\_\{t\}\)\-\\ell\_\{i\}\(\\theta\)\|
7:Update class counts

mc←mc\+\|Bt,c\|m\_\{c\}\\leftarrow m\_\{c\}\+\|B\_\{t,c\}\|
8:If

e\>Ewe\>E\_\{w\}, update

hc←β​hc\+\(1−β\)​\|Bt,c\|−1​∑xi∈Bt,cΔ​Lxih\_\{c\}\\leftarrow\\beta h\_\{c\}\+\(1\-\\beta\)\|B\_\{t,c\}\|^\{\-1\}\\sum\_\{x\_\{i\}\\in B\_\{t,c\}\}\\Delta L\_\{x\_\{i\}\}
9:If

e\>Ewe\>E\_\{w\}, update

PxiP\_\{x\_\{i\}\}by Eqs\. \([7](https://arxiv.org/html/2607.21999#Sx3.E7)\) and \([8](https://arxiv.org/html/2607.21999#Sx3.E8)\)

10:endfor

11:endfor

12:return

θT\\theta\_\{T\}

To maintain stable training, SGS constructs each mini\-batch from the original long\-tailed distributionPxib​a​s​eP^\{base\}\_\{x\_\{i\}\}and the current SGS distributionPxiP\_\{x\_\{i\}\}defined in Eq\. \([8](https://arxiv.org/html/2607.21999#Sx3.E8)\)\. We use a warm\-up ratiorw∈\[0,1\]r\_\{w\}\\in\[0,1\]and setEw=⌊rw​T⌋E\_\{w\}=\\lfloor r\_\{w\}T\\rfloor\. For a mini\-batch of sizeBB, the numbers assigned to the two distributions at epocheeare

Bbase​\(e\)\\displaystyle B\_\{\\mathrm\{base\}\}\(e\)=round⁡\(\(1−α​\(e\)\)​B\),\\displaystyle=\\operatorname\{round\}\\\!\\left\(\(1\-\\alpha\(e\)\)B\\right\),\(9\)BSGS​\(e\)\\displaystyle B\_\{\\mathrm\{SGS\}\}\(e\)=B−Bbase​\(e\)\\displaystyle=B\-B\_\{\\mathrm\{base\}\}\(e\)respectively\. We first drawBbase​\(e\)B\_\{\\mathrm\{base\}\}\(e\)samples fromPxib​a​s​eP^\{base\}\_\{x\_\{i\}\}, then drawBSGS​\(e\)B\_\{\\mathrm\{SGS\}\}\(e\)samples fromPxiP\_\{x\_\{i\}\}after excluding the selected indices, and concatenate the two subsets into a mini\-batch of sizeBB\. During warm\-up,α​\(e\)=0\\alpha\(e\)=0, so the entire mini\-batch follows the original sampler\. After warm\-up,α​\(e\)\\alpha\(e\)gradually increases towardαmax\\alpha\_\{\\max\}, increasing the SGS portion without abruptly changing the training distribution\. Unless otherwise specified, we setαmax=1\\alpha\_\{\\max\}=1\. Algorithm[1](https://arxiv.org/html/2607.21999#alg1)summarizes the procedure\.

### A Stochastic Dynamics Perspective of SGS

We further interpret SGS as a continuous distributional dynamics\. This view characterizes how frequency\-curvature feedback moves the empirical long\-tailed distribution toward a flatness\-aware target distribution\.

###### Theorem 1\(Continuous\-Time Dynamics of SGS\)\.

Letqi​\(t\)q\_\{i\}\(t\)be the instance\-level sampling probability andqc​\(t\)=∑i:yi=cqi​\(t\)q\_\{c\}\(t\)=\\sum\_\{i:y\_\{i\}=c\}q\_\{i\}\(t\)be the class\-level probability\. Define the frequency\-curvature drivegc​\(t\)=log⁡\(pc​\(t\)\+ξ\)\+log⁡\(h~c​\(t\)κ\+ξ\)g\_\{c\}\(t\)=\\log\(p\_\{c\}\(t\)\+\\xi\)\+\\log\(\\tilde\{h\}\_\{c\}\(t\)^\{\\kappa\}\+\\xi\), so the class score is proportional toexp⁡\(−gc​\(t\)\)\\exp\(\-g\_\{c\}\(t\)\)\. Assumegc​\(t\)g\_\{c\}\(t\)admits the Stratonovich limitd​gc​\(t\)=μc​\(t\)​d​t\+σc​\(t\)∘d​Wc​\(t\)dg\_\{c\}\(t\)=\\mu\_\{c\}\(t\)dt\+\\sigma\_\{c\}\(t\)\\circ dW\_\{c\}\(t\)\. Then, for an instanceziz\_\{i\}with labelyiy\_\{i\}, the induced sampling probability satisfies

d​qi​\(t\)=−qi​\(t\)​\[μyi​\(t\)−μ¯​\(t\)\]​d​t\\displaystyle dq\_\{i\}\(t\)=\-q\_\{i\}\(t\)\\left\[\\mu\_\{y\_\{i\}\}\(t\)\-\\bar\{\\mu\}\(t\)\\right\]dt\(10\)−qi​\(t\)​\[σyi​\(t\)∘d​Wyi​\(t\)−∑c=1Cqc​\(t\)​σc​\(t\)∘d​Wc​\(t\)\]\.\\displaystyle\\quad\-q\_\{i\}\(t\)\\Big\[\\sigma\_\{y\_\{i\}\}\(t\)\\circ dW\_\{y\_\{i\}\}\(t\)\-\\sum\_\{c=1\}^\{C\}q\_\{c\}\(t\)\\sigma\_\{c\}\(t\)\\circ dW\_\{c\}\(t\)\\Big\]\.whereμ¯​\(t\)=∑c=1Cqc​\(t\)​μc​\(t\)\\bar\{\\mu\}\(t\)=\\sum\_\{c=1\}^\{C\}q\_\{c\}\(t\)\\mu\_\{c\}\(t\)\.

Remark\.This SDE explicitly decouples the sampling evolution into a deterministic relative competition \(the drift term\) and a stochastic fluctuation \(the diffusion term\)\. The drift establishes a self\-regulating mechanism: probability mass intrinsically flows to classes whose evolution rateμyi​\(t\)\\mu\_\{y\_\{i\}\}\(t\)is below the global baselineμ¯​\(t\)\\bar\{\\mu\}\(t\)\. This ensures a continuous transfer of sampling weights from over\-represented head classes to tail classes\. Crucially, the curvature component acts as a geometry\-aware ”thermostat”—if a tail class enters an excessively sharp minimum, its curvature penalty spikes, triggering immediate negative feedback to suppress its sampling rate\. Simultaneously, the diffusion term formally models the destructive variance caused by sparse tail\-class mini\-batch sampling\. This motivates the use of EMA to smooth class\-level estimates and obtain a more stable curvature\-aware sampling distribution\.

###### Theorem 2\(Stationary Density for a Fixed Class\)\.

Consider the sampling probability of a fixed classcc, denoted byq=qc​\(t\)q=q\_\{c\}\(t\)\. In a local time window, freeze the slowly varying coefficients and writeac=μc−μ¯a\_\{c\}=\\mu\_\{c\}\-\\bar\{\\mu\}, whereμ¯=∑j=1Cqj​μj\\bar\{\\mu\}=\\sum\_\{j=1\}^\{C\}q\_\{j\}\\mu\_\{j\}\. Assume the remaining class\-wise noise can be represented by an effective volatilityσ~c\\tilde\{\\sigma\}\_\{c\}and the one\-dimensional dynamics are

d​q=−ac​q​d​t\+q​σ~c∘d​Wt\.dq=\-a\_\{c\}q\\,dt\+q\\tilde\{\\sigma\}\_\{c\}\\circ dW\_\{t\}\.\(11\)On a compact positive\-probability supportq∈\[qmin,qmax\]⊂\(0,1\)q\\in\[q\_\{\\min\},q\_\{\\max\}\]\\subset\(0,1\)with zero probability flux at the boundaries, the stationary density satisfies

φ∞\(c\)​\(q\)=1zc​q−γc,γc=1\+2​acσ~c2=1\+2​\(μc−μ¯\)σ~c2,\\varphi\_\{\\infty\}^\{\(c\)\}\(q\)=\\frac\{1\}\{z\_\{c\}\}q^\{\-\\gamma\_\{c\}\},\\qquad\\gamma\_\{c\}=1\+\\frac\{2a\_\{c\}\}\{\\tilde\{\\sigma\}\_\{c\}^\{2\}\}=1\+\\frac\{2\(\\mu\_\{c\}\-\\bar\{\\mu\}\)\}\{\\tilde\{\\sigma\}\_\{c\}^\{2\}\},\(12\)wherezc=∫qminqmaxq−γc​𝑑qz\_\{c\}=\\int\_\{q\_\{\\min\}\}^\{q\_\{\\max\}\}q^\{\-\\gamma\_\{c\}\}dqnormalizes the density\.

Remark\.The equilibrium is governed by the relative driftac=μc−μ¯a\_\{c\}=\\mu\_\{c\}\-\\bar\{\\mu\}\. Whenμc<μ¯\\mu\_\{c\}<\\bar\{\\mu\}, we haveγc<1\\gamma\_\{c\}<1, so the stationary density is less concentrated near the lower\-probability boundary and the class tends to retain larger exposure\. Whenμc\>μ¯\\mu\_\{c\}\>\\bar\{\\mu\},γc\\gamma\_\{c\}increases and the density shifts toward smaller sampling probabilities, suppressing over\-sampled or sharper classes\. Sinceφ∞\(c\)​\(q\)∝exp⁡\(−γc​log⁡q\)\\varphi\_\{\\infty\}^\{\(c\)\}\(q\)\\propto\\exp\(\-\\gamma\_\{c\}\\log q\), changes in the frequency\-curvature drive affect the sampling density in a nonlinear way\. Thus SGS does not behave as naive tail over\-sampling: it favors classes with insufficient exposure or moderate curvature, while reducing the probability of classes whose frequency\-curvature drive is already high\. A balanced fixed point corresponds to aligning the class\-wise drive with the population average, yielding a frequency\-curvature balanced sampling target\.

###### Theorem 3\(Tighter PAC\-Bayes Bound under SGS Sampling\)\.

Let𝐮\\mathbf\{u\}be the class\-balanced prior,𝛑\\boldsymbol\{\\pi\}be the empirical long\-tailed prior, and𝐪⋆\\mathbf\{q\}^\{\\star\}be the stationary SGS distribution from[theorem2](https://arxiv.org/html/2607.21999#Thmtheorem2)\. Letℒ^𝐪,Sρ​\(w\)\\widehat\{\\mathcal\{L\}\}\_\{\\mathbf\{q\},S\}^\{\\rho\}\(w\)denote the SAM sharp empirical risk under class\-level distribution𝐪\\mathbf\{q\}\. We writeℬ​\(𝐪\)\\mathcal\{B\}\(\\mathbf\{q\}\)for the sampling\-dependent PAC penalty, consisting of the balanced\-prior mismatch and the class\-wise effective\-sample complexity:

ℬ​\(𝐪\)=‖𝐪−𝐮‖1\+1C​∑c=1CΦ​\(qc\),\\mathcal\{B\}\(\\mathbf\{q\}\)=\\\|\\mathbf\{q\}\-\\mathbf\{u\}\\\|\_\{1\}\+\\frac\{1\}\{C\}\\sum\_\{c=1\}^\{C\}\\Phi\(q\_\{c\}\),\(13\)whereΦ​\(qc\)\\Phi\(q\_\{c\}\)denotes the PAC complexity term for classccand decreases as the effective class sample sizen​qcnq\_\{c\}increases\. Assume the sharp loss is bounded and each class has positive effective sample size\. Suppose that the movement from𝛑\\boldsymbol\{\\pi\}to𝐪⋆\\mathbf\{q\}^\{\\star\}admits an equalizing\-transfer decomposition in the effective\-sample region, that𝐪⋆\\mathbf\{q\}^\{\\star\}is closer to the balanced prior,

‖𝐪⋆−𝐮‖1<‖𝝅−𝐮‖1,\\\|\\mathbf\{q\}^\{\\star\}\-\\mathbf\{u\}\\\|\_\{1\}<\\\|\\boldsymbol\{\\pi\}\-\\mathbf\{u\}\\\|\_\{1\},\(14\)and that any increase in sharp empirical risk is smaller than the resulting reduction inℬ\\mathcal\{B\}\. Then, with probability at least1−δ1\-\\delta, SGS has a tighter PAC\-Bayes right\-hand side than ordinary long\-tailed SAM:

ℒ^𝐪⋆,Sρ​\(w\)\+ℬ​\(𝐪⋆\)<ℒ^𝝅,Sρ​\(w\)\+ℬ​\(𝝅\)\.\\widehat\{\\mathcal\{L\}\}\_\{\\mathbf\{q\}^\{\\star\},S\}^\{\\rho\}\(w\)\+\\mathcal\{B\}\(\\mathbf\{q\}^\{\\star\}\)<\\widehat\{\\mathcal\{L\}\}\_\{\\boldsymbol\{\\pi\},S\}^\{\\rho\}\(w\)\+\\mathcal\{B\}\(\\boldsymbol\{\\pi\}\)\.\(15\)

Remark\.Compared with the standard SAM PAC\-Bayes analysis under the empirical training distribution, ordinary SAM on long\-tailed data suffers from two coupled effects\. First, the empirical SAM objective is optimized under the imbalanced prior𝝅\\boldsymbol\{\\pi\}, whereas long\-tailed recognition is evaluated by the class\-balanced risk, yielding the mismatch term‖𝝅−𝐮‖1\\\|\\boldsymbol\{\\pi\}\-\\mathbf\{u\}\\\|\_\{1\}\. Second, tail classes haven​πc≪n/Cn\\pi\_\{c\}\\ll n/C, so their class\-wise PAC complexity scales roughly as𝒪​\(\(n​πc\)−1/2\)\\mathcal\{O\}\(\(n\\pi\_\{c\}\)^\{\-1/2\}\)rather than the balanced𝒪​\(\(n/C\)−1/2\)\\mathcal\{O\}\(\(n/C\)^\{\-1/2\}\)\. Thus, even if SAM encourages flat minima locally, its bound can remain loose because rare classes have insufficient effective samples\. The stationary law in[theorem2](https://arxiv.org/html/2607.21999#Thmtheorem2)explains how SGS reduces this looseness: it shifts probability away from over\-exposed or high\-curvature classes and toward classes with lower frequency\-curvature drive\. As a result,‖𝐪⋆−𝐮‖1\\\|\\mathbf\{q\}^\{\\star\}\-\\mathbf\{u\}\\\|\_\{1\}is reduced, the effective denominatorsn​Qc⋆−1nQ\_\{c\}^\{\\star\}\-1for tail classes become larger, and the sharp empirical term is less dominated by over\-represented sharp regions\.

## Experiments

### Hyperparameter Analysis

Warm\-Up Ratiorwr\_\{w\}\.Table[1](https://arxiv.org/html/2607.21999#Sx4.T1)studies the warm\-up ratiorwr\_\{w\}, which controls when SGES starts to use frequency\-curvature feedback\. A too largerwr\_\{w\}delays geometry\-aware sampling and leaves insufficient time for tail correction\. For example, on CIFAR\-100 LT with IR100,rw=0\.9r\_\{w\}=0\.9achieves the best head accuracy but only obtains 12\.83 tail accuracy and 44\.94 overall accuracy\. In contrast, activating SGES too early can be unstable because early sharpness estimates are noisy\. The best IR100 performance is achieved atrw=0\.7r\_\{w\}=0\.7, improving tail accuracy to 20\.76 and overall accuracy to 47\.06\. Under the more severe IR200 setting, the best result appears atrw=0\.4r\_\{w\}=0\.4, indicating that stronger imbalance requires earlier intervention\. Overall, a moderate warm\-up is important: it preserves stable representation learning at the beginning while leaving enough epochs for SGES to reshape the sampling trajectory toward tail\- and curvature\-balanced optimization\. In practice, we use a largerrwr\_\{w\}for milder imbalance and a smallerrwr\_\{w\}for more severe imbalance\.

Table 1:Effect of the warm\-up ratiorwr\_\{w\}on CIFAR\-100 LT\. IR100 reports Head, Medium, Tail, and All accuracy; IR200 reports overall accuracy\.Sharpness Exponentκ\\kappa\.Table[2](https://arxiv.org/html/2607.21999#Sx4.T2)studies the sharpness exponentκ\\kappa, which controls the strength of the curvature term in the sampling score\. On CIFAR\-100 LT with IR100, decreasingκ\\kappafrom 1\.0 to 0\.6 improves the overall accuracy from 47\.56 to 48\.19 and gives the best medium\-class accuracy\. This indicates that smoothing the curvature signal withκ=0\.6\\kappa=0\.6improves the balance between representation stability and tail exposure\. In contrast,κ=0\.9\\kappa=0\.9gives the best tail accuracy but lower overall accuracy, whileκ=0\.1\\kappa=0\.1andκ=0\.3\\kappa=0\.3weaken the sharpness signal and reduce tail performance\. For the milder IR10 setting, performance is less sensitive toκ\\kappa\. Based on this analysis, we setκ=0\.6\\kappa=0\.6unless otherwise specified\.

Table 2:Effect of the sharpness exponentκ\\kappaon CIFAR\-100 LT\. IR100 reports Head, Medium, Tail, and All accuracy; IR10 reports overall accuracy\.Table 3:Performance comparison on CIFAR\-LT datasets with various imbalance ratios \(IR\)\. For IR100, we report accuracy on Head, Medium, Tail, and All classes; for other IRs, we report overall accuracy\.
### Long\-Tailed Classification

Datasets & Evaluation\.We evaluate our method on four standard long\-tailed \(LT\) recognition benchmarks: CIFAR\-10 LT, CIFAR\-100 LT\(Caoet al\.[2019](https://arxiv.org/html/2607.21999#bib.bib21)\)\(with imbalance ratios IR in\{10,50,100,200\}\\\{10,50,100,200\\\}\), ImageNet\-LT\(Liuet al\.[2019](https://arxiv.org/html/2607.21999#bib.bib13)\)\. CIFAR100\-LT and ImageNet\-LT are artificially truncated from the balanced CIFAR100\(Krizhevskyet al\.[2009](https://arxiv.org/html/2607.21999#bib.bib11)\)and ImageNet\(Liuet al\.[2019](https://arxiv.org/html/2607.21999#bib.bib13)\)datasets\. Performance is measured using top\-1 balanced accuracy across the overall test set, as well as on three disjoint subset splits: Head, Medium, and Tail\.

Architectures & Training\.We employ ResNet\-32\(Heet al\.[2016](https://arxiv.org/html/2607.21999#bib.bib10)\)for the CIFAR datasets and ResNet\-50\(Heet al\.[2016](https://arxiv.org/html/2607.21999#bib.bib10)\)for ImageNet\-LT and iNaturalist, optimizing all models for 200 epochs\. We set SGD optimizer with momentum 0\.9 as the base optimizer and train all models for 200 epochs, with a batch size of 64 for CIFAR100\-LT and 256 for ImageNet\-LT\. Besides the Cross\-Entropy loss \(CE\) setting, we also evaluate SGS with Logit Adjustment loss \(LA\)\(Menonet al\.[2021](https://arxiv.org/html/2607.21999#bib.bib9)\)\. LA adds the empirical class\-prior offset to the logits and can be applied either as a post\-hoc correction or as a training loss for balanced error\. However, SGS itself changes the mini\-batch sampling distribution, so directly applying LA throughout SGS training would couple two class\-prior corrections\. We therefore adopt a deferred LA protocol: first train SGS\-SAM for 180 epochs to learn the representation and geometry\-aware sampling trajectory, then freeze the backbone and fine\-tune only the classifier for 20 epochs with the LA loss and SAM under the original long\-tailed training set\. More details about datasets, networks, and training settings are presented in Appendix\.

Compared Methods\.We compare against a broad spectrum of state\-of\-the\-art approaches\. On ResNet architectures, we integrate standard LT loss functions with vanilla SAM\(Foretet al\.[2021](https://arxiv.org/html/2607.21999#bib.bib22)\), ImbSAM\(Zhouet al\.[2023a](https://arxiv.org/html/2607.21999#bib.bib23)\), and CC\-SAM\(Zhouet al\.[2023b](https://arxiv.org/html/2607.21999#bib.bib24)\), Focal\-SAM\(Liet al\.[2025](https://arxiv.org/html/2607.21999#bib.bib16)\)alongside other representative LT baselines\.

Comparison on CIFAR10/100\-LT\.Table[3](https://arxiv.org/html/2607.21999#Sx4.T3)summarizes the CIFAR\-LT results under different imbalance ratios\. SGS\-SAM consistently improves overall accuracy in high\-imbalance regimes\. For IR100, it improves CIFAR\-10 LT from 77\.2 to 77\.96 under CE and from 82\.9 to 84\.06 under LA; on CIFAR\-100 LT, it improves from 44\.0 to 47\.56 under CE and from 50\.7 to 51\.99 under LA\. Similar gains are observed for IR200 and IR50, where SGS\-SAM achieves the best overall accuracy across both datasets and loss settings\.

The gains mainly come from medium and tail classes, which are typically under\-trained in long\-tailed recognition\. On CIFAR\-10 LT with IR100, CE\+SGS\-SAM improves tail accuracy over CE\+Focal\-SAM by 1\.80 points, and LA\+SGS\-SAM improves medium/tail accuracy from 81\.2/79\.2 to 83\.29/84\.96\. On CIFAR\-100 LT, CE\+SGS\-SAM raises tail accuracy from 8\.9 to 19\.75, while LA\+SGS\-SAM raises it from 32\.5 to 38\.22\. These results support the motivation of SGS: reallocating training exposure by both class frequency and local sharpness gives under\-represented classes more effective optimization opportunities\.

SGS also remains compatible with deferred logit\-adjusted calibration\. LA adjusts the decision boundary through class\-prior logits, while SGS shapes the training trajectory through geometry\-aware exposure; applying LA only in the final fine\-tuning stage avoids disturbing the SGS sampling dynamics\. When the imbalance becomes mild \(IR10\), the advantage of SGS\-SAM becomes smaller and is generally comparable to Focal\-SAM, indicating that geometry\-aware sampling is most useful when the training distribution is severely skewed\.

Table 4:Performance comparison on ImageNet\-LT\. We report top\-1 accuracy on Head, Medium, Tail, and All classes\. The CE block follows ImbSAM\(Zhouet al\.[2023a](https://arxiv.org/html/2607.21999#bib.bib23)\), and the LA block follows Focal\-SAM\(Liet al\.[2025](https://arxiv.org/html/2607.21999#bib.bib16)\)\.Table 5:Foundation\-model fine\-tuning results on ImageNet\-LT and iNaturalist\. Results of compared methods are reported by Focal\-SAM\(Liet al\.[2025](https://arxiv.org/html/2607.21999#bib.bib16)\)\. We report top\-1 accuracy\.ImageNet\-LT Results\.Table[4](https://arxiv.org/html/2607.21999#Sx4.T4)further evaluates SGS\-SAM on the large\-scale ImageNet\-LT benchmark\. Under CE training, vanilla SAM does not improve the overall accuracy over CE and leaves tail accuracy almost unchanged, suggesting that class\-agnostic flatness optimization is still dominated by head\-class exposure\. ImbSAM improves tail accuracy to 21\.6 by modifying the perturbation strategy, while CE\+SGS\-SAM further increases tail accuracy to 28\.19 and overall accuracy to 53\.40\. Under the deferred LA protocol, LA\+SGS\-SAM also improves over LA\+Focal\-SAM, raising tail accuracy from 34\.4 to 36\.26 and overall accuracy from 54\.3 to 54\.57\. The head accuracy is slightly lower because SGS deliberately reallocates training exposure from head\-dominated batches toward medium and tail classes\. These results are consistent with the CIFAR\-LT observations and show that geometry\-aware sampling remains effective on a larger\-scale long\-tailed benchmark\.

### Large\-Scale Long\-Tailed Fine\-Tuning

Fine\-Tuning Protocol\.We further evaluate SGS for foundation\-model fine\-tuning on ImageNet\-LT and iNaturalist\(Van Hornet al\.[2018](https://arxiv.org/html/2607.21999#bib.bib12)\), following the experimental protocols of Focal\-SAM\(Liet al\.[2025](https://arxiv.org/html/2607.21999#bib.bib16)\)and LIFT\(Shiet al\.[2024](https://arxiv.org/html/2607.21999#bib.bib20)\)\. Specifically, we fine\-tune the CLIP\(Radfordet al\.[2021](https://arxiv.org/html/2607.21999#bib.bib8)\)image encoder with a ViT\-B/16 backbone\(Dosovitskiyet al\.[2021](https://arxiv.org/html/2607.21999#bib.bib7)\)under two fine\-tuning paradigms, namely full fine\-tuning \(FFT\) and LIFT\. The default training schedule consists of 20 epochs\. Since this setting employs the LA loss defined according to the original long\-tailed class distribution, we set the maximum SGS mixing coefficient toαmax=0\.1\\alpha\_\{\\max\}=0\.1to prevent an excessive shift in the effective sampling distribution\. Considering the short fine\-tuning schedule, we setrw=0r\_\{w\}=0to activate SGS from the beginning and useκ=2\\kappa=2to strengthen the sharpness feedback\. On iNaturalist, the SGS variants continue to improve beyond the default schedule\. We therefore additionally report their results after 25 epochs, denoted by SGS\-SAM25in Table[5](https://arxiv.org/html/2607.21999#Sx4.T5)\.

Fine\-Tuning Results\.Table[5](https://arxiv.org/html/2607.21999#Sx4.T5)summarizes the results under the CLIP/ViT\-B/16 fine\-tuning protocol\. Under FFT on ImageNet\-LT, SGS\-SAM achieves the best medium\-, tail\-, and overall accuracies of 74\.5%, 64\.9%, and 75\.3%, respectively\. Compared with Focal\-SAM, it improves tail accuracy by 10\.5 percentage points and overall accuracy by 1\.4 points, showing that geometry\-aware sampling substantially benefits underrepresented classes\. Under LIFT, SGS\-SAM achieves 77\.4% overall accuracy, matching the best result in this group, while obtaining the best medium\-class accuracy of 76\.6% and maintaining competitive head\- and tail\-class performance\.

On iNaturalist, the 20\-epoch SGS\-SAM variants remain competitive but have not fully converged\. Extending FFT with SGS\-SAM to 25 epochs increases tail and overall accuracy to 75\.1% and 74\.1%, respectively, outperforming the corresponding 20\-epoch result and yielding the best tail accuracy within the FFT group\. More substantial gains are observed under LIFT: LIFT with SGS\-SAM∗25\*\{25\}achieves head, medium, tail, and overall accuracies of 74\.0%, 80\.2%, 82\.1%, and 80\.3%, respectively\. It obtains the best medium\-, tail\-, and overall results in the LIFT group and ties the best head\-class accuracy\. Although SGS\-SAM∗25\*\{25\}uses five additional epochs, its total training time is only1\.26×1\.26\\timesthat of vanilla SAM, remaining below the1\.29×1\.29\\timescost of Focal\-SAM \(the reasons why SGS needs more epoch for better results is discussed in Appendix\)\. These results demonstrate that SGS can improve long\-tailed foundation\-model fine\-tuning while preserving favorable training efficiency\.

### Training Speed

To reduce the influence of hardware and implementation details, we report relative training time with respect to vanilla SAM instead of absolute seconds\. The comparison ratios in Table[6](https://arxiv.org/html/2607.21999#Sx4.T6)are taken from the Focal\-SAM\(Liet al\.[2025](https://arxiv.org/html/2607.21999#bib.bib16)\)\.

SGS\-SAM follows the same optimization pipeline as vanilla SAM\. The sharpness signal is directly obtained from the loss gap produced by the original SAM ascent–descent steps, while the sampler only maintains class\-level frequency and EMA sharpness statistics\. Therefore, SGS does not introduce additional class\-wise perturbations or extra backward passes\. Its overhead is limited to updating a \(C\)\-dimensional sampling distribution and drawing mini\-batches accordingly, which is negligible compared with the forward/backward computation of deep networks\.

Table 6:Relative training time per epoch on CIFAR\-LT datasets\. Ratios are measured with respect to vanilla SAM\.

## Conclusion

In this paper, we presented Sharpness\-Guided Equilibrium Sampling \(SGES\), a geometry\-aware sampling framework for long\-tailed recognition\. Different from existing SAM\-based methods that mainly modify the loss or perturbation rule after biased mini\-batches are drawn, SGES directly reshapes the training trajectory by coupling class\-frequency feedback with local sharpness estimates\. The resulting sampler assigns more effective optimization opportunities to under\-represented classes while avoiding excessive updates from unstable high\-sharpness regions\. We further introduced a warm\-up and progressive mixing strategy to stabilize early training, and provided a stochastic\-dynamics view that explains how the discrete sampler evolves toward a frequency\-curvature balanced distribution\. Extensive experiments on CIFAR\-LT and ImageNet\-LT show that SGES\-SAM consistently improves medium and tail performance under severe imbalance, and remains compatible with deferred logit\-adjusted calibration\. We also extend the protocol to long\-tailed instance segmentation through decoupled classifier training on LVIS\. Since SGES reuses the sharpness information already produced by SAM and only updates lightweight class\-level statistics, it offers an efficient alternative to class\-wise perturbation methods\. A limitation is that the sampler depends on reliable class\-level sharpness statistics, so the warm\-up ratio and sharpness exponent still require mild tuning under different imbalance ratios\. Overall, our results suggest that controlling the sampling process with optimization geometry is a promising direction for scalable long\-tailed learning\.

## References

- M\. Buda, A\. Maki, and M\. A\. Mazurowski \(2018\)A systematic study of the class imbalance problem in convolutional neural networks\.Neural networks106,pp\. 249–259\.Cited by:[Introduction](https://arxiv.org/html/2607.21999#Sx1.p1.1),[Introduction](https://arxiv.org/html/2607.21999#Sx1.p2.1)\.
- K\. Cao, C\. Wei, A\. Gaidon, N\. Arechiga, and T\. Ma \(2019\)Learning imbalanced datasets with label\-distribution\-aware margin loss\.Advances in neural information processing systems32\.Cited by:[Introduction](https://arxiv.org/html/2607.21999#Sx1.p1.1),[Long\-Tailed Learning](https://arxiv.org/html/2607.21999#Sx2.SSx1.p1.1),[Long\-Tailed Classification](https://arxiv.org/html/2607.21999#Sx4.SSx2.p1.1)\.
- J\. Cui, Z\. Zhong, S\. Liu, B\. Yu, and J\. Jia \(2021\)Parametric contrastive learning\.InProceedings of the IEEE/CVF international conference on computer vision,pp\. 715–724\.Cited by:[Long\-Tailed Learning](https://arxiv.org/html/2607.21999#Sx2.SSx1.p1.1)\.
- J\. Cui, Z\. Zhong, Z\. Tian, S\. Liu, B\. Yu, and J\. Jia \(2023\)Generalized parametric contrastive learning\.IEEE Transactions on Pattern Analysis and Machine Intelligence46\(12\),pp\. 7463–7474\.Cited by:[Introduction](https://arxiv.org/html/2607.21999#Sx1.p1.1)\.
- A\. Dosovitskiy, L\. Beyer, A\. Kolesnikov, D\. Weissenborn, X\. Zhai, T\. Unterthiner, M\. Dehghani, M\. Minderer, G\. Heigold, S\. Gelly,et al\.\(2021\)An image is worth 16x16 words: transformers for image recognition at scale\.InInternational Conference on Learning Representations,Cited by:[Large\-Scale Long\-Tailed Fine\-Tuning](https://arxiv.org/html/2607.21999#Sx4.SSx3.p1.4)\.
- P\. Foret, A\. Kleiner, H\. Mobahi, and B\. Neyshabur \(2021\)Sharpness\-aware minimization for efficiently improving generalization\.InInternational Conference on Learning Representations,Cited by:[Introduction](https://arxiv.org/html/2607.21999#Sx1.p2.1),[Sharpness\-Aware Minimization in Long\-Tailed Learning](https://arxiv.org/html/2607.21999#Sx2.SSx2.p1.1),[Long\-Tailed Classification](https://arxiv.org/html/2607.21999#Sx4.SSx2.p3.1)\.
- K\. He, X\. Zhang, S\. Ren, and J\. Sun \(2016\)Deep residual learning for image recognition\.InProceedings of the IEEE conference on computer vision and pattern recognition,pp\. 770–778\.Cited by:[Long\-Tailed Classification](https://arxiv.org/html/2607.21999#Sx4.SSx2.p2.1)\.
- Y\. Hong, J\. Zhang, Z\. Sun, and K\. Yan \(2022\)Safa: sample\-adaptive feature augmentation for long\-tailed image classification\.InEuropean conference on computer vision,pp\. 587–603\.Cited by:[Long\-Tailed Learning](https://arxiv.org/html/2607.21999#Sx2.SSx1.p1.1)\.
- B\. Kang, S\. Xie, M\. Rohrbach, Z\. Yan, A\. Gordo, J\. Feng, and Y\. Kalantidis \(2019\)Decoupling representation and classifier for long\-tailed recognition\.arXiv preprint arXiv:1910\.09217\.Cited by:[Long\-Tailed Learning](https://arxiv.org/html/2607.21999#Sx2.SSx1.p1.1)\.
- A\. Krizhevsky, G\. Hinton,et al\.\(2009\)Learning multiple layers of features from tiny images\.\(2009\)\.Cited by:[Long\-Tailed Classification](https://arxiv.org/html/2607.21999#Sx4.SSx2.p1.1)\.
- S\. Li, Q\. Xu, Z\. Yang, Z\. Wang, L\. Zhang, X\. Cao, and Q\. Huang \(2025\)Focal\-sam: focal sharpness\-aware minimization for long\-tailed classification\.InInternational Conference on Machine Learning,pp\. 36624–36651\.Cited by:[Introduction](https://arxiv.org/html/2607.21999#Sx1.p1.1),[Introduction](https://arxiv.org/html/2607.21999#Sx1.p2.1),[Sharpness\-Aware Minimization in Long\-Tailed Learning](https://arxiv.org/html/2607.21999#Sx2.SSx2.p1.1),[Long\-Tailed Classification](https://arxiv.org/html/2607.21999#Sx4.SSx2.p3.1),[Large\-Scale Long\-Tailed Fine\-Tuning](https://arxiv.org/html/2607.21999#Sx4.SSx3.p1.4),[Training Speed](https://arxiv.org/html/2607.21999#Sx4.SSx4.p1.1),[Table 4](https://arxiv.org/html/2607.21999#Sx4.T4),[Table 5](https://arxiv.org/html/2607.21999#Sx4.T5)\.
- Z\. Liu, Z\. Miao, X\. Zhan, J\. Wang, B\. Gong, and S\. X\. Yu \(2019\)Large\-scale long\-tailed recognition in an open world\.InProceedings of the IEEE/CVF conference on computer vision and pattern recognition,pp\. 2537–2546\.Cited by:[Long\-Tailed Classification](https://arxiv.org/html/2607.21999#Sx4.SSx2.p1.1)\.
- A\. K\. Menon, S\. Jayasumana, A\. S\. Rawat, H\. Jain, A\. Veit, and S\. Kumar \(2020\)Long\-tail learning via logit adjustment\.arXiv preprint arXiv:2007\.07314\.Cited by:[Long\-Tailed Learning](https://arxiv.org/html/2607.21999#Sx2.SSx1.p1.1)\.
- A\. K\. Menon, S\. Jayasumana, A\. S\. Rawat, H\. Jain, A\. Veit, and S\. Kumar \(2021\)Long\-tail learning via logit adjustment\.InInternational Conference on Learning Representations,Cited by:[Long\-Tailed Classification](https://arxiv.org/html/2607.21999#Sx4.SSx2.p2.1)\.
- A\. Radford, J\. W\. Kim, C\. Hallacy, A\. Ramesh, G\. Goh, S\. Agarwal, G\. Sastry, A\. Askell, P\. Mishkin, J\. Clark,et al\.\(2021\)Learning transferable visual models from natural language supervision\.InInternational conference on machine learning,pp\. 8748–8763\.Cited by:[Large\-Scale Long\-Tailed Fine\-Tuning](https://arxiv.org/html/2607.21999#Sx4.SSx3.p1.4)\.
- J\. Ren, C\. Yu, X\. Ma, H\. Zhao, S\. Yi,et al\.\(2020\)Balanced meta\-softmax for long\-tailed visual recognition\.Advances in neural information processing systems33,pp\. 4175–4186\.Cited by:[Long\-Tailed Learning](https://arxiv.org/html/2607.21999#Sx2.SSx1.p1.1)\.
- J\. Shi, T\. Wei, Z\. Zhou, J\. Shao, X\. Han, and Y\. Li \(2024\)Long\-tail learning with foundation model: heavy fine\-tuning hurts\.InProceedings of the 41st International Conference on Machine Learning,pp\. 45014–45039\.Cited by:[Introduction](https://arxiv.org/html/2607.21999#Sx1.p1.1),[Large\-Scale Long\-Tailed Fine\-Tuning](https://arxiv.org/html/2607.21999#Sx4.SSx3.p1.4)\.
- G\. Van Horn, O\. Mac Aodha, Y\. Song, Y\. Cui, C\. Sun, A\. Shepard, H\. Adam, P\. Perona, and S\. Belongie \(2018\)The inaturalist species classification and detection dataset\.InProceedings of the IEEE conference on computer vision and pattern recognition,pp\. 8769–8778\.Cited by:[Large\-Scale Long\-Tailed Fine\-Tuning](https://arxiv.org/html/2607.21999#Sx4.SSx3.p1.4)\.
- A\. Wang, H\. Chen, L\. Liu, K\. Chen, Z\. Lin, J\. Han, and G\. Ding \(2024\)Yolov10: real\-time end\-to\-end object detection\.Advances in neural information processing systems37,pp\. 107984–108011\.Cited by:[Introduction](https://arxiv.org/html/2607.21999#Sx1.p1.1)\.
- T\. Wang, Y\. Li, B\. Kang, J\. Li, J\. Liew, S\. Tang, S\. Hoi, and J\. Feng \(2020\)The devil is in classification: a simple framework for long\-tail instance segmentation\.InEuropean conference on computer vision,pp\. 728–744\.Cited by:[Long\-Tailed Learning](https://arxiv.org/html/2607.21999#Sx2.SSx1.p1.1)\.
- W\. Wang, J\. Dai, Z\. Chen, Z\. Huang, Z\. Li, X\. Zhu, X\. Hu, T\. Lu, L\. Lu, H\. Li,et al\.\(2023a\)Internimage: exploring large\-scale vision foundation models with deformable convolutions\.InProceedings of the IEEE/CVF conference on computer vision and pattern recognition,pp\. 14408–14419\.Cited by:[Introduction](https://arxiv.org/html/2607.21999#Sx1.p1.1)\.
- Z\. Wang, Q\. Xu, Z\. Yang, Y\. He, X\. Cao, and Q\. Huang \(2023b\)A unified generalization analysis of re\-weighting and logit\-adjustment for imbalanced learning\.Advances in Neural Information Processing Systems36,pp\. 48417–48430\.Cited by:[Introduction](https://arxiv.org/html/2607.21999#Sx1.p1.1)\.
- X\. Wei, S\. Xu, H\. Chen, L\. Xiao, and Y\. Peng \(2022\)Prototype\-based classifier learning for long\-tailed visual recognition\.Science China Information Sciences65\(6\),pp\. 160105\.Cited by:[Long\-Tailed Learning](https://arxiv.org/html/2607.21999#Sx2.SSx1.p1.1)\.
- Z\. Zhong, J\. Cui, S\. Liu, and J\. Jia \(2021\)Improving calibration for long\-tailed recognition\.InProceedings of the IEEE/CVF conference on computer vision and pattern recognition,pp\. 16489–16498\.Cited by:[Long\-Tailed Learning](https://arxiv.org/html/2607.21999#Sx2.SSx1.p1.1)\.
- Y\. Zhou, Y\. Qu, X\. Xu, and H\. Shen \(2023a\)Imbsam: a closer look at sharpness\-aware minimization in class\-imbalanced recognition\.InProceedings of the IEEE/CVF International Conference on Computer Vision,pp\. 11345–11355\.Cited by:[Introduction](https://arxiv.org/html/2607.21999#Sx1.p2.1),[Sharpness\-Aware Minimization in Long\-Tailed Learning](https://arxiv.org/html/2607.21999#Sx2.SSx2.p1.1),[Long\-Tailed Classification](https://arxiv.org/html/2607.21999#Sx4.SSx2.p3.1),[Table 4](https://arxiv.org/html/2607.21999#Sx4.T4)\.
- Z\. Zhou, L\. Li, P\. Zhao, P\. Heng, and W\. Gong \(2023b\)Class\-conditional sharpness\-aware minimization for deep long\-tailed recognition\.InProceedings of the IEEE/CVF conference on computer vision and pattern recognition,pp\. 3499–3509\.Cited by:[Introduction](https://arxiv.org/html/2607.21999#Sx1.p2.1),[Sharpness\-Aware Minimization in Long\-Tailed Learning](https://arxiv.org/html/2607.21999#Sx2.SSx2.p1.1),[Long\-Tailed Classification](https://arxiv.org/html/2607.21999#Sx4.SSx2.p3.1)\.

Similar Articles

Mini-batch Noise Lowers Sharpness via Dominant-Subspace Fluctuations

arXiv cs.LG

This paper argues that the dominant subspace of the Hessian, while contributing little to loss reduction, plays a key role in reducing sharpness during mini-batch SGD. It derives a sharpness correction term induced by mini-batch noise in the dominant directions.

Sample Where You Struggle: Sharpening Base Model Reasoning via Entropy-Guided Power Sampling

arXiv cs.LG

This paper introduces Entropy-Guided Power Sampling (EGPS), a training-free and verifier-free sampler that improves the efficiency of power sampling for enhancing base language model reasoning. EGPS achieves up to 12.6x speedup over standard Metropolis-Hastings sampling while reaching best or tied-best accuracy on benchmarks like MATH500, HumanEval, and GPQA.