Text Processing Model Attention Layer Optimization

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The attention mechanism in text processing models, such as those using the Transformer architecture, faces significant computational costs due to its square increase with input sequence length, and is sparse, meaning only a few words are crucial for semantic understanding, necessitating a method to reduce costs by identifying important words before attention calculation.

Innovation Solution

A text processing method that filters target words with the highest first attention scores using a first attention layer, performs dimensionality reduction to reduce computational costs, and calculates second attention scores only for these target words, thereby reducing unnecessary computations and improving efficiency.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If the attention mechanism is applied to all words in the input sequence, then the semantic understanding accuracy is improved, but the computational cost increases quadratically with input sequence length

Engineering Contradiction:
Improvesemantic understanding accuracyVSAvoidcomputational cost
Core Design Contradiction:
Measurement precisionVSUse of energy by moving object

Solution Approach 1:

The patent extracts only the most important words (target words) from the input sequence based on first attention scores, rather than processing all words. This extraction is achieved by performing dimensionality reduction on the input sequence to identify and isolate key words that contribute most to semantic understanding, thereby reducing computational cost while maintaining accuracy

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent performs preliminary dimensionality reduction and identification of target words before the main attention calculation. By pre-processing the input sequence to determine which words are most important, the system avoids performing expensive attention calculations on all words, thus reducing overall computational cost while preserving semantic understanding accuracy

Inventive Principle:
Principle #10Preliminary action

2Use of energy by moving object

If dimensionality reduction is performed on the input sequence, then the computational cost is reduced, but the processing precision may be degraded

Engineering Contradiction:
Improvecomputational costVSAvoidprocessing precision
Core Design Contradiction:
Use of energy by moving objectVSMeasurement precision

Solution Approach 1:

The patent applies dimensionality reduction selectively to different parts of the input sequence based on their importance. Rather than uniformly reducing dimensions across all words, the system identifies target words with high first attention scores and applies dimensionality reduction primarily to less important words, thereby reducing computational cost while preserving processing precision for critical words

Inventive Principle:
Principle #3Local quality

3Loss of information

If attention scores are calculated for all words, then the semantic representation is comprehensive, but the processing time increases

Engineering Contradiction:
Improvesemantic representation completenessVSAvoidprocessing time
Core Design Contradiction:
Loss of informationVSLoss of time

Solution Approach 1:

The patent extracts and processes only the most semantically important words (target words) identified through first attention scoring and dimensionality reduction. By calculating attention scores exclusively for these extracted target words rather than all words in the input sequence, the system maintains comprehensive semantic representation for key concepts while significantly reducing processing time

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent performs attention calculation partially, focusing only on the most critical target words rather than all words. This partial action is sufficient to achieve comprehensive semantic understanding because the target words contain the essential semantic information, thereby reducing processing time without sacrificing semantic representation completeness

Inventive Principle:
Principle #16Partial or excessive action

Data Source

PatentUS20240289538A1Text processing methods, training methods for text processing and related devices
Publication Date: 2024.08.29 BEIJING YOUZHUJU NETWORK TECH CO LTD
  • US20240289538A1 patent drawing
  • US20240289538A1 patent drawing
  • US20240289538A1 patent drawing

AI summary

This disclosure relates to a text processing method, a training method for text processing and related devices, and relates to the field of natural language processing. The text processing method includes: filtering one or more target words with highest first attention scores from words in a piece of text using a first attention layer of a text processing model; calculating second attention scores of the target words using a second attention layer of the text processing model; and obtaining a processing result of the text from the processing model based on the second attention scores of the target words.