Increasing global energy demands and decreasing stocks of fossil fuels have led to a resurgence of research into energy forecasting. Artificial intelligence, explicitly time series forecasting holds great potential to improve predictions of cost and demand with many lucrative applications across several fields. Many factors influence prices on a global scale, from socio-economic factors to distribution, availability, and international policy. Also, various factors need to be considered in order to make an accurate forecast. By analyzing the current literature, a gap for improvements within this domain exists. Therefore, this work suggests and explores the potential of multi-headed long short-term memory models for gasoline price forecasting, since this issue was not tackled with multi-headed models before. Additionally, since the computational requirements for such models are relatively high, work focuses on lightweight approaches that consist of a relatively low number of neurons per layer, trained in a small number of epochs. However, as algorithm performance can be heavily dependent on appropriate hyper-parameter selections, a modified variant of the particle swarm optimization algorithm is also set forth to help in optimizing the model’s architecture and training parameters. A comparative analysis is conducted using energy data collected from multiple public sources between several contemporary optimizers. The outcomes are put through a meticulous statistical validation to ascertain the significance of the findings. The best-constructed models attained a mean square error of just 0.044025 with an R-squared of 0.911797, suggesting potential for real-world use.