Bundling Key and Value Tensors for Neural Network Attention Layers

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing neural network architectures, particularly transformers used in large language models, face inefficiencies due to the management of multiple key (K) and value (V) tensors across attention heads, leading to increased complexity and processing time.

Innovation Solution

Bundling individual key and value tensors for each attention head into a single tensor each, simplifying the structure by associating each attention layer with a single K tensor and a single V tensor, optimized for efficient processing with a four-dimensional tensor layout.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If multiple key and value tensors are managed separately for each attention head, then the attention mechanism can process diverse information independently, but the device complexity and processing time increase

Engineering Contradiction:
Improveattention mechanism flexibilityVSAvoidtensor management complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent combines multiple key tensors into a single key tensor and multiple value tensors into a single value tensor for the attention layer. This merging reduces the number of separate tensor inputs and outputs, simplifying the tensor management structure while maintaining the attention mechanism's ability to process diverse information through the unified tensors.

Inventive Principle:
Principle #5Merging (Combining)

2Loss of information

If multiple key and value tensors are managed separately for each attention head, then detailed information can be tracked independently, but the processing time increases

Engineering Contradiction:
Improveinformation tracking precisionVSAvoidprocessing time
Core Design Contradiction:
Loss of informationVSLoss of time

Solution Approach 1:

By merging multiple key tensors into one and multiple value tensors into one, the patent reduces the number of tensor operations and data transfers required during processing. This consolidation maintains all necessary information within the unified tensors while significantly reducing processing time by eliminating redundant separate tensor management overhead.

Inventive Principle:
Principle #5Merging (Combining)

3Adaptability or versatility

If individual key and value tensors are used for each attention head, then the model can handle complex transformations, but the processor load increases

Engineering Contradiction:
Improvetransformation capabilityVSAvoidprocessing efficiency
Core Design Contradiction:
Adaptability or versatilityVSProductivity

Solution Approach 1:

The patent merges multiple key and value tensors into unified tensors that are then processed by the attention layer. This approach reduces processor load by decreasing the number of separate tensor operations, while the attention mechanism's inherent design preserves the capability to handle complex transformations through the consolidated tensor structure.

Inventive Principle:
Principle #5Merging (Combining)

4Adaptability or versatility

If multiple key and value tensors are managed separately, then each attention head can operate independently, but the number of tensor inputs and outputs increases

Engineering Contradiction:
Improveattention head independenceVSAvoidtensor I/O complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent consolidates multiple key tensors into a single key tensor and multiple value tensors into a single value tensor, dramatically reducing the number of tensor inputs and outputs to the attention layer. This merging maintains attention head independence through the attention mechanism's internal structure while simplifying the external tensor interface.

Inventive Principle:
Principle #5Merging (Combining)

Data Source

PatentUS20250173542A1Bundling key and value tensors to reduce memory between split networks
Publication Date: 2025.05.29 QUALCOMM INC
  • US20250173542A1 patent drawing
  • US20250173542A1 patent drawing
  • US20250173542A1 patent drawing

AI summary

A processor-implemented method includes bundling a set of key (K) tensors into a single K tensor associated with an attention layer of a neural network model. The processor-implemented method also includes bundling a set of value (V) tensors into a single V tensor associated with the attention layer. The processor-implemented method further includes processing, via an application processor, the single K tensor and the single V tensor. The processor-implemented method also includes executing the neural network model based on processing the single K tensor and the single V tensor.