Lower Triangular Matrix Allocation for Mask Attention Efficiency

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing methods for calculating mask attention score matrices in transformer-based artificial neural networks are inefficient due to unnecessary calculations in matrix multiplication, particularly for elements outside the lower triangular matrix.

Innovation Solution

The proposed solution involves optimizing the matrix multiplication calculation by allocating data such that calculations corresponding to masked locations are avoided, effectively replacing zero calculations with non-zero valued elements and focusing on the lower triangular matrix for the result.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If conventional matrix multiplication is used for mask attention score calculation, then complete matrix computation is performed, but computational efficiency deteriorates due to unnecessary zero calculations

Engineering Contradiction:
Improvecalculation efficiencyVSAvoidcomputational load
Core Design Contradiction:
ProductivityVSLoss of energy

Solution Approach 1:

The patent extracts and processes only the lower triangular matrix elements from the complete matrix multiplication result. By separating the useful computation (lower triangular elements needed for mask attention) from the useless computation (upper triangular elements that will be masked), the system eliminates unnecessary calculations and improves computational efficiency.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent applies masking operations in advance during the matrix multiplication process itself, rather than performing complete multiplication and then masking afterward. By preliminarily identifying which elements will be masked and excluding them from computation, the system avoids wasting computational resources on calculations that will ultimately be discarded.

Inventive Principle:
Principle #10Preliminary action

2Measurement precision

If complete matrix multiplication is performed, then all elements are calculated, but calculation time increases due to processing elements outside the lower triangular matrix

Engineering Contradiction:
Improvecalculation accuracyVSAvoidcalculation time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent extracts only the lower triangular elements from the matrix multiplication result for further processing. By separating these essential elements from the rest of the matrix, the system performs calculations only where needed, maintaining accuracy for relevant computations while eliminating time-wasting operations on irrelevant upper triangular elements.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent performs partial matrix multiplication by focusing exclusively on the lower triangular portion of the result matrix. This partial action approach calculates only the necessary elements (lower triangular) without performing excessive calculations on the upper triangular elements that would not contribute to the final mask attention score.

Inventive Principle:
Principle #16Partial or excessive action

3Productivity

If data is allocated for complete matrix computation, then all matrix elements are processed, but resource utilization decreases due to handling masked locations

Engineering Contradiction:
Improveprocessing throughputVSAvoiddata allocation complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent extracts and processes only the lower triangular matrix elements from the complete matrix computation result. By separating the essential computation from the redundant computation, the system optimizes data allocation to handle only necessary elements, reducing the complexity of data management while improving processing throughput.

Inventive Principle:
Principle #2Taking out (Extraction)

Data Source

PatentUS20250190522A1Method and apparatus for obtaining lower triangular matrix for matrix multiplication result value
Publication Date: 2025.06.12 ELECTRONICS & TELECOMM RES INST
  • US20250190522A1 patent drawing
  • US20250190522A1 patent drawing
  • US20250190522A1 patent drawing

AI summary

A computer implementation method for obtaining a lower triangular matrix for a matrix multiplication result value, the method comprising: a process of allocating elements of each of a first operand matrix pair and a second operand matrix pair input into a memory to calculation units of an accelerator; and a process of the calculation units of the accelerator performing a matrix multiplication calculation on the elements of the first operand matrix pair and the second operand matrix pair, wherein the process of allocating the elements thereof to the calculation units of the accelerator comprises: allocating elements of the first operand matrix pair to first calculation units corresponding to elements of the lower triangular matrix for the matrix multiplication result value of the first operand matrix pair; and allocating elements of the second operand matrix pair to second calculation units corresponding to elements of the lower triangular matrix for the matrix multiplication result value of the second operand matrix pair.