Program Generation Apparatus Using Natural Language Search and Input-Output Modification

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing automatic programming technologies face challenges in generating correct programs from ambiguous natural language specifications and often result in programs that do not satisfy programming language syntax, or become overfitted to limited input-output examples.

Innovation Solution

A program generation device that includes a search unit to find similar code from a dataset of syntactically correct programs and a change unit to modify this code to match input-output examples, using a combination of natural language specifications and input-output examples to generate a desired program.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Extent of automation

If a program is generated from natural language using machine translation models, then the program generation process is automated, but the generated program may not satisfy the syntax of the programming language or may be incorrect due to ambiguous natural language information

Engineering Contradiction:
Improveprogram generation automationVSAvoidprogram correctness
Core Design Contradiction:
Extent of automationVSReliability

Solution Approach 1:

The patent implements a feedback mechanism where the generated program is tested against the natural language specification through a tester that checks whether the program satisfies the specification. If the program fails the test, the system automatically modifies the program by adjusting the translation model or adding correction layers, and re-tests until the program passes. This closed-loop feedback ensures program correctness while maintaining automation.

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The patent performs preliminary actions by pre-processing the natural language specification to extract structured information, and pre-training translation models on high-quality parallel corpora before generation. The system also pre-defines a set of candidate programs and pre-establishes testing frameworks, so that when generation occurs, the process is guided by pre-prepared resources that ensure syntactic correctness and semantic accuracy.

Inventive Principle:
Principle #10Preliminary action

2Ease of manufacture

If automatic programming uses input-output examples, then program components can be composited to satisfy examples, but the amount of information is small and programs may become overfitted to the examples

Engineering Contradiction:
Improveprogram synthesis capabilityVSAvoidspecification information completeness
Core Design Contradiction:
Ease of manufactureVSLoss of information

Solution Approach 1:

The patent merges multiple information sources: natural language specifications, input-output examples, and program syntax constraints are combined into a unified generation framework. The translation model processes natural language specifications while simultaneously considering input-output example pairs, and the generated program must satisfy both the natural language meaning and the example constraints. This merging prevents overfitting by requiring the program to generalize from examples rather than merely memorizing them.

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The patent adds a new dimension to program generation by introducing a semantic verification layer that operates beyond traditional input-output matching. Instead of only verifying programs against examples (one-dimensional), the system verifies programs against the semantic meaning of natural language specifications (two-dimensional), creating a richer constraint space that prevents overfitting and improves generalization.

Inventive Principle:
Principle #17Another dimension (Dimensionality change)

Data Source

PatentUS12175215B2Program generation apparatus, program generation method and program
Publication Date: 2024.12.24 NIPPON TELEGRAPH & TELEPHONE CORP
  • US12175215B2 patent drawing
  • US12175215B2 patent drawing
  • US12175215B2 patent drawing

AI summary

The possibility of a desired program being automatically generated is increased by a program generation device including: a search unit configured to search for a first program that corresponds to a specification written in natural language similar to natural language that describes a specification of a program to be generated, from a set of pairs each constituted by natural language that describes a specification of a program and the program that satisfies syntax of a programing language; and a change unit configured to change the first program to generate a second program that satisfies at least one pair of an input value and an output value.