Neural Network Program Synthesis via Incremental Tree Expansion

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing neural network architectures for program induction are computationally expensive, difficult to train, and lack interpretability, requiring separate training for each task and struggling to capture program behavior effectively.

Innovation Solution

A machine-learning approach using a recursive, reverse-recursive neural network (R3NN) for program synthesis, which trains end-to-end with an input-output encoder to generate programs incrementally without explicit search, by encoding input-output examples and iteratively expanding partial program trees based on expansion probabilities.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If neural network architectures are used for program induction, then program behavior can be captured, but computational cost increases and training becomes difficult

Engineering Contradiction:
Improveprogram behavior captureVSAvoidcomputational cost
Core Design Contradiction:
ReliabilityVSUse of energy by moving object

Solution Approach 1:

The program synthesis task is segmented into incremental steps through tree expansion. Instead of searching the entire program space at once, the system builds programs step-by-step by expanding partial program trees, where each expansion step generates a subset of possible programs. This segmentation reduces the computational burden at each step while maintaining the ability to capture complex program behaviors through the cumulative effect of multiple steps.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system performs preliminary encoding of input-output examples into distributed representations before program generation. This preliminary action prepares the data in advance, allowing the program-generation model to focus computational resources on synthesizing programs rather than processing raw input-output pairs during the main synthesis task, thereby reducing overall computational cost.

Inventive Principle:
Principle #10Preliminary action

2Measurement precision

If neural networks are trained for each task separately, then task-specific accuracy improves, but training time and resource requirements increase

Engineering Contradiction:
Improvetask-specific accuracyVSAvoidtraining time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The program-generation model is designed with universal applicability across different tasks. By training on diverse programs and input-output examples, the model learns general patterns and structures that can be applied to multiple tasks. The model's ability to handle various program types and domains through a single unified architecture eliminates the need for separate training for each task, reducing training time while maintaining task-specific accuracy through the universal representation learning.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Solution Approach 2:

The system adapts to different tasks by changing the distribution and characteristics of training data rather than retraining the entire model. The program-generation model uses parameter adjustments in the encoding and generation processes to accommodate different task domains, allowing efficient task adaptation without full retraining. This enables the model to maintain high accuracy across tasks while significantly reducing the time and resources required for each new task.

Inventive Principle:
Principle #35Parameter changes

3Extent of automation

If neural networks are used for program synthesis, then automation increases, but interpretability and verification become difficult

Engineering Contradiction:
Improveprogram synthesis automationVSAvoidinterpretability
Core Design Contradiction:
Extent of automationVSDifficulty of detecting and measuring

Solution Approach 1:

The system generates programs by copying and combining structural patterns from training examples. The program-generation model learns from the structure of programs in the training set and replicates these patterns to generate new programs. This copying approach maintains interpretability because the generated programs follow the same syntactic and semantic structures as the training programs, making them easier to verify and understand, while still achieving high automation through the learned patterns.

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The program generation process is segmented into interpretable steps through tree expansion. Each expansion step corresponds to a specific program construction operation, and the partial program trees provide an intermediate representation that can be inspected and verified. This segmentation of the generation process into discrete, interpretable steps maintains transparency and verifiability while achieving automation through the systematic application of expansion rules guided by the neural network.

Inventive Principle:
Principle #1Segmentation

4Reliability

If explicit search algorithms are used for program synthesis, then program construction is systematic, but engineering and research efforts increase

Engineering Contradiction:
Improveprogram construction systematicityVSAvoidengineering effort
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The system replaces mechanical search algorithms with a neural network-based generative model. Instead of using systematic search methods that require carefully designed heuristics and complex control logic, the program-generation model uses learned patterns from training data to directly generate programs. This substitution of mechanical search with neural generation reduces the engineering and research effort required to design search heuristics while maintaining systematic program construction through the automated learning process.

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

Solution Approach 2:

The system changes the approach from fixed search heuristics to learned generation parameters. The program-generation model uses parameters learned from training data to control the program synthesis process, replacing the need for manually designed search heuristics. This parameter-based approach reduces engineering effort because the parameters are learned automatically from data rather than requiring extensive research to design effective search strategies, while still providing systematic program construction through the learned generation process.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS10795645B2Neural network for program synthesis
Publication Date: 2020.10.06 MICROSOFT TECHNOLOGY LICENSING LLC
  • US10795645B2 patent drawing
  • US10795645B2 patent drawing
  • US10795645B2 patent drawing

AI summary

Described are systems, methods, and computer-readable media for program generation in a domain-specific language based on input-output examples. In accordance with various embodiments, a neural-network-based program generation model conditioned on an encoded set of input-output examples is used to generate a program tree by iteratively expanding a partial program tree, beginning with a root node and ending when all leaf nodes are terminal.