Spectral Transform Mixing Layer for Transformer Efficiency

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing transformer models face inefficiencies in processing long sequences due to high computational costs and memory demands associated with attention mechanisms, which require a large number of trainable parameters, hindering performance in natural language processing and computer vision tasks.

Innovation Solution

The implementation of a spectral transform mixing layer replaces or complements attention mechanisms, utilizing discrete Fourier transforms to process input sequences, reducing the need for extensive parameter training and enhancing processing efficiency by making more tokens available to subsequent layers.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If attention mechanisms are used in transformer models, then diverse syntactic and semantic relationships can be captured, but computational cost and memory demands increase significantly

Engineering Contradiction:
Improvecapture of syntactic and semantic relationshipsVSAvoidcomputational cost and memory demands
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent extracts and removes the attention mechanism component from the transformer architecture, replacing it with a spectral transform mixing layer. This extraction eliminates the source of high computational cost and memory demands while preserving the essential functionality of token mixing through spectral transforms in the frequency domain.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent substitutes the mechanical attention mechanism (which computes pairwise interactions between tokens) with a spectral transform-based mixing layer that operates in the frequency domain. This replacement uses mathematical transforms (Fourier, cosine, or sine transforms) to mix tokens more efficiently, reducing computational complexity from O(N^2) to O(N log N) or O(N).

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

2Adaptability or versatility

If attention layers are used to process long sequences, then relationships between tokens can be modeled, but the number of trainable parameters increases significantly

Engineering Contradiction:
Improvemodeling of token relationshipsVSAvoidnumber of trainable parameters
Core Design Contradiction:
Adaptability or versatilityVSQuantity of substance

Solution Approach 1:

The patent removes the attention layers that generate large numbers of trainable parameters and replaces them with spectral transform mixing layers. The spectral transforms use fixed mathematical kernels rather than learnable parameters, dramatically reducing the quantity of trainable parameters while maintaining the ability to model token relationships through frequency-domain mixing.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent changes the fundamental approach from parameter-heavy attention mechanisms to parameter-efficient spectral transforms. By using fixed mathematical transforms (Fourier, cosine, or sine) with predetermined kernels, the system reduces trainable parameters while maintaining modeling capability through the inherent properties of spectral transforms in capturing global dependencies.

Inventive Principle:
Principle #35Parameter changes

3Reliability

If traditional transformer architectures are used, then encoding functions can be performed, but training and inference speeds are slower

Engineering Contradiction:
Improveencoding function performanceVSAvoidtraining and inference speed
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent substitutes the computationally intensive attention mechanism with a spectral transform mixing layer that leverages efficient Fourier or cosine transforms. These transforms can be implemented using highly optimized libraries (such as FFT implementations), enabling faster computation during both training and inference while maintaining encoding functionality.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

Solution Approach 2:

The patent changes the computational paradigm from O(N^2) attention computations to O(N log N) or O(N) spectral transforms. This parameter complexity reduction translates directly to faster training and inference speeds, as spectral transforms can be parallelized efficiently and benefit from highly optimized implementations in hardware and software.

Inventive Principle:
Principle #35Parameter changes

4Adaptability or versatility

If attention mechanisms are used in transformers, then token mixing can be achieved, but memory footprint increases

Engineering Contradiction:
Improvetoken mixing capabilityVSAvoidmemory footprint
Core Design Contradiction:
Adaptability or versatilityVSVolume of stationary object

Solution Approach 1:

The patent extracts and removes the attention mechanism that consumes significant memory for storing attention matrices and gradients. By replacing attention with spectral transforms, the system eliminates the need to store large attention matrices, thereby reducing memory footprint while preserving token mixing capability through frequency-domain operations.

Inventive Principle:
Principle #2Taking out (Extraction)

Data Source

PatentUS20230077928A1Mixing tokens with spectral transform
Publication Date: 2023.03.16 GOOGLE LLC
  • US20230077928A1 patent drawing
  • US20230077928A1 patent drawing
  • US20230077928A1 patent drawing

AI summary

Transformer systems and methods of using such transformer systems including computer programs encoded on a computer storage medium, for performing a deep learning task on an input sequence to generate an encoded output. In one aspect, one of the transformer systems includes an encoder architecture block, comprising: a spectral transform mixing layer that receives input embeddings of input tokens and generates, as output, a spectral transform output along a sequence dimension of the input embeddings; and a feed forward layer that receives an input based on the input embeddings of input tokens and the spectral transform output and generates an output for a subsequent processing block.