Air conditioning, as an essential appliance in daily life, has the function of ensuring comfortable room temperature, but it is also accompanied by a large amount of power consumption. Consequently, the study suggests an energy consumption prediction model based on improved genetic algorithm—least squares support vector machine—to accurately predict the energy consumption of building heating, ventilation, and air conditioning. This model uses the improved genetic algorithm for regularization parameter and kernel parameter optimization to prevent overfitting and underfitting issues. According to the testing results, the least squares support vector machine, an upgraded genetic algorithm, may accomplish convergence faster than other algorithms, taking only 0.2 milliseconds to finish. In addition, the average relative error of the improved genetic algorithm- least squares support vector machine did not exceed 0.6%. In the energy consumption prediction for the whole year of 2022, the average error of the improved genetic algorithm-least squares support vector machine was only 2.0 × 106 kWh, and the prediction accuracy could reach up to 97.2%. The above outcomes revealed that the energy consumption prediction model can accurately predict the air conditioning energy consumption, which provides a strong support for the control and optimization of the air conditioning system.