Lambda Functions for Reduced Memory Complexity in Long-Range Interaction Modeling

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Attention operations in machine learning suffer from per-example quadratic memory complexity, hindering their use in large inputs and multidimensional data due to high memory and computational requirements.

Innovation Solution

The use of lambda functions, which transform available contexts into individual functions applied directly to queries without materializing attention maps, enabling dense long-range content and position-based interactions with reduced memory complexity.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If attention operations are used to capture long-range interactions, then modeling capability is improved, but memory complexity increases quadratically per example

Engineering Contradiction:
Improvemodeling capabilityVSAvoidmemory complexity
Core Design Contradiction:
ReliabilityVSQuantity of substance

Solution Approach 1:

The patent extracts the essential functional capability of attention (computing interactions between queries and context) while removing the problematic component (materialized attention maps). By computing lambda functions that encapsulate context information without storing full attention maps, the system achieves linear memory complexity while preserving long-range interaction modeling capability.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent changes the parameter representation from dense attention maps (quadratic memory) to compact lambda function parameters (linear memory). By representing context interactions through parameterized functions rather than explicit maps, the system reduces memory complexity from O(n²) to O(n) while maintaining modeling effectiveness.

Inventive Principle:
Principle #35Parameter changes

2Measurement precision

If per-example attention maps are materialized, then long-range interactions are captured accurately, but computational requirements increase

Engineering Contradiction:
Improveinteraction accuracyVSAvoidcomputational requirements
Core Design Contradiction:
Measurement precisionVSPower

Solution Approach 1:

The patent creates a functional copy of attention capability through lambda functions. Instead of copying and storing full attention maps for each example, the system uses parameterized lambda functions that can be applied efficiently to queries, achieving similar interaction accuracy with reduced computational overhead.

Inventive Principle:
Principle #26Copying

3Adaptability or versatility

If attention is applied to large inputs, then comprehensive context modeling is achieved, but memory footprint becomes prohibitive

Engineering Contradiction:
Improvecontext modelingVSAvoidmemory footprint
Core Design Contradiction:
Adaptability or versatilityVSArea of stationary object

Solution Approach 1:

The patent segments the attention computation into two parts: (1) pre-computed lambda functions that capture context information in a compact form, and (2) application of these functions to queries. This segmentation allows comprehensive context modeling while keeping the memory footprint linear rather than quadratic, enabling processing of large inputs.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS20230229886A1Modeling of Long-Range Interactions with Reduced Feature Materialization via Lambda Functions
Publication Date: 2023.07.20 GOOGLE LLC
  • US20230229886A1 patent drawing
  • US20230229886A1 patent drawing
  • US20230229886A1 patent drawing

AI summary

The present disclosure provides systems, methods, and computer program products for performing modeling of long-range interactions with reduced feature materialization, for example, in machine learning models. A computer-implemented method may include receiving a layer input comprising input data and context data, generating one or more lambda functions based, at least in part, on a content function and a position function for each of a plurality of context elements in the context data, and applying one or more of the generated lambda functions to the input data in association with generating a layer output associated with a respective lambda layer. Experimental results for image classification on ResNet and for object detection with RetinaNet show that examples of the present disclosure significantly outperform convolutional and attentional counterparts while providing increased accuracy and efficiency.