The invention relates to a
large model compression method based on continuous layer
pruning and endpoint tuning, and the method comprises the steps: firstly introducing a learnable continuous interval soft
mask, and building a differentiable hierarchical
mask mechanism in a model in cooperation with a residual bypass; secondly, by minimizing the KL
divergence between output distributions before and after
pruning, the optimal
pruning starting point and length are automatically learned, and
adaptive selection of continuous layer segments is achieved; then, executing
physical layer deletion according to the optimized interval parameters, and reconnecting the network structures before and after pruning; and finally, implementing an endpoint tuning strategy, only carrying out all-parameter
fine tuning on key
layers on two sides of the sheared interval, and recovering the model performance at the lowest calculation overhead. According to the method, through combination of differential interval search and end point directional optimization, accurate compression and high-performance maintenance of the
depth dimension of the
large model are realized, model storage occupation and reasoning
delay are remarkably reduced, the model output reliability in a key task scene is guaranteed, and the method is suitable for large-scale popularization and application. The method is particularly suitable for efficient deployment of the large
language model in a resource-constrained environment.