In order to solve the disadvantage of considering slopes as a homogeneous layer in intelligent stability assessment, this paper proposes a compatible three-dimensional convolutional neural network (3-D CNN) to improve the prediction performance in the stability of multilayer slopes. In the 3-D CNN, the slope information is encoded in a format similar to RGB images, with three channels corresponding to the mass density, cohesion, and friction angle of the rock and soil materials, and the parameters within each channel are aligned with the geometry of the slopes to reflect the layered rock and soil. The prior knowledge (actual slope cases and landslide inventories) and digital twin technique are carried out to form a database consisting of 4394 slopes for the proposed 3-D CNN model in the case of difficulty in collecting multilayer slope data. The results showed that, the best 3-D CNN framework achieves the R2R2 = 0.929 in 879 testing data, which is 6.3% higher than the best 1-D CNN framework. Finally, the stability of 12 real slope cases around the world was predicted by the optimal 3-D CNN, which obtained an R2R2 of 0.795 and an RMSE of 0.158 by comparing the predicted and the analyzed safety factors. The results indicate that the proposed 3-D CNN has compatibility through training with the dataset generated by the digital twin and prior knowledge.