Due to the uncertainty of soil condition and pile design characteristics, it is always a challenge for geotechnical engineers to accurately determine the bearing capacity of piles. The main objective of this study is to propose a hybrid model coupling least squares support vector machine (LSSVM) with an improved particle swarm optimization (IPSO) algorithm for the prediction of bearing capacity of piles. The improved PSO algorithm was used to optimize the LSSVM hyperparameters. The performance of the IPSO-LSSVM model was compared with seven artificial intelligence models, namely adaptive neuro-fuzzy inference system (ANFIS), M5 model tree (M5MT), multivariate adaptive regression splines (MARS), gene expression programming (GEP), random forest (RF), regression tree (RT) and a stacked ensemble model. Six statistical indices (e.g., coefficient of determination (R2), mean absolute error (MAE), root mean squared error (RMSE), relative root mean squared error (RRMSE), BIAS and discrepancy ratio (DR)) were used to evaluate the performance of the models. The R2, MAE, RMSE, RRMSE and BIAS values of the IPSO-LSSVM model were 1, 4.27 kN, 6.164 kN, 0.005 and 0, respectively, for the training datasets and 0.9977, 22 kN, 36.03 kN, 0.0275 and –11, respectively, for the testing datasets. Compared with the ANFIS, MARS, GEP, M5MT, RF, RT and the stacked ensemble models, the proposed IPSO-LSSVM model shows high accuracy and robustness on the test datasets. In addition, the sensitivity, uncertainty, reliability and resilience of the IPSO-LSSVM model were also analyzed in this study. First published online 22 October 2024