Multi-modal Program Inference via Component Synthesis

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current software development tools face limitations in accurately generating programs from natural language descriptions, as pre-trained language models often produce ambiguous and imprecise code, while program synthesis techniques struggle with handling the ambiguity of natural languages.

Innovation Solution

A multi-modal program inference approach that combines pre-trained language models with component-based synthesis, utilizing optimized prompts and domain-agnostic techniques to generate accurate programs by leveraging the strengths of both methods, including iterative synthesis and ranking of candidate programs.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Ease of operation

If pre-trained language models are used to generate programs from natural language descriptions, then the ability to handle natural language ambiguity is improved, but the precision and accuracy of generated code deteriorates

Engineering Contradiction:
Improvenatural language handlingVSAvoidcode precision
Core Design Contradiction:
Ease of operationVSManufacturing precision

Solution Approach 1:

The patent introduces an intermediary verification and refinement process between natural language understanding and code generation. This includes using formal specification languages as an intermediate representation, implementing multi-stage verification processes, and using type systems to bridge the gap between ambiguous natural language and precise code, thereby maintaining natural language flexibility while ensuring code precision

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent implements feedback mechanisms where generated code is automatically verified against the original natural language specification and formal constraints. This includes using type checkers, runtime verification, and iterative refinement processes that provide feedback to both the user and the generation system, allowing correction of imprecise code while preserving the benefits of natural language input

Inventive Principle:
Principle #23Feedback

2Manufacturing precision

If program synthesis techniques are used to generate accurate programs, then the precision of code generation is improved, but the ability to handle natural language ambiguity deteriorates

Engineering Contradiction:
Improvecode accuracyVSAvoidnatural language processing
Core Design Contradiction:
Manufacturing precisionVSEase of operation

Solution Approach 1:

The patent segments the program synthesis process into distinct stages: natural language interpretation, formal specification generation, constrained code synthesis, and verification. Each stage handles specific aspects of the problem, allowing the system to process natural language ambiguity in early stages while ensuring code accuracy in later stages through formal methods and constraints

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent uses formal specification languages and intermediate representations as mediators between natural language input and synthesized code. These intermediaries provide a structured, unambiguous representation that preserves the intent of natural language descriptions while enabling precise program synthesis through formal methods

Inventive Principle:
Principle #24Intermediary (Mediator)

3Reliability

If comprehensive program synthesis is performed to ensure accuracy, then the reliability of generated programs is improved, but the complexity of the synthesis process increases

Engineering Contradiction:
Improveprogram reliabilityVSAvoidsynthesis process complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent changes key parameters of the synthesis process, including using typed intermediate representations, applying formal constraints, and implementing multi-stage verification. These parameter changes enable comprehensive reliability checking without requiring exhaustive search of all possible programs, thereby reducing synthesis complexity while maintaining high reliability

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The patent performs preliminary actions by generating formal specifications and type constraints before actual code synthesis. This preliminary structuring of requirements and constraints guides the synthesis process, reducing the search space and enabling reliable program generation without requiring complex exhaustive synthesis procedures

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS11934801B2Multi-modal program inference
Publication Date: 2024.03.19 MICROSOFT TECHNOLOGY LICENSING LLC
  • US11934801B2 patent drawing
  • US11934801B2 patent drawing
  • US11934801B2 patent drawing

AI summary

Embodiments use a multi-modal approach to generate software programs that match a solution program description. The solution program description may include natural language, input-output examples, partial source code, desired operators, or other hints. Some embodiments use optimized prompts to a pre-trained language model to obtain initial candidate programs. Maximal program components are extracted and then recombined variously using component-based synthesis. Beam search reduces a solution program search space by discarding some candidates from a given synthesis iteration. Relevance metrics, string similarity metrics, operator frequency distributions, token rareness scores, and other optimizations may be employed. By virtue of optimizations and the multi-modal approach, a solution program may be obtained after fewer iterations than by use of a language model alone. The multi-modal approach is domain agnostic, as illustrated by examples using regular expression and cascading style sheet selector domain specific languages.