The Stan Math Library: Reverse-Mode Automatic Differentiation in C++
Bob Carpenter, Matthew D. Hoffman, Marcus Brubaker, Daniel Lee, Peter, Li, Michael Betancourt

TL;DR
The paper introduces the Stan Math Library, a comprehensive C++ tool for reverse-mode automatic differentiation that simplifies derivative computation in complex algorithms, emphasizing usability, extensibility, efficiency, and portability.
Contribution
It presents a new, extensive C++ library that makes reverse-mode automatic differentiation accessible, efficient, and customizable for optimization and statistical inference tasks.
Findings
Provides a user-friendly C++ interface for automatic differentiation.
Includes extensive built-in functions for matrix, linear algebra, and probability.
Achieves high efficiency and stability through advanced memory management and stable algorithms.
Abstract
As computational challenges in optimization and statistical inference grow ever harder, algorithms that utilize derivatives are becoming increasingly more important. The implementation of the derivatives that make these algorithms so powerful, however, is a substantial user burden and the practicality of these algorithms depends critically on tools like automatic differentiation that remove the implementation burden entirely. The Stan Math Library is a C++, reverse-mode automatic differentiation library designed to be usable, extensive and extensible, efficient, scalable, stable, portable, and redistributable in order to facilitate the construction and utilization of such algorithms. Usability is achieved through a simple direct interface and a cleanly abstracted functional interface. The extensive built-in library includes functions for matrix operations, linear algebra, differential…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSimulation Techniques and Applications · Markov Chains and Monte Carlo Methods · Numerical Methods and Algorithms
