Partial Position Encoding in Attention Networks for Long Contexts

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Neural networks face memory bottlenecks and computational inefficiencies due to limited on-chip memory and large context sizes, particularly when processing long input sequences, which constrain operating speed and latency.

Innovation Solution

Implement a partial position encoding scheme in attention neural networks, reducing the size of local windows in local attention mechanisms while maintaining performance, and incorporating a modified training method to generalize to longer context lengths without degrading performance on shorter sequences.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If a KV cache is maintained to store keys and values for later re-use, then computation is avoided and efficiency is improved, but memory consumption increases and bandwidth requirements constrain operating speed

Engineering Contradiction:
Improveinference speedVSAvoidmemory consumption
Core Design Contradiction:
ProductivityVSQuantity of substance

Solution Approach 1:

The patent segments the attention mechanism into local attention layers that process only a subset of positions (local windows) rather than all positions globally. This segmentation reduces the KV cache size to only store keys and values for positions within the local window, significantly reducing memory consumption while maintaining inference speed through the segmented processing approach.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent applies partial position encoding only to local attention layers rather than all attention layers. This partial application reduces the computational overhead and memory requirements for position encoding while maintaining the necessary positional information for accurate processing, effectively applying action only where needed.

Inventive Principle:
Principle #16Partial or excessive action

2Measurement precision

If position encoding is applied to all attention layers, then processing accuracy is maintained, but computational overhead and memory requirements increase

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

Solution Approach 1:

The patent applies position encoding selectively only to local attention layers that require it for accurate processing, while omitting it from global attention layers. This local quality approach maintains processing accuracy where needed while reducing overall computational overhead and memory requirements by applying the complex operation only to the necessary subset of layers.

Inventive Principle:
Principle #3Local quality

3Quantity of substance

If local window size is reduced to decrease memory usage, then memory savings are achieved, but processing accuracy may degrade

Engineering Contradiction:
Improvememory usageVSAvoidprocessing accuracy
Core Design Contradiction:
Quantity of substanceVSMeasurement precision

Solution Approach 1:

The patent segments the attention mechanism into multiple local windows that each process a subset of positions. By organizing processing into these segmented local windows, the system reduces memory usage for each window while maintaining overall processing accuracy through the collective action of multiple windows covering the entire input sequence.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS20260037776A1Attention neural networks with partial position encoding
Publication Date: 2026.02.05 GDM HOLDING LLC
  • US20260037776A1 patent drawing
  • US20260037776A1 patent drawing
  • US20260037776A1 patent drawing

AI summary

Methods, systems, and apparatus, including computer programs encoded on computer storage media, for processing input sequences using a neural network that uses a partial position encoding scheme. The neural network generally includes both global and local attention layers. In the partial position encoding scheme, while the local attention layers do use position encoding, (i) a subset of the global attention layers can apply an attention mechanism that does not use position encoding, or (ii) the subset of global attention layers can apply an attention mechanism that does not apply position encoding to one or more of the dimensions of the input to the attention mechanism.