IP Library Granted Patent US 12,602,377
Granted Patent B2
US 12,602,377 · App. 18/423,836 · Granted Apr 14, 2026

Systems and methods for question answering with diverse knowledge sources

Inventors: Tong Niu (Sunnyvale, CA); Shafiq Rayhan Joty (San Jose, CA); Yingbo Zhou (Palo Alto, CA); Semih Yavuz (Redwood City, CA); Wenting Zhao (San Francisco, CA); Ye Liu (Fremont, CA)
Assignee: Salesforce, Inc.
G06F16/24522G06F40/295G06F40/30G06F40/40
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,602,377
App. No.
18/423,836
Granted
Apr 14, 2026
Kind
B2
Abstract

Embodiments described herein provide systems and methods for retrieval augmented generation. A neural network based language model may be provided a question as a user input. Based on the user input, semantically diverse queries may be generated for retrieval from diverse data sources. For example, a structured data source (e.g., database or knowledge base) and unstructured data (e.g., text articles) may be used to retrieve information relevant to the user input. The retrieve information may be ranked so that the most relevant information is used by the language model in generating an answer to the question in the user input. A non-retrieval based answer generated by the language model may be utilized in some embodiments in generating the final answer.

Claims (106)

1 . A method for a retrieval augmented generation neural network system deployed on one or more artificial intelligence (AI) accelerators, the method comprising:

receiving, via a communication interface, a user input relating to providing an answer to a question;

generating, by a neural network based language model, a plurality of semantically diverse queries based on the user input;

retrieving, by a first retriever, a first set of information from a structured data source based on a first query from the plurality of semantically diverse queries;

retrieving, by a second retriever, a second set of information from an unstructured data source based on a second query from the plurality of semantically diverse queries;

retrieving, by a third retriever, a third set of information from a linearized text version of the structured data source based on a third query from the plurality of semantically diverse queries;

generating, by a cross-encoder model, a ranking of the first set of information, the second set of information, and the third set of information based on a relevance to the user input;

generating a context prompt combining at least a part of the first set of information and/or the second set of information and/or the third set of information based on the ranking; and

generating, by the neural network based language model, the answer based on the user input and the context prompt.

2 . The method of claim 1 , further comprising:

generating, by the neural network based language model, a plurality of single-hop questions based on a first prompt template and the user input when the user input comprises a multi-hop question; and

generating a second plurality of semantically diverse queries based on the plurality of single-hop questions, the first set of information, and the second set of information,

wherein the generating the plurality of semantically diverse queries is further based on the plurality of single-hop questions and a second prompt template.

3 . The method of claim 1 , wherein the generating the plurality of semantically diverse queries includes:

extracting, via a named entity recognition model, a named entity from the user input;

receiving, from the structured data source, an entity ID based on the named entity;

receiving, from the structured data source, a list of relations associated with the entity ID;

determining a highest ranked relation of the list of relations based on a semantic similarity to the user input;

receiving, from the structured data source, a relation ID based on the highest ranked relation; and

generating a structured query, via the neural network based language model, based on an input prompt including at least one of:

the user input,

the named entity,

the entity ID,

the highest ranked relation, or

the relation ID.

4 . The method of claim 1 , further comprising:

generating, by the neural network based language model, a second answer based on the user input without use of the first set of information or the second set of information,

wherein the generating the context prompt further includes combining the second answer.

5 . The method of claim 4 , wherein the combining the second answer is based on a determination of low relevance of the first set of information or the second set of information.

6 . The method of claim 1 , further comprising:

generating, by the neural network based language model, a variant of the second query from the plurality of semantically diverse queries;

retrieving, by the second retriever, a set of additional data based on the variant of the second query from the plurality of diverse queries; and

wherein, the second set of information includes the set of additional data based on the variant of the second query from the plurality of diverse queries.

7 . The method of claim 1 ,

wherein the structured data source is a knowledge base, and

