The invention relates to the field of
artificial intelligence, and discloses a
data processing method comprising the steps of acquiring to-be-processed data and a target neural
network model, whereinthe target neural
network model comprises a first
transformer layer, the first
transformer layer comprises a first residual error
branch and a second residual error
branch, the first residual error
branch comprises a first attention head, and the second residual error branch comprises a target feedforward layer FFN; performing target task related
processing on the to-be-processed data according toa target neural
network model to obtain a
data processing result, the target neural network model being used for performing target operation on the output of the first attention head and the first
weight value to obtain the output of the first residual branch, and / or using the target neural network model for performing target operation on the output of the target FFN and the second
weight value to obtain the output of the second residual branch. According to the embodiment of the invention, for different tasks, the
weight value for controlling the output of the residual branch is set, so thatthe computing resource requirement of the
terminal equipment for operating the target neural network model is reduced.