[Paper Review] Embedded hyper-parameter tuning by Simulated Annealing
This paper proposes an embedded hyper-parameter tuning method that integrates Simulated Annealing (SA) within Stochastic Gradient Descent (SGD) to dynamically adjust learning rates during training. By evaluating candidate hyper-parameters on-the-fly using gradient-informed moves and SA acceptance criteria, the method improves generalization, achieving up to 1-2% higher validation accuracy than standard SGD on ResNet34 and VGG16 for CIFAR-10.
We propose a new metaheuristic training scheme that combines Stochastic Gradient Descent (SGD) and Discrete Optimization in an unconventional way. Our idea is to define a discrete neighborhood of the current SGD point containing a number of "potentially good moves" that exploit gradient information, and to search this neighborhood by using a classical metaheuristic scheme borrowed from Discrete Optimization. In the present paper we investigate the use of a simple Simulated Annealing (SA) metaheuristic that accepts/rejects a candidate new solution in the neighborhood with a probability that depends both on the new solution quality and on a parameter (the temperature) which is modified over time to lower the probability of accepting worsening moves. We use this scheme as an automatic way to perform hyper-parameter tuning, hence the title of the paper. A distinctive feature of our scheme is that hyper-parameters are modified within a single SGD execution (and not in an external loop, as customary) and evaluated on the fly on the current minibatch, i.e., their tuning is fully embedded within the SGD algorithm. The use of SA for training is not new, but previous proposals were mainly intended for non-differentiable objective functions for which SGD is not applied due to the lack of gradients. On the contrary, our SA method requires differentiability of (a proxy of) the loss function, and leverages on the availability of a gradient direction to define local moves that have a large probability to improve the current solution. Computational results on image classification (CIFAR-10) are reported, showing that the proposed approach leads to an improvement of the final validation accuracy for modern Deep Neural Networks such as ResNet34 and VGG16.
Motivation & Objective
- To address the challenge of hyper-parameter tuning in deep neural networks (DNNs), particularly learning rate selection, which is typically manual or done in external loops.
- To develop a method that embeds hyper-parameter search directly within a single SGD training run, enabling real-time adaptation without external loops.
- To leverage gradient information to define promising local moves in hyper-parameter space, improving search efficiency compared to random or grid-based methods.
- To explore the role of the random seed as a tunable hyper-parameter that significantly influences the optimization path and final generalization performance.
- To evaluate whether SA-based hyper-parameter tuning can outperform standard SGD in terms of final validation accuracy and loss on modern DNN architectures.
Proposed method
- Define a discrete neighborhood of hyper-parameters (e.g., learning rates) around the current SGD point, using gradient information to guide potentially beneficial moves.
- Use Simulated Annealing (SA) to probabilistically accept or reject candidate hyper-parameter changes based on the loss change and a time-varying temperature parameter.
- Apply the Metropolis acceptance criterion: accept worsening moves with probability exp(−Δ/T), where Δ is the loss increase and T is the temperature, which decreases over time.
- Evaluate each candidate hyper-parameter change on the current minibatch in real time, enabling on-the-fly tuning without storing or re-evaluating on full datasets.
- Integrate the entire process within a single SGD training loop, eliminating the need for external hyper-parameter search loops.
- Treat the random seed as a hyper-parameter to be tuned externally, as it significantly influences the search trajectory and final model performance.
Experimental results
Research questions
- RQ1Can Simulated Annealing be effectively used to tune hyper-parameters like learning rates within a single SGD training run, rather than in external loops?
- RQ2Does embedding SA-based hyper-parameter tuning within SGD lead to better generalization performance on image classification benchmarks compared to standard SGD?
- RQ3How does the random seed influence the optimization path and final model performance when using SA for hyper-parameter tuning?
- RQ4Can gradient-informed moves in hyper-parameter space improve search efficiency compared to purely random or grid-based hyper-parameter selection?
- RQ5To what extent does the proposed method reduce the need for manual hyper-parameter tuning while maintaining or improving model accuracy?
Key findings
- The proposed SGD-SA method achieves significantly lower final validation loss than standard SGD on both ResNet34 and VGG16 for CIFAR-10, with improvements observed across all seeds.
- For ResNet34, SGD-SA achieves a 1-2% higher validation accuracy than standard SGD when considering the best-performing run across 10 random seeds.
- The training accuracy of SGD-SA converges more slowly than standard SGD, but the final validation accuracy is consistently better, indicating improved generalization.
- The probability of accepting worsening moves decreases over time, as expected in SA, with high acceptance in early epochs and near-zero acceptance in later epochs.
- Different random seeds lead to substantially different optimization trajectories in SGD-SA, demonstrating that the seed acts as a powerful hyper-parameter influencing model performance.
- The use of a differentiable proxy loss function enables gradient-based move generation, while the SA acceptance rule allows exploration of non-ideal moves, enhancing robustness and generalization.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.