IP Library › Granted Patent US 12,743,582
Granted Patent B2
US 12,743,582 · App. 18/419,896 · Granted Sep 22, 2026

Dynamic vocabularies for conditioning a language model for transforming natural language to a logical form

Inventors: Srikant Panda (Bangalore, IN); Amit Agarwal (Kolkata, IN); Kulbhushan Pachauri (Bangalore, IN)
Assignee: Oracle International Corporation
G06F40/284G06F16/2455G06F40/295G06F40/35G06F40/205
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,743,582
App. No.
18/419,896
Granted
Sep 22, 2026
Kind
B2
Abstract

Techniques are disclosed herein for generating dynamic vocabularies for conditioning a language model. A dynamic vocabulary is constructed from an input prompt, database schema information for a database to be queried, and programming language information for a programming language to be used for querying the database to condition the language model to predict an output statement in the programming language. The dynamic vocabulary can be included in prompt information that is provided to the language model. The number of tokens in the dynamic vocabulary can be different than a number of tokens included in a vocabulary of the language model. By utilizing a dynamic vocabulary, the language model can be conditioned to predict tokens for the output statement that are contextually consistent with the tokens included the dynamic vocabulary.

Claims (40)

1 . A computer-implemented method comprising:

generating, by a computing system, input information for a machine learning model configured to predict a statement, wherein the input information comprises an input prompt and a dynamic vocabulary derived from the input prompt and separate from the input prompt, wherein the dynamic vocabulary is further derived from a programming language and database schema information, and wherein a set of tokens of the dynamic vocabulary comprises one or more tokens associated with the programming language, one or more tokens associated with the database schema information, and one or more tokens associated with at least one condition of the input prompt;

predicting, by the computing system and using the machine learning model, an output statement for the input prompt based at least in part on the input information, wherein the output statement comprises a plurality of tokens, and wherein at least one token of the plurality of tokens is selected from the set of tokens;

executing, by the computing system and using the output statement, a query on a database associated with the database schema information to retrieve a result for the query; and

providing, by the computing system, the result for the query to a user device.

2 . The computer-implemented method of claim 1 , wherein the input information is first input information, wherein the input prompt is a first input prompt, wherein the set of tokens is a first set of tokens, wherein the database schema information is first database schema information, wherein the output statement is a first output statement, and wherein the plurality of tokens is a first plurality of tokens, the method further comprising:

generating, by the computing system, second input information for the machine learning model, wherein the second input information comprises a second input prompt and a second set of tokens, and wherein the second set of tokens comprises one or more tokens associated with the programming language, one or more tokens associated with second database schema information, and one or more tokens associated with at least one condition of the second input prompt; and

predicting, by the computing system and using the machine learning model, a second output statement for the second input prompt based at least in part on the second input information, wherein the second output statement comprises a second plurality of tokens, and wherein at least one token of the second plurality of tokens is selected from the second set of tokens.

3 . The computer-implemented method of claim 2 , wherein a number of tokens included in the first set of tokens is different from a number of tokens in the second set of tokens.

4 . The computer-implemented method of claim 1 , wherein the machine learning model comprises a vocabulary, and wherein a number of tokens included in the set of tokens is less than a number of tokens included in the vocabulary.

5 . The computer-implemented method of claim 1 , wherein at least one token of the one or more tokens associated with the at least one condition of the input prompt corresponds to a term included in the input prompt.

6 . The computer-implemented method of claim 1 , wherein at least one token of the one or more tokens associated with the at least one condition of the input prompt is generated using a rules-based approach and/or a named-entity recognition-based approach.

7 . A system comprising:

one or more processors; and

one or more computer-readable media storing instructions which, when executed by the one or more processors, cause the system to perform operations comprising:

generating input information for a machine learning model configured to predict a statement, wherein the input information comprises an input prompt and a dynamic vocabulary derived from the input prompt and separate from the input prompt, wherein the dynamic vocabulary is further derived from a programming language and database schema information, and wherein a set of tokens of the dynamic vocabulary comprises one or more tokens associated with the programming language, one or more tokens associated with the database schema information, and one or more tokens associated with at least one condition of the input prompt;

predicting, using the machine learning model, an output statement for the input prompt based at least in part on the input information, wherein the output statement comprises a plurality of tokens, and wherein at least one token of the plurality of tokens is selected from the set of tokens;

executing, using the output statement, a query on a database associated with the database schema information to retrieve a result for the query; and

providing the result for the query to a user device.

8 . The system of claim 7 , wherein the input information is first input information, wherein the input prompt is a first input prompt, wherein the set of tokens is a first set of tokens, wherein the database schema information is first database schema information, wherein the output statement is a first output statement, and wherein the plurality of tokens is a first plurality of tokens, the operations further comprising:

generating second input information for the machine learning model, wherein the second input information comprises a second input prompt and a second set of tokens, and wherein the second set of tokens comprises one or more tokens associated with the programming language, one or more tokens associated with second database schema information, and one or more tokens associated with at least one condition of the second input prompt; and

predicting, using the machine learning model, a second output statement for the second input prompt based at least in part on the second input information, wherein the second output statement comprises a second plurality of tokens, and wherein at least one token of the second plurality of tokens is selected from the second set of tokens.

9 . The system of claim 8 , wherein a number of tokens included in the first set of tokens is different from a number of tokens in the second set of tokens.

