Low hydration activity and challenging management of delayed expansion restrict the application of fly ash \(\left(FA\right)\) and \(MgO\) expansive additive \(\left(MEA\right)\) in cement pastes. Very few research on machine learning techniques for volume expansion \(\left({V}_{e}\right)\) in such systems have been conducted already. This study develops a machine learning framework to predict the volume expansion \(\left({V}_{e}\right)\) of cement pastes incorporating fly ash \(\left(FA\right)\) and \(MgO\) expansive additive \(\left(MEA\right)\) , materials whose low hydration activity and delayed expansion complicate their practical use. A dataset of 170 samples compiled from published literature was utilized, comprising four input variables—Portland cement content ( \(PC\) , %), fly ash content ( \(FA\) , %), \(MgO\) expansive additive ( \(MEA\) , %), and curing age ( \(SA\) , days)—to predict the target variable, \({V}_{e}\) (%). A Categorical Boosting \(\left(CatBoost\right)\) model was optimized using two recent metaheuristic algorithms, the Starfish Optimization Algorithm \(\left(StOA\right)\) and the Flood Optimization Algorithm \(\left(FlOA\right)\) , to enhance prediction accuracy. Model performance was assessed through cross-validation, normalization, and feature importance analysis, with 70% of the data (n = 119) used for training and 30% (n = 51) for testing. The optimized \(CatBoost-StOA\) model achieved the best performance, with \(RMSLE\) values of 0.00404 (training) and 0.0053 (testing), corresponding to low mean absolute and root mean square errors in predicting \({V}_{e}\) . These results demonstrate the model’s potential as a reliable predictive tool for mix design optimization and dimensional stability control in cementitious materials.