Cubic scandium trifluoride (ScF_3) has a large negative thermal expansion over a wide range of temperatures. Inelastic neutron scattering experiments were performed to study the temperature dependence of the lattice dynamics of ScF3 from 7 to 750 K. The measured phonon densities of states show a large anharmonic contribution with a thermal stiffening of modes around 25 meV. Phonon calculations with first-principles methods identified the individual modes in the densities of states, and frozen phonon calculations showed that some of the modes with motions of F atoms transverse to their bond direction behave as quantum quartic oscillators. The quartic potential originates from harmonic interatomic forces in the DO_9 structure of ScF_3, and accounts for phonon stiffening with the temperature and a significant part of the negative thermal expansion