The invention discloses a
dynamic feature retrieval generation and management method based on a cross attention mechanism, which belongs to the technical field of
natural language processing, and comprises the following steps: step 1, converting
knowledge base document fragments into atomic knowledge units, each atomic
knowledge unit comprising question and answer pairs, codes as key value pairs, and adding dynamic priority weights; self-attention query is replaced with a double-channel query structure, one channel is used for cross attention, a cross attention query vector is generated through linear transformation, and key value pairs of atomic knowledge units are used; and step 3, training a cross attention adapter, freezing the weight of the
language model, optimizing parameters of the adapter, and dynamically adjusting a
loss function by using pre-judgment parameters based on input sequence context complexity. By means of the method, deep correlation description of
user input and knowledge fragments can be achieved, semantic
ambiguity is eliminated, knowledge injection and context information are balanced,
distortion is avoided, and the strict requirement for semantic precision in the professional field is met.