IP Library › Granted Patent US 12,468,897
Granted Patent B2
US 12,468,897 · App. 18/128,450 · Granted Nov 11, 2025

Self-improving LLMs through consistency-based self-generated demonstrations

Inventors: Ruoxi Sun (Santa Clara, CA); Xingchen Wan (Oxford, GB); Hanjun Dai (San Jose, CA); Sercan Omer Arik (San Francisco, CA); Tomas Pfister (Redwood Shores, CA)
Assignee: Google LLC
G06F40/40G06F16/3344
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,468,897
App. No.
18/128,450
Filed
Mar 30, 2023
Granted
Nov 11, 2025
Kind
B2
Examiner
GAY, SONIA L
Art Unit
2657
USPC
704/9
Abstract

Aspects of the disclosure are directed to automatically selecting examples in a prompt for an LLM to demonstrate how to perform tasks. Aspects of the disclosure can select and build a set of examples from LLM zero-shot outputs via predetermined criteria that can combine consistency, diversity, and repetition. In the zero-shot setting for three different LLMs, using only LLM predictions, aspects of the disclosure can improve performance up to 15% compared to zero-shot baselines and can match or exceed few-shot base-lines for a range of reasoning tasks.

Claims (38)

1 . A method for consistency based self-adaptive prompting, comprising:

generating, by one or more processors, a pool of demonstrations using a large language model (LLM) for a plurality of test queries by running chain-of-thought (CoT) over the plurality of test queries;

determining, by the one or more processors, a self-consistency score for respective demonstrations in the pool of demonstrations;

selecting, by the one or more processors, a set of demonstrations from the pool of demonstrations based on the self-consistency scores;

prepending, by the one or more processors, the set of demonstrations to the plurality of test queries; and

generating, by the one or more processors, a plurality of predictions based on the test queries prepended with the set of demonstrations using the LLM.

2 . The method of claim 1 , further comprising receiving, by the one or more processors, the plurality of test queries, each test query being concatenated with a trigger phrase or a labeled demonstration.

3 . The method of claim 1 , wherein the CoT comprises Zero-shot CoT or Few-shot CoT.

4 . The method of claim 1 , wherein the CoT is run multiple times using the LLM to generate multiple reasoning paths and different predictions for each test query.

5 . The method of claim 1 , wherein selecting a set of demonstrations further comprises computing a majority vote prediction and retaining only reasoning paths that result in a majority vote prediction.

6 . The method of claim 5 , wherein the majority vote prediction is computed based on entropy and repetitiveness.

7 . The method of claim 1 , wherein prepending the set of demonstrations further comprises adaptively allocating a number of demonstrations per test query that is proportional to an entropy of the test query.

8 . The method of claim 1 , wherein generating the plurality of predictions further comprises querying the test queries prepended with the set of demonstrations multiple times using the LLM to generate multiple predictions for each test query.

9 . The method of claim 8 , further comprising:

selecting, by the one or more processors, a prediction of the multiple predictions for each test query based on a majority voting; and

outputting, by the one or more processors, the selected prediction for each test query.

10 . A system comprising:

one or more processors; and

one or more storage devices coupled to the one or more processors and storing instructions that, when executed by the one or more processors, cause the one or more processors to perform operations for consistency based self-adaptive prompting, the operations comprising:

generating a pool of demonstrations using a large language model (LLM) for a plurality of test queries by running chain-of-thought (CoT) over the plurality of test queries;

determining a self-consistency score for respective demonstrations in the pool of demonstrations;

selecting a set of demonstrations from the pool of demonstrations based on the self-consistency scores;

prepending the set of demonstrations to the plurality of test queries; and

generating a plurality of predictions based on the test queries prepended with the set of demonstrations using the LLM.

11 . The system of claim 10 , wherein the CoT is run multiple times using the LLM to generate multiple reasoning paths and different predictions for each test query.

12 . The system of claim 10 , wherein selecting a set of demonstrations further comprises computing a majority vote prediction and retaining only reasoning paths that result in a majority vote prediction, the majority vote prediction being computed based on entropy and repetitiveness.

13 . The system of claim 10 , wherein generating the plurality of predictions further comprises querying the test queries prepended with the set of demonstrations multiple times using the LLM to generate multiple predictions for each test query.

14 . The system of claim 13 , wherein the operations further comprise selecting a prediction of the multiple predictions for each test query based on a majority voting.

15 . A non-transitory computer readable medium for storing instructions that, when executed by one or more processors, cause the one or more processors to perform operations for consistency based self-adaptive prompting, the operations comprising:

generating a pool of demonstrations using a large language model (LLM) for a plurality of test queries by running chain-of-thought (CoT) over the plurality of test queries;

determining a self-consistency score for respective demonstrations in the pool of demonstrations;

selecting a set of demonstrations from the pool of demonstrations based on the self-consistency scores;

prepending the set of demonstrations to the plurality of test queries; and

generating a plurality of predictions based on the test queries prepended with the set of demonstrations using the LLM.

16 . The non-transitory computer readable medium of claim 15 , wherein the CoT is run multiple times using the LLM to generate multiple reasoning paths and different predictions for each test query.

17 . The non-transitory computer readable medium of claim 15 , wherein selecting a set of demonstrations further comprises computing a majority vote prediction and retaining only reasoning paths that result in a majority vote prediction, the majority vote prediction being computed based on entropy and repetitiveness.

18 . The non-transitory computer readable medium of claim 15 , wherein generating the plurality of predictions further comprises querying the test queries prepended with the set of demonstrations multiple times using the LLM to generate multiple predictions for each test query.

