Cemented tailings backfill is widely used in worldwide mining areas, and its development trend is increasing due to the technical and economic benefits. However, there is no reliable and simple machine learning model for the prediction of the compressive strength. In the present study, the research process to use artificial intelligence algorithms to predict the compressive strength of cemented tailing backfill was conducted, overcoming the shortcomings of traditional empirical formulas. Experimental tests to measure the compressive strength of cemented tailing backfill were conducted to construct the dataset for the machine learning. Five input parameters (tailing to cement ratio, percentage of fine tailings, cement type, curing time, and solid to water ratio) were considered for the design of the laboratory tests. The firefly algorithm (FA) was used to tune the random forest (RF) hyperparameters, and it was adopted to combine the RF model to improve the accuracy and efficiency for the prediction of the compressive strength of the cemented tailing backfill. By comparing the predicted and actual results, the reliability and accuracy of the prediction model proposed are confirmed. Tailing to cement ratio and curing time are the two most important parameters to the compressive strength of the cemented tailing backfill.