Subroutine Neural Networks for Long-Sequence Algorithmic Reasoning

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional neural networks struggle to perform algorithmic reasoning on input distributions outside their training data, requiring self-attention and conditional masking mechanisms to generalize effectively.

Innovation Solution

A neural network system composed of subroutine neural networks, including an encoder, decoder, and masking network, leverages self-attention and conditional masking to process inputs in a single pass, avoiding vanishing and exploding gradients, and generalizes on a wide range of input examples.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If conventional neural networks are used for algorithmic reasoning, then they perform well on training data distribution, but they fail to generalize on input distributions outside training data

Engineering Contradiction:
Improvegeneralization capabilityVSAvoidperformance consistency
Core Design Contradiction:
Adaptability or versatilityVSReliability

Solution Approach 1:

The neural network is segmented into multiple subroutine networks, each responsible for executing a specific algorithmic subroutine. This segmentation allows each subroutine to be trained independently on its specific task, improving generalization to unseen input distributions while maintaining reliability through specialized functionality.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system dynamically composes subroutine networks based on the input problem type and requirements. The neural network system can adaptively select and combine different subroutine networks during inference, enabling it to handle diverse input distributions effectively while maintaining consistent performance through dynamic adaptation.

Inventive Principle:
Principle #15Dynamics

2Length of moving object

If neural networks process long sequences, then they can handle complex inputs, but they suffer from vanishing and exploding gradients

Engineering Contradiction:
Improvesequence lengthVSAvoidgradient stability
Core Design Contradiction:
Length of moving objectVSReliability

Solution Approach 1:

Processing long sequences is segmented into multiple time steps, with each time step executing a specific subroutine. This temporal segmentation breaks down long sequence processing into manageable chunks, preventing gradient vanishing/exploding while maintaining the ability to handle complex long-range dependencies through sequential composition of subroutines.

Inventive Principle:
Principle #1Segmentation

3Measurement precision

If neural networks require multiple passes to process sequences, then they can achieve accurate results, but training complexity increases

Engineering Contradiction:
Improveoutput accuracyVSAvoidtraining complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

Algorithmic subroutines are pre-trained independently on their specific tasks before being composed into the full system. This preliminary training of subroutines allows the system to achieve accurate results through single-pass execution during inference, reducing training complexity by avoiding the need for end-to-end training of the entire system on all possible input-output pairs.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS12572793B1Subroutine neural networks
Publication Date: 2026.03.10 GOOGLE LLC
  • US12572793B1 patent drawing
  • US12572793B1 patent drawing
  • US12572793B1 patent drawing

AI summary

Methods, systems, and apparatus, including computer programs encoded on a computer storage medium, for generating an output sequence from an input sequence. In one aspect, one of the systems includes one or more subroutine neural networks each comprising: an encoder neural network configured to receive an encoder network input comprising i) a subroutine input sequence of the subroutine neural network and ii) an input mask that masks one or more subroutine input elements of the subroutine input sequence and to generate an encoded representation of the encoder network input; a decoder neural network configured to receive the encoded representation and to generate the subroutine network output; and a masking neural network configured to generate an output mask, wherein the output mask will be used as the input mask of the encoder neural network at a subsequence time step of the plurality of time steps.