  Recently, machine learning potentials (MLP) largely enhances the reliability
of molecular dynamics, but its accuracy is limited by the underlying
$\textit{ab initio}$ methods. A viable approach to overcome this limitation is
to refine the potential by learning from experimental data, which now can be
done efficiently using modern automatic differentiation technique. However,
potential refinement is mostly performed using thermodynamic properties,
leaving the most accessible and informative dynamical data (like spectroscopy)
unexploited. In this work, through a comprehensive application of adjoint and
gradient truncation methods, we show that both memory and gradient explosion
issues can be circumvented in many situations, so the dynamical property
differentiation is well-behaved. Consequently, both transport coefficients and
spectroscopic data can be used to improve the density functional theory based
MLP towards higher accuracy. Essentially, this work contributes to the solution
of the inverse problem of spectroscopy by extracting microscopic interactions
from vibrational spectroscopic data.
