IP Library › Granted Patent US 12,596,731
Granted Patent B2
US 12,596,731 · App. 18/407,027 · Granted Apr 7, 2026

System and method of efficient knowledge-enhanced chain-of-thought prompting

Inventors: Morgan Lindsay Heisler (Burnaby, CA); Chendi Wang (Vancouver, CA); Gursimran Singh (Delta, CA); Yong Zhang (Burnaby, CA)
Assignee: HUAWEI CLOUD COMPUTING TECHNOLOGIES CO., LTD.
G06F16/3329G06F40/30G06F40/40G06F16/3341G10L15/30
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,596,731
App. No.
18/407,027
Granted
Apr 7, 2026
Kind
B2
Abstract

Methods and systems for processing a natural language input query that includes a question and a respective set of candidate answers for the question, including generating, based on the input query and a knowledge graph, natural language logic paths between at least some of the candidate answers and the question; forming a natural language prompt based on both the input query and the logic paths; and obtaining a response from a pretrained natural language processing model based on the natural language promp.

Claims (55)

1 . A computer-implemented method for processing a natural language input query that includes a question and a respective set of candidate answers for the question, the method comprising:

generating, based on the input query and a knowledge graph, natural language logic paths between at least some of the candidate answers and the question, the generating includes:

identifying a question entity for the question included in the input query;

identifying a respective candidate answer entity for each of the candidate answers included in the input query;

identifying, for the question entity, a matching question node entity of the knowledge graph;

identifying, for at least some of the candidate answer entities, respective matching node answer entities of the knowledge graph; and

identifying, based on inter-node entity relationships specified in the knowledge graph, a respective logic path for each matching node answer entity to the matching question node entity as the natural language logic paths;

forming a natural language prompt based on both the input query and the logic paths; and

obtaining a response, based on the natural language prompt, from a pretrained natural language processing model based on a large neural network operating under a pretrain-finetune paradigm.

2 . The method of claim 1 wherein:

identifying the matching question node entity for the question entity is based on a comparison of an embedding generated for the question entity with embeddings generated for node entities of the knowledge graph; and

identifying the respective matching node answer entities for the at least some of the candidate answer entities is based on a comparison of embeddings generated for the candidate answer entities with embeddings generated for the node entities of the knowledge graph,

the embeddings each being generated by a neural network model that has been pretrained to generate similar embeddings for terms having semantically similar meanings.

3 . The method of claim 2 wherein identifying the respective logic path for each matching node answer entity to the matching question node entity comprises:

identifying, for each matching node answer entity, a respective set of candidate logic paths for the matching node answer entity to the matching question node entity;

ranking each of the candidate logic paths within each of the respective sets of candidate logic paths; and

selecting as the respective logic path for each matching node answer entity the candidate logic path having the highest ranking from the respective set of candidate logic paths for the matching node answer entity.

4 . The method of claim 3 wherein identifying the respective set of candidate logic paths for each matching node answer entity is limited to paths that fall within a predefined number of entity node hops.

5 . The method of claim 1 wherein identifying the question entity for the question comprises applying a keyphrase extraction tool to the question to extract the question entity.

6 . The method of claim 1 wherein forming the natural language prompt comprises combining content from the input query, the logic paths and one or more exemplars to form the natural language prompt, wherein each exemplar includes a representation of an example natural language prompt combined with an example response thereto, each example natural language prompt comprising a respective example question and set of example candidate answers together with example logic paths between the example question and the example candidate answers.

7 . The method of claim 1 wherein the response indicates a selected answer from the set of candidate answers and a natural language chain-of-thought statement for the selected answer.

8 . The method of claim 1 comprising receiving the input query over a network from a requesting device and providing the response over the network to the requesting device.

9 . The method of claim 1 comprising receiving the knowledge graph over a network from a requesting device.

10 . A computing system comprising:

a processing unit configured to execute computer-readable instructions to cause the system to perform a method for processing a natural language input query that includes a question and a respective set of candidate answers for the question, the method including:

generating, based on the input query and a knowledge graph, natural language logic paths between at least some of the candidate answers and the question, the generating includes:

identifying a question entity for the question included in the input query;

identifying a respective candidate answer entity for each of the candidate answers included in the input query;

identifying, for the question entity, a matching question node entity of the knowledge graph;

identifying, for at least some of the candidate answer entities, respective matching node answer entities of the knowledge graph; and

identifying, based on inter-node entity relationships specified in the knowledge graph, a respective logic path for each matching node answer entity to the matching question node entity as the natural language logic paths;

forming a natural language prompt based on both the input query and the logic paths; and

obtaining a response, based on the natural language prompt, from a pretrained natural language processing model based on a large neural network operating under a pretrain-finetune paradigm.

11 . The computing system of claim 10 wherein:

identifying the matching question node entity for the question entity is based on a comparison of an embedding generated for the question entity with embeddings generated for node entities of the knowledge graph; and

identifying the respective matching node answer entities for the at least some of the candidate answer entities is based on a comparison of embeddings generated for the candidate answer entities with embeddings generated for the node entities of the knowledge graph,

the embeddings each being generated by a neural network model that has been pretrained to generate similar embeddings for terms having semantically similar meanings.

