Optuna: A Next-generation Hyperparameter Optimization Framework
Paper · 2019 · Takuya Akiba, Shotaro Sano, Toshihiko Yanase et al.
Summary
Tuning hyperparameters is tedious, and the authors argue that existing tools (Hyperopt, Spearmint, SMAC, Vizier, Katib, Tune and others) make it harder than it needs to be. These tools force users to declare the whole search space before any trial runs. Many of them also lack good early stopping of weak trials, or require heavy infrastructure. The paper proposes three design requirements for the next generation of such software:
- the search space is built while the code runs (define-by-run);
- sampling and pruning are both efficient and can be customized;
- the architecture scales from a quick notebook experiment to a distributed cluster.
Optuna, released under the MIT license, implements these ideas. The objective function receives a live trial object and asks it for values through suggest calls, using ordinary Python loops and branches. Each new value is drawn using the history of earlier trials. The authors say Optuna is the first optimizer built on this principle and that it beats many major black-box frameworks while staying easy to install. This matters because conditional, heterogeneous model spaces become short, readable and modular code.
Key points
- The paper's terminology: an optimization run is a study, and each evaluation of the objective is a trial. Values come from calls such as
suggest_int. - In the MNIST example, an MLPClassifier has 1 to 4 layers with 1 to 128 units per layer, optimized over 100 trials. The equivalent Hyperopt code needs nested
hp.choicedictionaries and is much longer and harder to read. - Table 1 places Optuna (2019) as the only define-by-run hyperparameter framework. This mirrors deep learning libraries such as Chainer, DyNet and PyTorch, as opposed to static ones like TensorFlow or Theano.
- The related-work section names pruning approaches: learning-curve extrapolation (Domhan et al.), Bayesian neural network curve prediction (Klein et al.) and the bandit-based Hyperband (Li et al.).
- Optuna had been in production use at Preferred Networks for over a year when the paper was written.
Interesting ideas
- I1. Let the search space emerge from running code: each choice is requested at the moment it becomes relevant, so conditional options exist only when their parent branch is taken. This avoids huge static configuration trees.
- I2. One objective can branch between entirely different model families (in the paper, random forest versus MLP), so the model choice is tuned together with its settings.
- I3. Keeping the search space modular means independent helper functions (model builder, optimizer builder) each request their own parameters. A part can then be swapped without touching the rest.
- I4. Treat pruning as equal in importance to sampling: check intermediate scores and stop trials that are clearly losing, which saves compute when resources are limited.
- I5. One tool that is light enough for an interactive session yet can also run distributed lowers the cost of every experiment.
For Mova
How these ideas could serve Mova, our small open language model — its files, stages and tests:
- I1 (learn): The training scripts for the perceptron parser and gparse could ask for feature-set, beam or layer options inside the training code, so options that depend on architecture stay readable.
- I2 (tree): One study could compare the perceptron parser against gparse on LAS, each with its own settings, rather than tuning the two in separate ad hoc runs.
- I3 (learn): Tokenizer, tagger and parser components could each expose their own suggest-style hooks, so a whole-pipeline tuning run reuses them unchanged.
- I4 (learn): Training runs on silver data could be cut early when dev LAS after the first epochs falls behind earlier runs, leaving more budget for promising configurations.
- I5 (answer): Small settings of the readers, such as thresholds on fable QA or math word problems, could be tuned in quick local studies with the same tool later used for large runs.
Institutions
Fields, topics and concepts
Shelves 4The field of science this work belongs to (OpenAlex fields).Computer Science · 19,503 worksArtificial Intelligence · 18,805 worksEngineering · 206 worksControl and Systems Engineering · 72 works
Appears in
Mentioned in articles aboutParis
Cite
Cite as Takuya Akiba, Shotaro Sano, Toshihiko Yanase, Takeru Ohta and Masanori Koyama. 2019. Optuna: A Next-generation Hyperparameter Optimization Framework. arXiv:1907.10902.
@misc{akiba2019optuna,
title = {{Optuna: A Next-generation Hyperparameter Optimization Framework}},
author = {Takuya Akiba, Shotaro Sano, Toshihiko Yanase, Takeru Ohta and Masanori Koyama},
year = {2019},
doi = {10.48550/arxiv.1907.10902},
eprint = {1907.10902},
archivePrefix = {arXiv},
url = {https://doi.org/10.48550/arxiv.1907.10902}
}References
- James Bergstra, Brent Komer, Chris Eliasmith, Dan Yamins, and David D Cox. Hyperopt: a Python library for model selection and hyperparameter optimization. Computational Science & Discovery, 80 (1):0 14008, 2015. OpenAlex ↗ · Scholar ↗
- Jasper Snoek, Hugo Larochelle, and Ryan P Adams. Practical bayesian optimization of machine learning algorithms. In NIPS, pages 2951–2959, 2012. OpenAlex ↗ · Scholar ↗
- Frank Hutter, Holger H. Hoos, and Kevin Leyton-Brown. Sequential model-based optimization for general algorithm configuration. In LION, pages 507–523, 2011. ISBN 978-3-642-25565-6. OpenAlex ↗ · Scholar ↗
- Patrick Koch, Oleg Golovidov, Steven Gardner, Brett Wujek, Joshua Griffin, and Yan Xu. Autotune: A derivative-free optimization framework for hyperparameter tuning. In KDD, pages 443–452, 2018. ISBN 978-1-4503-5552-0. OpenAlex ↗ · Scholar ↗
- Daniel Golovin, Benjamin Solnik, Subhodeep Moitra, Greg Kochanski, John Karro, and D Sculley. Google Vizier: A service for black-box optimization. In KDD, pages 1487–1495, 2017. ISBN 978-1-4503-4887-4. OpenAlex ↗ · Scholar ↗
- James Bergstra, Rémi Bardenet, Yoshua Bengio, and Balázs Kégl. Algorithms for hyper-parameter optimization. In NIPS, pages 2546–2554, 2011. OpenAlex ↗ · Scholar ↗
- Richard Liaw, Eric Liang, Robert Nishihara, Philipp Moritz, Joseph E. Gonzalez, and Ion Stoica. Tune: A research platform for distributed model selection and training. In ICML Workshop on AutoML, 2018. OpenAlex ↗ · Scholar ↗
- Tobias Domhan, Jost Tobias Springenberg, and Frank Hutter. Speeding up automatic hyperparameter optimization of deep neural networks by extrapolation of learning curves. In IJCAI, pages 3460–3468, 2015. OpenAlex ↗ · Scholar ↗
- Aaron Klein, Stefan Falkner, Jost Tobias Springenberg, and Frank Hutter. Learning curve prediction with Bayesian neural networks. In ICLR, 2017. OpenAlex ↗ · Scholar ↗
- Lisha Li, Kevin Jamieson, Giulia DeSalvo, Afshin Rostamizadeh, and Ameet Talwalkar. Hyperband: A novel bandit-based approach to hyperparameter optimization. Journal of Machine Learning Research, 180 (185):0 1–52, 2018a. OpenAlex ↗ · Scholar ↗
- Philipp Moritz, Robert Nishihara, Stephanie Wang, Alexey Tumanov, Richard Liaw, Eric Liang, William Paul, Michael I. Jordan, and Ion Stoica. Ray: A distributed framework for emerging AI applications. CoRR, abs/1712.05889, 2017. URL http://arxiv.org/abs/1712.05889. OpenAlex ↗ · Scholar ↗
- Frank Hutter, Lars Kotthoff, and Joaquin Vanschoren, editors. Automatic Machine Learning: Methods, Systems, Challenges. Springer, 2018. In press, available at http://automl.org/book. OpenAlex ↗ · Scholar ↗
- Seiya Tokui, Kenta Oono, Shohei Hido, and Justin Clayton. Chainer: a next-generation open source framework for deep learning. In NIPS Workshop on Machine Learning Systems, 2015. OpenAlex ↗ · Scholar ↗
- Graham Neubig, Chris Dyer, Yoav Goldberg, Austin Matthews, Waleed Ammar, Antonios Anastasopoulos, Miguel Ballesteros, David Chiang, Daniel Clothiaux, Trevor Cohn, Kevin Duh, Manaal Faruqui, Cynthia Gan, Dan Garrette, Yangfeng Ji, Lingpeng Kong, Adhiguna Kuncoro, Gaurav Kumar, Chaitanya Malaviya, Paul Michel, Yusuke Oda, Matthew Richardson, Naomi Saphra, Swabha Swayamdipta, and Pengcheng Yin. Dynet: The dynamic neural network toolkit. CoRR, abs/1701.03980, 2017. our card
- Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in PyTorch. In NIPS Autodiff Workshop, 2017. OpenAlex ↗ · Scholar ↗
- Martín Abadi, Paul Barham, Jianmin Chen, Zhifeng Chen, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Geoffrey Irving, Michael Isard, Manjunath Kudlur, Josh Levenberg, Rajat Monga, Sherry Moore, Derek G. Murray, Benoit Steiner, Paul Tucker, Vijay Vasudevan, Pete Warden, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. TensorFlow: A system for large-scale machine learning. In OSDI, pages 265–283, 2016. our card
- Nikolaus Hansen and Andreas Ostermeier. Completely derandomized self-adaptation in evolution strategies. Evolutionary Computation, 90 (2):0 159–195, 2001. OpenAlex ↗ · Scholar ↗
- Bobak Shahriari, Kevin Swersky, Ziyu Wang, Ryan P Adams, and Nando De Freitas. Taking the human out of the loop: A review of bayesian optimization. Proceedings of the IEEE, 1040 (1):0 148–175, 2016. OpenAlex ↗ · Scholar ↗
- Liam Li, Kevin Jamieson, Afshin Rostamizadeh, Ekaterina Gonina, Moritz Hardt, Benjamin Recht, and Ameet Talwalkar. Massively parallel hyperparameter tuning. In NeurIPS Workshop on Machine Learning Systems, 2018b. OpenAlex ↗ · Scholar ↗
- Kevin Jamieson and Ameet Talwalkar. Non-stochastic best arm identification and hyperparameter optimization. In Artificial Intelligence and Statistics, pages 240–248, 2016. OpenAlex ↗ · Scholar ↗
- Wes McKinney. Pandas: a foundational python library for data analysis and statistics. In SC Workshop on Python for High Performance and Scientific Computing, 2011. OpenAlex ↗ · Scholar ↗
- Thomas Kluyver, Benjamin Ragan-Kelley, Fernando Pérez, Brian Granger, Matthias Bussonnier, Jonathan Frederic, Kyle Kelley, Jessica Hamrick, Jason Grout, Sylvain Corlay, Paul Ivanov, Damián Avila, Safia Abdalla, and Carol Willing. Jupyter notebooks – a publishing format for reproducible computational workflows. In F. Loizides and B. Schmidt, editors, Positioning and Power in Academic Publishing: Players, Agents and Agendas, pages 87 – 90. IOS Press, 2016. OpenAlex ↗ · Scholar ↗
- Michael McCourt. Benchmark suite of test functions suitable for evaluating black-box optimization strategies. https://github.com/sigopt/evalset, 2016. OpenAlex ↗ · Scholar ↗
- Ian Dewancker, Michael McCourt, Scott Clark, Patrick Hayes, Alexandra Johnson, and George Ke. A strategy for ranking optimization methods using multiple criteria. In ICML Workshop on AutoML, pages 11–20, 2016. OpenAlex ↗ · Scholar ↗
- Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. ImageNet classification with deep convolutional neural networks. In NIPS, pages 1097–1105, 2012. our card
- Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. In NIPS Workshop on Deep Learning and Unsupervised Feature Learning, 2011. OpenAlex ↗ · Scholar ↗
- Alina Kuznetsova, Hassan Rom, Neil Alldrin, Jasper R. R. Uijlings, Ivan Krasin, Jordi Pont-Tuset, Shahab Kamali, Stefan Popov, Matteo Malloci, Tom Duerig, and Vittorio Ferrari. The open images dataset V4: unified image classification, object detection, and visual relationship detection at scale. CoRR, abs/1811.00982, 2018. OpenAlex ↗ · Scholar ↗
- Takuya Akiba, Tommi Kerola, Yusuke Niitani, Toru Ogawa, Shotaro Sano, and Shuji Suzuki. PFDet: 2nd place solution to open images challenge 2018 object detection track. In ECCV Workshop on Open Images Challenge, 2018. our card
- Siying Dong, Mark Callaghan, Leonidas Galanis, Dhruba Borthakur, Tony Savor, and Michael Strum. Optimizing space amplification in rocksdb. In CIDR, 2017. OpenAlex ↗ · Scholar ↗
This page in Markdown https://md.research.elamur.ai/free/en/papers/akiba-2019-optuna-next-generation-hyperparameter-optimization/