19 . The non-transitory computer readable medium of claim 18 , wherein the operations further comprise selecting a prediction of the multiple predictions for each test query based on a majority voting.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 30, 2023
From: SUN, RUOXI; WAN, XINGCHEN; DAI, HANJUN; ARIK, SERCAN OMER; PFISTER, TOMAS
To: GOOGLE LLC
Reel/Frame 063165/0764 →
Continuity (2)
Provisional Application 63480789 · Jan 20, 2023
Related Publication 20240249080A1 · Jul 25, 2024
References Cited (33)
US 20200311473A1 · Agarwal · 2020 [cited by examiner]
US 20220027792A1 · Cummings · 2022 [cited by examiner]
Zhu. Solving Math Word Problems via Cooperative Reasoning induced Language models, arXiv, 2022, whole document (Year: 2022). [cited by examiner]
International Search Report and Written Opinion for PCT Application No. PCT/US2023/036341, dated Feb. 23, 2024. 17 pages. [cited by applicant]
Brown et al. 2020. Language models are few-shot learners. Advances in neural information processing systems, 33:1877-1901. [cited by applicant]
Caruana et al. 2004. Ensemble selection from libraries of models. In Proceedings of the twenty-first international conference on Machine learning, 8 pages. [cited by applicant]
Deng et al. 2022. RLPrompt: Optimizing discrete text prompts with reinforcement learning. arXiv preprint arXiv:2205.12548. 23 pages. [cited by applicant]
Grandvalet et al. 2004. Semi-supervised learning by entropy minimization. Advances in neural information processing systems, 17. 8 pages. [cited by applicant]
Huang et al. 2022. Large language models can self-improve. arXiv preprint arXiv:2210.11610. 19 pages. [cited by applicant]
Klein et al. 2017. OpenNMT: Open-source toolkit for neural machine translation. arXiv preprint arXiv:1701.02810. 6 pages. [cited by applicant]
Kojima et al. 2022. Large language models are zero-shot reasoners. Advances in Neural Information Processing Systems (NeurIPS) 35. 42 pages. [cited by applicant]
Lee et al. 2013. Pseudo-label: The simple and efficient semi-supervised learning method for deep neural networks. In Workshop on challenges in representation learning, ICML, vol. 3, 7 pages. [cited by applicant]
Li et al. 2022a. Self-prompting large language models for open-domain QA. arXiv preprint arXiv:2212.08635. 13 pages. [cited by applicant]
Li et al. 2022b. On the advance of making language models better reasoners. arXiv preprint arXiv:2206.02336. 13 pages. [cited by applicant]
Liu et al. 2021. What makes good in-context examples for gpt-3? arXiv preprint arXiv:2101.06804. 12 pages. [cited by applicant]
Paulus et al. 2017. A deep reinforced model for abstractive summarization. arXiv preprint arXiv:1705.04304. 12 pages. [cited by applicant]
Radford et al. 2018. Language models are unsupervised multitask learners. 24 pages. [cited by applicant]
Rae et al. 2021. Scaling language models: Methods, analysis & insights from training gopher. arXiv preprint arXiv:2112.11446. 118 pages. [cited by applicant]
Rizve et al. 2021. In defense of pseudo-labeling: An uncertainty-aware pseudo label selection framework for semi-supervised learning. arXiv preprint arXiv:2101.06329. 20 pages. [cited by applicant]
Rubin et al. 2021. Learning to retrieve prompts for in-context learning. arXiv preprint arXiv:2112.08633. 17 pages. [cited by applicant]
Schulman et al. 2022. ChatGPT: Optimizing language models for dialogue. Introducing ChatGPT Blog. Retrieved on Mar. 29, 2023. Retrieved from the Internet: <https://openai.com/blog/chatgpt>. 10 pages. [cited by applicant]
Shi et al. 2018. Transductive semi-supervised deep learning using min-max features. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 299-315. [cited by applicant]
Su et al. 2022. Selective annotation makes language models better few-shot learners. arXiv preprint arXiv:2209.01975. 21 pages. [cited by applicant]
Thoppilan et al. 2022. LaMDA: Language models for dialog applications. arXiv preprint arXiv:2201.08239. 47 pages. [cited by applicant]
Van Hasselt et al. 2016. Learning values across many orders of magnitude. Advances in neural information processing systems, 29. 19 pages. [cited by applicant]
Wang et al. 2018. GLUE: A multi-task benchmark and analysis platform for natural language understanding. In Proceedings of the 2018 EMNLP Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, pp. 353… [cited by applicant]
Wang et al. 2019. SuperGLUE: A stickier benchmark for general-purpose language understanding systems. Advances in neural information processing systems, 32. 30 pages. [cited by applicant]
Wang et al. 2022. Self-consistency improves chain of thought reasoning in language models. arXiv preprint arXiv:2203.11171. 24 pages. [cited by applicant]
Wei et al. 2022a. Emergent abilities of large language models. arXiv preprint arXiv:2206.07682. 30 pages. [cited by applicant]
Wei et al. 2022b. Chain of thought prompting elicits reasoning in large language models. arXiv preprint arXiv:2201.11903. 43 pages. [cited by applicant]
Weng et al. 2022. Large language models are reasoners with self-verification. arXiv preprint arXiv:2212.09561. 24 pages. [cited by applicant]
Zelikman et al. 2022. STaR: Self-taught reasoner bootstrapping reasoning with reasoning. 30 pages. [cited by applicant]
Zhang et al. 2022. Automatic chain of thought prompting in large language models. arXiv preprint arXiv:2210.03493. 25 pages. [cited by applicant]