Multi-round dialogue processing method based on block perception dynamic attention
Патент · CN B
Полный текст
The invention discloses a multi-round dialogue processing method based on block perception dynamic attention, which comprises the following steps of dividing a multi-round dialogue input sequence into a history record and a current query, dividing the history record into a plurality of semantic sub-blocks according to a preset partitioning rule, calculating comprehensive importance scores of each semantic sub-block and the current query, wherein the comprehensive importance scores are dynamically generated based on semantic relevance and time sequence position weights, and dividing the semantic sub-blocks into three types according to the comprehensive importance scores, and respectively applying hard pruning, sparse attention or full attention strategies to dynamically allocate calculation resources. The invention dynamically and differentially distributes the attention computing resources based on the current query by identifying the semantic block structure of the dialogue, thereby remarkably improving the reasoning speed and the generating accuracy of the large language model when processing the long-context multi-round dialogue.