# Self-Tuning Lam Annealing: Learning Hyperparameters While Problem Solving
## 2 Methods
### Self-Tuning Lam
#### 2.3.5 Putting It All Together
We then simulate \(N\) iterations by generating a \"cost\" for a neighbor at each iteration, without actually generating any neighbors or calculating any actual cost function. At the beginning of the run, the artificially generated \"cost\" alternates between higher than current cost and lower than current cost. An eighth of the way through the run, we generate \"costs\" that are better than the current every four iterations, and then after the next eighth of the run this becomes every eight iterations, and so forth. The rationale is to simulate typical behavior where SA will eventually settle into a local optimum. By artificially generating costs in this way, we eliminate the time impact of cost function computation and neighbor generation. Therefore, what we are timing is simply the operations of the annealing schedules alone. For each run length \(N\) and each of the two algorithms, we repeat this procedure 100 times, computing the average runtime in seconds of CPU time. Table 21 summarizes the results. Runs of fewer than \(N=\) 16,000 iterations completed too quickly on our test machine to meaningfully measure CPU time. Therefore, our results begin with \(N=\) 16,000, and we double \(N\) for each subsequent trial. As you can see, the differences in the CPU time of the two annealing schedules are not statistically significant (\(p>0.05\)) at any run length considered. ## 4 Discussion and Conclusions

The Modified Lam is one of the more widely-known adaptive annealing schedules. Rather than a monotonically decreasing temperature, the Modified Lam allows the temperature to fluctuate both up and down, using feedback from the search to attempt to match [PERSON] and [PERSON]'s idealized rate of neighbor acceptance. It has often been argued to be a parameter-free annealing schedule, often performing well across a wide range of problem types. It uses an EMA estimate of the acceptance rate internally to determine if \begin{table}
\begin{tabular}{c c c c} \hline \hline \(N\) & **Modified Lam** & **Self-Tuning Lam** & **T-Test \(p\)-Value** \\ \hline
16,000 & 0.00063 & 0.00094 & 0.52 \\
32,000 & 0.00156 & 0.00172 & 0.82 \\
64,000 & 0.00313 & 0.00328 & 0.86 \\
128,000 & 0.00594 & 0.00625 & 0.77 \\
256,000 & 0.01156 & 0.01328 & 0.054 \\
512,000 & 0.02406 & 0.02547 & 0.20 \\
1,024,000 & 0.04875 & 0.05000 & 0.14 \\ \hline \hline \end{tabular}
\end{table} 
Table 21: Runtime comparison, measured in seconds of CPU time, of the Modified Lam and Self-Tuning Lam annealing schedules. Averages of 100 runs of each run length. SA is currently accepting too few neighbors or too many neighbors relative to the target idealized rate. The parameters of that EMA are treated as constants, rather than tunable parameters. As a consequence, short runs may not sufficiently weight the most recent iterations, and long runs may too heavily weight the most recent iterations. Due to its constant initial temperature, it may accept too few neighbors in the early portion of the search, essentially beginning with a strict hill climb; and its constant rate of temperature change may prevent the Modified Lam from adjusting the temperature quickly enough to track the target rate of acceptance. In our experiments, we showed that due to this, the Modified Lam is sensitive to cost function scale and run length. Namely, we saw that short runs of the Modified Lam lead to an acceptance rate during the run that rarely matches the target acceptance rate, and is often significantly below the target, such as seen in Figures 2a, 3a, 4a, 4a, 5a, 6a, 9a, 10a, 11a, 13a, 14a, 15a, 18a, 19a and 20a. For longer runs, the Modified Lam is often slow to match the target acceptance rate, and then once it does begins large oscillations around the target as it continuously overcompensates in its adjustments, such as in Figures 3b, 5b-d and 6b. In some cases, the Modified Lam is just generally far off from its target acceptance rate, such as in Figures 4a-d, 10b, 11b, 12a, 14b, 15b, 17a, 19b and 20b.