Using gels to replace a certain amount of cement in concrete is conducive to the green concrete industry, while testing the compressive strength (CS) of geopolymer concrete requires a substantial amount of substantial effort and expense. To solve the above issue, a hybrid machine learning model of a modified beetle antennae search (MBAS) algorithm and random forest (RF) algorithm was developed in this study to model the CS of geopolymer concrete, in which MBAS was employed to adjust the hyperparameters of the RF model. The performance of the MBAS was verified by the relationship between 10-fold cross-validation (10-fold CV) and root mean square error (RMSE) value, and the prediction performance of the MBAS and RF hybrid machine learning model was verified by evaluating the correlation coefficient (R) and RMSE values and comparing with other models. The results show that the MBAS can effectively tune the performance of the RF model; the hybrid machine learning model had high R values (training set R = 0.9162 and test set R = 0.9071) and low RMSE values (training set RMSE = 7.111 and test set RMSE = 7.4345) at the same time, which indicated that the prediction accuracy was high; NaOH molarity was confirmed as the most important parameter regarding the CS of geopolymer concrete, with the importance score of 3.7848, and grade 4/10 mm was confirmed as the least important parameter, with the importance score of 0.5667.