Early Stopping Bayesian Optimization for Controller Tuning

David Stenger, Dominik Scheurenberg, Heike Vallery, Sebastian Trimpe

TL;DR

Standard Bayesian Optimization (BO) for controller tuning is often slow because it evaluates every candidate parameter set over a fixed, full-length episode—even when a controller is clearly performing poorly. This paper introduces Early Stopping Bayesian Optimization (ESBO), which terminates suboptimal experiments early and uses novel heuristics to incorporate the resulting partial data into the optimization process, reducing experimentation time by up to 48% without sacrificing the quality of the final controller.

What Problem Does This Paper Address?

Tuning controllers (like PIDs or MPCs) for complex hardware is a "black-box" problem: we don't have a perfect mathematical formula for how parameters affect real-world performance. Bayesian Optimization is the gold standard for solving this, as it builds a probabilistic model (a Gaussian Process) to "guess" the best parameters with very few trials.

However, standard BO is wasteful. If a proposed controller causes a robot to oscillate violently or a tank to overflow within the first five seconds, standard practice is to let the experiment run for the full duration (say, 60 seconds). This wastes time, causes unnecessary hardware wear, and consumes energy. The challenge is that BO models expect a complete "score" for every trial; if you stop early, you only have a partial score, which the model might mistakenly interpret as a "good" (low) cost simply because the experiment didn't finish.

Methods

The authors propose a framework that decides when to stop and how to use the resulting "broken" data.

  1. The Stopping Rule: An episode is stopped the moment its cumulative cost exceeds the total cost of the current best-known controller. Since costs are non-negative and additive, if you've already performed worse than the best in half the time, there is no way to "win" by continuing.
  2. Handling Partial Data: They propose three heuristics to prevent the model from being "tricked" by incomplete runs:
  3. ESBO-C (Crash): Treats early-stopped runs as "crashes." It uses pessimistic predictions from a model trained only on successful runs to assign a high virtual cost to the failure.
  4. ESBO-TR (Time Reformulation): Instead of modeling cost directly, it models the time it takes to reach the current best cost threshold.
  5. ESBO-GP (Segmented GPs): The most sophisticated approach. It splits the episode into time segments and uses separate Gaussian Processes to "hallucinate" the missing costs of the remaining segments based on data from completed runs.

Datasets

The researchers evaluated their methods on a diverse set of control benchmarks:

  • Simulations: Five distinct tasks including a Bang-Bang controlled boiler, a PI-controlled three-tank system, a PID for a system with dead-time, State Feedback for a Cart Pole, and an MPC for a non-linear three-tank system.
  • Hardware: A physical three-tank hardware test bed at RWTH Aachen University, where a PI controller was tuned to track water levels.

Key Insights and Ideas

  • Partial Info is Better than Binary Info: Previous "crash constraint" methods only noted if a run failed. ESBO-GP actually looks at how the cost was accumulating before the stop, allowing the model to learn more about the "shape" of the failure region.
  • The Efficiency-Quality Trade-off: The authors found that you don't need to finish a bad experiment to know it's bad. By cutting these runs short, the optimizer can move on to more promising areas of the parameter space much faster.
  • Application Independence: The stopping rule is based purely on the cumulative sum of costs, making it applicable to any controller objective that is time-integrated (like Mean Squared Error or energy consumption).

Key Results

  • Significant Speedups: In simulations, ESBO-GP reduced the total simulation time by 48% compared to vanilla BO to reach the same performance level.
  • Hardware Success: On the physical three-tank system, ESBO-GP reached a high-quality solution 35% faster than standard BO (reducing experimentation time from 34 minutes to 22 minutes).
  • Robustness: Despite stopping many runs early, the ESBO variants consistently found controller parameters that were just as good as those found by standard, full-length BO.

Limitations and Future Work

  • Additive Costs Only: The current method relies on the cost being a sum of non-negative values (like error over time). It cannot handle metrics like "settling time" or frequency-domain requirements that can only be calculated at the very end of an episode.
  • Reset Time Neglect: The paper assumes that the time saved by stopping early is the primary bottleneck. In some hardware setups, the "reset time" (draining tanks, homing motors) might be so long that stopping an episode 10 seconds early provides negligible total time savings.
  • Probabilistic Stopping: Future work could involve "Bayesian early stopping," where an episode is aborted based on a prediction that it will likely be suboptimal, even before it actually crosses the cost threshold.

Summary updated

BibTeX
@inproceedings{stenger2024early,
  author = {David Stenger and Dominik Scheurenberg and Heike Vallery and Sebastian Trimpe},
  title = {{Early Stopping Bayesian Optimization for Controller Tuning}},
  booktitle = {CDC},
  year = {2024},
  doi = {10.1109/cdc56724.2024.10886051},
}
Figure