Transformer Attention Row Clustering for Lower Memory Complexity

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Transformers require exponentially increasing memory resources due to the square of the number of input data for attention operations, leading to high computational complexity.

Innovation Solution

Apply low rank approximation to query and key vectors, cluster rows based on similarity, determine representative rows, and create a sub-query vector to calculate sub-attention values, reducing data dimension and memory capacity.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If attention operation is performed using all input data, then processing accuracy is improved, but memory capacity and computational complexity increase exponentially

Engineering Contradiction:
Improveprocessing accuracyVSAvoidcomputational complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent segments the input data by applying low rank approximation to decompose the query or key matrix into smaller factor matrices. This segmentation reduces the dimensionality of the attention computation from O(N) to O(k) where k << N, thereby decreasing computational complexity while preserving the essential patterns needed for accurate processing

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent creates approximate representations (copies) of the original data through low rank approximation. Instead of processing all original input data, it processes compressed approximate versions that capture the dominant patterns, reducing memory requirements and computational load while maintaining sufficient accuracy for the attention operation

Inventive Principle:
Principle #26Copying

2Measurement precision

If attention operation is performed using all input data, then processing accuracy is improved, but memory capacity increases exponentially

Engineering Contradiction:
Improveprocessing accuracyVSAvoidmemory capacity
Core Design Contradiction:
Measurement precisionVSQuantity of substance

Solution Approach 1:

The patent segments the large input data into compressed representations through low rank approximation. By decomposing matrices into smaller factor matrices with rank k, it reduces the memory capacity from O(N^2) to O(Nk) where k is much smaller than N, enabling processing of large datasets with limited memory resources

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent creates compact approximate copies of the original data using low rank decomposition. These compressed copies retain the essential information needed for attention computation while occupying significantly less memory space, allowing accurate processing without exponential memory requirements

Inventive Principle:
Principle #26Copying

3Device complexity

If row clustering is applied to reduce data dimension, then computational complexity is decreased, but processing accuracy may be reduced

Engineering Contradiction:
Improvecomputational complexityVSAvoidprocessing accuracy
Core Design Contradiction:
Device complexityVSMeasurement precision

Solution Approach 1:

The patent changes the parameter of data representation from full-rank to low-rank approximation. By adjusting the rank parameter k to be much smaller than the original dimension N, it achieves a balance between computational complexity (reduced by factor of N/k) and processing accuracy (maintained through preservation of dominant singular vectors that capture essential data patterns)

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS20250335541A1Method for determining attention value of transformer using row clustering
Publication Date: 2025.10.30 KOREA UNIV RES & BUSINESS FOUND
  • US20250335541A1 patent drawing
  • US20250335541A1 patent drawing
  • US20250335541A1 patent drawing

AI summary

The present disclosure is characterized by reducing the data dimension of an attention operation through row clustering on the basis of the fact that most rows constituting an attention score of a transformer have similar patterns.