wherein the first query is a structured query of a format specific to the knowledge base.

8 . A system for retrieval augmented generation, the system comprising:

a memory that stores a neural network based language model and a plurality of processor executable instructions;

a communication interface that receives a user input relating to providing an answer to a question; and

one or more hardware processors that read and execute the plurality of processor-executable instructions from the memory to perform operations comprising:

generating, by the neural network based language model, a plurality of semantically diverse queries based on the user input;

retrieving, by a first retriever, a first set of information from a structured data source based on a first query from the plurality of semantically diverse queries;

retrieving, by a second retriever, a second set of information from an unstructured data source based on a second query from the plurality of semantically diverse queries;

retrieving, by a third retriever, a third set of information from a linearized text version of the structured data source based on a third query from the plurality of semantically diverse queries;

generating, by a cross-encoder model, a ranking of the first set of information, the second set of information, and the third set of information based on a relevance to the user input;

generating a context prompt combining at least a part of the first set of information and/or the second set of information and/or the third set of information based on the ranking; and

generating, by the neural network based language model, the answer based on the user input and the context prompt.

9 . The system of claim 8 , the operations further comprising:

generating, by the neural network based language model, a plurality of single-hop questions based on a first prompt template and the user input when the user input comprises a multi-hop question; and

generating a second plurality of semantically diverse queries based on the plurality of single-hop questions, the first set of information, and the second set of information,

wherein the generating the plurality of semantically diverse queries is further based on the plurality of single-hop questions and a second prompt template.

10 . The system of claim 8 , wherein the generating the plurality of semantically diverse queries includes:

extracting, via a named entity recognition model, a named entity from the user input;

receiving, from the structured data source, an entity ID based on the named entity;

receiving, from the structured data source, a list of relations associated with the entity ID;

determining a highest ranked relation of the list of relations based on a semantic similarity to the user input;

receiving, from the structured data source, a relation ID based on the highest ranked relation; and

generating a structured query, via the neural network based language model, based on an input prompt including at least one of:

the user input,

the named entity,

the entity ID,

the highest ranked relation, or

the relation ID.

11 . The system of claim 8 , the operations further comprising:

generating, by the neural network based language model, a second answer based on the user input without use of the first set of information or the second set of information,

wherein the generating the context prompt further includes combining the second answer.

12 . The system of claim 11 , wherein the combining the second answer is based on a determination of low relevance of the first set of information or the second set of information.

13 . The system of claim 8 ,

wherein the structured data source is a knowledge base, and

wherein the first query is a structured query of a format specific to the knowledge base.

14 . The system of claim 8 , further comprising:

generating, by the neural network based language model, a variant of the second query from the plurality of semantically diverse queries;

retrieving, by the second retriever, a set of additional data based on the variant of the second query from the plurality of diverse queries; and

wherein, the second set of information includes the set of additional data based on the variant of the second query from the plurality of diverse queries.

15 . A non-transitory machine-readable medium comprising a plurality of machine-executable instructions which, when executed by one or more processors, are adapted to cause the one or more processors to perform operations comprising:

receiving, via a communication interface, a user input relating to providing an answer to a question;

generating, by a neural network based language model, a plurality of semantically diverse queries based on the user input;

retrieving, by a first retriever, a first set of information from a structured data source based on a first query from the plurality of semantically diverse queries;

retrieving, by a second retriever, a second set of information from an unstructured data source based on a second query from the plurality of semantically diverse queries;

retrieving, by a third retriever, a third set of information from a linearized text version of the structured data source based on a third query from the plurality of semantically diverse queries;

generating, by a cross-encoder model, a ranking of the first set of information, the second set of information, and the third set of information based on a relevance to the user input;

generating a context prompt combining at least a part of the first set of information and/or the second set of information and/or the third set of information based on the ranking; and

generating, by the neural network based language model, the answer based on the user input and the context prompt.