12 . The computing system of claim 11 wherein identifying the respective logic path for each matching node answer entity to the matching question node entity comprises:

identifying, for each matching node answer entity, a respective set of candidate logic paths for the matching node answer entity to the matching question node entity;

ranking each of the candidate logic paths within each of the respective sets of candidate logic paths; and

selecting as the respective logic path for each matching node answer entity the candidate logic path having the highest ranking from the respective set of candidate logic paths for the matching node answer entity.

13 . The computing system of claim 12 wherein identifying the respective set of candidate logic paths for each matching node answer entity is limited to paths that fall within a predefined number of entity node hops.

14 . The computing system of claim 10 wherein identifying the question entity for the question comprises applying a keyphrase extraction tool to the question to extract the question entity.

15 . The computing system of claim 10 wherein forming the natural language prompt comprises combining content from the input query, the logic paths and one or more exemplars to form the natural language prompt, wherein each exemplar includes a representation of an example natural language prompt combined with an example response thereto, each example natural language prompt comprising a respective example question and set of example candidate answers together with example logic paths between the example question and the example candidate answers.

16 . The computing system of claim 10 wherein the response indicates a selected answer from the set of candidate answers and a natural language chain-of-thought statement for the selected answer.

17 . The computing system of claim 10 , wherein the processing unit is configured to execute computer-readable instructions to cause the system to receive the input query over a network from a requesting device and provide the response over the network to the requesting device.

18 . A non-transitory computer-readable medium having instructions stored thereon, wherein the instructions are executable by a processing unit of a computing system to cause the computing system to perform a method of processing a natural language input query that includes a question and a respective set of candidate answers for the question, the method comprising:

generating, based on the input query and a knowledge graph, natural language logic paths between at least some of the candidate answers and the question, the generating includes:

identifying a question entity for the question included in the input query;

identifying a respective candidate answer entity for each of the candidate answers included in the input query;

identifying, for the question entity, a matching question node entity of the knowledge graph;

identifying, for at least some of the candidate answer entities, respective matching node answer entities of the knowledge graph; and

identifying, based on inter-node entity relationships specified in the knowledge graph, a respective logic path for each matching node answer entity to the matching question node entity as the natural language logic paths;

forming a natural language prompt based on both the input query and the logic paths; and

obtaining a response, based on the natural language prompt, from a pretrained natural language processing model based on a large neural network operating under a pretrain-finetune paradigm.

Assignments (2)
CORRECTIVE ASSIGNMENT TO CORRECT THE NAME OF ASSIGNEE PREVIOUSLY RECORDED ON REEL 67047 FRAME 84. ASSIGNOR(S) HEREBY CONFIRMS THE ASSIGNMENT. Recorded Feb 4, 2025
From: HEISLER, MORGAN LINDSAY; WANG, CHENDI; SINGH, GURSIMRAN; ZHANG, YONG
To: HUAWEI CLOUD COMPUTING TECHNOLOGIES CO., LTD.
Reel/Frame 070104/0377 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Apr 9, 2024
From: HEISLER, MORGAN LINDSAY; WANG, CHENDI; SINGH, GURSIMRAN; ZHANG, YONG
To: HUAWEI TECHNOLOGIES CO., LTD.
Reel/Frame 067047/0084 →
Continuity (1)
Related Publication 20250225160A1 · Jul 10, 2025
References Cited (12)
US 20060235696A1 · Bennett · 2006 [cited by examiner]
US 20090292687A1 · Fan · 2009 [cited by examiner]
CN 106095932B · 2019 [cited by examiner]
CN 114090746A · 2022 [cited by examiner]
CN 113569023B · 2024 [cited by examiner]
Wang, et al., “Keqing: Knowledge-Based Question Answering is a Nature Chain-of-Thought Mentor of LLM,” arXiv, Dec. 31, 2023. (Year: 2023). [cited by examiner]
Wang, et al., “Keqing: Knowledge-Based Question Answering is a Nature Chain-of-Thought Mentor of LLM,” arXiv, Dec. 31, 2023. (Year: 2023) (Year: 2023). [cited by examiner]
Wang, et al. “Keqing: Knowledge-Based Question Answering is a Nature Chain-of-Thought Mentor of LLM,” arXiv, Dec. 31, 2023 (see attached copy in the previous Office action). (Year: 2023). [cited by examiner]
Wei, Jason et al. “Chain-of-Thought Prompting Elicits Reasoning in Large Language Models.” 36th Converence on Neural Information Processing Systems (NeurIPS 2022). arXiv:2201.11903v6[cs. CL] Jan. 10, 2023. [cited by applicant]
Chen, Xiang et al. “KnowPrompt: Knowledge-aware Prompt-tuning with Synergistic Optimization for Relation Extraction”. In Proceedings of the ACM Web Conference 2022 (WWWW'22), Apr. 25-20, 2022, Virtual Event, Lyon, Franc… [cited by applicant]
Ling, Chen et al. “Knowledge-enhanced Prompt for Open-domain Commonsense Reasoning”. Nov. 2022. [cited by applicant]
Yasunaga, Michihiro et al. “QA-GNN: Reasoning with Language Models and Knowledge Graphs for Question Answering”. arXiv:2104.06378v5 [cs.CL] Dec. 13, 2022. [cited by applicant]