Enhanced large language models with decision-tree-of-thought prompting
The DToT prompting method addresses the challenge of efficiently refining LLM prompts by iteratively selecting fine-grained context, enhancing response accuracy and reducing costs in tasks like toxic content identification.
Patent Information
- Application Number
- US18/470110
- Authority / Receiving Office
- US · United States
- Patent Type
- Patents(United States)
- Current Assignee / Owner
- Filing Date
- 2023-09-19
- Publication Date
- 2026-12-01
- Estimated Expiration
- 2044-10-27
AI Technical Summary
Efficiently designing prompts for large language models (LLMs) is challenging, leading to high run-time costs and undermining their deployments, particularly in tasks like toxic content identification and other language-based content classification.
The decision-tree-of-thought (DToT) prompting approach iteratively selects more fine-grained context for LLMs when their responses lack confidence, using a confidence checker and context selector to refine prompts, enhancing zero-shot and few-shot in-context learning performance.
Improves the accuracy and confidence of LLM responses by automatically selecting appropriate fine-grained context, providing improved rationales and reducing run-time costs.
Smart Images

Figure US12818125-D00000_ABST
Abstract
Description
BACKGROUND
[0001] Large language models in machine learning may be used to analyze words and phrases. However, efficiently designing prompts for large language models may be challenging.BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS
[0002] To easily identify the discussion of any particular element or act, the most significant digit or digits in a reference number refer to the figure number in which that element is first introduced.
[0003] FIG. 1 illustrates an example system for large language models (LLMs) with decision-tree-of-thought (DToT) prompting in accordance with one or more embodiments of the present disclosure.
[0004] FIG. 2 illustrates an example system for LLMs with DToT prompting in accordance with one or more embodiments of the present disclosure.
[0005] FIG. 3 a flow diagram for a process for using LLMs with DToT prompting in accordance with one or more embodiments of the present disclosure.
[0006] FIG. 4 a flow diagram for a process for using LLMs with DToT prompting in accordance with one or more embodiments of the present disclosure.
[0007] FIG. 5 illustrates a block diagram of an example machine upon which any of one or more techniques (e.g., methods) may be performed, in accordance with one or more example embodiments of the present disclosure.
[0008] Certain implementations will now be described more fully below with reference to the accompanying drawings, in which various implementations and / or aspects are shown. However, various aspects may be implemented in many different forms and should not be construed as limited to the implementations set forth herein; rather, these implementations are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art. Like numbers in the figures refer to like elements throughout. Hence, if a feature is used across several drawings, the number used to identify the feature in the drawing where the feature first appeared will be used in later drawings.DETAILED DESCRIPTIONOverview
[0009] Example embodiments described herein provide certain systems, methods, and devices for large language models (LLMs) with decision-tree-of-thought (DToT) prompting.
[0010] LLMs may be used to analyze words and phrases, and perform a variety of content analyses. In machine learning (ML), few-shot learning allows ML models to predict a classification of data when a small number of examples are available in a training dataset, whereas zero-shot learning allows ML models to predict the correct classification without exposure to any instances of the classification being included in the training dataset.
[0011] LLMs (e.g., machine learning models) have shown promise in content detection due to superior zero-shot and few-shot in-context learning ability, as well as broad transferability of machine learning (ML) tasks.
[0012] In ML, a prompt may include natural language text describing one or more tasks for the model to perform. For example, a prompt to a LLM may include, “Does this content include course language?” However, designing LLM prompts efficiently may be challenging. In addition, LLMs may have a high run-time cost that may undermine their deployments.
[0013] In one or more embodiments, to address these LLM challenges, a bootstrapping and distilling LLM (BD-LLM) may be used for content analysis such as toxic content identification and other language-based content classification. The DTOT herein may automatically select more fine-grained context to re-prompt the LLMs when the LLMs' responses lack confidence. The rationales extracted via DToT may be used to fine-tune student language models.
[0014] In one or more embodiments, the DTOT may represent an enhanced LLM prompting approach to improve zero-shot and few-shot in-context learning performance of LLMs, as well as to extract improved rationales from the LLMs. DTOT works by iteratively selecting more fine-grained context with which to re-prompt LLMs when they have low-confidence answers. The DTOT prompting may automatically decide when to select a more fine-grained context for re-prompting, and which type of fine-grained context should be selected.
[0015] For example, for a question q input to a LLM with DTOT prompting, the LLM with DTOT prompting may generate an answer a with a rationale r for the answer. For example, in a toxic content identification context, a LLM response may be, “Yes, this sentence includes toxic content. The rationale is that the sentence includes hate speech and biased content toward a certain group of people by implying that the people are not welcome in a particular location.” The DTOT enhancement provides an improved response with rationale compared to a non-DToT approach, which may recognize that a sentence includes toxic content, but may not recognize a particular context for the rationale.
[0016] The DTOT prompting for the LLM may use a context tree in which initial context c0 and the question q are input to a prompt generator, which may generate a prompt pt input to the LLM. The LLM may generate an answer at and rationale rt based on the prompt. A confidence checker may determine whether a confidence in the answer and / or rationale exceed a respective confidence threshold. When the confidence is too low, the rationale rt may be fed back to a context selector, which may select new context from the context tree, where
[0017] ct=ctjfor iteration step t. The new context may be fed to the prompt generator with the question q to generate another prompt for the LLM, which generates an answer and rationale until the answer and rationale satisfy the confidence threshold.
[0018] Two challenges of DToT prompting include: (1) how to decide whether the response (answer and / or rationale) of the LLM is confident or not, and (2) how to decide which type of fine-grained context should be selected to re-prompt the LLM. The confidence checker addresses the first challenge by measuring the confidence score(s) of the LLM output. The context selector addresses the second challenge by selecting the appropriate fine-grained context from a context tree based on the rationale generated by the LLM.
[0019] In one or more embodiments, the DTOT prompting herein may include four modules: (1) the confidence checker, (2) the context tree, (3) the context selector, and (4) the prompt generator. The prompt generator may be used for LLMs for which there may only be access to output responses (e.g., proprietary LLMs) and for LLMs for which the model parameters may be accessible (e.g., open-source LLMs).
[0020] In one or more embodiments, the confidence checker module may measure the self-confidence score of the LLM's response, which may be defined as
[0021] stconffor iteration step t. For proprietary LLMs, the confidence checker may use a rating of the LLM output (e.g., from 0-100 confidence level) to calculate the confidence score. If the confidence rating is above a maximal threshold sh or below a minimal threshold sl, the answer of the LLM to the question may be considered confident or not, respectively. To obtain the confidence rating, the LLM may be required to output its rating in the prompt pt. For open-source LLMs, the confidence checker may leverage the output logits of LLM to calculate the probability of generating answers at conditional on the prompt pt. This probability may be used as the confidence measurement (e.g.,
[0022] stconf=Pr[at<semantics definitionURL="">❘<annotation encoding="Mathematica">"\[LeftBracketingBar]"< / annotation>< / semantics>pt]).Formally:
[0023] stconf={1[st∉(sl,sh),for proprietary LLMsPr[at<semantics definitionURL="">❘<annotation encoding="Mathematica">"\[LeftBracketingBar]"< / annotation>< / semantics>pt],for open-source LLMs,where 1[·] is an indicator function.
[0024] In one or more embodiments, suppose the confidence checker has measured the self-confidence score st of the LLM's answer at. Then, if
[0025] stconfis higher than a threshold sδ, the checker may consider at as a confident LLM answer. Formally, the output of the confidence checker Dcheck may be defined as:
[0026] Dcheck(stconf)={Unconfident, if stconf∈[0,sδ]Confident, if stconf∈[sδ,1],where s∂ is an adjustable threshold.
[0027] In one or more embodiments, suppose the universe of context were represented by a set . The context tree may be defined as Tc: →LIST[], which is a mapping from a parent-node context ct∈ to the list of its child-node contexts
[0028] [ct+11,… ,ct+1Nct],where Nc<sub2>t < / sub2>is the total number of child nodes of ct, and
[0029] ct+1j∈is the j-th child-node context of ct. Any child-node context's category may be designed to be a subcategory of its parent-node context's category, such that the child-node context is more fine-grained than parent-node context. For example, suppose that c0 provides the definition of toxic content, which includes hate speech, etc. Then
[0030] c11may be a more fine-grained definition for hate speech, and
[0031] c12may be a more fine-grained definition for biased content, etc.
[0032] In one or more embodiments, the rationale rt, the current context ct, and the context tree Tc may be input to the context selector module to select a more fine-grained context ct+1. Whenever an answer at at iteration step t is considered unconfident by the confidence checker, the context selector may select new context from the context tree for re-prompting LLMs. Specifically, the context selector may measure the relevance between rationale rt and respective child-node context
[0033] ct+1j,and then select the most relevant one
[0034] ct+1=cc+1j*.The output of the context selector may be defined as:
[0035] Dselect(rt)=j*=argmax1≤j≤Nctstrele,j(rt,ct+1j),where
[0036] [ct+11,… ,ct+1Nct]=Tc(ct),and
[0037] strele,jis the relevance score between rt and
[0038] ct+1j.
[0039] To calculate
[0040] strele,jfor LLMS that can generate high-quality rationales (e.g., proprietary LLMs), a classification prompt may be used to ask the LLM which of the child-node context categories are most relevant to the rationale rt. Denote the LLM answer as Class(rt). In contrast, for open-source LLMs that may not generate high-quality rationales, a set of candidate rationales may be generated as
[0041] rt=[rt1,… ,rtNct],where any
[0042] rt[j]=rtjis relevant to only one of the child-node contexts
[0043] ct+1j.Because the output logics of the LLM may be available, the probability of generating each candidate rationale conditional on the prompt pt (e.g., Pr[rt[j]|pt]) may be measured as the relevance score. Formally:
[0044] strele,j={1[i=Class(rt)],for proprietary LLMsPr[rt[j]<semantics definitionURL="">❘<annotation encoding="Mathematica">"\[LeftBracketingBar]"< / annotation>< / semantics>pt],for open-source LLMs.
[0045] In one or more embodiments, the prompt generator module P may generate an input prompt pt for LLM M based on question q and context ct at iteration step t. The prompt generator module may modify the question q with a change of context. For example, the initial question based on c0 may be designed to ask whether a statement contains toxic content. Suppose c1 is selected to provide context related to hate speech. The prompt generator may modify the question to ask whether the statement contains hate speech, which is a specific category of toxic content. For example, a LLM prompt for toxic content identification may include the context of type (c), the sentence analyzed, the question, “Does this sentence include the type (c) content,”“First, answer ‘Yes’ or ‘No,’”“Second, rate the type (c) level,”“Third, explain your rationale briefly,” resulting in an output of the format: Answer, type (c) level, rationale. Another LLM prompt for toxic content identification may include context type (c), “Does this sentence include type (c) content,”“Answer yes or no, and explain your answer,” resulting in the answer and rationale.
[0046] In one or more embodiments, the DTOT prompting herein also may apply to few-shot learning. For example, the prompt may include a few demonstrations, such as K positive statements and K negative statements most semantically similar to the input statement. Another example may include the prompt with rationales or facts.
[0047] The above descriptions are for purposes of illustration and are not meant to be limiting. Numerous other examples, configurations, processes, etc., may exist, some of which are described in greater detail below. Example embodiments will now be described with reference to the accompanying figures.Illustrative Processes and Use Cases
[0048] FIG. 1 illustrates an example system 100 for LLMs with DToT prompting in accordance with one or more embodiments of the present disclosure.
[0049] Referring to FIG. 1, an input 102 (e.g., a question, content, request, etc.) may be provided to a LLM 104 with DToT prompting 106. For example, the input 102 may be a voice utterance including a question or request, or may include content being analyzed, such as text, audio, or video. The LLM 104 with DToT prompting 106 may use a context tree 108, a prompt generator 110 (e.g., one or more modules), a confidence checker 112 (e.g., one or more modules), and a context selector 114 (e.g., one or more modules) to analyze the input 102 and context from the context tree 108 to generate prompts for the LLM 104. For example, an initial context 116 (e.g., context c0) and the input 102 may be input to the prompt generator 110, which may generate a prompt 118 (e.g., prompt pt for iteration t) based on the input 102 and the initial context 116. The prompt 118 may be input to the LLM 104 to generate an output 120 for the input 102, and a rationale 122 for the output 120. The confidence checker 112 may determine whether the output 120 and rationale 122 for iteration t satisfy a respective confidence threshold. When the output 120 and rationale 122 do not satisfy the respective confidence threshold, the rationale 122 may be input to the context selector 114, which may select new context 124 (e.g.,
[0050] ct+1=ct+1j,represented by new context 1, new context j, . . . , new context N in FIG. 1)) from the context tree 108. The new context 124 may be input to the prompt generator 110 along with the input 102, which may be modified based on the context as described above. The LLM 104 with DTOT prompting 106 may continue until the confidence of the output 120 and rationale 122 satisfy a confidence threshold at the confidence checker 112, at which time they may be output by the LLM 104 with DTOT prompting 106. In one or more embodiments, the output 120 and rationale 122 may be input to fine-tune one or more student LMs 130.
[0051] In one or more embodiments, the LLM 104 with DTOT prompting 106 may represent a BD-LLM. The LLM 104 with DTOT prompting 106 herein may automatically select more fine-grained context to re-prompt the LLM 104 when the LLM's output 120 lacks confidence.
[0052] In one or more embodiments, the context selector 114 iteratively selects more fine-grained context (e.g., the new context 124) with which to re-prompt the LLM 104 when the LLM 104 generates low-confidence outputs. The DToT prompting may automatically decide when to select a more fine-grained context for re-prompting, and which type of fine-grained context should be selected.
[0053] In one or more embodiments, the confidence checker 112 may measure the self-confidence score of the LLM's response (e.g., the output 120), which may be defined as
[0054] stconffor iteration step t. For proprietary LLMs, the confidence checker 112 may use a rating of the LLM output (e.g., from 0-100 confidence level) to calculate the confidence score. If the confidence rating is above a maximal threshold sh or below a minimal threshold sl, the output 120 of the LLM 104 may be considered confident or not, respectively. To obtain the confidence rating, the LLM 104 may be required to output its rating in the prompt pt. For open-source LLMs, the confidence checker may leverage the output logits of LLM to calculate the probability of generating answers at conditional on the prompt pt. This probability may be used as the confidence measurement
[0055] (e.g.,stconf=Pr[at|pt]).Formally:
[0056] stconf={1[st∉(sl,sh),for proprietary LLMsPr[at❘pt],for open-source LLMs,where 1[·] is an indicator function.
[0057] In one or more embodiments, suppose the confidence checker 112 has measured the self-confidence score st of the LLM's answer at. Then, if
[0058] stconfis higher than a threshold sδ, the checker may consider at as a confident LLM answer. Formally, the output of the confidence checker 112 Dcheck may be defined as:
[0059] Dcheck(stconf)={Unconfident,if stconf∈[0,sδ]Confident,if stconf∈[sδ,1],where s∂ is an adjustable threshold.
[0060] In one or more embodiments, suppose the universe of context were represented by a set . The context tree 108 may be defined as Tc: →LIST[], which is a mapping from a parent-node context ct∈ to the list of its child-node contexts
[0061] [ct+11, … , ct+1Nct],where Nc<sub2>t < / sub2>is the total number of child nodes of ct, and
[0062] ct+1j∈𝒞is the j-th child-node context of ct. Any child-node context's category may be designed to be a subcategory of its parent-node context's category, such that the child-node context is more fine-grained than parent-node context. For example, suppose that c0 provides the definition of toxic content, which includes hate speech, etc. Then
[0063] c11may be a more fine-grained definition for hate speech, and
[0064] c12may be a more fine-grained definition for biased content, etc.
[0065] In one or more embodiments, the rationale rt, the current context ct, and the context tree Tc may be input to the context selector 114 to select a more fine-grained context ct+1. Whenever an answer at at iteration step t is considered unconfident by the confidence checker 112, the context selector 114 may select new context from the context tree 108 for re-prompting LLMs. Specifically, the context selector 114 may measure the relevance between rationale rt and respective child-node context
[0066] ct+1j,and then select the most relevant one
[0067] ct+1=ct+1j*.The output of the context selector 114 may be defined as:
[0068] Dselect(rt)=j*=argmax1≤j≤Nctstrele,j(rt,ct+1j),where
[0069] [ct+11,… ,ct+1Nct]=Tc(ct),and
[0070] strele,jis the relevance score between rt and
[0071] ct+1j.
[0072] To calculate
[0073] strele,jfor LLMs than can generate high-quality rationales (e.g., proprietary LLMs), a classification prompt (e.g., the prompt 118) may be used to ask the LLM 104 which of the child-node context categories are most relevant to the rationale rt. Denote the LLM answer (e.g., the output 120) as Class(rt). In contrast, for open-source LLMs that may not generate high-quality rationales, a set of candidate rationales may be generated as
[0074] rc=[rt1,… , rtNct],where any
[0075] rt[j]=rtjis relevant to only one of the child-node contexts
[0076] ct+1j.Because the output logics of the LLM may be available, the probability of generating each candidate rationale conditional on the prompt pt (e.g., Pr[rt[j]|pt]) may be measured as the relevance score. Formally:
[0077] strele,j={1[j=Class(rt)],for proprietary LLMsPr[rt[j]|pt],for open-source LLMs.
[0078] In one or more embodiments, the prompt generator module P (e.g., the prompt generator 110) may generate an input prompt pt (e.g., the prompt 118) for LLM M based on question q (e.g., input 102) and context ct at iteration step t. The prompt generator 110 may modify the question q with a change of context. For example, the initial question based on c0 may be designed to ask whether a statement contains toxic content. Suppose c1 is selected to provide context related to hate speech. The prompt generator 110 may modify the question to ask whether the statement contains hate speech, which is a specific category of toxic content.
[0079] In one or more embodiments, the context tree 108 may be based on the type of context for which the input 102 is analyzed. Toxic content is one type of context that may be analyzed, but other types of context may be analyzed. For example, the context tree 108 may include nodes for analyzing types of course language, sexual content, drug and alcohol use, violence, and the like.
[0080] In one or more embodiments, when the context tree 108 is used for toxic content analysis, the initial context 116 (e.g., c0) may be something like, “Toxic content includes hate speech, biased content, sexual content, violent content . . . ” Sub-context (e.g.,
[0081] c11)may include something like, “Hate and intolerant content refers to any form of communication, media, or expression that promotes or incites violence, hostility . . . .” Additional sub-context (e.g.,
[0082] c12)may include something like, “Biased and discriminatory content can disrespect, stereotype, or promote bias and discrimination against an individual or group of people with . . . ” and the like.
[0083] FIG. 2 illustrates an example system 200 for LLMs with DToT prompting in accordance with one or more embodiments of the present disclosure.
[0084] Referring to FIG. 2, a user 202 with one or more devices (e.g., wearable device 204, wearable device 206, mobile device 208, etc.) may interact with the one or more devices, or with other devices 210 (e.g., smart home assistant device 212, mobile device 214, display device 216, etc.), such as by providing inputs (e.g., the input 102 of FIG. 1), including touches, gestures, voice utterances (e.g., voice utterance 218), and the like. Data 220 from the inputs may be provided to the devices 210. The devices 210 and / or one or more remote devices 250 (e.g., servers / cloud-based devices) may generate the output 120 and the rationale 122 using the LLM 104 with the DToT prompting 106. The devices 210 and / or one or more remote devices 250 may provide information (e.g., the output 120, the rationale 122, and / or confidence score in the output 120) to one or more applications / services 260 for use. For example, the one or more applications / services 260 may rely on the information to determine what content to present and how to the user 202, such as by responding to user queries based on the output 120 indicating the presence of toxic content, etc.
[0085] In one or more embodiments, the input 102 of FIG. 1 may include at least a portion of the voice utterance 218 and / or other inputs from the user 202. The input 102 may include any content accessible by the devices 210 and / or the one or more remote devices 250, such as video titles, audio titles, text, and the like. In this manner, the input 102 may include user questions / queries and requests, and / or may include presentable content to be analyzed.
[0086] FIG. 3 a flow diagram for a process 300 for using LLMs with DToT prompting in accordance with one or more embodiments of the present disclosure.
[0087] At block 302, a device (or system, e.g., the system 100 of FIG. 1, the system 200 of FIG. 2) may generate (e.g., using the prompt generator 110) an input prompt for a LLM (e.g., the LLM 104) based on an input (e.g., the input 102) and a context (e.g., the initial context 116) from a context tree (e.g., the context tree 108 of FIG. 1). For example, the prompt may be represented by: pt=P(q, ct, M) for LLM M. The prompt may request the LLM to generate an output for an input (e.g., an answer to a question), a confidence score in the output, and a rationale for the output. The prompt may use zero-shot learning with no example inputs and their outputs, or may include few-shot learning with a few examples of inputs and their outputs to train the LLM.
[0088] At block 304, the device may determine whether the LLM is proprietary. If yes, at block 306, the LLM may generate an output (a response, e.g., the output 120) based on the input, the output, and a rating for the output. The output may be represented by: M(pt)=(at, st, rt). If no, at block 308, the LLM may generate the output based on the input and the output according to: M(pt)=(at, rt).
[0089] At block 310, the device (e.g., using the LLM 104) may generate a confidence score for the LLM output according to:
[0090] stconf={1[sr∉(sl,sh),for proprietary LLMsPr[at|pt],for open-source LLMs.
[0091] At block 312, the device (e.g., using the confidence checker 112) may determine whether the confidence score is greater than a confidence threshold, for example, if
[0092] Dcheck(stconf)={Unconfident,if stconf∈[0,sδ]Confident,if stconf∈[sδ,1].
[0093] If no at block 312, then at block 316, the device may determine whether the LLM is proprietary. If the LLM is proprietary at block 316, then at block 318, the device (e.g., using the context selector 114) may generate the rationale class: Class(rt). If the LLM is not proprietary at block 316, then at block 320, the device may calculate a relevance score for one or more candidate rationale(s). For example, let rt be the candidate rationale list:
[0094] [rt,j]j=1Nct,and calculate the relevance score
[0095] strele,j]j=1Nct.
[0096] At block 322, the device may select updated context from the context tree. For example, calculate j*=Dselect(rt), and set the updated context ct+1 as
[0097] ct+1jand t=t+1. The context tree may be defined as Tc: →LIST[], which is a mapping from a parent-node context ct∈ to the list of its child-node contexts
[0098] [ct+11,… ,ct+1Nct],where Nc<sub2>t < / sub2>is the total number of child nodes of ct, and
[0099] ct+1j∈𝒞is the j-th child-node context of ct. Any child-node context's category may be designed to be a subcategory of its parent-node context's category, such that the child-node context is more fine-grained than parent-node context. Selecting the updated context therefore may include mapping from the parent-node context (e.g., the initial context of block 302) to child-node contexts of the tree as a subcategory of the parent-node context. The process 300 may return to block 304 until the confidence score for the output and rationale based on the updated context exceeds the confidence threshold at block 312, at which time the device, at block 324, may provide information including the LLM output, the rationale, and / or the confidence score (e.g., to the one or more applications / services 260 of FIG. 2).
[0100] FIG. 4 a flow diagram for a process 400 for using LLMs with DToT prompting in accordance with one or more embodiments of the present disclosure.
[0101] At block 402, a device (or system, e.g., the system 100 of FIG. 1, the system 200 of FIG. 2) may input an input (e.g., the input 102) and a context from a context tree (e.g., the context tree 108) to a prompt generator (e.g., the prompt generator 110).
[0102] At block 404, the device (e.g., using the prompt generator 110) may generate a prompt for a LLM (e.g., the LLM 104) based on the input and the context. The prompt may request the LLM to generate an output for an input (e.g., an answer to a question), a confidence score in the output, and a rationale for the output. The prompt may use zero-shot learning with no example inputs and their outputs, or may include few-shot learning with a few examples of inputs and their outputs to train the LLM.
[0103] At block 406, the device may generate (e.g., using the LLM 104) an output (e.g., response), a confidence score in the output, and a rationale for the output based on the prompt.
[0104] At block 408, the device may determine whether the confidence level in the output is greater than a confidence threshold. When the confidence level is not greater than the confidence threshold, the device, at block 410, may select an updated context from the context tree. The context tree may be defined as Tc: →LIST[], which is a mapping from a parent-node context ct∈ to the list of its child-node contexts
[0105] [ct+11,… ,ct+1Nct],where Nc<sub2>t < / sub2>is the total number of child nodes of ct, and
[0106] ct+1j∈𝒞is the j-th child-node context of ct. Any child-node context's category may be designed to be a subcategory of its parent-node context's category, such that the child-node context is more fine-grained than parent-node context. Selecting the updated context therefore may include mapping from the parent-node context (e.g., the initial context of block 302) to child-node contexts of the tree as a subcategory of the parent-node context.
[0107] At block 412, the device may generate an updated prompt based on the updated context, and the process 400 may return to block 406 where the LLM may generate an output based on the updated prompt. The process 400 may continue until the confidence level of the LLM output is sufficient at block 408.
[0108] At block 414, the device may provide information including the LLM output, the rationale for the output, and or the confidence level when the confidence level for the output is sufficient (e.g., to the one or more applications / services 260 of FIG. 2).
[0109] The examples herein are not meant to be limiting.
[0110] FIG. 5 illustrates a block diagram of an example machine upon which any of one or more techniques (e.g., methods) may be performed, in accordance with one or more example embodiments of the present disclosure.
[0111] In other embodiments, the machine 500 may operate as a standalone device or may be connected (e.g., networked) to other machines. In a networked deployment, the machine 500 may operate in the capacity of a server machine, a client machine, or both in server-client network environments. The machine 500 may be a server, a personal computer (PC), a smart home device, a tablet PC, a set-top box (STB), a personal digital assistant (PDA), a mobile telephone, a wearable computer device, a web appliance, a network router, a switch or bridge, or any machine capable of executing instructions (sequential or otherwise) that specify actions to be taken by that machine, such as a base station. Further, while only a single machine is illustrated, the term “machine” shall also be taken to include any collection of machines that individually or jointly execute a set (or multiple sets) of instructions to perform any one or more of the methodologies discussed herein, such as cloud computing, software as a service (SaaS), or other computer cluster configurations.
[0112] Examples, as described herein, may include or may operate on logic or a number of components, modules, or mechanisms. Modules are tangible entities (e.g., hardware) capable of performing specified operations when operating. A module includes hardware. In an example, the hardware may be specifically configured to carry out a specific operation (e.g., hardwired). In another example, the hardware may include configurable execution units (e.g., transistors, circuits, etc.) and a computer readable medium containing instructions where the instructions configure the execution units to carry out a specific operation when in operation. The configuring may occur under the direction of the executions units or a loading mechanism. Accordingly, the execution units are communicatively coupled to the computer-readable medium when the device is operating. In this example, the execution units may be a member of more than one module. For example, under operation, the execution units may be configured by a first set of instructions to implement a first module at one point in time and reconfigured by a second set of instructions to implement a second module at a second point in time.
[0113] The machine 500 (e.g., computer system) may include a hardware processor 502 (e.g., a central processing unit (CPU), a graphics processing unit (GPU), a hardware processor core, or any combination thereof), a tensor processing unit (TPU), a main memory 504 and a static memory 506, some or all of which may communicate with each other via an interlink (e.g., bus 508). The machine 500 may further include a power device 534, a graphics display device 510, an input device 512 (e.g., a keyboard), and a user interface UI navigation device 514 (e.g., a mouse). In an example, the graphics display device 510, input device 512, and UI navigation device 514 may be a touch screen display. The machine 500 may additionally include a storage device 516, a signal generation device 518, one or more LLM and DTOT devices 519 (e.g., representing any of the LLM 104 with DToT 106), a network interface 522 coupled to antenna(s) 532, and one or more sensors 528. The machine 500 may include an output controller 536, such as a serial (e.g., universal serial bus (USB), parallel, or other wired or wireless (e.g., infrared (IR), near field communication (NFC), etc.) connection to communicate with or control one or more peripheral devices (e.g., a printer, a card reader, etc.)).
[0114] The storage device 516 may include a machine-readable medium 524 on which is stored one or more sets of data structures or instructions 526 (e.g., software) embodying or utilized by any one or more of the techniques or functions described herein. The instructions 526 may also reside, completely or at least partially, within the main memory 504, within the static memory 506, or within the hardware processor 502 during execution thereof by the machine 500. In an example, one or any combination of the hardware processor 502, the main memory 504, the static memory 506, or the storage device 516 may constitute machine-readable media.
[0115] While the machine-readable medium 524 is illustrated as a single medium, the term “machine-readable medium” may include a single medium or multiple media (e.g., a centralized or distributed database, and / or associated caches and servers) configured to store the one or more instructions 526.
[0116] Various embodiments may be implemented fully or partially in software and / or firmware. This software and / or firmware may take the form of instructions contained in or on a non-transitory computer-readable storage medium. Those instructions may then be read and executed by one or more processors to enable performance of the operations described herein. The instructions may be in any suitable form, such as but not limited to source code, compiled code, interpreted code, executable code, static code, dynamic code, and the like. Such a computer-readable medium may include any tangible non-transitory medium for storing information in a form readable by one or more computers, such as but not limited to read only memory (ROM); random access memory (RAM); magnetic disk storage media; optical storage media; a flash memory, etc.
[0117] The term “machine-readable medium” may include any medium that is capable of storing, encoding, or carrying instructions for execution by the machine 500 and that cause the machine 500 to perform any one or more of the techniques of the present disclosure, or that is capable of storing, encoding, or carrying data structures used by or associated with such instructions. Non-limiting machine-readable medium examples may include solid-state memories and optical and magnetic media. In an example, a massed machine-readable medium includes a machine-readable medium with a plurality of particles having resting mass. Specific examples of massed machine-readable media may include non-volatile memory, such as semiconductor memory devices (e.g., electrically programmable read-only memory (EPROM), or electrically erasable programmable read-only memory (EEPROM)) and flash memory devices; magnetic disks, such as internal hard disks and removable disks; magneto-optical disks; and CD-ROM and DVD-ROM disks.
[0118] The instructions 526 may further be transmitted or received over a communications network 530 using a transmission medium via the network interface 522 utilizing any one of a number of transfer protocols (e.g., frame relay, internet protocol (IP), transmission control protocol (TCP), user datagram protocol (UDP), hypertext transfer protocol (HTTP), etc.). Example communications networks may include a local area network (LAN), a wide area network (WAN), a packet data network (e.g., the Internet), mobile telephone networks (e.g., cellular networks), plain old telephone (POTS) networks, wireless data networks (e.g., Institute of Electrical and Electronics Engineers (IEEE) 602.11 family of standards known as Wi-Fi®, IEEE 602.16 family of standards known as WiMax®), IEEE 602.15.4 family of standards, and peer-to-peer (P2P) networks, among others. In an example, the network interface 522 may include one or more physical jacks (e.g., Ethernet, coaxial, or phone jacks) or one or more antennas to connect to the communications network 530. The term “transmission medium” shall be taken to include any intangible medium that is capable of storing, encoding, or carrying instructions for execution by the machine 500 and includes digital or analog communications signals or other intangible media to facilitate communication of such software.
[0119] The operations and processes described and shown above may be carried out or performed in any suitable order as desired in various implementations. Additionally, in certain implementations, at least a portion of the operations may be carried out in parallel. Furthermore, in certain implementations, less than or more than the operations described may be performed.
[0120] The word “exemplary” is used herein to mean “serving as an example, instance, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments. The terms “computing device,”“user device,”“communication station,”“station,”“handheld device,”“mobile device,”“wireless device” and “user equipment” (UE) as used herein refers to a wireless communication device such as a cellular telephone, a smartphone, a tablet, a netbook, a wireless terminal, a laptop computer, a femtocell, a high data rate (HDR) subscriber station, an access point, a printer, a point of sale device, an access terminal, or other personal communication system (PCS) device. The device may be either mobile or stationary.
[0121] As used within this document, the term “communicate” is intended to include transmitting, or receiving, or both transmitting and receiving. This may be particularly useful in claims when describing the organization of data that is being transmitted by one device and received by another, but only the functionality of one of those devices is required to infringe the claim. Similarly, the bidirectional exchange of data between two devices (both devices transmit and receive during the exchange) may be described as “communicating,” when only the functionality of one of those devices is being claimed. The term “communicating” as used herein with respect to a wireless communication signal includes transmitting the wireless communication signal and / or receiving the wireless communication signal. For example, a wireless communication unit, which is capable of communicating a wireless communication signal, may include a wireless transmitter to transmit the wireless communication signal to at least one other wireless communication unit, and / or a wireless communication receiver to receive the wireless communication signal from at least one other wireless communication unit.
[0122] As used herein, unless otherwise specified, the use of the ordinal adjectives“first,”“second,”“third,” etc., to describe a common object, merely indicates that different instances of like objects are being referred to and are not intended to imply that the objects so described must be in a given sequence, either temporally, spatially, in ranking, or in any other manner.
[0123] Some embodiments may be used in conjunction with various devices and systems, for example, a personal computer (PC), a desktop computer, a mobile computer, a laptop computer, a notebook computer, a tablet computer, a server computer, a handheld computer, a handheld device, a personal digital assistant (PDA) device, a handheld PDA device, an on-board device, an off-board device, a hybrid device, a vehicular device, a non-vehicular device, a mobile or portable device, a consumer device, a non-mobile or non-portable device, a wireless communication station, a wireless communication device, a wireless access point (AP), a wired or wireless router, a wired or wireless modem, a video device, an audio device, an audio-video (A / V) device, a wired or wireless network, a wireless area network, a wireless video area network (WVAN), a local area network (LAN), a wireless LAN (WLAN), a personal area network (PAN), a wireless PAN (WPAN), and the like.
[0124] Some embodiments may be used in conjunction with one or more types of wireless communication signals and / or systems following one or more wireless communication protocols, for example, radio frequency (RF), infrared (IR), frequency-division multiplexing (FDM), orthogonal FDM (OFDM), time-division multiplexing (TDM), time-division multiple access (TDMA), extended TDMA (E-TDMA), general packet radio service (GPRS), extended GPRS, code-division multiple access (CDMA), wideband CDMA (WCDMA), CDMA 2000, single-carrier CDMA, multi-carrier CDMA, multi-carrier modulation (MDM), discrete multi-tone (DMT), Bluetooth®, global positioning system (GPS), Wi-Fi, Wi-Max, ZigBee, ultra-wideband (UWB), global system for mobile communications (GSM), 2G, 2.5G, 3G, 3.5G, 4G, fifth generation (5G) mobile networks, 3GPP, long term evolution (LTE), LTE advanced, enhanced data rates for GSM Evolution (EDGE), or the like. Other embodiments may be used in various other devices, systems, and / or networks.
[0125] It is understood that the above descriptions are for purposes of illustration and are not meant to be limiting.
[0126] Although specific embodiments of the disclosure have been described, one of ordinary skill in the art will recognize that numerous other modifications and alternative embodiments are within the scope of the disclosure. For example, any of the functionality and / or processing capabilities described with respect to a particular device or component may be performed by any other device or component. Further, while various illustrative implementations and architectures have been described in accordance with embodiments of the disclosure, one of ordinary skill in the art will appreciate that numerous other modifications to the illustrative implementations and architectures described herein are also within the scope of this disclosure.
[0127] Program module(s), applications, or the like disclosed herein may include one or more software components including, for example, software objects, methods, data structures, or the like. Each such software component may include computer-executable instructions that, responsive to execution, cause at least a portion of the functionality described herein (e.g., one or more operations of the illustrative methods described herein) to be performed.
[0128] A software component may be coded in any of a variety of programming languages. An illustrative programming language may be a lower-level programming language such as an assembly language associated with a particular hardware architecture and / or operating system platform. A software component comprising assembly language instructions may require conversion into executable machine code by an assembler prior to execution by the hardware architecture and / or platform.
[0129] Another example programming language may be a higher-level programming language that may be portable across multiple architectures. A software component comprising higher-level programming language instructions may require conversion to an intermediate representation by an interpreter or a compiler prior to execution.
[0130] Other examples of programming languages include, but are not limited to, a macro language, a shell or command language, a job control language, a script language, a database query or search language, or a report writing language. In one or more example embodiments, a software component comprising instructions in one of the foregoing examples of programming languages may be executed directly by an operating system or other software component without having to be first transformed into another form.
[0131] A software component may be stored as a file or other data storage construct. Software components of a similar type or functionally related may be stored together such as, for example, in a particular directory, folder, or library. Software components may be static (e.g., pre-established or fixed) or dynamic (e.g., created or modified at the time of execution).
[0132] Software components may invoke or be invoked by other software components through any of a wide variety of mechanisms. Invoked or invoking software components may comprise other custom-developed application software, operating system functionality (e.g., device drivers, data storage (e.g., file management) routines, other common routines and services, etc.), or third-party software components (e.g., middleware, encryption, or other security software, database management software, file transfer or other network communication software, mathematical or statistical software, image processing software, and format translation software).
[0133] Software components associated with a particular solution or system may reside and be executed on a single platform or may be distributed across multiple platforms. The multiple platforms may be associated with more than one hardware vendor, underlying chip technology, or operating system. Furthermore, software components associated with a particular solution or system may be initially written in one or more programming languages, but may invoke software components written in another programming language.
[0134] Computer-executable program instructions may be loaded onto a special-purpose computer or other particular machine, a processor, or other programmable data processing apparatus to produce a particular machine, such that execution of the instructions on the computer, processor, or other programmable data processing apparatus causes one or more functions or operations specified in any applicable flow diagrams to be performed. These computer program instructions may also be stored in a computer-readable storage medium (CRSM) that upon execution may direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means that implement one or more functions or operations specified in any flow diagrams. The computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational elements or steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process.
[0135] Additional types of CRSM that may be present in any of the devices described herein may include, but are not limited to, programmable random access memory (PRAM), SRAM, DRAM, RAM, ROM, electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the information and which can be accessed. Combinations of any of the above are also included within the scope of CRSM. Alternatively, computer-readable communication media (CRCM) may include computer-readable instructions, program module(s), or other data transmitted within a data signal, such as a carrier wave, or other transmission. However, as used herein, CRSM does not include CRCM.
[0136] Although embodiments have been described in language specific to structural features and / or methodological acts, it is to be understood that the disclosure is not necessarily limited to the specific features or acts described. Rather, the specific features and acts are disclosed as illustrative forms of implementing the embodiments. Conditional language, such as, among others, “can,”“could,”“might,” or “may,” unless specifically stated otherwise, or otherwise understood within the context as used, is generally intended to convey that certain embodiments could include, while other embodiments do not include, certain features, elements, and / or steps. Thus, such conditional language is not generally intended to imply that features, elements, and / or steps are in any way required for one or more embodiments or that one or more embodiments necessarily include logic for deciding, with or without user input or prompting, whether these features, elements, and / or steps are included or are to be performed in any particular embodiment.
Claims
1. A method for prompting large language models using a decision-tree-of-thought, the method comprising:receiving, by at least one processor, a question received from a user;inputting, by the at least one processor, the question and a first context from a context tree to a prompt generator, wherein the context tree comprises a mapping from parent-nodes to child-nodes of the parent-nodes, and wherein the child-nodes comprise more fine-grained context than their respective parent-node;generating, by the at least one processor, using the prompt generator, a first prompt to be input to a large language machine learning model to cause the large language machine learning model to generate a first response to the question and the first context, provide a first confidence score for the first response, and provide a first rationale for the first response;inputting, by the at least one processor, the first prompt to the large language machine learning model;generating, by the at least one processor, using the large language machine learning model and based on the first prompt, the first response to the question, the first rationale, and the first confidence score;determining, by the at least one processor, using a confidence checker, that the first confidence score is less than a confidence threshold;inputting, by the at least one processor, based on the determination that the first confidence score is less than the confidence threshold, the first rationale to a context selector;selecting, by the at least one processor, using the context selector, a second context from the context tree, wherein the second context is a subcategory of the first context;generating, by the at least one processor, using the prompt generator, a second prompt to be input to the large language machine learning model to cause the large language machine learning model to generate a second response to the question based on the second context, provide a second confidence score for the second response, and provide a second rationale for the second response;inputting, by the at least one processor, the second prompt to the large language machine learning model;generating, by the at least one processor, using the large language machine learning model and based on the second prompt, the second response, the second rationale, and the second confidence score;determining, by the at least one processor, using the confidence checking device, that the second confidence score is greater than the confidence threshold; andproviding, by the at least one processor, based on the determination that the second confidence score is greater than the confidence threshold, information indicative of at least one of the second response, the second rationale, or the second confidence score.
2. The method of claim 1, wherein the first prompt and the second prompt are zero-shot learning prompts.
3. The method of claim 1, wherein the first prompt and the second prompt comprise examples of questions and answers associated with training the large language machine learning model.
4. The method of claim 1, wherein the first context and the second context are indicative of whether a sentence associated with the question includes toxic content, and wherein the first response and the second response are yes or no answers.
5. A method for prompting large language models using a decision-tree-of-thought, the method comprising:inputting, by at least one processor, an input and a first context from a context tree to a prompt generator, wherein the context tree comprises a mapping from parent-nodes to child-nodes of the parent-nodes, and wherein the child-nodes comprise more fine-grained context than their respective parent-node;generating, by the at least one processor, using the prompt generator, a first prompt based on the context tree and the input;inputting, by the at least one processor, the first prompt to a language machine learning model;generating, by the at least one processor, using the language machine learning model and based on the first prompt, a first output to the input, a first rationale for the first output, and a first confidence score in the first output;determining, by the at least one processor, using a confidence checker that is configured to provide an output when a confidence score is greater than a confidence threshold and provide a rationale to a context selector for the selection of a child-node context when a confidence score is less than the confidence threshold, that the first confidence score is greater than the confidence threshold;providing, by the at least one processor, based on the determination that the first confidence score is greater than the confidence threshold, information indicative of at least one of the first output, the first rationale, or the first confidence score;wherein the first context is from a first node of the context tree, the method further comprising:inputting the input and a second context from a second node of the context tree to the prompt generator;generating, using the prompt generator, a second prompt based on the input and the second context;inputting the second prompt to the language machine learning model;generating, using the language machine learning model and based on the second prompt, a second output to the input, a second rationale for the second output, and a second confidence score in the second output;determining, using the confidence checker, that the second confidence score is less than the confidence threshold;inputting, based on the determination that the second confidence score is less than the confidence threshold, the second rationale to the context selector;selecting, using the context selector, the first context as a child node context of the second context based on a first relevance between the second rationale and the first context, wherein the second node is a parent-node, wherein the first node is a child-node of the second node, and wherein selecting the first context comprises mapping from the second node to the first node;generating, using the prompt generator, a third prompt based on the input and the first context; andproviding, based on the third prompt, information indicative of a third output of the language machine learning model and at least one of a third rationale or a third confidence score for the third output.
6. The method of claim 5, wherein the first context is indicative of whether the input includes toxic content, and wherein the first output is a yes or no answer.
7. The method of claim 5, wherein the first prompt is a zero-shot learning prompt.
8. The method of claim 5, wherein the first prompt comprises examples of inputs and outputs associated with training the language machine learning model.
9. The method of claim 5, wherein output logits of the language machine learning model are available to the at least one processor, the method further comprising:determining, based on the output logits, probabilities of the language machine learning model generating respective outputs conditional on a respective prompt,wherein the first confidence score is a first probability of the language machine learning model generating the first output based on the first prompt.
10. The method of claim 5, wherein output logits of the language machine learning model are unavailable to the at least one processor, the method further comprising:determining that the first confidence score is between the confidence threshold and a maximal confidence threshold,wherein presenting the first output is further based on determining that the first confidence score is between the confidence threshold and the maximal confidence threshold.
11. The method of claim 5, wherein the confidence threshold is adjustable.
12. The method of claim 5, wherein selecting the first context as the child node context of the second context comprises:determining the first relevance between the second rationale and the first context;determining a second relevance between the second rationale and a third context corresponding to another child-node of the second node;determining that the first relevance is greater than the second relevance; andselecting the first context as the child node context of the second context based on the first relevance being greater than the second relevance.
13. The method of claim 5, wherein output logits of the language machine learning model are unavailable to the at least one processor, wherein selecting the first context as the child node context of the second context comprises:inputting an additional prompt to the language machine learning model, the additional prompt requesting the language machine learning model to specify which child-node context of the second context is most relevant to the second rationale,wherein selecting the first context as the child node context of the second context is based on the most relevant child-node context identified by the language machine learning model.
14. The method of claim 5, wherein output logits of the language machine learning model are available to the at least one processor, wherein selecting the first context as the child node context of the second context comprises:generating a set of candidate rationales, wherein respective candidate rationales of the set are relevant to only one of a plurality of candidate child-node contexts of the second context; anddetermining, using the logits, respective probabilities of the language machine learning model generating a respective candidate rationale of the set conditional on the second prompt,wherein selecting the first context as the child node context of the second context is based on a first probability of the language machine learning model generating the second rationale based on the second prompt.
15. A system for prompting large language models using a decision-tree-of-thought, the system comprising:a context selector;a context tree comprising a mapping from parent-nodes to child-nodes of the parent-nodes, and wherein the child-nodes comprise more fine-grained context than their respective parent-node, wherein the context selector is further configured to, based on a determination that a confidence score is less than a confidence score threshold, select a child-node context based on a relevance between a rationale generated by the language machine learning model and the child-node context;a prompt generator configured to generate prompts for a language machine learning model;a confidence checker configured to determine whether confidence scores of outputs of the language machine learning model satisfy the confidence score threshold; andmemory coupled to at least one processor, the at least one processor configured to:input an input and a first context from a first node of the context tree to the prompt generator;generate, using the prompt generator, a first prompt based on the input and the first context;input the first prompt to the language machine learning model;generate, using the language machine learning model and based on the first prompt, a first output to the input, a first rationale for the first output, and a first confidence score in the first output;determine, using the confidence checker, that the first confidence score is greater than the confidence score threshold;provide, based on the determination that the first confidence score is greater than the confidence score threshold, information indicative of at least one of the first output, the first rationale, or the first confidence score;input the input and a second context from a second node of the context tree to the prompt generator;generate, using the prompt generator, a second prompt based on the input and the second context;input the second prompt to the language machine learning model;generate, using the language machine learning model and based on the second prompt, a second output to the input, a second rationale for the second output, and a second confidence score in the second output;determine, using the confidence checker, that the second confidence score is less than the confidence score threshold;input, based on the determination that the second confidence score is less than the confidence score threshold, the second rationale to a context selector;select, using the context selector, the first context as a child-node context of the second context based on a relevance between the second rationale and the first context, wherein the second node is a parent-node, wherein the first node is a child-node of the parent-node, and wherein to select the first context comprises to map from the second node to the first node;generate, using the prompt generator, a third prompt based on the input and the first context; andprovide, based on the third prompt, information indicative of a third output of the language machine learning model and at least one of a third rationale or a third confidence score for the third output.
16. The system of claim 15, wherein the first context is indicative of whether the input includes toxic content, and wherein the first output is a yes or no answer.
Citation Information
Patent Citations
Interactive bot for natural language analytics
US10678402B1
Method and system for multi-level artificial intelligence supercomputer design
US12001462B1
Post-calibration of large language model confidence scoring via combined techniques
US12032919B1
Method and system for electronic processing of user queries maintaining factual consistency during processing
US12204524B1
System and method for pruning a set of symbol-based sequences by relaxing an independence assumption of the sequences
US20180075084A1
