The invention discloses a method for quickly searching an optimal embedding position of a
large model, which is characterized by comprising the following steps of: selecting K representative samples of a
data set of a task, and constructing a representative set for searching the optimal embedding position, in which K is not suitable to be too large; inputting all samples of the representative set to a multi-
modal large model (MLLM) and a small model of a specific task at the same time, introducing a
feature fusion module, and fusing the features of the i Transform module of the MLLM and the features of the final layer of the small model; the parameters of the small model are frozen, k-step efficient parameter
fine tuning is carried out on all the parameters of the MLLM, and k is not suitable to be too large; in each step of
fine tuning, solving a two-norm of a gradient vector of the parameter with respect to a
loss function to obtain k gradient two-norms, and carrying out weighted summation on the k gradient two-norms to obtain fitness; the random number seeds are replaced, the second step to the fourth step are repeated, P times of repeated experiments are carried out, P should not be too large or too small, and it is preferable that P should be 3-30 times; and i is iterated in a value range from 1 to T, 2 to 5 steps are repeated in each iteration step, the average fitness of different embedding positions is obtained, i * with the maximum average fitness is finally selected as the optimal embedding position, and T is the total number of
layers of the MLLM. The rapid searching method for the optimal embedding position of the
large model has the advantages of being high in searching speed and high in task expansibility, and is particularly suitable for scenes where small model knowledge fusion needs to be rapidly conducted on the large model.