This paper aims to accurately predict China's rare earth export prices and reveal the impact of variables such as seasonality, significant events, finance, and supply and demand on rare earth price volatility. Daily datasets of light and heavy rare earths from 2011 to 2023 were used, and the Tree-structured Parzen Estimator-Temporal Fusion Transformer model was employed to predict rare earth prices. Complete Ensemble Empirical Mode Decomposition with Adaptive Noise and partial dependence plots were used to reveal the factors affecting price volatility. The following conclusions were drawn: (1) The Tree-structured Parzen Estimator-Temporal Fusion Transformer deep learning model can provide more accurate rare earth price prediction information; (2) Light rare earth prices are more susceptible to cyclical influences, while heavy rare earth prices are more affected by significant events. The outbreak of COVID-19 has had a long-term impact on both light and heavy rare earth prices; (3) The fluctuations in heavy rare earth prices are mainly influenced by financial factors, while the fluctuations in light rare earth prices are influenced by multiple factors such as finance, supply and demand, and macroeconomics; (4) An increase in resource tax rates may lead to a decrease in rare earth prices, while an increase in restrictions on rare earth mining may lead to an increase in rare earth prices.