16 . The non-transitory machine-readable medium of claim 15 , the operations further comprising:

generating, by the neural network based language model, a plurality of single-hop questions based on a first prompt template and the user input when the user input comprises a multi-hop question; and

generating a second plurality of semantically diverse queries based on the plurality of single-hop questions, the first set of information, and the second set of information,

wherein the generating the plurality of semantically diverse queries is further based on the plurality of single-hop questions and a second prompt template.

17 . The non-transitory machine-readable medium of claim 15 , wherein the generating the plurality of semantically diverse queries includes:

extracting, via a named entity recognition model, a named entity from the user input;

receiving, from the structured data source, an entity ID based on the named entity;

receiving, from the structured data source, a list of relations associated with the entity ID;

determining a highest ranked relation of the list of relations based on a semantic similarity to the user input;

receiving, from the structured data source, a relation ID based on the highest ranked relation; and

generating a structured query, via the neural network based language model, based on an input prompt including at least one of:

the user input,

the named entity,

the entity ID,

the highest ranked relation, or

the relation ID.

18 . The non-transitory machine-readable medium of claim 15 , the operations further comprising:

generating, by the neural network based language model, a second answer based on the user input without use of the first set of information or the second set of information,

wherein the generating the context prompt further includes combining the second answer.

19 . The non-transitory machine-readable medium of claim 18 , wherein the combining the second answer is based on a determination of low relevance of the first set of information or the second set of information.

20 . The non-transitory machine-readable medium of claim 15 ,

wherein the structured data source is a knowledge base, and

wherein the first query is a structured query of a format specific to the knowledge base.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 5, 2024
From: NIU, TONG; JOTY, SHAFIQ RAYHAN; ZHOU, YINGBO; LIU, YE; ZHAO, WENTING; YAVUZ, SEMIH
To: SALESFORCE, INC.
Reel/Frame 066343/0172 →
Continuity (2)
Provisional Application 63585123 · Sep 25, 2023
Related Publication 20250103592A1 · Mar 27, 2025
References Cited (9)
US 20230316001A1 · Araki · 2023 [cited by examiner]
Pramanik, Soumajit, et al. “Uniqorn: unified question answering over RDF knowledge graphs and natural language text.” arXiv: 2108.08614v7 Jul. 10, 2023 (Year: 2023). [cited by examiner]
Omar Khattab, Keshav Santhanam, Xiang Lisa Li, David Hall, Percy Liang, Christopher Potts, and Matei Zaharia. 2022. Demonstrate-search-predict: Composing retrieval and language models for knowledge-intensive nlp. arXiv … [cited by applicant]
Wenhu Chen, Ming-Wei Chang, Eva Schlinger, William Wang, and William W Cohen. 2021a. Open question answering over tables and text. Proceedings of ICLR 2021. [cited by applicant]
International Search Report and Written Opinion for PCT/US2024/048155, dated Jan. 9, 2025, 16 pages. [cited by applicant]
Anonymous, “Large language model—Wikipedia”, Retrieved from the Internet: URL:https://en.wikipedia.org/w/index.php? title=Large_language_model&oldid=1172845164, Aug. 29, 2023, pp. 1-17. [cited by applicant]
Ma et al., “Query Rewriting in Retrieval-Augmented Large Language Models”, Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, May 23, 2023, pp. 1-17. [cited by applicant]
Pramanik et al., “UNIQORN: Unified Question Answering over RDF Knowledge Graphs and Natural Language Text”, arxiv.org, Cornell University Library, 201 Olin Library Cornell University Ithaca, NY 14853, Aug. 19, 2021, pp.… [cited by applicant]
Shen et al., “Large Language Models Are Strong Zero-Shot Retriever”, arxiv.org, Cornell University Library, 201 Olin Library Cornell University Ithaca, NY 14853, Aug. 2, 2023, 15 pages. [cited by applicant]