Probability-Dependent Gradient Decay in Large Margin Softmax

Siyuan Zhang, Linbo Xie, Ying ChenarXiv 2022 · DOI

Introduction

Modern deep learning predominantly relies on the Softmax function paired with Cross-Entropy loss for classification tasks. Despite its ubiquity, this approach frequently leads to overconfident models that assign near-100% probabilities to predictions, even when incorrect—a phenomenon known as poor model calibration. While "large margin" variants like ArcFace or AM-Softmax improve accuracy by forcing class separation, they often exacerbate overconfidence. This paper investigates how the rate of gradient decay, as a model gains confidence, influences training dynamics and final reliability.

Methodology: Controlling Gradient Decay with $\beta$

The authors propose a modified Softmax objective by introducing a hyperparameter $\beta$ into the denominator:

$$J = -\log \frac{e^{z_c}}{\sum_{i \neq c} e^{z_i} + \beta e^{z_c}}$$

In this formulation, $\beta$ serves as a "control valve" for gradient decay. When $\beta$ is small (e.g., 0.01), the gradient remains high even as the probability of the correct class ($p_c$) increases, forcing the model to push samples deeper into class clusters. Conversely, a large $\beta$ (e.g., 20) causes the gradient to drop off earlier, preventing over-optimization of easy samples and improving calibration.

Figure 2: Gradient decay curves for various values of $\beta$. Smaller $\beta$ values maintain higher gradients at high probabilities, while larger $\beta$ values induce earlier decay.

The parameter $\beta$ also regulates the local Lipschitz constant of the loss surface. A linear warm-up strategy—starting with a small $\beta$ to accelerate initial feature learning and gradually increasing it—is proposed to balance accuracy and calibration.

Feature Distribution and the Calibration Trade-off

The choice of $\beta$ significantly impacts the learned feature space. Small $\beta$ values produce highly compact intra-class clusters, effectively acting as a large margin constraint. However, this compactness often comes at the cost of Expected Calibration Error (ECE), as the model becomes overconfident.

Figure 1: Visualization of feature distributions on MNIST for different $\beta$ values. Decreasing $\beta$ leads to tighter, more separated class clusters.

This creates a "curriculum" effect: with small $\beta$, the model focuses intensely on "easy" samples until they are deeply embedded in their clusters before shifting focus to harder, ambiguous samples. Large $\beta$ values result in "fuzzier" clusters but yield more honest probability estimates, addressing calibration issues during training rather than through post-processing techniques like Temperature Scaling.

Experimental Results

The approach was evaluated on benchmarks including MNIST, CIFAR-10/100, SVHN, and Tiny-ImageNet using architectures like ResNet and MobileNet.

  • Calibration: On CIFAR-100 with ResNet18, a large $\beta=20$ achieved an ECE of 0.021, significantly better than standard Softmax ($\beta=1$, ECE=0.130) and post-processing methods like Vector Scaling (0.041).
  • Accuracy: On SVHN, smaller $\beta$ values (0.1) improved Top-1 accuracy over standard Softmax, demonstrating the benefits of the large margin effect in certain feature spaces.
  • Warm-up Strategy: The proposed warm-up schedule frequently outperformed specialized losses like A-Softmax and Center Loss by achieving both high accuracy and low calibration error.

Conclusion and Future Work

Adjusting probability-dependent gradient decay via $\beta$ provides a principled way to tune the balance between feature discriminability and model calibration. While the optimal $\beta$ and its schedule currently require manual tuning based on the dataset, future work may involve adaptive mechanisms to dynamically adjust $\beta$ based on real-time training statistics and exploring its interaction with learning rate schedulers.

Summary updated

BibTeX
@misc{zhang2022probability,
  author = {Siyuan Zhang and Linbo Xie and Ying Chen},
  title = {{Probability-Dependent Gradient Decay in Large Margin Softmax}},
  year = {2022},
  eprint = {2210.17145},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2210.17145},
}
Figure