10 . The system of claim 7 , wherein the machine learning model comprises a vocabulary, and wherein a number of tokens included in the set of tokens is less than a number of tokens included in the vocabulary.

11 . The system of claim 7 , wherein at least one token of the one or more tokens associated with the at least one condition of the input prompt corresponds to a term included in the input prompt.

12 . The system of claim 7 , wherein at least one token of the one or more tokens associated with the at least one condition of the input prompt is generated using a rules-based approach and/or a named-entity recognition-based approach.

13 . The system of claim 7 , wherein the providing the result for the query to the user device comprises incorporating the result for the query in a dialog between the user device and a skill bot and presenting the dialog on a display of the user device.

14 . One or more non-transitory computer-readable media storing instructions which, when executed by one or more processors, cause a system to perform operations comprising:

generating input information for a machine learning model configured to predict a statement, wherein the input information comprises an input prompt and a dynamic vocabulary derived from the input prompt and separate from the input prompt, wherein the dynamic vocabulary is further derived from a programming language and database schema information, and wherein a set of tokens of the dynamic vocabulary comprises one or more tokens associated with the programming language, one or more tokens associated with the database schema information, and one or more tokens associated with at least one condition of the input prompt;

predicting, using the machine learning model, an output statement for the input prompt based at least in part on the input information, wherein the output statement comprises a plurality of tokens, and wherein at least one token of the plurality of tokens is selected from the set of tokens;

executing, using the output statement, a query on a database associated with the database schema information to retrieve a result for the query; and

providing the result for the query to a user device.

15 . The one or more non-transitory computer-readable media of claim 14 , wherein the input information is first input information, wherein the input prompt is a first input prompt, wherein the set of tokens is a first set of tokens, wherein the database schema information is first database schema information, wherein the output statement is a first output statement, and wherein the plurality of tokens is a first plurality of tokens, the operations further comprising:

generating second input information for the machine learning model, wherein the second input information comprises a second input prompt and a second set of tokens, and wherein the second set of tokens comprises one or more tokens associated with the programming language, one or more tokens associated with second database schema information, and one or more tokens associated with at least one condition of the second input prompt; and

predicting, using the machine learning model, a second output statement for the second input prompt based at least in part on the second input information, wherein the second output statement comprises a second plurality of tokens, and wherein at least one token of the second plurality of tokens is selected from the second set of tokens.

16 . The one or more non-transitory computer-readable media of claim 15 , wherein a number of tokens included in the first set of tokens is different from a number of tokens in the second set of tokens.

17 . The one or more non-transitory computer-readable media of claim 14 , wherein the machine learning model comprises a vocabulary, and wherein a number of tokens included in the set of tokens is less than a number of tokens included in the vocabulary.

18 . The one or more non-transitory computer-readable media of claim 14 , wherein at least one token of the one or more tokens associated with the at least one condition of the input prompt corresponds to a term included in the input prompt.

19 . The one or more non-transitory computer-readable media of claim 14 , wherein at least one token of the one or more tokens associated with the at least one condition of the input prompt is generated using a rules-based approach and/or a named-entity recognition-based approach.

20 . The computer-implemented method of claim 1 , wherein the providing the result for the query to the user device comprises incorporating the result for the query in a dialog between the user device and a skill bot and presenting the dialog on a display of the user device.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 23, 2024
From: PANDA, SRIKANT; AGARWAL, AMIT; PACHAURI, KULBHUSHAN
To: ORACLE INTERNATIONAL CORPORATION
Reel/Frame 066214/0062 →
Continuity (1)
Related Publication 20250238614A1 · Jul 24, 2025
References Cited (8)
US 20240362212A1 · Sun · 2024 [cited by examiner]
Yu, T., Zhang, R., Er, H.Y., Li, S., Xue, E., Pang, B., Lin, X.V., Tan, Y.C., Shi, T., Li, Z. and Jiang, Y., 2019. Cosql: A conversational text-to-sql challenge towards cross-domain natural language interfaces to databa… [cited by examiner]
Kun Zhang, Xiexiong Lin, Yuanzhuo Wang, Xin Zhang, Fei Sun, Cen Jianhe, Hexiang Tan, Xuhui Jiang, and Huawei Shen. 2023. ReFSQL: A Retrieval-Augmentation Framework for Text-to-SQL Generation. In Findings of the Associat… [cited by examiner]
Katsogiannis-Meimarakis, G. and Koutrika, G., 2023. A survey on deep learning approaches for text-to-SQL. The VLDB Journal, 32(4), pp. 905-936. (Year: 2023). [cited by examiner]
Wang, B., Shin, R., Liu, X., Polozov, O. and Richardson, M., Jul. 2020, Rat-sql: Relation-aware schema encoding and linking for text-to-sql parsers. In Proceedings of the 58th annual meeting of the association for compu… [cited by examiner]
Hwang et al., A Comprehensive Exploration on WikiSQL with Table-Aware Word Contextualization, KR2ML Workshop at NeurIPS 2019, Nov. 11, 2019, 34 pages. [cited by applicant]
Touvron et al., LLaMA: Open and Efficient Foundation Language Models, Computation and Language, Feb. 27, 2023, 27 pages. [cited by applicant]
Vaswani et al., Attention is All You Need, NIPS, Available online at: https://arxiv.org/pdf/1706.03762.pdf, Aug. 2, 2023, 15 pages. [cited by applicant]