Mask Attention Network for Transformer Accuracy

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Traditional transformer architectures face challenges in accurately determining the influence between data items within a sequence, often increasing complexity and resource consumption to improve accuracy.

Innovation Solution

The introduction of a mask attention network (MAN) that computes an original attention data structure and modifies it using a mask data structure to better account for neighboring data items, enhancing relevance within local neighborhoods without significantly increasing the number of machine-trained parameter values.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If modified SANs are proposed to replace the traditional SAN in the transformer architecture, then the accuracy of the transformer is increased, but the complexity of the transformer increases

Engineering Contradiction:
ImproveaccuracyVSAvoidcomplexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent divides the attention mechanism into two distinct components: a self-attention network (SAN) that processes global relationships and a mask attention network (MAN) that processes local neighborhood relationships. This segmentation allows each component to specialize in specific aspects of the data, improving overall accuracy without requiring a complete redesign of the transformer architecture. The MAN is applied selectively to enhance local patterns while the SAN handles broader contextual relationships.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The mask attention network introduces local quality by applying different attention masks to different positions in the sequence, allowing the model to selectively emphasize local neighborhood relationships where they are most relevant. The mask data structure enables position-specific modulation of attention weights, enhancing local patterns without uniformly increasing complexity across the entire architecture.

Inventive Principle:
Principle #3Local quality

2Measurement precision

If modified SANs are proposed to replace the traditional SAN in the transformer architecture, then the accuracy of the transformer is increased, but the efficiency of the transformer deteriorates

Engineering Contradiction:
ImproveaccuracyVSAvoidefficiency
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The mask attention network applies attention masking selectively rather than universally. The mask data structure allows the model to apply enhanced attention processing only where local neighborhood relationships are beneficial, while relying on the standard SAN for other positions. This partial application of the enhanced mechanism maintains efficiency while improving accuracy in specific contexts.

Inventive Principle:
Principle #16Partial or excessive action

Solution Approach 2:

By segmenting the attention processing into SAN and MAN components that can be applied in sequence or selectively, the patent avoids the inefficiency of applying a fully modified attention mechanism to all positions. The modular structure allows efficient computation by combining the fast standard SAN with the more computationally intensive MAN only where needed.

Inventive Principle:
Principle #1Segmentation

3Measurement precision

If the MAN modifies the original attention data structure by mask values, then the relevance of neighboring data items is boosted, but the number of machine-trained parameter values increases

Engineering Contradiction:
Improverelevance determination accuracyVSAvoidnumber of parameter values
Core Design Contradiction:
Measurement precisionVSQuantity of substance

Solution Approach 1:

The mask attention network modifies the attention data structure by applying mask values that change the weighting parameters dynamically based on position and context, rather than introducing entirely new learned parameters. The mask data structure enables parameter modulation through multiplication or addition operations on existing attention weights, achieving enhanced relevance determination without proportionally increasing the number of trainable parameters.

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The mask data structure acts as an intermediary between the SAN output and the final attention weights. Rather than directly learning complex interaction patterns through numerous parameters, the MAN introduces a intermediate masking layer that modulates the attention weights based on local neighborhood relationships. This intermediary approach achieves enhanced relevance with fewer direct parameters by leveraging the structure of the mask data.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS12260338B2Transformer-based neural network including a mask attention network
Publication Date: 2025.03.25 MICROSOFT TECHNOLOGY LICENSING LLC
  • US12260338B2 patent drawing
  • US12260338B2 patent drawing
  • US12260338B2 patent drawing

AI summary

A transformer-based neural network includes at least one mask attention network (MAN). The MAN computes an original attention data structure that expresses influence between pairs of data items in a sequence of data items. The MAN then modifies the original data structure by mask values in a mask data structure, to produce a modified attention data structure. Compared to the original attention data structure, the modified attention data structure better accounts for the influence of neighboring data items in the sequence of data items, given a particular data item under consideration. The mask data structure used by the MAN can have static and/or machine-trained mask values. In one implementation, the transformer-based neural network includes at least one MAN in combination with at least one other attention network that does not use a mask data structure, and at least one feed-forward neural network.