Neural Machine Translation Model Training via Code Fragmentation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current Neural Machine Translation (NMT) models for programming languages face challenges in generating effective training data, which is crucial for efficient translation between programming languages, especially during migration from one platform to another.

Innovation Solution

A method and system for training NMT models that involves encoding source and target statements using a predefined token dictionary, creating a source-target map, and iteratively fragmenting statements to generate training data within a predefined threshold, ensuring that the neural network learns token mappings effectively.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If NMT models are used for programming language translation, then translation efficiency is improved, but the quality of training data becomes insufficient

Engineering Contradiction:
Improvetranslation efficiencyVSAvoidtraining data quality
Core Design Contradiction:
ProductivityVSManufacturing precision

Solution Approach 1:

The patent segments programming language statements into smaller sub-statements or phrases to create training data pairs. This segmentation approach allows the NMT model to learn from finer-grained translation units, improving training data quality while maintaining translation efficiency. The source code is divided into meaningful segments that can be paired with corresponding target language segments for training.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent performs preliminary processing of source and target code to generate training data pairs before actual NMT model training. This includes extracting statement pairs, segmenting code, and preparing aligned training examples in advance. This preliminary action ensures high-quality training data is ready before model training begins, resolving the training data quality issue while maintaining efficient translation.

Inventive Principle:
Principle #10Preliminary action

2Manufacturing precision

If rule-based approach is used for programming language translation, then translation accuracy is improved, but device complexity increases

Engineering Contradiction:
Improvetranslation accuracyVSAvoidsystem complexity
Core Design Contradiction:
Manufacturing precisionVSDevice complexity

Solution Approach 1:

The patent replaces the mechanical rule-based translation system with a neural machine translation model trained on segmented programming language data. Instead of using complex hand-crafted translation rules, the system uses learned patterns from training data to perform translations. This substitution reduces system complexity while maintaining translation accuracy through the neural model's ability to learn from examples.

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

Solution Approach 2:

The patent changes the approach from fixed translation rules to dynamic neural network parameters that are learned from training data. The translation accuracy is achieved not through predetermined rules but through optimized neural network weights and parameters. This parameter-based approach reduces the complexity of manually managing translation rules while maintaining or improving translation quality.

Inventive Principle:
Principle #35Parameter changes

3Productivity

If bulk volume training data is provided to NMT models, then model efficiency is improved, but data collection and processing difficulty increases

Engineering Contradiction:
Improvemodel efficiencyVSAvoiddata processing complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent segments large volumes of source and target code into smaller statement pairs or phrase pairs to create training data. This segmentation automatically generates structured training examples from bulk code corpora, reducing the manual processing effort required. The segmented units are easier to align and process, enabling efficient model training with large datasets without proportionally increasing data processing complexity.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system automatically generates training data pairs from source and target code corpora through automated segmentation and pairing processes. This self-service approach eliminates the need for manual annotation or curation of training data, allowing bulk volume data to be processed efficiently. The automated pipeline transforms raw code pairs into ready-to-use training examples, reducing data processing complexity while maintaining model efficiency.

Inventive Principle:
Principle #25Self-service

Data Source

PatentUS11875141B2System and method for training a neural machine translation model
Publication Date: 2024.01.16 INFOSYS LTD
  • US11875141B2 patent drawing
  • US11875141B2 patent drawing
  • US11875141B2 patent drawing

AI summary

The system and method for training a neural machine translation (NMT) model is disclosed wherein training data in terms of source statements and equivalent targets statements may be received. The source statements and equivalent targets statements may be encoded using source and target vocabulary respectively. A source-target map containing relation between tokens is created. The source statements and equivalent target statements is split into multiple fragments using fragments generator based on the source-target map. Such generated multiple fragments are used to train NMT model. Whenever the trained NMT model receives a source codes as input, the source codes are transformed to target codes.