LLM Code Preprocessing for Performance-Portable Tensor Transpilation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Legacy code bases, particularly in scientific computing, are challenging to port to modern hardware platforms due to their hardware-specific optimizations and lack of compatibility with modern tensor computation languages, requiring significant manual effort and being prone to errors.

Innovation Solution

A machine learning method using large language models (LLMs) to extract performance-critical code segments, generate ground truth data, and transpile legacy code into tensor computation language (TCL) candidates, with automated verification and optimization using compiler feedback.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If legacy code is manually ported to modern hardware platforms, then performance portability is improved, but development time and resource costs increase significantly

Engineering Contradiction:
Improveperformance portabilityVSAvoiddevelopment time
Core Design Contradiction:
Adaptability or versatilityVSLoss of time

Solution Approach 1:

The patent replaces manual code porting (mechanical human effort) with an automated machine learning system that uses large language models to transpile legacy code to tensor computation language, dramatically reducing development time while maintaining performance portability

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

Solution Approach 2:

The patent introduces an intermediary ML-based transpilation system that acts as a mediator between legacy code and modern tensor computation platforms, automatically generating equivalent code without requiring manual intervention

Inventive Principle:
Principle #24Intermediary (Mediator)

2Power

If legacy code uses hardware-specific optimizations, then performance on specific hardware is improved, but compatibility with modern platforms deteriorates

Engineering Contradiction:
Improvehardware performanceVSAvoidplatform compatibility
Core Design Contradiction:
PowerVSAdaptability or versatility

Solution Approach 1:

The patent extracts hardware-specific optimization patterns from legacy code and translates them into equivalent tensor computation operations that work across modern platforms, preserving performance characteristics while improving compatibility

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent transforms hardware-specific parameters and operations in legacy code into platform-agnostic tensor operations, changing the representation of computational parameters to achieve broad compatibility while maintaining performance

Inventive Principle:
Principle #35Parameter changes

3Manufacturing precision

If manual code transpilation is performed, then accuracy of code transformation is improved, but productivity and automation level deteriorate

Engineering Contradiction:
Improvecode transformation accuracyVSAvoidcode transpilation throughput
Core Design Contradiction:
Manufacturing precisionVSProductivity

Solution Approach 1:

The patent implements a self-service automated transpilation system where the ML model autonomously performs code transformation, verification, and optimization without human intervention, achieving both high accuracy and productivity

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The patent incorporates feedback mechanisms where the system verifies transpiled code against ground truth data and iteratively improves transformation accuracy, maintaining precision while enabling automated high-throughput processing

Inventive Principle:
Principle #23Feedback

4Speed

If legacy code is rewritten in tensor computation language, then performance on modern hardware is improved, but error rate and resource intensity increase

Engineering Contradiction:
Improveexecution speedVSAvoiderror rate
Core Design Contradiction:
SpeedVSReliability

Solution Approach 1:

The patent performs preliminary actions by generating ground truth data from legacy code before transpilation, establishing a reference for verification that catches errors early and reduces the error rate in final transpiled code

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent uses feedback loops where transpiled code is automatically verified against ground truth data, identifying and correcting errors before deployment, thereby reducing error rates while maintaining high execution speed

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS12578940B2Preprocessing code using large language models for performance portability
Publication Date: 2026.03.17 NEC CORP
  • US12578940B2 patent drawing
  • US12578940B2 patent drawing
  • US12578940B2 patent drawing

AI summary

A computer-implemented, machine learning method for preprocessing code for performance portability includes extracting performance critical code segments from an application and obtaining input data. Ground truth data is generated based on the input data and the application. Original code of the application is transpiled using a large language model (LLM) into a tensor computation language (TCL) candidate. Correctness of an implementation of the TCL candidate is verified using the ground truth data. The method has applications including, but not limited to, use cases in medical/healthcare, and other artificial intelligence applications for preprocessing and optimizing code for performance portability. The method can also support decision making and could be implemented with machine learning.