Interaction system, question-answering processing method, and computer-readable storage medium
By working collaboratively between the terminal device and the server, a response outline is generated using guiding phrases and a state library, and the terminal device generates a detailed response. This solves the problem of improving the accuracy of responses from large language models without compromising user privacy, and achieves efficient and accurate question-and-answer processing.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-06-26
- Publication Date
- 2026-04-02
AI Technical Summary
How can we improve the accuracy of large language model responses without compromising user privacy, especially when terminal devices and servers are working together?
By working collaboratively between terminal devices and servers, the terminal device simply sends a question, while the server generates a response outline based on the prompt phrase and state library. The terminal device then generates a detailed response based on the content and the response outline, ensuring that user privacy is not compromised and improving response accuracy through multi-device collaboration.
This approach improves the accuracy and efficiency of responses and enhances the user experience without compromising user privacy.
Smart Images

Figure CN2025104107_02042026_PF_FP_ABST
Abstract
Description
Interactive system, question and answer processing method and computer readable storage medium
[0001] The present application claims priority to the Chinese patent application No. 202411396990.5, filed on September 30, 2024, and entitled "Interactive system, question and answer processing method and computer readable storage medium", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD
[0002] The present application belongs to the technical field of terminals, and particularly relates to an interactive system, a question and answer processing method, a first device, a second device and a computer readable storage medium. BACKGROUND
[0003] A large language model (LLM) refers to a natural language processing model with a parameter quantity of more than one billion, and is the core of an application program such as an intelligent question and answer or an intelligent assistant. A user or a system can input a question in the form of a query, and the large language model can output a corresponding reply according to the question. In order to improve the accuracy of the reply of the large language model, when the question is input, the user or the system can add a chain of thoughts (CoT) guide such as "step by step" after the question to guide the large language model to expand details, so that the large language model can output a reply containing more detailed content.
[0004] Although the CoT guide can improve the accuracy of the reply of the large language model, the CoT guide needs to obtain relevant content on a terminal device, and the relevant content on the terminal device generally includes content related to user privacy. At present, the large language model is generally run on a server provided by a provider of an application program, and uploading the content related to user privacy to the server for processing of the large language model can cause leakage of the user privacy content. Therefore, how to improve the accuracy of the reply of the large language model without leaking the user privacy content has become a problem to be solved by those skilled in the art. SUMMARY
[0005] Embodiments of the present application provide an interactive system, a question and answer processing method and a computer readable storage medium, which can improve the accuracy of the reply without leaking the user privacy content.
[0006] In a first aspect, embodiments of the present application provide an interactive system, which includes a first device and a second device.
[0007] The first device is configured to obtain a first question and send the first question to the second device.
[0008] The second device is configured to receive the first question, process the first question by using a first large language model to obtain a first reply outline corresponding to the first question, and send the first reply outline to the first device.
[0009] The first device is further configured to obtain first content, and process the first question by using a second large language model based on the first content and the first reply outline to obtain a first target reply corresponding to the first question.
[0010] In the above-provided interactive system, the question and answer processing can be performed in a multi-device cooperative manner. When the question and answer processing is performed in a multi-device cooperative manner, the first device can send only the first question to be processed to the second device, without sending the first content generated on the first device to the second device, i.e., without sending the content related to the user privacy to the second device, so that the user privacy content can be avoided from being leaked. The first large language model in the second device can accurately infer the reply outline corresponding to the first question according to the first question only, so that the time length of processing by the second device each time can be reduced, and the throughput of the second device can be improved. The first device can obtain the first content generated on the first device, and can process the first question by using the second large language model based on the first content and the first reply outline to obtain the first target reply corresponding to the first question, so that the first target reply can be accurately determined based on the first reply outline, and the accuracy of the first target reply can be improved, and the user experience can be improved. That is, the question processing in a multi-device cooperative manner can improve the accuracy of the reply without leaking the user privacy content.
[0011] In a possible implementation, the second device stores a guide phrase library and a state library, the guide phrase library includes a first guide phrase, and the state library includes a first state.
[0012] The second device is further configured to determine a second guide phrase from the guide phrase library according to the first question, and determine a second state from the state library according to the first question, the second guide phrase includes one or more of the first guide phrase, and the second state includes one or more of the first state.
[0013] The second device is further configured to obtain a first input text according to the second guide phrase, the second state, the first question, and a first thinking chain guide prompt, input the first input text into the first large language model to obtain the first reply outline output by the first large language model, and the first thinking chain guide prompt is used to guide the first large language model to perform the inference of the reply outline on the first question.
[0014] The first reply outline includes a third guiding phrase, or the first reply outline includes the third guiding phrase and a third state, the third guiding phrase includes one or more of the second guiding phrase, and the third state includes one or more of the second state.
[0015] In the system provided by the implementation, the first reply outline can include guiding phrases corresponding to each reply step, or guiding phrases and states. The first thought chain guiding prompt can be used to guide the first large language model in the second device to perform reasoning on the guiding phrases and the states, so that the first large language model only needs to perform reasoning on the guiding phrases or the guiding phrases and the states, which can reduce the number of characters for each reasoning of the first large language model, can reduce the time length of each reasoning of the first large language model, can not only improve the reasoning speed of the first large language model, but also improve the throughput of the first large language model.
[0016] In addition, the second device can determine, from a preset guiding phrase library, guiding phrases (i.e., second guiding phrases) that can be used by reply steps corresponding to the first question according to the first question, and can determine, from a preset state library, states (i.e., second states) that can be used by reply steps corresponding to the first question according to the first question, so that the first large language model in the second device can only process the first question on the basis of the second guiding phrases and the second states, can quickly obtain the first reply outline corresponding to the first question, and can improve the reasoning speed and efficiency of the first reply outline.
[0017] In another possible implementation, the second device stores a guiding phrase library and a state library, the guiding phrase library includes first guiding phrases and first identifiers corresponding to the first guiding phrases, and the state library includes first states and second identifiers corresponding to the first states;
[0018] The second device is further configured to determine, from the guiding phrase library, second guiding phrases corresponding to the first question and first identifiers corresponding to the second guiding phrases, determine, from the state library, second states corresponding to the first question and second identifiers corresponding to the second states;
[0019] The second device is further configured to obtain a second input text according to the second guiding phrases and the first identifiers corresponding to the second guiding phrases, the second states and the second identifiers corresponding to the second states, the first question, and a second thought chain guiding prompt, input the second input text into the first large language model for processing, and obtain the first reply outline output by the first large language model, the second thought chain guiding prompt is used to guide the first large language model to perform reasoning on reply identifiers of the first question.
[0020] The first reply outline includes a first identifier corresponding to the third guiding phrase, or the first reply outline includes a first identifier corresponding to the third guiding phrase and a second identifier corresponding to the third state, the third guiding phrase includes one or more of the second guiding phrase, and the third state includes one or more of the second state.
[0021] In the system provided by the implementation, the first reply outline can include identifiers (i.e., first identifiers, or can be referred to as step identifiers) of guiding phrases corresponding to each reply step, or identifiers of guiding phrases and identifiers of states (i.e., second identifiers, or can be referred to as state identifiers). The second thought chain guiding prompt can be used to guide the first large language model to perform reasoning on the identifiers of the guiding phrases and the identifiers of the states, so that the first large language model only needs to perform reasoning on the identifiers of the guiding phrases or the identifiers of the guiding phrases and the identifiers of the states. This can reduce the number of characters in each reasoning of the first large language model and reduce the time length of each reasoning of the first large language model. Not only can it improve the reasoning speed of the first large language model, but also can improve the throughput of the first large language model.
[0022] In addition, the second device can determine guiding phrases (i.e., second guiding phrases) and identifiers (i.e., first identifiers) that may be used by reply steps corresponding to the first question from a preset guiding phrase library according to the first question, and can determine states (i.e., second states) and identifiers (i.e., second identifiers) that may be used by reply steps corresponding to the first question from a preset state library according to the first question. The first large language model in the second device can process the first question based on the second guiding phrase and the identifier corresponding to the second guiding phrase, and the identifier of the second state corresponding to the second state, so as to quickly obtain the first reply outline corresponding to the first question, and improve the reasoning speed and efficiency of the first reply outline.
[0023] In a possible implementation, the first device is further configured to obtain the second guiding phrase and the second state, obtain a third input text based on the second guiding phrase, the second state, the first content, the first question, and a third thought chain guiding prompt, and process the third input text by the second large language model based on the first reply outline to obtain a first target reply corresponding to the first question, the third thought chain guiding prompt being used to guide the second large language model to perform reasoning on detailed replies to the first question.
[0024] In the system provided by the implementation, the first device can obtain the guiding phrase (i.e., the second guiding phrase) and the state (i.e., the second state) used by the second device to determine the first reply outline, and can process the first question according to the second guiding phrase, the second state, and the first reply outline by the second large language model in the first device to obtain a detailed first target reply corresponding to the first question, so as to improve the reasoning speed and accuracy of the first target reply based on the same guiding phrase and the same state used by the first reply outline.
[0025] In another possible implementation, the first device is further configured to obtain fourth input text according to the first content, the first question, and a third thinking chain guiding prompt, and obtain the first target reply corresponding to the first question by processing the fourth input text based on the first reply outline by the second large language model, where the third thinking chain guiding prompt is used to guide the second large language model to perform reasoning for detailed reply to the first question.
[0026] In the system provided by the implementation, the second large language model in the first device can also perform reasoning for the first target reply without using the guiding phrase and the state.
[0027] In another possible implementation, the first device stores a guiding phrase library and a state library, the guiding phrase library includes the first guiding phrase, and the state library includes the first state.
[0028] The first device is further configured to determine a fourth guiding phrase from the guiding phrase library according to the first question and / or the first content, and determine a fourth state from the state library according to the first question and / or the first content, the fourth guiding phrase includes one or more of the first guiding phrase, and the fourth state includes one or more of the first state.
[0029] The first device is further configured to obtain fifth input text according to the fourth guiding phrase, the fourth state, the first content, the first question, and a third thinking chain guiding prompt, and obtain the first target reply corresponding to the first question by processing the fifth input text based on the first reply outline by the second large language model, where the third thinking chain guiding prompt is used to guide the second large language model to perform reasoning for detailed reply to the first question.
[0030] In the system provided by the implementation, the first device can store a preset guide phrase library and a state library, wherein the guide phrase library in the first device is the same as the guide phrase library in the second device, and the state library in the first device is the same as the state library in the second device. The first device can determine a guide phrase (i.e., a fourth guide phrase) possibly used in the reply step corresponding to the first question from the preset guide phrase library according to the first question and / or the first content, and determine a state (i.e., a fourth state) possibly used in the reply step corresponding to the first question from the preset state library according to the first question and / or the first content, so that the second large language model in the first device can process the first question based on the fourth guide phrase, the fourth state, and the first reply outline, and quickly obtain the first target reply corresponding to the first question, thereby improving the reasoning speed and efficiency of the first target reply.
[0031] In a possible implementation, the first reply outline includes one or more third guide phrases or a first identifier corresponding to each of the third guide phrases.
[0032] The first device is further configured to obtain a fifth guide phrase corresponding to a first reply step of the first target reply generated by the second large language model when processing the first question by using the second large language model, wherein the first reply step is one of the first target replies.
[0033] The first device is further configured to, for the first reply step, determine a sixth guide phrase corresponding to the first reply step according to the first reply outline, wherein the sixth guide phrase is one of the third guide phrases.
[0034] The first device is further configured to, when determining that the fifth guide phrase corresponding to the first reply step and the sixth guide phrase do not satisfy a first preset condition, adjust the fifth guide phrase corresponding to the first reply step according to the sixth guide phrase, and adjust the first reply step according to the adjusted fifth guide phrase by using the second large language model.
[0035] It should be understood that the first preset condition can be that the fifth guide phrase is consistent with the sixth guide phrase. The consistency of the fifth guide phrase and the sixth guide phrase can mean that the fifth guide phrase is the same as the sixth guide phrase, or can mean that the keywords contained in the fifth guide phrase are the same as the keywords contained in the sixth guide phrase.
[0036] In the system provided by the implementation, in the inference process of the first target reply by the second large language model in the first device, the first device can obtain the content of each reply step inferred by the second large language model in real time, for example, obtain the guiding phrase corresponding to each reply step. For each reply step, the first device can determine whether the guiding phrase corresponding to the reply step inferred by the second large language model is accurate according to the guiding phrase corresponding to the first reply outline, that is, determine whether the guiding phrase corresponding to the reply step inferred by the second large language model is consistent with the guiding phrase corresponding to the first reply outline. When it is determined that the guiding phrase corresponding to the reply step inferred by the second large language model is inaccurate, that is, when it is determined that the guiding phrase corresponding to the reply step inferred by the second large language model is inconsistent with the guiding phrase corresponding to the first reply outline, the first device can adjust the guiding phrase corresponding to the reply step inferred by the second large language model according to the guiding phrase corresponding to the first reply outline to ensure the accuracy of the guiding phrase inferred by the second large language model, so that the second large language model can continue to infer according to the adjusted and accurate guiding phrase, thereby improving the accuracy of each reply step and improving the accuracy of the first target reply.
[0037] In another possible implementation, the first device is further configured to output the adjusted fifth guiding phrase after the second large language model adjusts the fifth guiding phrase corresponding to the first reply step according to the sixth guiding phrase.
[0038] In the system provided by the implementation, when the question and answer processing is performed based on the interaction of the user, for each reply step inferred by the second large language model, when it is necessary to adjust the reply step inferred by the second large language model based on the first reply outline, the first device can output the guiding phrase corresponding to the reply step after determining that the adjustment of the guiding phrase corresponding to the reply step is completed, that is, after determining that the guiding phrase is accurate, so as to improve the interactive experience. When the guiding phrase corresponding to the reply step is output, the output of each character in the guiding phrase can be performed at a certain interval, which can achieve the effect of smoothing the response interval and improve the user experience.
[0039] In another possible implementation, the first reply outline includes one or more third states or second identifiers corresponding to the third states.
[0040] The first device is further configured to obtain a fifth state corresponding to a first reply step inferred by the second large language model when the second large language model processes the first question, wherein the first reply step is one of the first target reply.
[0041] The first device is further configured to determine, for the first reply step, a sixth state corresponding to the first reply step according to the first reply outline, the sixth state being one of the third states;
[0042] The first device is further configured to adjust the current state of the first device according to the sixth state when it is determined that the fifth state corresponding to the first reply step and the sixth state do not satisfy a second preset condition; and adjust the first reply step according to the sixth state through the second large language model when it is determined that the current state of the first device is adjusted to the sixth state.
[0043] It should be understood that the second preset condition can be that the fifth state is consistent with the sixth state. The consistency of the fifth state and the sixth state can mean that the fifth state is the same as the sixth state, or that the keywords contained in the fifth state are the same as the keywords contained in the sixth state.
[0044] In the system provided in this implementation, in the inference process of the first target reply by the second large language model in the first device, the first device can obtain the content of each reply step inferred by the second large language model in real time. For the reply step with a state, the first device can determine whether the state corresponding to the reply step inferred by the second large language model is accurate according to the state corresponding to the first reply outline, i.e., whether the state corresponding to the reply step inferred by the second large language model is consistent with the state corresponding to the first reply outline. When it is determined that the state corresponding to the reply step inferred by the second large language model is not accurate, i.e., the state corresponding to the reply step inferred by the second large language model is not consistent with the state corresponding to the first reply outline, the first device can adjust the state corresponding to the reply step inferred by the second large language model according to the state corresponding to the first reply outline, improve the accuracy of the state inferred by the second large language model, and improve the accuracy of each reply step, thereby improving the accuracy of the first target reply.
[0045] That is, for each reply step, when the second large language model performs reasoning on the reply step, the first device can determine whether the guiding phrase reasoned by the second large language model is accurate based on the first reply outline. When it is determined that the guiding phrase reasoned by the second large language model is inaccurate, the first device can adjust the guiding phrase reasoned by the second large language model based on the guiding phrase corresponding to the first reply outline. For the reply step with the state, after the adjustment of the guiding phrase or when it is determined that the guiding phrase reasoned by the second large language model is accurate, the first device can continue to determine whether the state reasoned by the second large language model is accurate. When it is determined that the state reasoned by the second large language model is inaccurate, the first device can adjust the state reasoned by the second large language model based on the state corresponding to the first reply outline, so that the second large language model can reason accurate reply steps, to improve the accuracy of the first target reply output by the second large language model and improve user experience.
[0046] In a possible implementation, the first device is further configured to, after obtaining the first question, determine whether the first question contains sensitive content; and when it is determined that the first question contains sensitive content, perform desensitization processing on the sensitive content, and send the desensitized first question to the second device.
[0047] In the system provided in this implementation, after obtaining the first question, if it is determined that the first question involves sensitive content, the first device can perform desensitization processing on the first question, so that the first question sent by the first device to the second device is a question that does not involve sensitive content such as user privacy, to avoid leaking user privacy.
[0048] In a possible implementation, the first reply outline includes a first identifier corresponding to the third guiding phrase, or includes the first identifier corresponding to the third guiding phrase and a second identifier corresponding to the third state.
[0049] The second device is further configured to determine a first outline identifier corresponding to the first reply outline, associate and save the first question and the first outline identifier, and associate the first outline identifier with the first identifier corresponding to the third guiding phrase, or associate the first outline identifier with the first identifier corresponding to the third guiding phrase and the second identifier corresponding to the third state.
[0050] In an example, the first device is further configured to obtain a second question, and send the second question to the second device.
[0051] The second device is further configured to identify a first question associated with the second question according to the second question and the first outline, determine a second outline identifier corresponding to the second question, take the second outline identifier as a second reply outline corresponding to the second question, and send the second reply outline to the first device, wherein the second outline identifier is one of the first outline identifiers;
[0052] The first device is further configured to obtain second content, process the second question by a second large language model based on the second content and the second reply outline, and obtain a second target reply corresponding to the second question.
[0053] In the system provided in this implementation, after the second device infers the reply outline (e.g., the first reply outline) corresponding to a question (e.g., the first question), the second device can save the association between the first reply outline and the first question, or the second device can determine the outline identifier corresponding to the first reply outline and save the association between the outline identifier and the first question, so that when a device (e.g., the first device) and the second device cooperate to process the first question in the future, the second device can quickly determine the first reply outline corresponding to the first question, and the speed of determining the reply outline is improved.
[0054] It should be understood that when the first reply outline includes a guide phrase and a state, after the second device infers the first reply outline corresponding to the first question, the second device can save the association between the first reply outline and the first question, or the second device can determine the outline identifier corresponding to the first reply outline and save the association between the outline identifier corresponding to the first reply outline and the first question. When the first reply outline includes an identifier of a guide phrase and an identifier of a state, after the second device infers the first reply outline corresponding to the first question, the second device can save the association between the first reply outline and the first question, or the second device can determine the outline identifier corresponding to the first reply outline, save the association between the outline identifier corresponding to the first reply outline and the first question, and save the association between the outline identifier and the identifiers of the respective reply steps and states of the first reply outline.
[0055] In one example, the second device is further configured to, after determining the second outline identifier corresponding to the second question, determine whether the second outline identifier and a first identifier associated with the second outline identifier have been sent to the first device, or determine whether the second outline identifier, the first identifier associated with the second outline identifier, and a second identifier have been sent to the first device;
[0056] The second device is further configured to send the second outline identifier and the first identifier associated with the second outline identifier to the first device when it is determined that the second outline identifier and the first identifier associated with the second outline identifier have not been sent to the first device; or
[0057] The second device is further configured to send the second outline identifier and the first identifier and the second identifier associated with the second outline identifier to the first device when it is determined that the second outline identifier, the first identifier and the second identifier associated with the second outline identifier have not been sent to the first device.
[0058] In the system provided in this implementation, when the reply outline sent by the second device to the first device is an outline identifier, so that the first device can determine the identifiers and status identifiers of each reply step corresponding to the reply outline according to the outline identifier after obtaining the outline identifier, the second device also needs to determine whether the identifiers and status identifiers of each reply step associated with the outline identifier have been sent to the first device. When it is determined that the identifiers and status identifiers of each reply step associated with the outline identifier have not been sent to the first device, the second device can send the identifiers and status identifiers of each reply step associated with the outline identifier to the first device when sending the outline identifier to the first device, so that the first device can determine the identifiers and status identifiers of each reply step according to the outline identifier, and thus can determine the guide phrases and states corresponding to each reply step according to the identifiers and status identifiers of each reply step, to adjust each reply step of the second large language model reasoning in the first device according to the guide phrases and states corresponding to each reply step.
[0059] In some embodiments, the first device is further configured to determine a third guide phrase corresponding to the second reply outline according to the second outline identifier;
[0060] The first device is further configured to, when processing the second question by the second large language model, obtain a seventh guide phrase corresponding to a second reply step output by the second large language model, and adjust the seventh guide phrase corresponding to the second reply step according to the third guide phrase corresponding to the second reply outline; wherein the second reply step is one of the second target replies; or,
[0061] The first device is further configured to determine a third guide phrase and a third state corresponding to the second reply outline according to the second outline identifier;
[0062] The first device is further configured to, when processing the second question by using the second large language model, acquire a seventh guide phrase corresponding to a second reply step output by the second large language model, and adjust the guide phrase corresponding to the second reply step according to a third guide phrase corresponding to the second reply outline;
[0063] The first device is further configured to, when processing the second question by using the second large language model, acquire a seventh state corresponding to a second reply step output by the second large language model, and adjust the seventh state corresponding to the second reply step according to a third state corresponding to the second reply outline.
[0064] In a second aspect, an embodiment of the present application provides a question and answer processing method, applied to a first device, and the method comprises the following steps.
[0065] Acquiring a first question and sending the first question to a second device;
[0066] Acquiring a first reply outline sent by the second device, the first reply outline being obtained by the second device by processing the first question by using a first large language model;
[0067] Acquiring first content;
[0068] Processing the first question by using a second large language model based on the first content and the first reply outline, to obtain a first target reply corresponding to the first question.
[0069] In the question and answer processing method provided in the above, the first device can cooperate with the second device to process the question and answer. When the first device cooperates with the second device to process the question and answer, the first device can only send the first question to be processed to the second device, and does not need to send the first content generated on the first device to the second device, that is, the content related to the user privacy can not be sent to the second device, and the leakage of the user privacy content can be avoided. The first large language model in the second device can accurately infer the reply outline corresponding to the first question according to the first question only, the time length of each processing of the second device can be reduced, and the throughput of the second device can be improved. The first device can acquire the first content generated on the first device, and can process the first question by using the second large language model based on the first content and the first reply outline, to obtain the first target reply corresponding to the first question, so that the accuracy of the first target reply can be improved based on the first reply outline, and the user experience can be improved. That is, the question processing by using the cooperation of multiple devices can improve the accuracy of the reply without leaking the user privacy content.
[0070] In some embodiments, the processing, by the second large language model, the first question based on the first content and the first reply outline to obtain the first target reply corresponding to the first question comprises:
[0071] determining a second guiding phrase and a second state, the second guiding phrase being a guiding phrase determined by the second device from a guiding phrase library of the second device according to the first question, and the second state being a state determined by the second device from a state library of the second device according to the first question;
[0072] obtaining a third input text according to the second guiding phrase, the second state, the first content, the first question, and a third thinking chain guiding prompt, the third thinking chain guiding prompt being used to guide the second large language model to perform detailed reply reasoning on the first question;
[0073] processing, by the second large language model, the third input text based on the first reply outline to obtain the first target reply corresponding to the first question.
[0074] In other embodiments, the processing, by the second large language model, the first question based on the first content and the first reply outline to obtain the first target reply corresponding to the first question comprises:
[0075] obtaining a fourth input text according to the first content, the first question, and a third thinking chain guiding prompt, the third thinking chain guiding prompt being used to guide the second large language model to perform detailed reply reasoning on the first question;
[0076] processing, by the second large language model, the fourth input text based on the first reply outline to obtain the first target reply corresponding to the first question.
[0077] In some embodiments, the first device stores a guiding phrase library and a state library, the guiding phrase library includes a first guiding phrase, and the state library includes a first state;
[0078] the processing, by the second large language model, the first question based on the first content and the first reply outline to obtain the first target reply corresponding to the first question comprises:
[0079] determining a fourth guiding phrase from the guiding phrase library according to the first question and / or the first content, and determining a fourth state from the state library according to the first question and / or the first content, the fourth guiding phrase including one or more of the first guiding phrase, and the fourth state including one or more of the first state;
[0080] According to the fourth guide phrase, the fourth state, the first content, the first question, and a third thought chain guide prompt, a fifth input text is obtained, the third thought chain guide prompt being used to guide the second large language model to make a detailed reply to the first question;
[0081] Based on the first reply outline, the second large language model processes the fifth input text to obtain the first target reply corresponding to the first question.
[0082] In some other embodiments, the first reply outline includes one or more third guide phrases or a first identifier corresponding to each of the third guide phrases;
[0083] The processing of the first question by the second large language model based on the first content and the first reply outline to obtain the first target reply corresponding to the first question includes:
[0084] When processing the first question by the second large language model, a fifth guide phrase corresponding to a first reply step of the second large language model is obtained, the first reply step being one of the first target reply;
[0085] According to the first reply outline, a sixth guide phrase corresponding to the first reply step is determined, the sixth guide phrase being one of the third guide phrases;
[0086] When the fifth guide phrase corresponding to the first reply step and the sixth guide phrase do not satisfy a first preset condition, the second large language model adjusts the fifth guide phrase corresponding to the first reply step according to the sixth guide phrase, and adjusts the first reply step according to the adjusted fifth guide phrase.
[0087] In one example, the method further includes:
[0088] After the second large language model adjusts the fifth guide phrase corresponding to the first reply step according to the sixth guide phrase, the adjusted fifth guide phrase is output.
[0089] In some other embodiments, the first reply outline includes one or more third states or a second identifier corresponding to each of the third states;
[0090] The processing of the first question by the second large language model based on the first content and the first reply outline to obtain the first target reply corresponding to the first question includes:
[0091] In the processing of the first question by the second large language model, a fifth state corresponding to a first reply step of the first question is obtained; the first reply step is one of the first target replies;
[0092] According to the first reply outline, a sixth state corresponding to the first reply step is determined, and the sixth state is one of the third states;
[0093] When it is determined that the fifth state corresponding to the first reply step and the sixth state do not satisfy a second preset condition, the current state of the first device is adjusted according to the sixth state; when it is determined that the current state of the first device is adjusted to the sixth state, the first reply step is adjusted by the second large language model according to the sixth state.
[0094] In one example, the sending of the first question to the second device includes:
[0095] It is determined whether the first question contains sensitive content;
[0096] When it is determined that the first question includes sensitive content, the sensitive content is desensitized, and the desensitized first question is sent to the second device.
[0097] In some embodiments, the method further includes:
[0098] A second question is obtained, and the second question is sent to the second device;
[0099] A second reply outline returned by the second device is obtained, the second reply outline includes a second outline identifier, the second outline identifier is determined by the second device according to the second question and a first question corresponding to a first outline identifier, the first outline identifier is an outline identifier corresponding to the first reply outline, and the first outline identifier is associated with a first identifier corresponding to a third guide phrase included in the first reply outline or associated with a first identifier corresponding to the third guide phrase and a second identifier corresponding to a third state included in the first reply outline;
[0100] Second content is obtained;
[0101] Based on the second content and the second reply outline, the second question is processed by a second large language model to obtain a second target reply corresponding to the second question.
[0102] In one possible implementation, based on the second content and the second reply outline, the second question is processed by a second large language model to obtain a second target reply corresponding to the second question, including:
[0103] determine, according to a second outline identifier corresponding to the second reply outline, a third guiding phrase and a third state corresponding to the second reply outline;
[0104] obtain, when processing the second question by the second large language model, a seventh guiding phrase corresponding to a second reply step pushed by the second large language model; the second reply step is one reply step in the second target reply;
[0105] adjust the seventh guiding phrase corresponding to the second reply step according to the third guiding phrase corresponding to the second reply outline;
[0106] obtain, when processing the second question by the second large language model, a seventh state corresponding to a second reply step pushed by the second large language model;
[0107] adjust the seventh state corresponding to the second reply step according to the third state corresponding to the second reply outline.
[0108] In a third aspect, an embodiment of the present application provides a question and answer processing method, applied to a second device, and the method comprises the following steps:
[0109] obtain a first question sent by a first device;
[0110] process the first question by a first large language model, obtain a first reply outline corresponding to the first question, and send the first reply outline to the first device; the first reply outline is used for adjusting, by the first device, a reply step pushed by a second large language model when processing the first question by the second large language model, so as to obtain a first target reply corresponding to the first question.
[0111] In the question and answer processing method provided in the above, the second device can process the question and answer in cooperation with the first device. In the question and answer processing of the second device in cooperation with the first device, the first device can only send the first question to be processed to the second device, without the need to send the first content generated on the first device to the second device, that is, the content related to the user privacy can not be sent to the second device, and the leakage of the user privacy content can be avoided. The first large language model in the second device can accurately infer the reply outline corresponding to the first question according to the first question only, the time length of each processing of the second device can be reduced, and the throughput of the second device can be improved. The first device can obtain the first content generated on the first device, and can process the first question based on the first content and the first reply outline through the second large language model to obtain the first target reply corresponding to the first question, so as to accurately determine the first target reply based on the first reply outline, and the accuracy of the first target reply can be improved, and the user experience can be improved. That is, the question processing through the cooperation of multiple devices can improve the accuracy of the reply without leaking the user privacy content.
[0112] In some embodiments, the first device stores a guide phrase library and a state library, the guide phrase library includes a first guide phrase, and the state library includes a first state;
[0113] The processing of the first question through the first large language model to obtain the first reply outline corresponding to the first question includes:
[0114] According to the first question, a second guide phrase is determined from the guide phrase library, and a second state is determined from the state library according to the first question, the second guide phrase includes one or more of the first guide phrase, and the second state includes one or more of the first state;
[0115] According to the second guide phrase, the second state, the first question, and a first thought chain guide prompt, a first input text is obtained, and the first thought chain guide prompt is used to guide the first large language model to infer the reply outline of the first question;
[0116] The first input text is input into the first large language model for processing to obtain the first reply outline output by the first large language model;
[0117] The first reply outline includes a third guide phrase, or the first reply outline includes the third guide phrase and a third state, the third guide phrase includes one or more of the second guide phrase, and the third state includes one or more of the second state.
[0118] In some embodiments, the second device stores a guide phrase library and a state library, the guide phrase library includes a first guide phrase and a first identifier corresponding to the first guide phrase, and the state library includes a first state and a second identifier corresponding to the first state.
[0119] The processing of the first question by the first large language model comprises:
[0120] According to the first question, a second guide phrase is determined from the guide phrase library, and a first identifier corresponding to the second guide phrase is determined; the second guide phrase includes one or more of the first guide phrase;
[0121] According to the first question, a second state is determined from the state library, and a second identifier corresponding to the second state is determined; the second state includes one or more of the first state;
[0122] According to the second guide phrase and the first identifier corresponding to the second guide phrase, the second state and the second identifier corresponding to the second state, the first question, and a second thought chain guide prompt, a second input text is obtained, and the second thought chain guide prompt is used to guide the first large language model to infer the reply identifier of the first question;
[0123] The second input text is input into the first large language model for processing to obtain the first reply outline output by the first large language model, and the first reply outline includes a first identifier corresponding to a third guide phrase, or the first reply outline includes the first identifier corresponding to the third guide phrase and a second identifier corresponding to a third state.
[0124] In a possible implementation, the first reply outline includes a first identifier corresponding to a third guide phrase, or includes the first identifier corresponding to the third guide phrase and a second identifier corresponding to a third state;
[0125] After the processing of the first question by the first large language model to obtain the first reply outline corresponding to the first question, the method further comprises:
[0126] A first outline identifier corresponding to the first reply outline is determined, the first question and the first outline identifier are associated and saved, and the first outline identifier is associated with the first identifier corresponding to the third guide phrase, or the first outline identifier is associated with the first identifier corresponding to the third guide phrase and the second identifier corresponding to the third state.
[0127] In some embodiments, the method further comprises:
[0128] obtaining a second question sent by the second device;
[0129] According to the second question and the first question associated with the first outline identifier, determining a second outline identifier corresponding to the second question, taking the second outline identifier as a second reply outline corresponding to the second question, and sending the second reply outline to the first device, the second outline identifier being one of the first outline identifiers.
[0130] In one example, the sending the second reply outline to the first device comprises:
[0131] After determining the second outline identifier corresponding to the second question, determining whether the second outline identifier and the first identifier associated with the second outline identifier have been sent to the first device, or determining whether the second outline identifier, the first identifier and the second identifier associated with the second outline identifier have been sent to the first device;
[0132] When it is determined that the second outline identifier and the first identifier associated with the second outline identifier have been sent to the first device, or when it is determined that the second outline identifier, the first identifier and the second identifier associated with the second outline identifier have been sent to the first device, the second reply outline is sent to the first device.
[0133] When it is determined that the second outline identifier and the first identifier associated with the second outline identifier have not been sent to the first device, the second outline identifier and the first identifier associated with the second outline identifier are sent to the first device; or,
[0134] When it is determined that the second outline identifier, the first identifier and the second identifier associated with the second outline identifier have not been sent to the first device, the second outline identifier, the first identifier and the second identifier associated with the second outline identifier are sent to the first device.
[0135] In a fourth aspect, the embodiments of the present application provide a question and answer processing apparatus, the apparatus being included in a first device, the apparatus having a function of implementing the behavior of the first device in the second aspect and each possible implementation manner of the second aspect.
[0136] In a fifth aspect, the embodiments of the present application provide a question and answer processing apparatus, the apparatus being included in a second device, the apparatus having a function of implementing the behavior of the second device in the third aspect and each possible implementation manner of the third aspect.
[0137] In a sixth aspect, an embodiment of the present application provides a first device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, when the processor executes the computer program, the first device implements the question and answer processing method in any one of the second aspect.
[0138] In a seventh aspect, an embodiment of the present application provides a second device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, when the processor executes the computer program, the second device implements the question and answer processing method in any one of the third aspect.
[0139] In an eighth aspect, an embodiment of the present application provides a computer readable storage medium, the computer readable storage medium stores a computer program, when the computer program is executed by a computer, the computer implements the question and answer processing method in any one of the second aspect, or implements the question and answer processing method in any one of the third aspect.
[0140] In a ninth aspect, an embodiment of the present application provides a computer program product, when the computer program product runs on the first device, the first device executes the question and answer processing method in any one of the second aspect, or when the computer program product runs on the second device, the first device executes the question and answer processing method in any one of the third aspect.
[0141] It can be understood that the beneficial effects of the second aspect to the ninth aspect can be referred to the related description in the first aspect, which will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS
[0142] FIG. 1 is a schematic diagram of an application scenario;
[0143] FIG. 2 is a structural schematic diagram of a first device to which the question and answer processing method provided by an embodiment of the present application is applicable;
[0144] FIG. 3 is a schematic diagram of a software architecture to which the question and answer processing method provided by an embodiment of the present application is applicable;
[0145] FIG. 4 is a structural schematic diagram of an interactive system to which the question and answer processing method provided by an embodiment of the present application is applicable;
[0146] FIG. 5 is a flowchart of the question and answer processing method provided by an embodiment of the present application;
[0147] FIG. 6 is a flowchart of the question and answer processing method provided by an embodiment of the present application;
[0148] FIG. 7 is a schematic diagram of an application scenario of intermediate result correction provided by an embodiment of the present application. DETAILED DESCRIPTION
[0149] It should be understood that the word “comprise” or variations such as “comprises” or “comprising”, when used in this specification and in the accompanying claims, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0150] It should also be understood that the term “and / or” when used in this specification and in the following claims is to be interpreted as “one or the other or both” and / or “any combination of the items in the list.
[0151] As used in this specification and in the appended claims, the term “if’ can be interpreted as meaning “when” or “once” or “in response to a determination” or “in response to a detection” depending on the context. Similarly, the phrase “if it is determined” or “if [a described condition or event] is detected” can be interpreted as meaning “once it is determined” or “in response to a determination” or “once [the described condition or event] is detected” or “in response to a detection of [the described condition or event]” depending on the context.
[0152] In addition, in the description of the application and in the following claims, the terms “first”, “second”, “third”, etc. are only used to distinguish descriptions, and cannot be understood as indicating or implying relative importance.
[0153] Reference in the specification to “one embodiment” or “some embodiments” means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the application. The appearances of the phrase “in one embodiment” or “in some embodiments” in various places in the specification are not necessarily all referring to the same embodiment, although it can. The terms “comprise”, “comprises”, “comprising”, “include”, “includes”, “including” and “contain”, “contains”, “containing” and their variants are meant to be construed as “including but not limited to”, unless otherwise noted.
[0154] In addition, “a plurality of” mentioned in the embodiments of the present application should be interpreted as two or more.
[0155] The steps involved in the question and answer processing method provided in the embodiments of the present application are only examples, and not all steps are necessarily performed, or the content in each information or message is necessarily selected. In use, it can be increased or reduced as needed. The same step or step or message with the same function in different embodiments can be mutually referenced and learned.
[0156] The service scenarios described in the embodiments of the present application are used to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art can know that, with the evolution of network architecture and the appearance of new service scenarios, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.
[0157] LLM refers to a natural language processing model with a parameter quantity of more than one billion, for example, with a parameter quantity of several billion to several hundred billion. LLM is the core of applications such as intelligent question answering or intelligent assistants. Users or systems can input questions in the form of asking questions, and LLM can output corresponding replies according to the questions. To improve the accuracy of LLM replies, when inputting questions, users or systems can add CoT guides such as “step by step” after the questions to guide LLM to expand details, so that LLM can output replies containing more detailed content. That is, when inputting questions, if CoT guides such as “step by step” are added after the questions, LLM will expand details step by step in the replies, so that the replies have detailed and rich details.
[0158] For example, please refer to FIG. 1, which shows an application scenario diagram.
[0159] As shown in (a) of FIG. 1, when the input question is “Is there a recommended action on the current page?”, if no CoT guide is added after the question, the reply output by LLM can be “The brightness of the current page is too low”.
[0160] As shown in (b) of FIG. 1, when the input question is “Is there a recommended action on the current page?”, and the CoT guide “step by step” is added after the question, the reply output by LLM can be “S1, the current user is browsing application A; S2, the positioning information state is on; S3, the interface search record is a page with theme B; S4, there is no recommendation for B content nearby”. Wherein, S1, S2, S3, and S4 can be step identifiers.
[0161] As can be seen from (a) of FIG. 1 and (b) of FIG. 1, when no CoT guide is added after the input question, the reply output by LLM is generally simple, and the accuracy of the reply is also low. When the CoT guide is added after the input question, LLM can output a reply containing more detailed content, and the accuracy of the reply is also high.
[0162] Although the CoT guide can improve the accuracy of the LLM reply, the CoT guide needs to obtain relevant content on the terminal device, such as obtaining application information, page theme content, or positioning information currently browsed by the user. The relevant content on the terminal device may involve the privacy content of the user.
[0163] When the question and answer processing is performed based on the LLM provided by the server, the related content related to the user privacy generally needs to be uploaded to the server. After the server obtains the question and the related content, the server can process the question and the related content through the LLM to obtain a corresponding reply, and send the reply to the terminal device. However, uploading the related content related to the user privacy to the server can cause the user privacy content to be leaked, and thus the user experience is poor.
[0164] When the question and answer processing is performed based on the LLM provided by the terminal device, due to the performance of the terminal device and other reasons, the parameter amount of the LLM deployed on the terminal device is generally small, and is much smaller than the parameter amount of the LLM deployed on the server. For example, the parameter amount of the LLM deployed on the terminal device can generally be several B (B is a parameter amount unit, representing one billion), and the parameter amount of the LLM deployed on the server can generally be several tens or several hundred B. Due to the small parameter amount of the LLM deployed on the terminal device, the terminal device can process the question and the related content through the LLM, but the accuracy of the reply output by the LLM is low.
[0165] In summary, how to improve the accuracy of the LLM reply without leaking the user privacy content has become a problem to be solved by the person skilled in the art.
[0166] To solve the above problems, the embodiments of the present application provide an interactive system, a question and answer processing method, a first device, a second device and a computer readable storage medium. The interactive system can include a first device and a second device. When performing question and answer processing, the first device can obtain a first question, and can send the first question to the second device. After the second device obtains the first question, the second device can process the first question through a first large language model to obtain a first reply outline corresponding to the first question, and can send the first reply outline to the first device. The first device can obtain first content, and can process the first question through a second large language model based on the first content and the first reply outline to obtain a first target reply corresponding to the first question.
[0167] That is, the embodiment of the present application can process questions in a multi-device cooperative manner. When processing questions in a multi-device cooperative manner, the first device can only send the first question to be processed to the second device, and does not need to send the first content generated on the first device to the second device, that is, it does not need to send content related to user privacy to the second device, which can avoid the leakage of user privacy content. The first large language model in the second device can accurately infer the reply outline corresponding to the first question according to the first question only, which can reduce the processing time of the second device each time and improve the throughput of the second device. The first device can obtain the first content generated on the first device, and process the first question based on the first content and the first reply outline through the second large language model to obtain the first target reply corresponding to the first question, so as to accurately determine the first target reply based on the first reply outline, which can improve the accuracy of the first target reply and enhance the user experience. That is, the question processing of the embodiment of the present application through multi-device cooperation can improve the accuracy of the reply without leaking user privacy content, which has strong ease of use and practicality.
[0168] In the embodiment of the present application, the first device can be a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a desktop computer, etc. The specific type of the first device is not limited in the embodiment of the present application. The second device can be a server, a cloud server, or a vehicle-mounted device, etc. which can deploy a large language model with large-scale parameters.
[0169] First, the first device involved in the embodiment of the present application is introduced. Please refer to FIG. 2, which shows a structural schematic diagram of the first device 200.
[0170] The first device 200 can include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, a headset jack 270D, a sensor module 280, a key 290, a camera 291, and a display 292, and the like. The sensor module 280 can include a pressure sensor 280A, a gyro sensor 280B, a barometric sensor 280C, a magnetic sensor 280D, an acceleration sensor 280E, a distance sensor 280F, a proximity light sensor 280G, a fingerprint sensor 280H, a temperature sensor 280J, a touch sensor 280K, an ambient light sensor 280L, and a bone conduction sensor 280M, and the like.
[0171] It can be understood that the structure illustrated by the embodiments of the present application does not constitute a specific limitation on the first device 200. In other embodiments of the present application, the first device 200 can include more or fewer components than illustrated, or combine certain components, or split certain components, or different arrangement of components. The illustrated components can be implemented in hardware, software, or a combination of software and hardware.
[0172] The processor 210 can include one or more processing units, for example: the processor 210 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), and the like. Different processing units can be independent devices, or can be integrated in one or more processors.
[0173] The controller can generate operation control signals according to instruction operation codes and timing signals, and complete the control of fetching instructions and executing instructions.
[0174] The processor 210 can also have internal memory that is used to store instructions and data. In some embodiments, the internal memory of the processor 210 is a cache memory. Such a memory can hold instructions or data that the processor 210 has recently accessed, or is likely to access again. If the processor 210 needs to re-use the instructions or data, it can directly call the memory, avoiding repeated access and reducing the waiting time of the processor 210, thereby improving the efficiency of the system.
[0175] In some embodiments, the processor 210 can include one or more interfaces. The interfaces can include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0176] It can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is only illustrative, and does not constitute a structural limitation of the first device 200. In some other embodiments of the present application, the first device 200 can also use different interface connection modes or combinations of multiple interface connection modes in the above embodiments.
[0177] The charging management module 240 is configured to receive a charging input from a charger.
[0178] The power management module 241 is configured to connect the battery 242 and the charging management module 240. The power management module 241 receives the input of the battery 242 and / or the charging management module 240, and supplies power to the processor 210, the internal memory 221, the display screen 292, the camera 291, and the wireless communication module 260, etc.
[0179] The wireless communication function of the first device 200 can be realized through the antenna 1, the antenna 2, the mobile communication module 250, the wireless communication module 260, the modem processor, and the baseband processor, etc.
[0180] Antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the first device 200 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in combination with a tuning switch.
[0181] The mobile communication module 250 can provide a solution including 2G / 3G / 4G / 5G wireless communication applied on the first device 200. The mobile communication module 250 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 250 can receive electromagnetic waves by the antenna 1, and perform filtering, amplification, etc. on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 250 can also amplify the signals modulated by the modem processor, and convert the signals into electromagnetic waves radiated by the antenna 1. In some embodiments, at least part of the functional modules of the mobile communication module 250 can be arranged in the processor 210. In some embodiments, at least part of the functional modules of the mobile communication module 250 can be arranged in the same device as at least part of the modules of the processor 210.
[0182] The modem processor can include a modulator and a demodulator. The modulator is used to modulate a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate a received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. The low-frequency baseband signal processed by the baseband processor is transmitted to the application processor. The application processor outputs a sound signal through an audio device (not limited to a loudspeaker 270A, a microphone 270B, etc.), or displays an image or a video through the display screen 292. In some embodiments, the modem processor can be an independent device. In some other embodiments, the modem processor can be independent of the processor 210, and arranged in the same device as the mobile communication module 250 or other functional modules.
[0183] The wireless communication module 260 can provide a solution for wireless communication including wireless local area networks (WLAN) (e.g., wireless fidelity (Wi-Fi) network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, etc. applied to the first device 200. The wireless communication module 260 can be one or more devices that integrate at least one communication processing module. The wireless communication module 260 receives electromagnetic waves via the antenna 2, frequency-modulates and filters the electromagnetic wave signals, and transmits the processed signals to the processor 210. The wireless communication module 260 can also receive signals to be transmitted from the processor 210, frequency-modulate them, amplify them, and radiate them as electromagnetic waves via the antenna 2.
[0184] In some embodiments, the antenna 1 and the mobile communication module 250 of the first device 200 are coupled, and the antenna 2 and the wireless communication module 260 are coupled, so that the first device 200 can communicate with a network and other devices through wireless communication technologies. The wireless communication technologies can include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS can include a global positioning system (GPS), a global navigation satellite system (GLONASS), a beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and / or a satellite based augmentation systems (SBAS).
[0185] The first device 200 implements a display function through a GPU, a display screen 292, and an application processor, etc. The GPU is a microprocessor for image processing, connected to the display screen 292 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 210 can include one or more GPUs that execute program instructions to generate or change display information.
[0186] The display screen 292 is configured to display images, videos, and the like. The display screen 292 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flex light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light emitting diodes (QLED), or the like. In some embodiments, the first device 200 can include one or N display screens 292, where N is a positive integer greater than 1.
[0187] The first device 200 can implement the photographing function through the ISP, the camera 291, the video codec, the GPU, the display screen 292, and the application processor, and the like.
[0188] The ISP is configured to process data fed back by the camera 291.
[0189] The camera 291 is configured to capture still images or videos. In some embodiments, the first device 200 can include one or N cameras 291, where N is a positive integer greater than 1.
[0190] The digital signal processor is configured to process digital signals, in addition to processing digital image signals, it can also process other digital signals. For example, when the first device 200 selects a frequency point, the digital signal processor is configured to perform Fourier transform on the frequency point energy, and the like.
[0191] The video codec is configured to compress or decompress digital videos. The first device 200 can support one or more video codecs. In this way, the first device 200 can play or record videos in multiple encoding formats, such as moving picture experts group (MPEG) 1, MPEG 2, MPEG 3, MPEG 4, and the like.
[0192] The NPU is a neural-network (NN) calculation processor, which is configured to quickly process input information by referring to the structure of a biological neural network, such as the transmission mode between human brain neurons, and can also constantly self-learn. Through the NPU, the first device 200 can implement intelligent cognition applications, such as image recognition, face recognition, voice recognition, text understanding, and the like.
[0193] The external memory interface 220 can be configured to connect an external memory card, such as a Micro SD card, to extend the storage capability of the first device 200. The external memory card communicates with the processor 210 through the external memory interface 220 to implement a data storage function. For example, files such as music and videos are stored in the external memory card.
[0194] The internal memory 221 can be configured to store computer executable program codes including instructions. The internal memory 221 can include a program storage area and a data storage area. The program storage area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.), and the like. The data storage area can store data (such as audio data, a phone book, etc.) created during use of the first device 200, and the like. In addition, the internal memory 221 can include a high-speed random access memory, and can further include a non-volatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like. The processor 210 executes various function applications and data processing of the first device 200 by running instructions stored in the internal memory 221 and / or instructions stored in a memory disposed in the processor.
[0195] The first device 200 can implement an audio function through an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, a headphone interface 270D, an application processor, and the like. For example, music playing, recording, and the like.
[0196] The audio module 270 is configured to convert digital audio information into an analog audio signal output, and is also configured to convert an analog audio input into a digital audio signal. The audio module 270 can also be configured to encode and decode an audio signal.
[0197] The software system of the first device 200 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. For example, the software system of the first device 200 can adopt an Android operating system (OS), a Harmony OS, an IOS, or the like with a layered architecture. Embodiments of the present application exemplarily illustrate the software structure of the first device 200 with a layered architecture.
[0198] FIG. 3 is a software structure block diagram of the first device 200 according to an embodiment of the present application.
[0199] The layered architecture divides software into several layers, each of which has a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the operating system is divided into four layers, from top to bottom, the application layer, the application framework layer, the runtime and system library, and the kernel layer.
[0200] The application layer can include a series of application packages.
[0201] As shown in FIG. 3, the application package can include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
[0202] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications of the application layer. The application framework layer includes some pre-defined functions.
[0203] As shown in FIG. 3, the application framework layer can include window manager, content provider, view system, phone manager, resource manager, notification manager, etc.
[0204] The window manager is used to manage window programs. The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, and take screenshots, etc.
[0205] The content provider is used to store and obtain data, and make the data accessible to the application. The data can include video, image, audio, dialed and received calls, browsing history and bookmarks, phonebook, etc.
[0206] The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build an application. A display interface can be composed of one or more views. For example, a display interface including a short message notification icon can include a view for displaying text and a view for displaying pictures.
[0207] The phone manager is used to provide the communication function of the first device 200. For example, the management of the call state (including call connection, call hang-up, etc.).
[0208] The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, etc.
[0209] The notification manager enables applications to display notification information in the status bar, which can be used to convey a message of the notification type, and can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify the completion of the download, message reminders, etc. The notification manager can also be a notification in the form of a chart or a scroll bar text appearing in the system top status bar, such as a notification of a background running application, and can also be a notification in the form of a dialog window appearing on the screen. For example, the status bar prompts the text information, emits a prompt sound, vibrates, and the indicator light flashes, etc.
[0210] The runtime includes a core library and a virtual machine. The runtime is responsible for the scheduling and management of the operating system.
[0211] The core library includes two parts: one part is the function function required to be called by the java language, and the other part is the core library of the operating system.
[0212] The application layer and the application framework layer run in the virtual machine. The virtual machine executes the java file of the application layer and the application framework layer into a binary file. The virtual machine is used to perform the management of the object life cycle, the stack management, the thread management, the security and exception management, and the garbage collection, etc.
[0213] The system library can include multiple functional modules. For example: a surface manager, media libraries, a three-dimensional graphics processing library (for example: OpenGL ES), a 2D graphics engine (for example: SGL), etc.
[0214] The surface manager is used to manage the display subsystem, and provides a fusion of 2D and 3D layers for multiple applications.
[0215] The media library supports multiple commonly used audio, video format playback and recording, and static image files, etc. The media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0216] The three-dimensional graphics processing library is used to realize three-dimensional graphics drawing, image rendering, synthesis, and layer processing, etc.
[0217] The 2D graphics engine is a drawing engine for 2D drawing.
[0218] The kernel layer is a layer between hardware and software. The kernel layer at least includes a display driver, a camera driver, an audio driver, and a sensor driver.
[0219] The question and answer processing method provided by the embodiments of the present application will be described in detail below in combination with the drawings and specific application scenarios.
[0220] Please refer to FIG. 4, which shows a structural schematic diagram of an interactive system provided in an embodiment of the present application.
[0221] As shown in FIG. 4, the interactive system can include at least one first device 200 (FIG. 4 shows only one first device 200 as an example) and at least one second device 420 (FIG. 4 shows only one second device 420 as an example). A large language model (for example, which can be referred to as large language model A) can be deployed in the first device 200. A large language model (for example, which can be referred to as large language model B) can also be deployed in the second device 420. The parameter quantity of the large language model B can be greater than the parameter quantity of the large language model A.
[0222] It should be noted that the first device 200 can be a terminal device such as a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an AR / VR device, or a notebook computer. The second device 420 can be an electronic device such as a server, a cloud server, or a vehicle-mounted device, which can deploy a large language model B with a large-scale parameter quantity.
[0223] It should be understood that the first device 200 can be communicatively connected to the second device 420 through a communication network to realize the interaction between the first device 200 and the second device 420. For example, the first device 200 can send a question to the second device 420 through the communication network. For example, the second device 420 can send a reply outline corresponding to the question to the first device 200 through the communication network. The communication mode between the first device 200 and the second device 420 is not limited in the embodiments of the present application. For example, the first device 200 can include a communication module (for example, which can be referred to as communication module A), and the first device 200 can be connected to the network through the communication module A to realize the communication with the second device 420. For example, the second device 420 can also include a communication module (for example, which can be referred to as communication module B), and the first device 200 can realize the communication with the second device 420 through the communication module A and the communication module B.
[0224] As shown in FIG. 4, the first device 200 can also include a processing module (for example, which can be referred to as processing module A). When performing the question and answer processing, the first device 200 can process the question and the related content through the processing module A to obtain a text (for example, which can be referred to as text A), and can input the text A to the large language model A for processing to obtain a reply corresponding to the question. In addition, when the large language model A processes the text A, the first device 200 can also identify whether the reply step (for example, the guiding phrase and / or the state corresponding to the reply step) inferred by the large language model A is accurate through the processing module A, and when it is identified that the reply step is not accurate, instruct the large language model A to adjust the reply step, so that the large language model A outputs an accurate reply.
[0225] As shown in FIG. 4, the second device 420 can also include a processing module (for example, which can be referred to as processing module B). When performing question and answer processing, for example, after the second device 420 obtains the question sent by the first device 200, the second device 420 can process the question through the processing module B to obtain text (for example, which can be referred to as text B), and can input the text B to the large language model B for processing to obtain a reply outline corresponding to the question.
[0226] Please refer to FIG. 5, which shows a flowchart of a question and answer processing method according to an embodiment of the present application. The method can be applied to the interaction system shown in FIG. 4. As shown in FIG. 5, the method can include:
[0227] S501, the first device 200 obtains a first question.
[0228] S502, the first device 200 sends the first question to the second device 420.
[0229] S503, the second device 420 processes the first question through the large language model B to obtain a first reply outline corresponding to the first question.
[0230] S504, the second device 420 sends the first reply outline to the first device 200.
[0231] S505, the first device 200 obtains first content.
[0232] S506, the first device 200 processes the first question based on the first content and the first reply outline through the large language model A to obtain a first target reply corresponding to the first question.
[0233] The embodiments of the present application can perform question and answer processing in a multi-device cooperative manner. When performing question and answer processing in a multi-device cooperative manner, the first device 200 can only send the first question to be processed to the second device 420, and does not need to send the first content generated on the first device 200 to the second device 420, that is, can not send content related to user privacy to the second device 420, and can avoid leakage of user privacy content. After the second device 420 obtains the first question, the large language model B in the second device 420 can only infer the first reply outline corresponding to the first question according to the first question, which can reduce the processing time of the second device 420 each time and improve the throughput of the second device 420. The first device 200 can process the first question based on the first content generated on the first device 200 and the first reply outline through the large language model A to obtain the first target reply corresponding to the first question, so as to guide the large language model A of the first device 200 to obtain an accurate first target reply based on the first reply outline determined by the second device 420, which can improve the accuracy of the first target reply and improve the user experience. That is, the question and answer processing performed by the embodiments of the present application in a multi-device cooperative manner can improve the accuracy of the reply without leaking user privacy content.
[0234] It should be noted that the first question can be generated by an application (or can be referred to as an application) in the first device 200 according to an actual scene, or the first question can be input by a user in the first device 200, etc. The embodiments of the present application do not limit the generation method of the first question, which can be determined according to the actual scene.
[0235] It should be understood that when the first question is a question input by a user in the first device 200, the embodiments of the present application do not limit the specific method of inputting the first question by the user. For example, the user can input the first question through a touch input method. For example, the user can input the first question through a key input method. For example, the user can input the first question through a voice input method, etc.
[0236] It should be noted that the large language model (for example, the large language model A and the large language model B) can be used to process the text content, that is, the input of the large language model A and the large language model B can be a question in the form of text, and the output can also be a reply in the form of text. Wherein, when the user inputs the first question through the voice input mode, the first device 200 can start the voice recognition function to obtain the voice content input by the user, and can convert the voice content into text content to obtain the first question in the form of text, so that the large language model A in the first device 200 can process the question in the form of text to obtain the first target reply. In addition, the first device 200 can also send the first question in the form of text to the second device 420, so that the large language model B in the second device 420 can process the first question in the form of text to obtain the first reply outline.
[0237] For example, the first question sent by the first device 200 to the second device 420 can be a question that does not involve privacy, that is, the first question sent by the first device 200 to the second device 420 can be a question that does not involve sensitive content such as user privacy, so as to avoid leaking user privacy. Wherein, when the first question obtained by the first device 200 is a question involving privacy, the first device 200 can perform desensitization processing on the first question, and can send the desensitized first question to the second device 420. It should be understood that the specific manner of desensitizing the first question by the embodiments of the present application is not limited, and can be determined according to the actual scene.
[0238] In one example, the first content can include content generated on the first device 200, for example, can include information stack and / or various states generated by the user using the first device 200, etc. For example, the first content can include relevant information of the application program used by the user in the first device 200, relevant information of the search record, positioning information, power information of the first device 200, relevant information of the Bluetooth state, and relevant information of the previous question and answer performed by the user, etc.
[0239] In another example, the first content can include intermediate results inferred by the large language model A when the first device 200 processes the first question through the large language model A. For example, when the second device 420 processes the first question through the large language model B, the first device 200 can also process the first question through the large language model A to obtain an intermediate result (for example, which can be referred to as intermediate result A), and can take the intermediate result A as the first content. After the first device 200 obtains the first reply outline sent by the second device 420, the first device 200 can process the first question through the large language model A based on the first reply outline and the first content (for example, which can include the content generated on the first device 200 and the intermediate result A) to obtain the first target reply corresponding to the first question.
[0240] It should be noted that the question and answer processing method provided in the embodiments of the present application can be applied to a question and answer scenario based on CoT guidance. That is, when reasoning through a large language model to reply, the large language model can be guided to output a reply through a CoT guidance prompt to improve the accuracy of the large language model reply.
[0241] For example, when the first device 200 processes the first question through the large language model A, a preset CoT guidance prompt (for example, which can be referred to as CoT guidance prompt A) can be added after the first question to guide the large language model A to process the first question through the CoT guidance prompt A, and obtain the first target reply corresponding to the first question.
[0242] For example, when the second device 420 processes the first question through the large language model B, a preset CoT guidance prompt (for example, which can be referred to as CoT guidance prompt B) can be added after the first question to guide the large language model B to process the first question through the CoT guidance prompt B, and obtain the first reply outline corresponding to the first question.
[0243] The process of the second device 420 processing the first question through the large language model B to obtain the first reply outline corresponding to the first question will be described in detail below.
[0244] In the embodiments of the present application, after obtaining the first question sent by the first device 200, the second device 420 (for example, the processing module B of the second device 420) can assemble the first question according to a fixed format (for example, which can be referred to as fixed format B) to obtain text B, and can input the text B to the large language model B for processing to obtain the first reply outline corresponding to the first question.
[0245] In some embodiments, the fixed format B can be: preposed background (for example, which can be referred to as preposed background B) + first question + CoT guidance prompt B. Among them, the second device 420 can only output the reply outline to help the first device 200 output an accurate reply. Therefore, the CoT guidance prompt B can be a guidance prompt for guiding the large language model B to only output the reply outline.
[0246] For example, the first reply outline can include a guiding phrase and a state corresponding to each reply step. Alternatively, the first reply outline can include an identification of a guiding phrase (hereinafter referred to as a step identification) and an identification of a state (hereinafter referred to as a state identification) corresponding to each reply step. It should be understood that the state or the state identification can be optional in the first reply outline. For example, when a reply step (e.g., reply step A) has no corresponding state, the first reply outline can only include a guiding phrase corresponding to the reply step A or a step identification corresponding to the reply step A for the reply step A. For example, when a reply step (e.g., reply step B) includes a corresponding state, the first reply outline can include a guiding phrase and a state corresponding to the reply step B or include a step identification and a state identification corresponding to the reply step B for the reply step B.
[0247] It should be understood that when the first reply outline output by the large language model B includes a guiding phrase and a state corresponding to each reply step, the CoT guiding prompt B can be a guiding prompt for guiding the large language model B to output the guiding phrase and the state. For example, the CoT guiding prompt B can be “step by step, only infer the guiding phrase and the state”. When the first reply outline output by the large language model B includes a step identification and a state identification corresponding to each reply step, the CoT guiding prompt B can be a guiding prompt for guiding the large language model B to output the step identification and the state identification. For example, the CoT guiding prompt B can be “step by step, only infer the step identification and the state identification”.
[0248] It should be noted that the input of the large language model can be a question in text form, and the output can be a reply in text form. For a question in text form, the large language model can generally output the first character of the reply through full inference, and can output other characters except the first character through incremental inference. That is, after inputting the question in text form into the large language model, the large language model generally needs to perform one full inference and multiple incremental inferences to output the reply corresponding to the question, that is, each character of each reply step can be output character by character through one full inference and multiple incremental inferences. Therefore, the time length of each inference of the large language model can be: the time length of full inference + the number of characters * the time length of single-character incremental inference. When there are more characters in the reply step, the time length of one inference of the large language model will be longer.
[0249] Therefore, the embodiment of the present application guides the large language model B to only perform reasoning of the reply outline (for example, the guiding phrase and the state, or the step identifier and the state identifier) through the CoT guiding prompt B, so that the large language model B only needs to reason the reply outline with less characters, the number of characters of each reasoning of the large language model B can be reduced, the time length of each reasoning of the large language model B can be reduced, not only the reasoning speed of the large language model B can be improved, but also the throughput of the large language model B can be improved.
[0250] In some embodiments, the pre-context B can be determined based on the guiding phrase in the guiding phrase library and the state in the state library. That is, the large language model B can determine the guiding phrase and the state included in the first reply outline based on the guiding phrase and the state indicated by the pre-context B. That is, the guiding phrase and the state included in the first reply outline can be determined according to the pre-context B, or the step identifier and the state identifier included in the first reply outline can be determined according to the pre-context B.
[0251] It should be noted that the second device 420 can store the guiding phrase library and the state library. The guiding phrase library can store guiding phrases of each step. For example, the guiding phrase library can include: <step 1, current user browsing>, <step 2, positioning information state>, …, <step 7, interface search record>, …, and the like. Wherein, “current user browsing” can be the guiding phrase of step 1, “positioning information state” can be the guiding phrase of step 2, and “interface search record” can be the guiding phrase of step 7. Similarly, the state library can store a plurality of states. For example, the state library can include: <state 101, start positioning>, <state 102, brightness to 10%>, <state 103, start Bluetooth>, and the like.
[0252] In a possible implementation, the second device 420 (for example, the processing module B of the second device 420) can determine all guiding phrases in the guiding phrase library and all states in the state library as the content of the pre-context B. That is, the large language model B can determine the guiding phrase and the state included in the first reply outline based on all guiding phrases in the guiding phrase library and all states in the state library, or determine the step identifier and the state identifier included in the first reply outline.
[0253] In another possible implementation, the second device 420 (e.g., the processing module B of the second device 420) can determine the partial guide phrases from the guide phrase library according to the first question, and can determine the partial states from the state library. Subsequently, the processing module B of the second device 420 can determine the partial guide phrases determined based on the first question and the partial states as the content of the pre-context B. That is, the large language model B can infer the guide phrases and the states included in the first reply outline based on the partial guide phrases in the guide phrase library and the partial states in the state library, or infer the step identifiers and the state identifiers included in the first reply outline.
[0254] For example, the processing module B of the second device 420 can determine the scene type to which the first question belongs according to the first question. Subsequently, the processing module B of the second device 420 can determine the guide phrases matched with the scene type from the guide phrase library and the states matched with the scene type from the state library according to the scene type to which the first question belongs.
[0255] It should be noted that the scene type and the determination manner of the scene type can be determined according to actual application scenarios, and the embodiments of the present application do not limit this.
[0256] In one example, after determining the guide phrases and the states, the processing module B of the second device 420 can directly splice the guide phrases and the states to obtain the pre-context B.
[0257] For example, the pre-context B can be: “The following is the guide phrase library, <step 1, current user browsing>, <step 2, location information state>, …, <step 7, interface search record>, … The following is the state library, <state 101, turn on location>, <state 102, brightness to 10%, <state 103, turn on Bluetooth>, …”.
[0258] In another example, after determining the guide phrases and the states, the processing module B of the second device 420 can further determine the step identifiers corresponding to the guide phrases and the state identifiers corresponding to the states, and can splice the guide phrases, the step identifiers corresponding to the guide phrases, the states, and the state identifiers corresponding to the states to obtain the pre-context B.
[0259] For example, the pre-context B can be: “The following is the guide phrase library, in the format of <A, B>, A represents the step identifier, and B represents the guide phrase. <1, current user browsing>, <2, location information state>, …, <7, interface search record>, … The following is the state library, in the format of <C, D>, C represents the state identifier, and D represents the state. <101, turn on location>, <102, brightness to 10%, <103, turn on Bluetooth>, …”.
[0260] For example, for each guiding phrase, the processing module B of the second device 420 can determine the step sequence number corresponding to the guiding phrase in the guiding phrase library as the step identifier corresponding to the guiding phrase, which can facilitate subsequent quick determination of the guiding phrase indicated by the step identifier, and can also reduce the number of characters when the large language model B performs first reply outline reasoning, and can improve the reasoning speed of the large language model B.
[0261] For example, when the guiding phrase library includes <step 1, current user browsing>, <step 2, positioning information state>, …, <step 7, interface search record>, …, etc., the processing module B of the second device 420 can determine the step sequence number (i.e., 1) corresponding to “current user browsing” as the step identifier corresponding to “current user browsing”, can determine the step sequence number (i.e., 2) corresponding to “positioning information state” as the step identifier corresponding to “positioning information state”, and can determine the step sequence number (i.e., 7) corresponding to “interface search record” as the step identifier corresponding to “interface search record”, etc. That is, the step identifier corresponding to “current user browsing” can be 1, the step identifier corresponding to “positioning information state” can be 2, the step identifier corresponding to “interface search record” can be 7, etc.
[0262] Similarly, for each state, the state identifier corresponding to the state can be determined according to the content of the state in the state library. For example, for each state, the processing module B of the second device 420 can determine the state sequence number corresponding to the state in the state library as the state identifier corresponding to the state, which can facilitate subsequent quick determination of the state indicated by the state identifier, and can also reduce the number of characters when the large language model B performs first reply outline reasoning, and can improve the reasoning speed of the large language model B.
[0263] For example, when the state library includes <state 101, start positioning>, <state 102, brightness to 10%>, <state 103, start Bluetooth>, etc., the processing module B of the second device 420 can determine the state sequence number (i.e., 101) corresponding to “start positioning” as the state identifier corresponding to “start positioning”, can determine the state sequence number (i.e., 102) corresponding to “brightness to 10%” as the state identifier corresponding to “brightness to 10%”, and can determine the state sequence number (i.e., 103) corresponding to “start Bluetooth” as the state identifier corresponding to “start Bluetooth”, etc. That is, the state identifier corresponding to “start positioning” can be 101, the state identifier corresponding to “brightness to 10%” can be 102, the state identifier corresponding to “start Bluetooth” can be 103, etc.
[0264] In some embodiments, the fixed format B can be: pre-context B + first question + CoT guiding prompt B + output prompt. The output prompt can be used to instruct the large language model B to output the first reply outline in a specified output format. For example, when the first reply outline includes a guiding phrase and a state, the output prompt can be: output a plurality of tuples, each tuple in the format of: <guiding phrase, state (optional)>. For example, when the first reply outline includes a step identifier and a state identifier, the output prompt can be: output a plurality of tuples, each tuple in the format of: <step identifier, state identifier (optional)>.
[0265] It should be noted that one tuple can represent one reply step, i.e., the first reply outline includes several tuples, which can represent that the reply to the first question needs to include several reply steps. Among them, for each tuple, the guiding phrase in <guiding phrase, state (optional)> can be the guiding phrase contained in the reply step, and the state can be the state contained in the reply step. It should be understood that state (optional) can be used to instruct the large language model B to output the state corresponding to a certain reply step when the reply step includes the state, i.e., the first reply outline can include the guiding phrase and the state corresponding to the reply step; and when a certain reply step does not include a state, the state can not be output, i.e., the first reply outline can only include the guiding phrase corresponding to the reply step.
[0266] Similarly, for each tuple, the step identifier in <step identifier, state identifier (optional)> can be the identifier of the guiding phrase corresponding to the reply step, and the state identifier can be the identifier of the state corresponding to the reply step. Among them, state identifier (optional) can be used to instruct the large language model B to output the state identifier corresponding to a certain reply step when the reply step includes the state, i.e., the first reply outline can include the step identifier and the state identifier corresponding to the reply step; and when a certain reply step does not include a state, the state identifier can not be output, i.e., the first reply outline can only include the step identifier corresponding to the reply step.
[0267] In the embodiments of the present application, after the processing module B of the second device 420 assembles the first question according to the fixed format B to obtain the text B corresponding to the first question, the processing module B of the second device 420 can input the text B into the large language model B. The large language model B can infer the text B to obtain the first reply outline corresponding to the first question.
[0268] In one example, the large language model B can output the first reply outline according to the output prompt included in the text B.
[0269] For example, when the output prompt included in the text B is: output multiple tuples, each tuple is in the format of: <guiding phrase, state (optional)>, the first reply outline output by the large language model B can include three tuples: <current user browsing>, <positioning state information, starting positioning> and <interface search record>. Among them, the three tuples can represent that the reply to the first question needs to include three steps (which can also be referred to as reply steps). The first step and the third step can only include guiding phrases, and the second step can include guiding phrases and states. That is, the reply to the first question needs three steps, which are related to the current user's browsing content, related to the positioning state, and related to the interface search record, and the positioning-related step can also include a target state (that is, starting positioning), that is, the first device 200 needs to start positioning.
[0270] For example, when the output prompt included in the text B is: output multiple tuples, each tuple is in the format of: <step identifier, state identifier (optional)>, the first reply outline output by the large language model B can be <1>, <2, 101>, <7> three tuples. That is, the reply to the first question needs to include three steps. Among them, the first step and the third step can only include an identifier, that is, a step identifier, and the second step can include two identifiers, that is, a step identifier and a state identifier. Assuming that the step identifier 1 indicates the guiding phrase "current user browsing", the step identifier 2 indicates the guiding phrase "positioning state information", the step identifier 7 indicates the guiding phrase "interface search record", and the state identifier 101 indicates the state "starting positioning", it is indicated that the first reply outline inferred by the large language model B can include three steps, which are: the step indicated by the step identifier 1 (that is, related to the current user's browsing content), the step indicated by the step identifier 2 (that is, related to positioning) and the step of the step identifier 3 (that is, related to the interface search record), and the positioning-related step can also include a target state (that is, starting positioning), that is, the first device 200 needs to start positioning.
[0271] It should be noted that the second device 420 can be provided with a default output format. When the text B does not include the output prompt, the large language model B can output the first reply outline according to the default output format. Among them, the default output format can be determined according to the actual scene, and the embodiments of the present application do not limit this.
[0272] In the embodiments of the present application, after the second device 420 obtains the first reply outline output by the large language model B, the first reply outline can be sent to the first device 200 through the communication network. After the first device 200 obtains the first reply outline sent by the second device 420, the first device 200 can process the first question through the large language model A based on the first content and the first reply outline, and obtain the first target reply corresponding to the first question, so as to improve the accuracy of the first target reply inferred by the large language model A based on the first reply outline.
[0273] The process of the first device 200 processing the first question through the large language model A based on the first content and the first reply outline to obtain the first target reply corresponding to the first question will be described in detail below.
[0274] In the embodiments of the present application, after the first device 200 obtains the first question and the first content, the first device 200 (for example, the processing module A of the first device 200) can assemble the first question and the first content in a fixed format (for example, which can be referred to as fixed format A) to obtain text A, and can input the text A to the large language model A for processing to obtain the first target reply corresponding to the first question. The first target reply can include one or more reply steps. Each reply step can include a guiding phrase part and a detail part. For each reply step, the guiding phrase part can include the guiding phrase corresponding to the reply step. If the reply step includes a state, the detail part can include the state corresponding to the reply step.
[0275] It should be understood that in the process of processing the text A by the large language model A, the processing module A of the first device 200 can adjust each reply step inferred by the large language model A based on the first reply outline, so that the large language model A can accurately output the first target reply corresponding to the first question. The content of the processing module A of the first device 200 adjusting each reply step inferred by the large language model A based on the first reply outline will be described in detail later.
[0276] In a possible implementation, the fixed format A can be: pre-context (which can be referred to as pre-context A) + first content + first question + CoT guiding prompt A. Since the first device 200 needs to output a target reply containing detailed content, the CoT guiding prompt A can be a guiding prompt for guiding the large language model A to make a detailed reply, that is, the CoT guiding prompt A can be used to guide the large language model A to expand the details of the reply. For example, the CoT guiding prompt A can be "step by step".
[0277] It should be noted that the CoT guiding prompt A described above is "step by step" only for exemplary explanation, and should not be understood as a limitation of the embodiments of the present application. In the embodiments of the present application, the CoT guiding prompt A can also be other guiding prompts that can be used to guide the large language model A to expand the details of the reply. For example, the CoT guiding prompt A can be "please think step by step". For example, the CoT guiding prompt A can be "please reason step by step", and the like.
[0278] In one example, the first device 200 can obtain the first content after obtaining the first reply outline sent by the second device 420. After obtaining the first content, the first device 200 can assemble the first content and the first question according to the fixed format A to obtain text A, and can input the text A to the large language model A for processing to obtain the first target reply corresponding to the first question. At this time, the first content can include the information stack and / or various states generated by the user using the first device 200, etc. For example, the first content can include related information of the application program used by the user in the first device 200, related information of the search record, positioning information, power information of the first device 200, related information of the Bluetooth state, and related information of the previous question and answer performed by the user, etc.
[0279] In another example, when the second device 420 determines the first reply outline according to the first question, the first device 200 can obtain the first content, can assemble the first content and the first question according to the fixed format A to obtain text A, and can input the text A to the large language model A for processing to obtain an intermediate result. For example, the first device 200 can input the text A to the large language module A in batches according to the preset number of characters for processing to obtain the intermediate result. After obtaining the intermediate result, the first device 200 can take the intermediate result as the first content and cache the intermediate result. Therefore, after obtaining the first reply outline sent by the second device 420, the first device 200 can process the first question through the large language model A based on the first reply outline and the first content (which can include the intermediate result) to obtain the first target reply corresponding to the first question. That is, the first device 200 can perform reasoning on the first question through the large language model A in advance in the reasoning process of the first reply outline by the second device 420 to obtain the intermediate result, so that the large language model A can perform reasoning based on the intermediate result subsequently, so that the reasoning of the large language model A can be synchronized in the reasoning process of the large language model B, the reasoning time delay of the large language model A can be reduced, the speed of the first target reply can be improved, and the user experience can be improved.
[0280] It should be understood that the preset number of characters can be determined according to an actual scenario, and embodiments of the present application do not limit this. For example, the preset number of characters can be determined to be 10 according to an actual scenario, or the preset number of characters can be determined to be 9 according to an actual scenario, or the preset number of characters can be determined to be 8 according to an actual scenario, and the like.
[0281] In some embodiments, the pre-context A can be determined based on a guide phrase in the guide phrase library and a state in the state library. That is, the large language model A can infer the output first target reply based on the guide phrase and the state indicated by the pre-context A. That is, the guide phrase and the state included in each reply step of the first target reply can be determined according to the pre-context A.
[0282] It should be noted that the guide phrase library and the state library can be stored in the first device 200. Among them, the guide phrase library stored in the first device 200 can be the same as the guide phrase library stored in the second device 420. The state library stored in the first device 200 can be the same as the state library stored in the second device 420.
[0283] In one example, the processing module A of the first device 200 can determine all guide phrases in the guide phrase library of the first device 200 and all states in the state library as the content of the pre-context A.
[0284] In another example, the processing module A of the first device 200 can determine part of the guide phrases from the guide phrase library of the first device 200 according to the first question, and can determine part of the states from the state library of the first device 200 according to the first question. Subsequently, the processing module A of the first device 200 can determine the part of the guide phrases and the part of the states determined based on the first question as the content of the pre-context A.
[0285] For example, the first device 200 can determine the scene type to which the first question belongs according to the first question. Subsequently, the first device 200 can determine the guide phrase matched with the scene type from the guide phrase library of the first device 200 according to the scene type to which the first question belongs, and can determine the state matched with the scene type from the state library of the first device 200.
[0286] It should be noted that the scene type and the determination method of the scene type can be determined according to an actual application scenario, and embodiments of the present application do not limit this.
[0287] In another example, the processing module A of the first device 200 can determine the partial guide phrases from the guide phrase library of the first device 200 according to the first question and the first content, and can determine the partial states from the state library of the first device 200 according to the first question and the first content. Subsequently, the processing module A of the first device 200 can determine the partial guide phrases and the partial states determined based on the first question and the first content as the content of the pre-context A.
[0288] For example, the first device 200 can determine the scene type to which the first question belongs according to the first question and the first content. Subsequently, the first device 200 can determine the guide phrases matching the scene type from the guide phrase library of the first device 200 according to the scene type to which the first question belongs, and can determine the states matching the scene type from the state library of the first device 200.
[0289] In another example, after the second device 420 determines the pre-context B based on the first question, the second device 420 can transmit the guide phrases and the states included in the pre-context B to the first device 200. The first device 200 can determine the guide phrases and the states transmitted by the second device 420 as the content of the pre-context A.
[0290] For example, when the pre-context B determined by the second device 420 is "The following is the guide phrase library, <step 1, current user browsing>, <step 2, location information state>,..., <step 7, interface search record>,.... The following is the state library, <state 101, turn on location>, <state 102, brightness to 10%, <state 103, turn on Bluetooth>,...". The second device 420 can transmit the guide phrases and the states included in the pre-context B to the first device 200, i.e., can transmit the guide phrases <step 1, current user browsing>, <step 2, location information state>,..., and <step 7, interface search record>, and the states <state 101, turn on location>, <state 102, brightness to 10%, and <state 103, turn on Bluetooth> to the first device 200. The first device 200 can determine the pre-context A according to the guide phrases and the states transmitted by the second device 420, for example, can determine the pre-context A as "The following is the guide phrase library, <step 1, current user browsing>, <step 2, location information state>,..., <step 7, interface search record>,.... The following is the state library, <state 101, turn on location>, <state 102, brightness to 10%, <state 103, turn on Bluetooth>,...".
[0291] It should be noted that the pre-context A can also be empty. That is, the fixed format A can be: first content + first question + CoT guide prompt A. That is, the large language model A can directly process the first question according to the first content, the first question and the CoT guide prompt A to obtain the first target reply corresponding to the first question in the scene without the pre-context A.
[0292] The process of adjusting each reply step inferred by the large language model A based on the first reply outline by the processing module A of the first device 200 will be described in detail below.
[0293] In some embodiments, the first target reply can include one or more reply steps. Each reply step can be separated by a separator, and the end of the first target reply can be marked by an end symbol. For example, the separator can be a semicolon, and the end symbol can be a period. That is, the form of the first target reply can be “AAAA; BBBB; CCCC; ……”.
[0294] It should be noted that the separator described above is a semicolon and the end symbol is a period, which is only exemplary and should not be construed as limiting the embodiments of the present application. In the embodiments of the present application, the separator and the end symbol can be determined according to the actual scene. For example, the separator can be a colon according to the actual scene. For example, the end symbol can be an exclamation mark according to the actual scene. The following will be exemplarily explained with the separator as a semicolon and the end symbol as a period.
[0295] In the embodiments of the present application, the large language model A can infer the first target reply by the skip-word method. That is, when processing the text A by the large language model A, the large language model A can output the first target reply corresponding to the first question by the skip-word method. Wherein, the first target reply can include one or more reply steps. For each reply step, the reply step can include a guide phrase part and a detail part. The guide phrase part can include the guide phrase corresponding to the reply step. For the reply step with a state, the detail part can include the state corresponding to the reply step.
[0296] For example, a certain reply step in the first target reply can be “ABCabcde;”. Wherein, “ABC” can be the guide phrase part, and “abcde” can be the detail part. That is, “ABC” can include the guide phrase corresponding to the reply step. And when the reply step includes a state, “abcde” can include the state corresponding to the reply step.
[0297] Please refer to FIG. 6, which shows a flowchart of the question and answer processing method provided by the embodiments of the present application.
[0298] As shown in FIG. 6, when the question and answer processing is performed, the first device 200 can obtain the first question, and can send the first question to the second device 420. After the second device 420 obtains the first question, the first question can be processed by the large language model B to obtain a first reply outline corresponding to the first question, and the first reply outline (for example, the step identifier and the state identifier corresponding to each reply step) can be sent to the first device 200. The first device 200 can obtain the first content, and can infer the first target reply by reasoning the first content and the first question through the large language model A, that is, obtain each reply step.
[0299] When the large language model A infers the first target reply, the first device 200 can adjust the reply step inferred by the large language model A step by step based on the first reply outline. For example, the first device 200 can determine whether the guide phrase corresponding to the first reply step inferred by the large language model A is accurate based on the guide phrase corresponding to the first reply step in the first reply outline (or the step identifier corresponding to the guide phrase, which is exemplarily illustrated by taking the step identifier as an example in FIG. 6). When it is determined that the guide phrase corresponding to the first reply step inferred by the large language model A is inaccurate, the first device 200 can correct the guide phrase corresponding to the first reply step inferred by the large language model A based on the guide phrase indicated by the step identifier in the first reply outline. When it is determined that the guide phrase corresponding to the first reply step inferred by the large language model A is accurate, or after the guide phrase corresponding to the first reply step inferred by the large language model A is adjusted, when the first reply step further includes a state, the first device 200 can determine whether the state corresponding to the first reply step inferred by the large language model A is accurate based on the state (or the state identifier, which is exemplarily illustrated by taking the state identifier as an example in FIG. 6) corresponding to the first reply step in the first reply outline. When it is determined that the state corresponding to the first reply step inferred by the large language model A is inaccurate, the first device 200 can adjust the state corresponding to the first reply step inferred by the large language model A based on the state indicated by the state identifier in the first reply outline.
[0300] When the state of the first reply step is determined to be accurate, or after the state corresponding to the first reply step is adjusted, the first device 200 can determine whether the large language model A reasons out an end symbol (e.g., a period). When it is determined that the large language model A does not reason out the end symbol, the first device 200 can correct the guide phrase corresponding to the second reply step reasoned by the large language model A based on the guide phrase (or the step identifier corresponding to the guide phrase) corresponding to the second reply step in the first reply outline, and / or adjust the state corresponding to the second reply step reasoned by the large language model A based on the state (or the state identifier) corresponding to the second reply step in the first reply outline. When the second reply step is determined to be accurate, or after the second reply step is adjusted, the first device 200 can determine whether the large language model A reasons out the end symbol. When it is determined that the large language model A does not reason out the end symbol, the first device 200 can correct the guide phrase corresponding to the third reply step reasoned by the large language model A based on the guide phrase (or the step identifier corresponding to the guide phrase) corresponding to the third reply step in the first reply outline, and / or adjust the state corresponding to the third reply step reasoned by the large language model A based on the state (or the state identifier) corresponding to the third reply step in the first reply outline, and so on, until the large language model A reasons out the end symbol, to obtain the first target reply corresponding to the first question.
[0301] In one example, when the large language model A reasons out a certain reply step (e.g., reply step A1) in the first target reply, the first device 200 determines the reply step A1 as the first reply step reasoned by the large language model A, to determine which guide phrase (or the step identifier corresponding to the guide phrase) corresponding to which reply step in the first reply outline is used to adjust the guide phrase corresponding to the reply step A1 reasoned by the large language model A, and / or which state (or the state identifier) corresponding to which step in the first reply outline is used to adjust the state corresponding to the reply step A1 reasoned by the large language model A.
[0302] For example, when the reply step A1 is determined to be the first reply step reasoned by the large language model A, the first device 200 can adjust the guide phrase corresponding to the reply step A1 reasoned by the large language model A based on the guide phrase (or the step identifier corresponding to the guide phrase) corresponding to the first reply step in the first reply outline. And / or, the first device 200 can adjust the state corresponding to the reply step A1 reasoned by the large language model A based on the state (or the state identifier) corresponding to the first reply step in the first reply outline.
[0303] For example, when determining that the reply step A1 is the second reply step of the large language model A inference, the first device 200 can adjust the guide phrase corresponding to the reply step A1 inferred by the large language model A based on the guide phrase corresponding to the second reply step in the first reply outline (or the step identifier corresponding to the guide phrase). And / or, the first device 200 can adjust the state corresponding to the reply step A1 inferred by the large language model A based on the state corresponding to the second reply step in the first reply outline (or the state identifier corresponding to the state).
[0304] For example, when determining that the reply step A1 is the second reply step of the large language model A inference, the first device 200 can adjust the guide phrase corresponding to the reply step A1 inferred by the large language model A based on the guide phrase corresponding to the second reply step in the first reply outline (or the step identifier corresponding to the guide phrase). And / or, the first device 200 can adjust the state corresponding to the reply step A1 inferred by the large language model A based on the state corresponding to the second reply step in the first reply outline (or the state identifier corresponding to the state).
[0305] For example, when the first reply outline includes <1>, <2, 101> and <7>, the processing module A of the first device 200 can determine the guide phrase corresponding to the first reply step in the first reply outline according to the step identifier (i.e. 1) corresponding to the first reply step (i.e. <1>) by searching the guide phrase library in the first device 200. Assuming that the guide phrase associated with the step identifier 1 is "current user browsing", the processing module A of the first device 200 can determine that the guide phrase corresponding to the first reply step in the first reply outline is "current user browsing".
[0306] The processing module A of the first device 200 can determine the guide phrase corresponding to the second reply step in the first reply outline according to the step identifier (i.e. 2) corresponding to the second reply step (i.e. <2, 101>) by searching the guide phrase library in the first device 200. Assuming that the guide phrase associated with the step identifier 2 is "location information state", the processing module A of the first device 200 can determine that the guide phrase corresponding to the second reply step in the first reply outline is "location information state". In addition, the processing module A of the first device 200 can determine the state corresponding to the second reply step in the first reply outline according to the state identifier (i.e. 101) corresponding to the second reply step (i.e. <2, 101>) by searching the state library in the first device 200. Assuming that the state associated with the state identifier 101 is "turn on the location", the processing module A of the first device 200 can determine that the state corresponding to the second reply step in the first reply outline is "turn on the location".
[0307] Similarly, the processing module A of the first device 200 can find the guide phrase library in the first device 200 according to the step identifier (i.e., 7) corresponding to the third reply step (i.e., <7>), and determine the guide phrase corresponding to the third reply step. Assuming that the guide phrase associated with the step identifier 7 is "interface browsing record", the processing module A of the first device 200 can determine that the guide phrase corresponding to the third reply step in the first reply outline is "interface browsing record".
[0308] The process of adjusting the reply step by the processing module A of the first device 200 will be exemplarily described below taking the reply step A1 in the first target reply as an example.
[0309] For the reply step A1, the processing module A of the first device 200 can determine the guide phrase (which can be referred to as guide phrase A2 for example) indicated by the first reply outline according to the first reply outline (i.e., the guide phrase or step identifier included in the first reply outline). When the reply step A1 includes a state, the processing module A of the first device 200 can also determine the state (which can be referred to as state B2 for example) indicated by the first reply outline according to the first reply outline (i.e., the state or state identifier included in the first reply outline). The following will be exemplarily described taking the reply step A1 including a state as an example.
[0310] In the process of the large language model A reasoning the reply step A1 word by word, the processing module A of the first device 200 can acquire the characters reasoned by the large language model A in real time, and can determine whether the guide phrase (which can be referred to as guide phrase A1 for example) corresponding to the reply step A1 reasoned by the large language model A is accurate according to these characters and the guide phrase (i.e., guide phrase A2) indicated by the first reply outline, i.e., determine whether the guide phrase A1 is consistent with the guide phrase A2. When it is determined that the guide phrase A1 is not consistent with the guide phrase A2, it is determined that the guide phrase A1 reasoned by the large language model A is not accurate, at which time the processing module A of the first device 200 can instruct the large language model A to correct the guide phrase A1 corresponding to the reply step A1 based on the guide phrase A2, i.e., can instruct the large language model A to adjust the guide phrase A1 corresponding to the reply step A1 to the guide phrase A2. After adjusting the guide phrase corresponding to the reply step A1 to the guide phrase A2, the large language model A can continue to reason the reply step A1 based on the guide phrase A2.
[0311] During the process that the large language model A continues to infer the reply step A1 based on the guide phrase A2, the processing module A of the first device 200 can continue to obtain each character inferred by the large language model A, for example, can obtain all the characters before the split symbol (i.e., the semicolon) inferred by the large language model A, and can determine the state (for example, which can be referred to as state B1) corresponding to the reply step A1 inferred by the large language model A according to these characters. Subsequently, the processing module A of the first device 200 can determine whether the state B1 corresponding to the reply step A1 inferred by the large language model A is accurate according to the state B1 and the state B2, that is, determine whether the state B1 is consistent with the state B2. When it is determined that the state B1 is not consistent with the state B2, it can be determined that the state B1 inferred by the large language model A is not accurate, at this time, the processing module A of the first device 200 can determine that the current state of the first device 200 needs to be adjusted. For example, the processing module A of the first device 200 can output a prompt information according to the state B2, so as to prompt the user to adjust the current state of the first device 200 to the state B2 through the prompt information. After determining that the current state of the first device 200 is adjusted to the state B2, the processing module A of the first device 200 can instruct the large language model A to re-infer the detail part in the reply step A1 based on the state B2, so as to obtain the accurate reply step A1.
[0312] For example, the state is generally located in the detail part. Therefore, after obtaining all the characters corresponding to the reply step A1, the processing module A of the first device 200 can determine the characters corresponding to the detail part from all the characters, and can determine the state B1 inferred by the large language model according to the characters corresponding to the detail part. For example, the processing module A of the first device 200 can determine the characters other than the characters corresponding to the guide phrase part in all the characters as the characters corresponding to the detail part.
[0313] For example, the character representing the state is generally followed by the character such as “for” or “is”. Therefore, after obtaining all the characters corresponding to the reply step A1 or the characters corresponding to the detail part, the processing module A of the first device 200 can determine the character such as “for” or “is” from all the characters or the characters corresponding to the detail part, and can determine the character after the character such as “for” or “is” as the state B1 inferred by the large language model.
[0314] In a possible implementation, the processing module A of the first device 200 can determine whether the guide phrase A1 and the guide phrase A2 are consistent according to whether the guide phrase A1 and the guide phrase A2 are completely identical. When the guide phrase A1 and the guide phrase A2 are completely identical, the processing module A of the first device 200 can determine that the guide phrase A1 and the guide phrase A2 are consistent. When the guide phrase A1 and the guide phrase A2 are not completely identical, the processing module A of the first device 200 can determine that the guide phrase A1 and the guide phrase A2 are inconsistent. It should be understood that the guide phrase A1 and the guide phrase A2 being completely identical can mean that the length of the guide phrase A1 is the same as the length of the guide phrase A2, and each character of the guide phrase A1 is one-to-one identical to each character of the guide phrase A2.
[0315] In another possible implementation, the processing module A of the first device 200 can determine whether the guide phrase A1 and the guide phrase A2 are consistent according to whether the keywords contained in the guide phrase A1 and the keywords contained in the guide phrase A2 are the same. When the keywords contained in the guide phrase A1 and the keywords contained in the guide phrase A2 are the same, the processing module A of the first device 200 can determine that the guide phrase A1 and the guide phrase A2 are consistent. When the keywords contained in the guide phrase A1 and the keywords contained in the guide phrase A2 are not the same, the processing module A of the first device 200 can determine that the guide phrase A1 and the guide phrase A2 are inconsistent.
[0316] In an example, in the scenario of determining whether the guide phrase A1 and the guide phrase A2 are consistent according to whether the guide phrase A1 and the guide phrase A2 are completely identical, in the process that the large language model A reasons the reply step A1 word by word, the processing module A of the first device 200 can acquire the characters reasoned by the large language model A in real time, and can match the acquired characters with the guide phrase A2, that is, can match the acquired characters with the characters at the corresponding positions in the guide phrase A2, to determine whether the guide phrase A1 reasoned by the large language model A and the guide phrase A2 are consistent.
[0317] That is, when the first character is inferred by the large language model A, the processing module A of the first device 200 can obtain the first character, and can determine whether the first character is the same as the first character in the guide phrase A2. When it is determined that the first character is the same as the first character in the guide phrase A2, the processing module A of the first device 200 can obtain the second character inferred by the large language model A, and can determine whether the second character is the same as the second character in the guide phrase A2. When it is determined that the second character is the same as the second character in the guide phrase A2, the processing module A of the first device 200 can obtain the third character inferred by the large language model A, and so on, until the processing module A of the first device 200 obtains the Nth character inferred by the large language model A, and when it is determined that the Nth character is the same as the Nth character in the guide phrase A2, the processing module A of the first device 200 can determine that the guide phrase A1 inferred by the large language model A is consistent with the guide phrase A2. Wherein, N is the number of characters contained in the guide phrase A2, and N is greater than or equal to 1.
[0318] Wherein, when it is determined that the first character is not the same as the first character in the guide phrase A2, the processing module A of the first device 200 can determine that the guide phrase A1 inferred by the large language model A is inconsistent with the guide phrase A2, that is, the second character can not be obtained. Or, when it is determined that the second character is not the same as the second character in the guide phrase A2, the processing module A of the first device 200 can determine that the guide phrase A1 inferred by the large language model A is inconsistent with the guide phrase A2. Or, when it is determined that the third character is not the same as the third character in the guide phrase A2, the processing module A of the first device 200 can determine that the guide phrase A1 inferred by the large language model A is inconsistent with the guide phrase A2, and so on.
[0319] For example, in the process that the large language model A reasons the reply step A1 word by word, the processing module A of the first device 200 can obtain the first character reasoned by the large language model A. Assuming that the guide phrase A2 is "ABC", the first character reasoned by the large language model A is "A". The processing module A of the first device 200 can determine that the first character reasoned by the large language model A is the same as the first character in the guide phrase A2, and can continue to obtain the second character reasoned by the large language model A. Assuming that the second character reasoned by the large language model A is "B", the processing module A of the first device 200 can determine that the second character reasoned by the large language model A is the same as the second character in the guide phrase A2, and can continue to obtain the third character reasoned by the large language model A. Assuming that the third character reasoned by the large language model A is "C", the processing module A of the first device 200 can determine that the third character reasoned by the large language model A is the same as the third character in the guide phrase A2. Therefore, the processing module A of the first device 200 can determine that the guide phrase A1 (i.e. ABC) reasoned by the large language model A is consistent with the guide phrase A2 (i.e. ABC).
[0320] For example, in the process that the large language model A reasons the reply step A1 word by word, the processing module A of the first device 200 can obtain the first character reasoned by the large language model A. Assuming that the guide phrase A2 is "ABC", the first character reasoned by the large language model A is "D". The processing module A of the first device 200 can determine that the first character reasoned by the large language model A (i.e. D) is not the same as the first character in the guide phrase A2 (i.e. A). Therefore, the processing module A of the first device 200 can directly determine that the guide phrase A1 reasoned by the large language model A is inconsistent with the guide phrase A2.
[0321] In another example, in the scenario of determining whether the guide phrase A1 is consistent with the guide phrase A2 according to whether the guide phrase A1 is completely the same as the guide phrase A2, the processing module A of the first device 200 can determine the number of characters (assuming N) of the guide phrase A2 according to the first reply outline. In the process that the large language model A reasons the reply step A1 word by word, the processing module A of the first device 200 can obtain the first N characters reasoned by the large language model A, and can match the first N characters with the guide phrase A2. When the first N characters are completely the same as the guide phrase A2, the processing module A of the first device 200 can determine that the guide phrase A1 reasoned by the large language model A is consistent with the guide phrase A2. When the first N characters are not completely the same as the guide phrase A2, for example, there is one or more characters in the first N characters that are not the same as the characters at the corresponding positions in the guide phrase A2, the processing module A of the first device 200 can determine that the guide phrase A1 reasoned by the large language model A is inconsistent with the guide phrase A2.
[0322] For example, when the guide phrase A2 is "ABC", in the process of the large language model A reasoning the reply step Al word by word, the processing module A of the first device 200 can obtain the first three characters reasoned by the large language model A. It is assumed that the first three characters reasoned by the large language model A are "ABC". Therefore, the processing module A of the first device 200 can determine that the guide phrase Al reasoned by the large language model A (i.e., ABC) is inconsistent with the guide phrase A2 (i.e., ABC).
[0323] For example, when the guide phrase A2 is "ABC", in the process of the large language model A reasoning the reply step Al word by word, the processing module A of the first device 200 can obtain the first three characters reasoned by the large language model A. It is assumed that the first three characters reasoned by the large language model A are "DEF". Therefore, the processing module A of the first device 200 can determine that the guide phrase Al reasoned by the large language model A (i.e., DEF) is inconsistent with the guide phrase A2 (i.e., ABC).
[0324] In another example, in the scenario of determining whether the guide phrase Al is consistent with the guide phrase A2 according to whether the keywords contained in the guide phrase Al and the keywords contained in the guide phrase A2 are the same, the processing module A of the first device 200 can determine the number of characters (assuming N) of the guide phrase A2 according to the first reply outline. In the process of the large language model A reasoning the reply step Al word by word, the processing module A of the first device 200 can obtain the first M characters reasoned by the large language model A according to the number of characters of the guide phrase A2. Wherein, M can be greater than or equal to N, and the specific value of M can be determined according to the actual scene.
[0325] Subsequently, the processing module A of the first device 200 can determine whether the keywords contained in the first M characters are the same as the keywords contained in the guide phrase A2. When the keywords contained in the first M characters are the same as the keywords contained in the guide phrase A2, the processing module A of the first device 200 can determine that the guide phrase Al reasoned by the large language model A is consistent with the guide phrase A2. When the keywords contained in the first M characters are not the same as the keywords contained in the guide phrase A2, the processing module A of the first device 200 can determine that the guide phrase Al reasoned by the large language model A is inconsistent with the guide phrase A2.
[0326] It should be understood that the processing module A of the first device 200 can determine whether the state B1 is consistent with the state B2 according to whether the state B1 and the state B2 are completely the same. When the state B1 and the state B2 are completely the same, the processing module A of the first device 200 can determine that the state B1 is consistent with the state B2. When the state B1 and the state B2 are not completely the same, the processing module A of the first device 200 can determine that the state B1 is inconsistent with the state B2.
[0327] Alternatively, the processing module A of the first device 200 can determine whether the state B1 is consistent with the state B2 according to whether the keywords contained in the state B1 are the same as the keywords contained in the state B2. When the keywords contained in the state B1 are the same as the keywords contained in the state B2, the processing module A of the first device 200 can determine that the state B1 is consistent with the state B2. When the keywords contained in the state B1 are not the same as the keywords contained in the state B2, the processing module A of the first device 200 can determine that the state B1 is not consistent with the state B2.
[0328] It should be noted that the specific content of the processing module A of the first device 200 determining whether the state B1 is consistent with the state B2 can refer to the related content of the processing module A of the first device 200 determining whether the guide phrase A1 is consistent with the guide phrase A2, and for the sake of brevity, it will not be repeated here.
[0329] In a possible implementation, the first device 200 can perform inference of the large language model A through the NPU (or GPU). When the large language model A performs inference in the form of word skipping, an intermediate result (i.e., K and V variables in the inference process of the large language model A, which can be referred to as KV below) can be generated to perform inference based on the intermediate result, which can reduce the amount of calculation and improve the inference efficiency of the large language model A. Therefore, during the inference process of the large language model A through the NPU (or GPU), key-value caching (KV Cache, i.e., key cache and value cache) needs to be performed on the NPU (or GPU) to cache the intermediate result in the inference process of the large language model A, i.e., cache the KV in the inference process of the large language model A.
[0330] When it is determined that a certain reply step (e.g., reply step A1) in the first target reply is inaccurate, it can be determined that the intermediate result generated by the large language model A in performing inference of the reply step A1 is inaccurate. Therefore, when correcting the reply step A1, the intermediate result cached by the NPU (or GPU) needs to be corrected, so that the large language model A can perform small-range re-inference of the reply step A1 according to the corrected intermediate result.
[0331] For example, the large language model A can correct the intermediate result cached by the NPU (or GPU) in the form of rollback overwriting. For example, the position at which the intermediate result needs to be rolled back can be determined according to the content that needs to be corrected in the reply step A1, and the intermediate result can be regenerated from the rolled-back position in an overwriting manner.
[0332] It should be noted that the inaccuracy of the reply step A1 can be that the guiding phrase corresponding to the reply step A1 is inaccurate, or can be that the state corresponding to the reply step A1 is inaccurate. When it is determined that the guiding phrase corresponding to the reply step A1 is inaccurate, the guiding phrase corresponding to the reply step A1 can be corrected, and the intermediate result cached by the NPU (or GPU) can be corrected based on the corrected guiding phrase, so as to infer the state corresponding to the reply step A1 according to the corrected intermediate result. When it is determined that the state corresponding to the reply step A1 is inaccurate, the state corresponding to the reply step A1 can be corrected, and the intermediate result cached by the NPU (or GPU) can be corrected based on the corrected state, so as to infer the next reply step (for example, the reply step A2) according to the corrected intermediate result.
[0333] For example, please refer to FIG. 7, which shows an application scenario of intermediate result correction provided by an embodiment of the present application. The application scenario takes the guiding phrase corresponding to the reply step A1 inferred by the large language model A as "ABC", and the guiding phrase inferred by the large language model A is inconsistent with the guiding phrase (for example, DE) in the first reply outline as an example for illustrative description.
[0334] As shown in FIG. 7, when the large language model A infers the guiding phrase "ABC" corresponding to the reply step A1, the large language model A can infer and output A based on the historical KV. The large language model A can take A as the input of the next incremental inference, generate the intermediate result KV1, and can infer and output B based on the intermediate result KV1. The large language model A can take B as the input of the next incremental inference, generate the intermediate result KV2, and can infer and output C based on the intermediate result KV2, and so on.
[0335] For the reply step A1, since the guiding phrase inferred by the large language model A is not the same as the guiding phrase indicated by the first reply outline, the guiding phrase "ABC" inferred by the large language model A needs to be corrected to the guiding phrase "DE". At this time, the large language model A needs to back up part of the KV in the inference process. The large language model A can determine that the position to be backed up is KV1 according to the content to be corrected (i.e. ABC) in the reply step A1. As shown in FIG. 7, the large language model A can regenerate from KV1 in an overlaying manner. That is, the large language model A can take D as a new input to re-infer the incremental inference corresponding to KV1, generate a new intermediate result (i.e. new KV1), and can infer and output E based on the new KV1. Subsequently, the large language model A can continue to infer according to E and new KV1. For example, the large language model A can continue to infer the details of the reply step A1 and subsequent content according to E and new KV1.
[0336] In a possible implementation, when the question and answer processing is performed based on the user interaction, for each reply step of the large language model A inference, when it is needed to adjust the reply step of the large language model A inference based on the first reply outline, the first device 200 can output the reply step after determining that the content of the reply step is all accurate, that is, after determining that the guide phrase and the state corresponding to the reply step are both adjusted, that is, the reply step is displayed in the first device 200.
[0337] In another possible implementation, when the question and answer processing is performed based on the user interaction, for each reply step of the large language model A inference, when it is needed to adjust the reply step of the large language model A inference based on the first reply outline, the first device 200 can output the guide phrase corresponding to the reply step first after determining that the guide phrase corresponding to the reply step is adjusted, which can improve the user interaction experience. When the guide phrase corresponding to the reply step is output, the output of each character in the guide phrase can be performed at a certain interval time, which can achieve the effect of smoothing the response interval and improve the user experience.
[0338] In a possible implementation, after the second device 420 obtains the first reply outline corresponding to the first question, the second device 420 can save the first question and the first reply outline in association. Alternatively, the second device 420 can determine the outline identifier corresponding to the first reply outline, and can save the first question and the outline identifier corresponding to the first reply outline in association, and save the outline identifier corresponding to the first reply outline and the guide phrase indicated by the first reply outline in association. It should be understood that when the first reply outline further includes a state, the second device 420 can further save the outline identifier corresponding to the first reply outline and the state indicated by the first reply outline in association. Alternatively, the second device 420 can determine the outline identifier corresponding to the first reply outline, and can save the first question and the outline identifier corresponding to the first reply outline in association, and can save the outline identifier corresponding to the first reply outline and the step identifier corresponding to the guide phrase indicated by the first reply outline in association. It should be understood that when the first reply outline further includes a state or a state identifier, the second device 420 can further save the outline identifier corresponding to the first reply outline and the state identifier corresponding to the state indicated by the first reply outline in association. Subsequently, when a certain question (which can be referred to as a second question) sent by a certain device (for example, the first device 200) is obtained, the second device 420 can directly determine the reply outline (which can be referred to as a second reply outline) corresponding to the second question or the outline identifier (which can be referred to as an outline identifier A) corresponding to the second question according to the second question and the association relationship between the question and the reply outline, and can send the outline identifier A to the first device 200 as the reply outline corresponding to the second question.
[0339] That is, after the second device 420 infers the reply outline corresponding to a certain question by the large language model B, the second device 420 can save the reply outline in association with the question; or can determine the outline identifier corresponding to the reply outline, and can save the outline identifier in association with the question and the guiding phrases and states (or the step identifiers corresponding to the guiding phrases and the state identifiers corresponding to the states) contained in the reply outline, so that when the second device 420 performs inference on a certain question subsequently, the question corresponding to the reply outline can be determined by matching the question with the questions corresponding to each reply outline (or outline identifier), which can improve the determination speed of the reply outline.
[0340] It should be noted that the second device 420 can determine the reply outline (or outline identifier) corresponding to the second question according to the similarity between the second question and the questions associated with each reply outline (or outline identifier). For example, the second device 420 can determine the similarity between the second question and the questions associated with each outline identifier, and can determine the outline identifier associated with the question with the greatest similarity as the outline identifier A corresponding to the second question.
[0341] It should be understood that the outline identifier can be determined according to the actual scene, and the embodiments of the present application do not limit this.
[0342] In one example, in the scenario where the second device 420 saves the association between the question and the outline identifier, after the second device 420 determines the outline identifier A corresponding to the second question, the second device 420 can first determine whether the second device 420 has sent the outline identifier A and the related identifier associated with the outline identifier A to the first device 200 before. It should be understood that when the reply outline only includes the guiding phrase or the step identifier corresponding to the guiding phrase, the related identifier can include the step identifier. When the reply outline includes the guiding phrase and the state, or includes the step identifier corresponding to the guiding phrase and the state identifier, the related identifier can include the step identifier and the state identifier.
[0343] Wherein, when it is determined that the outline identifier A and the related identifier (for example, the step identifier and the state identifier) associated with the outline identifier A have been sent to the first device 200, the second device 420 can only send the outline identifier A to the first device 200. When it is determined that the outline identifier A and the related identifier (for example, the step identifier and the state identifier) associated with the outline identifier A have not been sent to the first device 200, the second device 420 can send the outline identifier A and the related identifier (for example, the step identifier and the state identifier) associated with the outline identifier A to the first device 200, so that after the first device 200 obtains the outline identifier A, the first device 200 can accurately determine the step identifier and the state identifier associated with the outline identifier A, thereby accurately determining the guide phrase and the state indicated by the outline identifier A, so that when the first device 200 inferences the target reply (which can be referred to as a second target reply) corresponding to the second question through the large language model A, the first device 200 can adjust the guide phrase corresponding to each reply step inferred by the large language model A according to the guide phrase indicated by the outline identifier A, and can adjust the state corresponding to each reply step inferred by the large language model A according to the state indicated by the outline identifier A, to accurately obtain the second target reply.
[0344] It should be noted that the specific content of the second target reply corresponding to the second question inferred by the first device 200 through the large language model A can refer to the related content of the first target reply corresponding to the first question inferred by the first device 200 through the large language model A as described above. For the sake of brevity, the details are not repeated here.
[0345] It should be understood that after the first device 200 obtains the reply outline (or the outline identifier) corresponding to a question, the first device 200 can associate and save the reply outline (or the outline identifier) with the question and the guide phrase and the state (or the step identifier corresponding to the guide phrase and the state identifier corresponding to the state) contained in the reply outline, so that when the first device 200 subsequently inferences a question, the first device 200 can directly match the question with the question corresponding to each reply outline (or the outline identifier) to determine the reply outline (or the outline identifier) corresponding to the question, thereby improving the determination speed of the reply outline, improving the inference speed, and improving the user experience.
[0346] It should be understood that the size of the serial number of each step in the above embodiments does not mean the order of execution. The execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0347] Corresponding to the question and answer processing method described in the above embodiments, the embodiments of the present application also provide a question and answer processing device. Each module of the device can correspondingly implement each step of the question and answer processing method.
[0348] It should be noted that the information interaction, execution process and the like between the above apparatuses / units are based on the same concept as the method embodiments of the present application, and specific functions and brought technical effects can be referred to the method embodiments part, which will not be repeated here.
[0349] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above-mentioned division of each functional unit and module is exemplified, and in actual application, the above-mentioned functions can be completed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or software. In addition, the specific name of each functional unit and module is only for easy distinction, and does not limit the protection scope of the present application. The specific working process of the unit and module in the system can be referred to the corresponding process in the foregoing method embodiments, which will not be repeated here.
[0350] The embodiment of the present application also provides a first device, which comprises at least one memory, at least one processor, and a computer program stored in the at least one memory and executable on the at least one processor, and when the processor executes the computer program, the first device realizes the steps performed by the first device 200 in any of the method embodiments.
[0351] The embodiment of the present application also provides a second device, which comprises at least one memory, at least one processor, and a computer program stored in the at least one memory and executable on the at least one processor, and when the processor executes the computer program, the second device realizes the steps performed by the second device 420 in any of the method embodiments.
[0352] The embodiment of the present application also provides a computer readable storage medium, which stores a computer program, and when the computer program is executed by a computer, the computer realizes the steps in any of the method embodiments.
[0353] The embodiment of the present application provides a computer program product, which, when executed on a first device, causes the first device to realize the steps performed by the first device 200 in any of the method embodiments.
[0354] The embodiment of the present application provides a computer program product, when the computer program product runs on the second device, causes the second device to implement the steps performed by the second device 420 in any of the above method embodiments.
[0355] The integrated unit, if in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the present application can implement all or part of the processes in the above embodiment methods by a computer program to instruct related hardware to complete, and the computer program can be stored in a computer readable storage medium. The computer program can implement the steps of the above method embodiments when executed by a processor. The computer program includes computer program code, which can be in the form of source code, object code, executable files or some intermediate forms. The computer readable storage medium at least includes any entity or device capable of carrying the computer program code to the device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunications signal and a software distribution medium. For example, a U disk, a mobile hard disk, a magnetic disk or an optical disk.
[0356] In the above embodiments, the description of each embodiment has its own focus, and the parts not described or recorded in detail in a certain embodiment can be referred to the related description of other embodiments.
[0357] Those skilled in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed in the present application can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0358] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules or units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the shown or discussed mutual elements can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms.
[0359] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Part or all of the units can be selected to achieve the purpose of the embodiment scheme according to actual needs.
[0360] The above embodiments are only used to illustrate the technical solutions of the present application, but not limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the technical solutions recorded in the foregoing embodiments can still be modified, or some technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. An interactive system, characterized by The interaction system comprises a first device and a second device; The first device is configured to acquire a first question and send the first question to the second device; The second device is configured to receive the first question, process the first question by using a first large language model to obtain a first reply outline corresponding to the first question, and send the first reply outline to the first device; The first device is further configured to acquire first content, and process the first question by using a second large language model based on the first content and the first reply outline to obtain a first target reply corresponding to the first question.
2. The system of claim 1, wherein, The second device stores a guide phrase library and a state library, the guide phrase library comprises a first guide phrase, and the state library comprises a first state; The second device is further configured to determine a second guide phrase from the guide phrase library according to the first question, and determine a second state from the state library according to the first question, the second guide phrase comprises one or more of the first guide phrase, and the second state comprises one or more of the first state; The second device is further configured to obtain a first input text according to the second guide phrase, the second state, the first question, and a first thinking chain guide prompt, input the first input text into the first large language model for processing, and obtain the first reply outline output by the first large language model, the first thinking chain guide prompt is used to guide the first large language model to perform reasoning on the reply outline of the first question; The first reply outline comprises a third guide phrase, or the first reply outline comprises the third guide phrase and a third state, the third guide phrase comprises one or more of the second guide phrase, and the third state comprises one or more of the second state.
3. The system of claim 1, wherein, The second device stores a guide phrase library and a state library, the guide phrase library comprises a first guide phrase and a first identifier corresponding to the first guide phrase, and the state library comprises a first state and a second identifier corresponding to the first state; The second device is further configured to determine a second guide phrase from the guide phrase library according to the first question, and determine a first identifier corresponding to the second guide phrase, determine a second state from the state library according to the first question, and determine a second identifier corresponding to the second state; The second device is further configured to obtain a second input text according to the second guide phrase and the first identifier corresponding to the second guide phrase, the second state and the second identifier corresponding to the second state, the first question, and a second thinking chain guide prompt, input the second input text into the first large language model for processing, and obtain the first reply outline output by the first large language model, the second thinking chain guide prompt is used to guide the first large language model to perform reasoning on the reply identifier of the first question; The first reply outline includes a first identifier corresponding to a third guiding phrase, or the first reply outline includes a first identifier corresponding to the third guiding phrase and a second identifier corresponding to a third state, the third guiding phrase includes one or more of the second guiding phrases, and the third state includes one or more of the second states.
4. The system of claim 2 or 3, wherein, The first device is further configured to obtain the second guiding phrase and the second state, obtain a third input text according to the second guiding phrase, the second state, the first content, the first question, and a third thinking chain guiding prompt, and process the third input text by the second large language model based on the first reply outline to obtain the first target reply corresponding to the first question, the third thinking chain guiding prompt being used to guide the second large language model to perform detailed reasoning for the first question.
5. The system of any one of claims 1 to 3, wherein, The first device is further configured to obtain a fourth input text according to the first content, the first question, and a third thinking chain guiding prompt, and process the fourth input text by the second large language model based on the first reply outline to obtain the first target reply corresponding to the first question, the third thinking chain guiding prompt being used to guide the second large language model to perform detailed reasoning for the first question.
6. The system of any one of claims 1 to 3, wherein, The first device stores a guiding phrase library and a state library, the guiding phrase library includes a first guiding phrase, and the state library includes a first state; The first device is further configured to determine a fourth guiding phrase from the guiding phrase library according to the first question and / or the first content, and determine a fourth state from the state library according to the first question and / or the first content, the fourth guiding phrase including one or more of the first guiding phrases, and the fourth state including one or more of the first states; The first device is further configured to obtain a fifth input text according to the fourth guiding phrase, the fourth state, the first content, the first question, and a third thinking chain guiding prompt, and process the fifth input text by the second large language model based on the first reply outline to obtain the first target reply corresponding to the first question, the third thinking chain guiding prompt being used to guide the second large language model to perform detailed reasoning for the first question.
7. The system of any one of claims 1 to 6, wherein, The first reply outline includes one or more third guiding phrases or a first identifier corresponding to each of the third guiding phrases; The first device is further configured to obtain a fifth guiding phrase corresponding to a first reply step of the first target reply output by the second large language model when processing the first question by the second large language model, the first reply step being one of the first target replies; The first device is further configured to, for the first reply step, determine a sixth guiding phrase corresponding to the first reply step according to the first reply outline, the sixth guiding phrase being one of the third guiding phrases. The first device is further configured to, when determining that the fifth guiding phrase corresponding to the first reply step does not satisfy the first preset condition with the sixth guiding phrase, adjust the fifth guiding phrase corresponding to the first reply step according to the sixth guiding phrase, and adjust the first reply step according to the adjusted fifth guiding phrase through the second large language model.
8. The system of claim 7, wherein, The first device is further configured to, after adjusting the fifth guiding phrase corresponding to the first reply step according to the sixth guiding phrase through the second large language model, output the adjusted fifth guiding phrase.
9. The system of any one of claims 1 to 8, wherein, The first reply outline includes one or more third states or second identifiers corresponding to the third states; The first device is further configured to, when processing the first question through the second large language model, acquire a fifth state corresponding to a first reply step output by the second large language model, wherein the first reply step is one of the first target replies; The first device is further configured to, for the first reply step, determine a sixth state corresponding to the first reply step according to the first reply outline, wherein the sixth state is one of the third states. The first device is further configured to, when determining that the fifth state corresponding to the first reply step does not satisfy a second preset condition with the sixth state, adjust the current state of the first device according to the sixth state, and when determining that the current state of the first device is adjusted to the sixth state, adjust the first reply step according to the sixth state through the second large language model.
10. The system of any one of claims 1 to 9, wherein, The first device is further configured to, after acquiring the first question, determine whether the first question contains sensitive content, and when determining that the first question contains sensitive content, perform desensitization processing on the sensitive content and send the desensitized first question to the second device.
11. The system of any one of claims 1 to 10, wherein, The first reply outline includes a first identifier corresponding to a third guiding phrase, or includes the first identifier corresponding to the third guiding phrase and a second identifier corresponding to a third state; The second device is further configured to determine a first outline identifier corresponding to the first reply outline, save the first question and the first outline identifier in association, and associate the first outline identifier with the first identifier corresponding to the third guiding phrase, or associate the first outline identifier with the first identifier corresponding to the third guiding phrase and the second identifier corresponding to the third state.
12. The system of claim 11, wherein, The first device is further configured to acquire a second question and send the second question to the second device. The second device is further configured to, according to the second question and the first question associated with the first question, determine a second outline identifier corresponding to the second question, take the second outline identifier as a second reply outline corresponding to the second question, and send the second reply outline to the first device, wherein the second outline identifier is one of the first outline identifiers. The first device is further configured to obtain second content, and process the second question based on the second content and the second reply outline to obtain a second target reply corresponding to the second question by using a second large language model.
13. The system of claim 12, wherein, The second device is further configured to determine whether the second outline identifier and the first identifier associated with the second outline identifier have been sent to the first device, or determine whether the second outline identifier, the first identifier associated with the second outline identifier and the second identifier have been sent to the first device after determining the second outline identifier corresponding to the second question. The second device is further configured to send the second outline identifier and the first identifier associated with the second outline identifier to the first device when it is determined that the second outline identifier and the first identifier associated with the second outline identifier have not been sent to the first device. The second device is further configured to send the second outline identifier and the first identifier and the second identifier associated with the second outline identifier to the first device when it is determined that the second outline identifier and the first identifier and the second identifier associated with the second outline identifier have not been sent to the first device.
14. The system of claim 12 or 13, wherein, The first device is further configured to determine a third guide phrase corresponding to the second reply outline according to the second outline identifier. The first device is further configured to obtain a seventh guide phrase corresponding to a second reply step when processing the second question by using the second large language model, and adjust the seventh guide phrase corresponding to the second reply step according to the third guide phrase corresponding to the second reply outline, wherein the second reply step is one of the second target reply. The first device is further configured to determine a third guide phrase and a third state corresponding to the second reply outline according to the second outline identifier. The first device is further configured to obtain a seventh guide phrase corresponding to a second reply step when processing the second question by using the second large language model, and adjust the guide phrase corresponding to the second reply step according to the third guide phrase corresponding to the second reply outline. The first device is further configured to obtain a seventh state corresponding to a second reply step when processing the second question by using the second large language model, and adjust the seventh state corresponding to the second reply step according to the third state corresponding to the second reply outline.
15. A question and answer processing method characterized by, The method applied to a first device comprises: obtaining a first question and sending the first question to a second device; obtaining a first reply outline sent by the second device, wherein the first reply outline is obtained by processing the first question by using a first large language model by the second device; obtaining first content; processing the first question based on the first content and the first reply outline by using a second large language model to obtain a first target reply corresponding to the first question.
16. The method of claim 15, wherein, The first question is processed by a second large language model based on the first content and the first reply outline to obtain a first target reply corresponding to the first question, including: determining a second guide phrase and a second state, the second guide phrase being a guide phrase determined by the second device from a guide phrase library of the second device according to the first question, and the second state being a state determined by the second device from a state library of the second device according to the first question; obtaining a third input text according to the second guide phrase, the second state, the first content, the first question, and a third thinking chain guide prompt, the third thinking chain guide prompt being used to guide the second large language model to perform detailed reply reasoning on the first question; processing the third input text by the second large language model based on the first reply outline to obtain the first target reply corresponding to the first question.
17. The method of claim 15, wherein, The first question is processed by a second large language model based on the first content and the first reply outline to obtain a first target reply corresponding to the first question, including: obtaining a fourth input text according to the first content, the first question, and a third thinking chain guide prompt, the third thinking chain guide prompt being used to guide the second large language model to perform detailed reply reasoning on the first question; processing the fourth input text by the second large language model based on the first reply outline to obtain the first target reply corresponding to the first question.
18. The method of any one of claims 15-17, wherein, The first device stores a guide phrase library and a state library, the guide phrase library includes a first guide phrase, and the state library includes a first state; The first question is processed by a second large language model based on the first content and the first reply outline to obtain a first target reply corresponding to the first question, including: determining a fourth guide phrase from the guide phrase library according to the first question and / or the first content, and determining a fourth state from the state library according to the first question and / or the first content, the fourth guide phrase including one or more of the first guide phrase, and the fourth state including one or more of the first state; obtaining a fifth input text according to the fourth guide phrase, the fourth state, the first content, the first question, and a third thinking chain guide prompt, the third thinking chain guide prompt being used to guide the second large language model to perform detailed reply reasoning on the first question; processing the fifth input text by the second large language model based on the first reply outline to obtain the first target reply corresponding to the first question.
19. The method according to any one of claims 15 to 18, characterized in that, The first reply outline includes one or more third guide phrases or a first identifier corresponding to each of the third guide phrases; The first question is processed by a second large language model based on the first content and the first reply outline to obtain a first target reply corresponding to the first question, including: In the processing of the first question by the second large language model, a fifth guide phrase corresponding to a first reply step of the first question is obtained; the first reply step is one of the first target replies; According to the first reply outline, a sixth guide phrase corresponding to the first reply step is determined, and the sixth guide phrase is one of the third guide phrases; When it is determined that the fifth guide phrase corresponding to the first reply step and the sixth guide phrase do not satisfy a first preset condition, the fifth guide phrase corresponding to the first reply step is adjusted by the second large language model according to the sixth guide phrase, and the first reply step is adjusted according to the adjusted fifth guide phrase.
20. The method of claim 19, wherein, The method further comprises: After the fifth guide phrase corresponding to the first reply step is adjusted by the second large language model according to the sixth guide phrase, the adjusted fifth guide phrase is output.
21. The method of any one of claims 15-20, wherein, The first reply outline comprises one or more third states or second identifiers corresponding to the third states; The processing of the first question by the second large language model based on the first content and the first reply outline to obtain the first target reply corresponding to the first question comprises: In the processing of the first question by the second large language model, a fifth state corresponding to a first reply step of the first question is obtained; the first reply step is one of the first target replies; According to the first reply outline, a sixth state corresponding to the first reply step is determined, and the sixth state is one of the third states; When it is determined that the fifth state corresponding to the first reply step and the sixth state do not satisfy a second preset condition, the current state of the first device is adjusted according to the sixth state; When it is determined that the current state of the first device is adjusted to the sixth state, the first reply step is adjusted by the second large language model according to the sixth state.
22. The method of any one of claims 15-21, wherein, The sending of the first question to the second device comprises: Determining whether the first question contains sensitive content; When it is determined that the first question contains sensitive content, the sensitive content is desensitized, and the desensitized first question is sent to the second device.
23. The method of any one of claims 15-22, wherein, The method further comprises: A second question is obtained, and the second question is sent to the second device; A second reply outline returned by the second device is obtained, the second reply outline comprises a second outline identifier, the second outline identifier is determined by the second device according to the second question and a first question corresponding to a first outline identifier, the first outline identifier is an outline identifier corresponding to the first reply outline, and the first outline identifier is associated with a first identifier corresponding to a third guide phrase included in the first reply outline or associated with a first identifier corresponding to the third guide phrase and a second identifier corresponding to a third state included in the first reply outline; Second content is obtained; Based on the second content and the second reply outline, the second question is processed by a second large language model to obtain a second target reply corresponding to the second question.
24. The method of claim 23, wherein, The processing of the second question by the second large language model based on the second content and the second reply outline to obtain the second target reply corresponding to the second question comprises: According to the second outline identifier corresponding to the second reply outline, a third guiding phrase and a third state corresponding to the second reply outline are determined; When the second question is processed by the second large language model, a seventh guiding phrase corresponding to a second reply step output by the second large language model is obtained; wherein the second reply step is one of the second target reply steps; According to the third guiding phrase corresponding to the second reply outline, the seventh guiding phrase corresponding to the second reply step is adjusted; When the second question is processed by the second large language model, a seventh state corresponding to a second reply step output by the second large language model is obtained; According to the third state corresponding to the second reply outline, the seventh state corresponding to the second reply step is adjusted.
25. A question and answer processing method characterized by, The method applied to the second device comprises: Obtaining a first question sent by a first device; Processing the first question by a first large language model to obtain a first reply outline corresponding to the first question, and sending the first reply outline to the first device, the first reply outline being used for adjusting a reply step output by a second large language model when the second large language model processes the first question, to obtain a first target reply corresponding to the first question.
26. The method of claim 25, wherein, The first device stores a guiding phrase library and a state library, the guiding phrase library comprising a first guiding phrase, and the state library comprising a first state; The processing of the first question by the first large language model to obtain the first reply outline corresponding to the first question comprises: According to the first question, a second guiding phrase is determined from the guiding phrase library, and a second state is determined from the state library, the second guiding phrase comprising one or more of the first guiding phrase, and the second state comprising one or more of the first state; According to the second guiding phrase, the second state, the first question, and a first thought chain guiding prompt, a first input text is obtained, the first thought chain guiding prompt being used to guide the first large language model to infer a reply outline for the first question; The first input text is input into the first large language model for processing to obtain the first reply outline output by the first large language model; The first reply outline comprises a third guiding phrase, or the first reply outline comprises the third guiding phrase and a third state, the third guiding phrase comprising one or more of the second guiding phrase, and the third state comprising one or more of the second state.
27. The method of claim 25, wherein, The second device stores a guide phrase library and a state library, the guide phrase library includes a first guide phrase and a first identifier corresponding to the first guide phrase, and the state library includes a first state and a second identifier corresponding to the first state; The first problem is processed by the first large language model to obtain a first reply outline corresponding to the first problem, which includes: A second guide phrase is determined from the guide phrase library according to the first question, and a first identifier corresponding to the second guide phrase is determined; the second guide phrase includes one or more of the first guide phrase; A second state is determined from the state library according to the first question, and a second identifier corresponding to the second state is determined; the second state includes one or more of the first state; A second input text is obtained according to the second guide phrase and the first identifier corresponding to the second guide phrase, the second state and the second identifier corresponding to the second state, the first question, and a second thinking chain guide prompt for guiding the first large language model to infer the reply identifier of the first question; The second input text is input into the first large language model for processing to obtain the first reply outline output by the first large language model, and the first reply outline includes a first identifier corresponding to a third guide phrase, or the first reply outline includes a first identifier corresponding to the third guide phrase and a second identifier corresponding to a third state.
28. The method of any one of claims 25-27, wherein, The first reply outline includes a first identifier corresponding to a third guide phrase, or includes a first identifier corresponding to the third guide phrase and a second identifier corresponding to a third state. After the first question is processed by the first large language model to obtain the first reply outline corresponding to the first question, the method further includes: A first outline identifier corresponding to the first reply outline is determined, the first question and the first outline identifier are associated and saved, and the first outline identifier is associated with the first identifier corresponding to the third guide phrase, or the first outline identifier is associated with the first identifier corresponding to the third guide phrase and the second identifier corresponding to the third state.
29. The method of claim 28, wherein, The method further includes: Obtaining a second question sent by the second device; According to the second question and the first question associated with the first outline identifier, a second outline identifier corresponding to the second question is determined, the second outline identifier is taken as a second reply outline corresponding to the second question, and the second reply outline is sent to the first device, and the second outline identifier is one of the first outline identifier.
30. The method of claim 29, wherein, The second reply outline is sent to the first device, which includes: After determining the second outline identifier corresponding to the second question, it is determined whether the second outline identifier and the first identifier associated with the second outline identifier have been sent to the first device, or it is determined whether the second outline identifier and the first identifier and the second identifier associated with the second outline identifier have been sent to the first device; sending the second reply outline to the first device upon determining that the second outline identifier and the first identifier associated with the second outline identifier have been sent to the first device, or upon determining that the second outline identifier, the first identifier associated with the second outline identifier, and the second identifier have been sent to the first device.
31. The method of claim 30, wherein, The method further comprises: sending the second outline identifier and the first identifier associated with the second outline identifier to the first device upon determining that the second outline identifier and the first identifier associated with the second outline identifier have not been sent to the first device; or, sending the second outline identifier, the first identifier associated with the second outline identifier, and the second identifier to the first device upon determining that the second outline identifier, the first identifier associated with the second outline identifier, and the second identifier have not been sent to the first device.
32. A first device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein, The processor, when executing the computer program, causes the first device to implement the question and answer processing method according to any one of claims 15 to 24.
33. A second device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein, The processor, when executing the computer program, causes the second device to implement the question and answer processing method according to any one of claims 25 to 31.
34. A computer-readable storage medium, the computer-readable storage medium storing a computer program, characterized in that, The computer program, when executed by a computer, causes the computer to implement the question and answer processing method according to any one of claims 15 to 24, or implement the question and answer processing method according to any one of claims 25 to 31.
Citation Information
Patent Citations
Task processing method and device based on large language model and electronic equipment
CN117131540A
Method for generating smart home control scene based on large language model
CN117687314A
Privacy protection proxy method for third-party large language model
CN117725610A
Question and answer optimization method and device, equipment, storage medium and product
CN118052288A
Methods and systems for dynamically generating content and providing access to the generated content during display of a first video
US20240146563A1