Natural-Language Query Conversion with LLM Syntax Validation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Users face inefficiencies in generating domain-specific database queries from natural language inputs, particularly in cybersecurity domains, due to unfamiliarity with varying query languages and inherent inefficiencies in determining query syntax.

Innovation Solution

A framework that utilizes an intent classifier to predict the intent and domain of a natural language query, generates prompts for a Large Language Model (LLM) to create database queries, and employs a lint program to validate the syntax, with follow-up prompts to correct invalid queries.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If users manually determine query syntax for domain-specific database queries, then query accuracy can be maintained, but user time and effort increase significantly

Engineering Contradiction:
Improvequery accuracyVSAvoiduser time and effort
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent introduces an intermediary system comprising a language model and validation module that translates natural language queries into domain-specific database queries. This intermediary handles the complex syntax transformation automatically, maintaining query accuracy while eliminating the time users would otherwise spend learning and applying query syntax rules across different domains.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The system performs self-validation through automated syntax checking and domain-specific validation modules that verify generated queries without requiring user intervention. The system serves itself by automatically detecting and correcting syntax errors, allowing users to simply input natural language without worrying about query syntax correctness.

Inventive Principle:
Principle #25Self-service

2Adaptability or versatility

If users learn multiple domain-specific query languages, then query capability across domains improves, but learning complexity and time requirements increase

Engineering Contradiction:
Improvequery capability across domainsVSAvoidlearning complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent implements a universal query translation system that handles multiple domain-specific query languages through a single interface. The language model is trained on multiple domain-specific languages and can automatically adapt to the appropriate domain based on the query context, providing multi-domain capability without requiring users to learn multiple query languages.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Solution Approach 2:

The system segments the complex task of multi-domain query translation into manageable components: natural language understanding, domain identification, syntax generation, and validation. Each component handles a specific aspect of the translation process, making the overall system manageable and maintainable while supporting multiple domains.

Inventive Principle:
Principle #1Segmentation

3Ease of operation

If automated query generation from natural language is implemented, then user effort decreases, but query syntax validity may be compromised

Engineering Contradiction:
Improveuser effortVSAvoidquery syntax validity
Core Design Contradiction:
Ease of operationVSReliability

Solution Approach 1:

The patent incorporates feedback loops where generated queries are automatically validated against domain-specific syntax rules and requirements. If validation fails, the system provides feedback to the language model to regenerate the query with corrected syntax, ensuring both ease of operation and syntax validity.

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The system performs preliminary syntax validation and domain-specific checks before executing queries. This preliminary action ensures that only syntactically valid and domain-correct queries are generated and executed, maintaining reliability while keeping the user interface simple and easy to use.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS20250284683A1Natural language query to domain-specific database query conversion with language models
Publication Date: 2025.09.11 PALO ALTO NETWORKS INC
  • US20250284683A1 patent drawing
  • US20250284683A1 patent drawing
  • US20250284683A1 patent drawing

AI summary

A natural language to database query converter (converter) receives a natural language query from a user (i.e., a user utterance) and identifies a cybersecurity domain related to intent of the natural language query. The converter then generates a database query for a query language of the cybersecurity domain corresponding to the natural language query with a large language model (LLM). An initial prompt to the LLM generated by the converter specifies a grammar of the query language and instructs the LLM to generate an initial database query that functions like the natural language query and satisfies the grammar. If a lint program determines that the initial database query is not valid for the query language, the converter generates a follow-up prompt to the LLM that indicates valid database queries from which to generate a follow-up database query. A query parser retrieves data that satisfy the initial or follow-up database query and a visualization/summarization module generates graph visualizations and summaries of the retrieved data.