NL2LF Error Correction Using Execution and Semantic Feedback

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing natural language to logical form models struggle with understanding complex, ambiguous, or context-specific queries, leading to inaccurate SQL translations and execution errors.

Innovation Solution

A computer-implemented method that includes training a machine learning model with error correction capabilities by generating error correction training examples through an iterative process, utilizing execution and semantic error messages to enhance a pretrained NL2LF model, and fine-tuning it with data augmentation techniques to improve translation accuracy.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If deep learning approaches are used to convert natural language queries to SQL queries, then generalization across tasks and domains is improved, but accuracy in understanding complex, ambiguous, or context-specific queries deteriorates

Engineering Contradiction:
Improvegeneralization across tasks and domainsVSAvoidaccuracy in understanding complex queries
Core Design Contradiction:
Adaptability or versatilityVSMeasurement precision

Solution Approach 1:

The patent introduces an intermediary verification step between natural language input and SQL generation. A separate verification model analyzes the generated SQL queries against the original natural language query and database schema, identifying semantic errors and execution errors. This intermediary verification process allows the system to maintain the generalization capabilities of deep learning while improving accuracy by catching errors that the primary model may have missed.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Measurement precision

If rule-based systems are used to translate natural language sentences to SQL queries, then domain-specific accuracy is improved, but ability to generalize to new use cases deteriorates

Engineering Contradiction:
Improvedomain-specific accuracyVSAvoidability to generalize to new use cases
Core Design Contradiction:
Measurement precisionVSAdaptability or versatility

Solution Approach 1:

The patent employs preliminary action by pre-training the verification model on a comprehensive dataset that includes diverse SQL patterns, database schemas, and natural language queries across multiple domains. This pre-training equips the verification model with domain-specific knowledge before it encounters new use cases, allowing it to verify queries accurately even in domains it hasn't explicitly seen during fine-tuning.

Inventive Principle:
Principle #10Preliminary action

3Productivity

If statistical-based systems are used to parse natural language sentences, then parsing speed is improved, but limitations on sentence types that can be parsed worsen

Engineering Contradiction:
Improveparsing speedVSAvoidsentence types that can be parsed
Core Design Contradiction:
ProductivityVSAdaptability or versatility

Solution Approach 1:

The patent implements feedback by using the verification model to analyze generated SQL queries and provide error information back to the system. The verification process feeds back semantic error messages and execution error messages that help identify limitations in the parsing capabilities. This feedback loop enables the system to recognize when sentence types exceed current parsing capabilities and potentially route them for special handling or model retraining.

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS20260037505A1Execution and semantic error correction capabilities for natural language to logical form model
Publication Date: 2026.02.05 ORACLE INT CORP
  • US20260037505A1 patent drawing
  • US20260037505A1 patent drawing
  • US20260037505A1 patent drawing

AI summary

Techniques are disclosed herein for providing and using a natural language to logical form model having execution and sematic error correction capabilities. In one aspect, a method is disclosed that includes: accessing a set of training examples and generating a set of error correction training examples via an iterative process performed for each training example. The iterative process includes generating an inferred logical form, executing the inferred logical form on a database, when executing the inferred logical form on the database fails, obtaining an execution error message corresponding to the failure, and recording the inferred logical form and the execution error message as part of an execution error example, and populating an error correction prompt template with the execution error example to generate an error correction training example. A machine learning model may then be trained with at least the set of error correction training examples.