Parallel Attention Computation for Faster Long-Sequence Inference

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Attention mechanisms in machine learning models, particularly large language models (LLMs), are resource-intensive due to the sequential execution of matrix multiplication and element-wise operations, leading to inefficient use of computational resources and increased time requirements as models process longer input sequences.

Innovation Solution

An accelerated attention mechanism that enables parallel execution of matrix multiplication operations with element-wise operations, allowing overlap between these operations within the GPU's dedicated units, thereby improving efficiency.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If matrix multiplication and element-wise operations are executed sequentially in attention mechanisms, then computational accuracy is maintained, but processing time and resource consumption increase

Engineering Contradiction:
Improvecomputational accuracyVSAvoidprocessing time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent segments the key matrix into multiple key blocks and divides the computation into multiple iterations. In each iteration, a portion of element-wise operations is performed followed by a matrix multiplication operation. This segmentation enables parallel execution of different operation types while maintaining computational accuracy through proper accumulation of results across iterations.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent performs preliminary element-wise operations (such as softmax calculations) before executing matrix multiplication operations. By preparing intermediate results in advance through element-wise computations, the system can then efficiently perform matrix multiplications in subsequent steps, overlapping these operations across multiple iterations to reduce overall processing time while preserving accuracy.

Inventive Principle:
Principle #10Preliminary action

2Adaptability or versatility

If attention mechanisms process longer input sequences, then model capability and context understanding improve, but resource intensity and computational power requirements increase

Engineering Contradiction:
Improvemodel capabilityVSAvoidresource intensity
Core Design Contradiction:
Adaptability or versatilityVSUse of energy by moving object

Solution Approach 1:

The patent segments both the query and key matrices into blocks, enabling processing of longer sequences by dividing the computational task into manageable iterations. Each iteration processes a subset of key blocks through element-wise operations followed by matrix multiplication, allowing the model to handle extended input sequences while distributing computational load efficiently across multiple smaller operations rather than one large resource-intensive computation.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS20250355965A1Accelerated attention mechanism with parallel operations
Publication Date: 2025.11.20 MICROSOFT TECHNOLOGY LICENSING LLC
  • US20250355965A1 patent drawing
  • US20250355965A1 patent drawing
  • US20250355965A1 patent drawing

AI summary

An accelerated attention mechanism with parallel operations can improve machine learning technology by enabling execution of certain matrix multiplication operations in parallel with element-wise operations, leading to an increase in speed without quality loss. To compute attention values in a machine learning model, the mechanism can receive a query vector, key vector, and value vector and split each of these vectors into blocks. For a given query block, the mechanism can determine attention values by performing element-wise operations to update the attention values for the given query block based at least in part on previously computed attention scores for the given query block and a given key block. Concurrent with performance of at least some of the element-wise operations, the mechanism can perform a matrix multiplication operation using given query block and a next key block to determine attention scores for the given query block and next key block.