After the water inrush accident in coal mine tunnels, early-stage pouring of aggregate forms a high-resistance, low-permeability aggregate stacking, transforming the pipeline flow into percolation. In the later stage, grouting is carried out into the interior of the aggregate stacking, effectively accumulating and solidifying the cement slurry. Among these, whether the slurry can migrate over long distances and fill the voids inside the aggregate stacking is the critical determinant of the success or failure of sealing. To quantitatively analyze the migration distance of slurry inside the aggregate stacking after grouting, a single-hole grouting test platform was established, and an orthogonal experiment was designed with grouting pressure, water cement ratio, and aggregate stacking porosity as influencing factors. Based on 25 sets of experimental measurements, four neural network prediction models suitable for studying the slurry migration distance within the aggregate stacking were constructed separately as back propagation neural network (BPNN), genetic algorithm (GA) combined BPNN, particle swarm optimization (PSO) combined BPNN, and GA-PSO combined BPNN. Evaluation criteria such as Mean Absolute Error (MAE), Mean Absolute Percentage Error (MAPE), Mean Square Error (MSE), Root Mean Square Error (RMSE), and the coefficient of determination (R2) were used for comparative analysis of the calculation errors and prediction accuracy of each model. From the perspective of neural network prediction results, the weight value of each influencing factor was analyzed, and the ranking was as follows: grouting pressure > aggregate particle size > water cement ratio, with grouting pressure being the primary controlling factor. The study demonstrates that the GA-PSO-BP model exhibits the best prediction performance, with an average relative error of only 1.59% and an R² of 0.998. This neural network model overcomes issues such as slow learning and getting stuck in tricky spots in BP neural networks. The prediction model shows high accuracy and stability, enabling more effective and accurate prediction of slurry migration distances, making it worthy of dissemination and application. This study can improve safety measures by reducing waste, expediting disaster management efforts, and minimizing environmental hazards associated with mining incidents.