Slag is a typical metallurgical solid waste, mainly composed of magnesium oxide, iron oxide, alumina oxide and other metal oxides. The rapid quantitative analysis of slag components is helpful to determine the content of valuable elements or components in slag, and then choose a suitable resource utilization way to achieve efficient utilization and reduce environmental pollution. In this study, a quantitative analysis method of Fe, Si and Ti in slag was proposed based on laser induced breakdown spectroscopy (LIBS) combined with machine learning algorithm. Firstly, LIBS spectra of slag samples were collected, and the characteristic spectral lines of related elements were identified through the National Institute of Standards and Technology (NIST) database. Then, the influence of different spectral preprocessing methods on the predictive performance of PLS model was investigated, and the combined performance of spectral preprocessing methods was discussed. On this basis, a mixed variable selection algorithm combining variable importance in projection (VIP) and grey wolf algorithm (GWO) was proposed to screen LIBS spectral characteristic variables of slag samples. Based on cross-validation, the parameters, thresholds, input variables and model parameters of the preprocessing method and feature screening method were optimized. A quantitative analysis model of Fe, Si and Ti in slag based on LIBS technique was established based on the optimized parameters and input variables. The results showed that the optimized model had better prediction performance than the original spectral model, with R-P(2) of 0.9525, 0.9604 and 0.9972, and RMSEp of 0.0461, 0.0141 and 0.1963, respectively. It was proved that LIBS combined with machine learning algorithm provided a feasible method for the field rapid detection of slag elements. The research is expected to provide some theoretical basis and technical reference for the resource utilization of metallurgical solid waste.