The design of geopolymer concrete must meet more stringent requirements for the landscape, so understanding and designing geopolymer concrete with a higher compressive strength challenging. In the performance prediction of geopolymer concrete compressive strength, machine learning models have the advantage of being more accurate and faster. However, only a single machine learning model is usually used at present, there are few applications of ensemble learning models, and model optimization processes is lacking. Therefore, this paper proposes to use the Firefly Algorithm (AF) as an optimization tool to perform hyperparameter tuning on Logistic Regression (LR), Multiple Logistic Regression (MLR), decision tree (DT), and Random Forest (RF) models. At the same time, the reliability and efficiency of four integrated learning models were analyzed. The model was used to analyze the influencing factors of geopolymer concrete and determine the strength of their influencing ability. According to the experimental data, the RF-AF model had the lowest RMSE value. The RMSE value of the training set and test set were 4.0364 and 8.7202, respectively. The R value of the training set and test set were 0.9774 and 0.8915, respectively. Therefore, compared with the other three models, RF-AF has a stronger generalization ability and higher prediction accuracy. In addition, the molar concentration of NaOH was the most important influencing factors, and its influence was far greater than the other possible factors including NaOH content. Therefore, it is necessary to pay more attention to NaOH molarity when designing geopolymer concrete.