Obtaining accurate lattice thermal conductivity data of LiF under extreme conditions not only provides important reference for performance evaluation, prediction, and control of materials, but also helps to alleviate the significant challenges of precise experimental measurements. The high-temperature phonon properties and lattice thermal conductivity (LTC) of solid LiF were calculated by combining on-the-fly machine learning force fields (MLFFs) with the Green–Kubo method. The introduction of MLFF successfully combines the accuracy of ab initio molecular dynamics with the scalability advantage of classical molecular dynamics. At high temperatures, there is a significant enhancement in the vibrational coupling between the acoustic and optical branches of LiF, as well as resonant effects between Li and F atoms, resulting in strong anharmonicity. Additionally, the main peak of the phonon density of states shows a noticeable redshift compared to the harmonic case. The enhanced coupling of TO and TA modes at high temperature leads to a significant increase in phonon scattering rate. By considering higher-order phonon anharmonicity, the predicted LTC is significantly reduced compared to the results obtained from considering only three-phonon interactions. Along the Hugoniot curve up to 100 GPa (2150 K), the predicted LTC agrees well with the experimental values. These findings demonstrate the crucial role of phonon anharmonicity in promoting phonon scattering.