Prompt word determination method and device based on large model, equipment and medium

By identifying and filtering the prompt words in the large language model, the problem of ambiguity and ambiguity of manual design prompt words is solved, and the output accuracy of the large language model and the applicability of the prompt words are improved.

CN119830901APending Publication Date: 2025-04-15BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202411887810.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

Artificially designed prompt words may have semantic ambiguity, fuzzy expression, insufficient task matching, and poor cross-domain adaptability in large language models, resulting in the generation results deviating from the expected goals.

Method used

By inputting the first prompt word into a large language model, intent recognition is performed, prompt words are output when the intent recognition result is correct, prompt words are selected with clear intention expressions, and ambiguity is reduced.

Benefits of technology

It improves the accuracy of the processing results output by large language models, reduces computing resource consumption, improves development efficiency, and enhances the cross-scene applicability of prompt words.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119830901A_ABST
    Figure CN119830901A_ABST
Patent Text Reader

Abstract

The invention provides a cue word determination method and device based on a large model, equipment and a medium, and relates to the field of data processing, in particular to the technical fields of cloud computing, artificial intelligence, intelligent search, big data, large models and the like. According to the specific implementation scheme, a first cue word is obtained; inputting the first cue word into the large language model to obtain an intention recognition result of the first cue word; and outputting the first cue word as a second cue word in response to the correctness of the intention recognition result. By applying the technical scheme provided by the embodiment of the invention, the cue word can be determined according to the intention recognition result obtained by performing intention recognition on the cue word through the large language model, and the accuracy of the cue word is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing technology, and in particular to technical fields such as cloud computing, artificial intelligence, intelligent search, big data, and big models. Background Art

[0002] Prompt words play a vital role in the Large Language Model (LLM). As the input of the LLM, their quality directly affects the response effect of the LLM and the success rate of engineering applications. Summary of the invention

[0003] The present disclosure provides a method, device, equipment and medium for determining a prompt word based on a large model.

[0004] According to one aspect of the present disclosure, a method for determining a prompt word based on a large model is provided, comprising:

[0005] Get the first prompt word;

[0006] Inputting the first prompt word into a large language model to obtain an intent recognition result of the first prompt word;

[0007] In response to the intention recognition result being correct, the first prompt word is output as the second prompt word.

[0008] According to a second aspect of the present disclosure, there is provided a prompt word determination device, comprising:

[0009] An acquisition module, used for acquiring a first prompt word;

[0010] A first input module, used for inputting the first prompt word into a large language model to obtain an intention recognition result of the first prompt word;

[0011] The first output module is used to output the first prompt word as the second prompt word in response to the intention recognition result being correct.

[0012] According to a third aspect of the present disclosure, there is provided an electronic device, including:

[0013] at least one processor; and

[0014] a memory communicatively connected to the at least one processor; wherein,

[0015] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method provided by the first aspect.

[0016] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the method provided according to the first aspect.

[0017] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method provided according to the first aspect.

[0018] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0020] Figure 1 This is a first schematic diagram of a method for determining a prompt word based on a large model provided in an embodiment of the present disclosure;

[0021] Figure 2 is a second schematic diagram of a method for determining a prompt word based on a large model provided in an embodiment of the present disclosure;

[0022] Figure 3 is a third schematic diagram of the method for determining prompt words based on a large model provided in an embodiment of the present disclosure;

[0023] Figure 4 is a fourth schematic diagram of a method for determining prompt words based on a large model provided in an embodiment of the present disclosure;

[0024] Figure 5 is a fifth schematic diagram of the method for determining prompt words based on a large model provided in an embodiment of the present disclosure;

[0025] Figure 6 is a sixth schematic diagram of a method for determining a prompt word based on a large model provided in an embodiment of the present disclosure;

[0026] Figure 7 It is a schematic diagram of a method for determining and optimizing prompt words based on a large model provided in an embodiment of the present disclosure;

[0027] Figure 8 is a schematic diagram of a prompt word determination device based on a large model provided in an embodiment of the present disclosure;

[0028] Fig. 9 is a schematic diagram of an electronic device provided by an embodiment of the present disclosure;

[0029] Fig.10It is a schematic block diagram of an electronic device used to implement the method for determining prompt words based on a large model according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0030] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0031] Prompt words play a vital role in large language models. As the input of large language models, the quality of prompt words directly affects the response effect of large language models and the success rate of engineering applications. By carefully designing efficient prompt words, users can clearly define task goals and guide large language models to generate highly relevant, coherent and accurate outputs.

[0032] In practical applications, high-quality prompt words can not only significantly improve the performance of large language models, but also reduce the consumption of computing resources and improve development efficiency. However, due to the differences between human thinking logic and the language generation mechanism of large language models, manually designed prompt words may have the following problems.

[0033] 1. Semantic ambiguity and vague expression: Artificially designed prompt words may be ambiguous, semantically vague, or imprecise in expression, causing the results generated by the large language model to deviate from the expected goals.

[0034] 2. Insufficient task matching: The prompt words may not fully and accurately describe the target task or scenario, resulting in the lack of pertinence and relevance of the generated results.

[0035] 3. Cross-domain adaptability: Different application scenarios have significantly different requirements for prompt words, and traditional methods are difficult to fully meet diverse needs.

[0036] The problem of the above-mentioned manually designed prompt words limits the actual performance of the large language model. To solve this problem, the embodiment of the present disclosure provides a method for determining prompt words based on a large model, such as Figure 1 As shown, the method comprises the following steps:

[0037] Step S101, obtaining a first prompt word;

[0038] Step S102, inputting the first prompt word into the large language model to obtain the intention recognition result of the first prompt word;

[0039] Step S103: In response to the intention recognition result being correct, the first prompt word is output as the second prompt word.

[0040] In the technical solution provided by the embodiment of the present disclosure, the large language model is used to perform intent recognition on the first prompt word to be determined, and the second prompt word is determined and output according to the intent recognition result of the large language model on the first prompt word. When the intent recognition result is correct, it means that the large language model can correctly understand the current first prompt word, the current first prompt word has a clear intent expression, and it is determined that the current first prompt word can be output as the second prompt word.

[0041] In the disclosed embodiment, the intent of prompt words is recognized through a large language model to implement screening of prompt words, and only prompt words with correct intent recognition results are output, thereby reducing the possibility that the output prompt words have problems such as ambiguity, semantic ambiguity, or imprecise expression, thereby improving the accuracy of the processing results of the large language model based on the output prompt words.

[0042] For ease of understanding, the following description is given using an electronic device as the execution subject, which is not intended to be limiting.

[0043] In step S101, the first prompt word is any prompt word (prompt) to be determined by the electronic device. The first prompt word may include the task to be processed and the relevant information required to process the task. The first prompt word may specifically include at least one of the following contents: role setting of the large language model, task background, task content, preset requirements and output format.

[0044] The role setting of the large language model can be the role information played by the large language model in the task, indicating the perspective and method of the large language model to process the input data. For example, the role setting can be "You are an xxx", "As an xxx", etc. The role setting helps the large language model to select the appropriate reasoning method and tone style, improves the accuracy of the large language model in processing tasks, and further improves the relevance of the processing results and the input content.

[0045] The task background may be task-related background information and source information of input data. The task background may include background introduction and status introduction of the task execution subject, as well as source introduction of input data. For example, the task background may be "Please analyze the sales of xxx product of xxx company based on the provided data", "The data includes sales volume, sales quantity and related user evaluation in xx year", etc. The task background facilitates the large language model to understand the contextual information and related information of the task, and helps the large language model to accurately associate input data with task objectives, reducing the probability of obtaining irrelevant or inappropriate processing results.

[0046] The task content can be the main content of the task that the large language model needs to process, indicating the task goal that the large language model needs to complete. The task content can include the purpose of the task, the specific steps of task processing, etc. For example, the task content can be "Please follow the following steps to analyze the data: 1. Clean the data; 2. Convert the data; 3. Use statistical methods or machine learning algorithms to analyze the data; 4. Output the analysis results" etc. The task content helps the large language model understand the task, process the task, and obtain the processing results that are close to user needs, reducing misunderstandings and deviations.

[0047] Preset requirements can be precautions that need to be avoided in the task and requirements that need to be emphasized. For example, a preset requirement can be "verify the analysis results to ensure the correctness of the results". Preset requirements can be used to obtain processing results that meet user requirements and avoid processing results that do not meet user requirements. Preset requirements can also be sorted by priority, so that the large language model can give priority to high-priority preset requirements when processing tasks, helping the large language model focus on the most important constraints or key points, and the processing results obtained are closer to user requirements.

[0048] The output format can be the output form and style requirements of the processing results. The output form can include tables, lists, text, pictures, etc. The style requirements can include simplicity, richness, and brisk tone, etc. For example, the output format can be "Please output the analysis results concisely in a table format." The output format can ensure that the structure of the obtained processing results is clear, meets user requirements, is easy for users to view, and improves the usability of the obtained processing results.

[0049] The technical solution provided by the disclosed embodiment defines the core content of the first prompt word and provides a systematic framework for the prompt word design in multiple scenarios. By designing a first prompt word with a clear structure, clear logic, comprehensive relevant information, and clear content, the time and resources required for subsequent prompt word optimization are significantly reduced, the efficiency and cross-scenario applicability of the prompt word project are improved, and the performance of the large language model is improved, the efficiency of obtaining processing results that are closer to user needs is improved, and the accuracy of the processing results is improved.

[0050] In the embodiment of the present disclosure, the first prompt word can be a manually designed prompt word, or a prompt word generated by other prompt word generating devices, which is not limited. According to the different sources of the first prompt word, the process of the electronic device obtaining the first prompt word can be divided into the following two cases.

[0051] Case 1: The first prompt word is a manually designed prompt word.

[0052] In case 1, the electronic device can interact with the user to obtain the first prompt word to screen and determine the manually designed prompt words.

[0053] In one example, a dialog box for interacting with the user may be displayed on the electronic device, and the electronic device may directly interact with the user to obtain a first prompt word.

[0054] The electronic device may receive a prompt word input by the user in the displayed dialog box as the first prompt word.

[0055] In another example, a dialog box for interacting with the user may be displayed on a preset terminal, and the electronic device may interact with the user using the preset terminal to obtain the first prompt word.

[0056] The preset terminal can receive the prompt word input by the user in the displayed dialog box, and send the prompt word input by the user to the electronic device, and the electronic device can receive the prompt word sent by the preset terminal as the first prompt word. The preset terminal can be a user terminal, etc., which is not limited.

[0057] Taking the preset terminal as a user terminal as an example, the user can enter "Please answer the following question..." in the dialog box displayed by the user terminal. The content entered by the user is the prompt word. The user terminal can receive the content entered by the user and send it to the electronic device. The electronic device receives the content entered by the user and obtains the first prompt word "Please answer the following question...". When the electronic device interacts with the user subsequently, any of the above two methods can be used to achieve interaction, and the method of interaction between the electronic device and the user is not limited here.

[0058] Case 2: the first prompt word is a prompt word generated by other prompt word generating devices.

[0059] In case 2, other prompt word generating devices may generate relevant prompt words in advance and send the generated prompt words to the electronic device, and the electronic device may receive the prompt words sent by other prompt word generating devices as the first prompt words to screen and determine the prompt words generated by other prompt word generating devices. The manner in which the electronic device obtains the first prompt word is not limited herein.

[0060] In step S102, the large language model can be any large language model that has been pre-trained and is used to identify intent. For ease of description, the large language model used to identify intent will be referred to as the large language model. The intent recognition result is the intent of the first prompt word recognized by the large language model.

[0061] The electronic device can input the first prompt word into the large language model, and the large language model analyzes the input first prompt word, identifies the intention of the first prompt word, and outputs the intention recognition result to the electronic device.

[0062] For example, the first prompt word may be "Please analyze the customer's purchasing habits based on the data provided", and the intent recognition result output by the large language model may be "A data processing task needs to be performed to analyze the data and customer purchasing behavior, and output a report or visual chart to display the analysis results". The first prompt word and the intent recognition result are not limited here.

[0063] The electronic device may also input the first prompt word and the content indicating the recognition intention into the large language model, and the large language model may perform the intent recognition on the first prompt word according to the content, and then the large language model may accurately output the intent recognition result. For example, the content indicating the recognition intention may be "please give the intention of the prompt word", etc., which is not limited to this.

[0064] The electronic device can input the first prompt word and the content indicating the recognition intention into the large language model together, or can input the first prompt word first and then the content indicating the recognition intention, or can input the content indicating the recognition intention first and then the first prompt word. There is no limitation on this.

[0065] In the disclosed embodiment, after obtaining the intention recognition result, the electronic device can interact with the user and display the intention recognition result to the user.

[0066] In the disclosed embodiment, after obtaining the intention recognition result, the electronic device can obtain a first judgment result indicating whether the intention recognition result is correct. The first judgment result can be information indicating that the intention recognition result is correct, such as "the current intention recognition result is correct", etc.; the first judgment result can also be information indicating that the intention recognition result is incorrect, such as "the current intention recognition result is incorrect", etc. For the convenience of description, the information indicating that the intention recognition result is incorrect will be referred to as the first information below.

[0067] In the embodiment of the present disclosure, the electronic device can obtain the first judgment result in the following two ways.

[0068] In mode a1, the electronic device can interact with the user and obtain the content of the user's feedback as the first judgment result.

[0069] After obtaining the intent recognition result, the electronic device can display the intent recognition result to the user, and the user can judge whether the intent recognition result is correct based on the intent recognition result, that is, judge whether the large language model correctly understands the first prompt word.

[0070] The user can enter content in the dialog box to indicate whether the intent recognition result is correct. The electronic device can receive the content entered by the user in the dialog box as a first judgment result, and analyze the first judgment result to determine that the intent recognition result is correct and the large language model correctly understands the first prompt word, or determine that the intent recognition result is incorrect and the large language model incorrectly understands the first prompt word.

[0071] In the disclosed embodiment, the electronic device may also display a first prompt word to the user, and the user may determine whether the intention recognition result is correct based on the intention recognition result and the first prompt word to ensure the accuracy of the first judgment result.

[0072] The electronic device can also interact with the user using a preset terminal such as a user terminal, display the intention recognition result to the user, and receive user feedback through a displayed dialog box to obtain a first judgment result, which is similar to the above process and will not be repeated here.

[0073] In method a2, the electronic device determines by itself whether the intention recognition result is correct and obtains a first judgment result.

[0074] After obtaining the intention recognition result, the electronic device can obtain information indicating the correct intention of the first prompt word. For the convenience of description, this information is referred to as the third information.

[0075] The electronic device can analyze the third information and the intent recognition result, calculate the similarity between the third information and the intent recognition result, and determine whether the similarity is higher than a preset similarity threshold to determine whether the intent recognition result is correct and whether the large language model correctly understands the first prompt word.

[0076] When the similarity is higher than the similarity threshold, the electronic device can determine that the intention recognition result is correct and the large language model correctly understands the first prompt word; when the similarity is lower than the preset similarity threshold, it is determined that the intention recognition result is wrong and the large language model incorrectly understands the first prompt.

[0077] In the disclosed embodiment, the electronic device can interact with the user, receive the correct intention of the first prompt word entered by the user in the dialog box, and obtain the third information. The electronic device can also use other devices to perform keyword analysis on the first prompt word, determine the correct intention of the first prompt word, and receive the correct intention sent by other devices to obtain the third information indicating the correct intention. The way in which the electronic device obtains the third information is not limited here.

[0078] When it is determined that the intention recognition result is correct, the electronic device may execute step S103 in response to the intention recognition result being correct.

[0079] In step S103, the second prompt word is a prompt word determined by the electronic device and can be output. After determining that the intention recognition result is correct, the electronic device determines that the current first prompt word can be output and uses the current first prompt word as the second prompt word.

[0080] In the embodiment of the present disclosure, the electronic device can interact with the user and display the output second prompt word to the user.

[0081] In some embodiments, when it is determined that the intention recognition result is wrong, the electronic device can optimize the current first prompt word using the large language model in response to the intention recognition result error, such as Figure 2 As shown, the above-mentioned method for determining prompt words based on a large model may include the following steps:

[0082] Step S201, obtaining a first prompt word; Step S201 is the same as the above step S101.

[0083] Step S202, input the first prompt word into the large language model to obtain the intention recognition result of the first prompt word; step S202 is the same as the above step S102.

[0084] Step S203, in response to the intention recognition result being correct, outputting the first prompt word as the second prompt word; step S203 is the same as the above step S103.

[0085] Step S204: In response to an error in the intent recognition result, the first prompt word is optimized using a large language model to obtain a third prompt word.

[0086] Step S205: update the first prompt word to the third prompt word, and return to execute step S202.

[0087] The large language model in step S204 can be any large language model that is pre-trained and used to optimize the first prompt word. In the embodiment of the present disclosure, the large language model used to identify the intent and the large language model used to optimize the first prompt word can be the same large language model or different large language models. The third prompt word is the prompt word optimized in the intent recognition stage.

[0088] In one example, the large language model used to identify the intent and the large language model used to optimize the first prompt word can be the same large language model. That is, the electronic device can input the first prompt word into a large language model to obtain the intent recognition result of the first prompt word. After determining that the intent recognition result is wrong, the electronic device determines that the current first prompt word needs to be optimized, and then the current first prompt word can be input into the same large language model, and the large language model optimizes the input first prompt word, and outputs the optimized prompt word to the electronic device to obtain the third prompt word.

[0089] In another example, the large language model used to identify the intent and the large language model used to optimize the first prompt word can be different large language models. That is, the electronic device can input the first prompt word into the first large language model to obtain the intent recognition result of the first prompt word, and when the intent recognition result is wrong, the electronic device determines that the current first prompt word needs to be optimized, and then the current first prompt word can be input into the second large language model, and the second large language model optimizes the input first prompt word, and outputs the optimized prompt word to the electronic device to obtain the third prompt word.

[0090] For ease of description, the following description will take the example that the big language model used for identifying intent and the big language model used for optimizing the first prompt word are the same big language model, and will be referred to as the big language model for short.

[0091] In the disclosed embodiment, the electronic device may also input indication information indicating the optimization prompt word into the large language model. The large language model may analyze the input indication information and optimize the first prompt word.

[0092] In the disclosed embodiment, the electronic device may only input the instruction information into the large language model to instruct the large language model to optimize the first prompt word. The electronic device may also input both the first prompt word and the instruction information into the large language model, which is not limited.

[0093] In the disclosed embodiment, after obtaining the third prompt word, the electronic device can execute step S205, use the third prompt word as the new first prompt word, execute step S202 again, input the new first prompt word into the large language model, obtain the intention recognition result of the new first prompt word, and obtain a first judgment result indicating whether the intention recognition result is correct. Based on the first judgment result, further execute step S203, or step S204 and step S205, until it is determined that the intention recognition result is correct, and output the first prompt word as the second prompt word.

[0094] In the technical solution provided by the embodiment of the present disclosure, when the intent recognition result is wrong, the electronic device can use the large language model to optimize the current first prompt word to obtain the optimized prompt word, and use the optimized prompt word as the first prompt word to perform intent recognition again. By cyclically inputting the first prompt word into the large language model, determining whether the intent recognition result is correct, and optimizing the first prompt word when the intent recognition result is wrong, the electronic device can perform one or more iterative optimizations on the first prompt word until it is determined that the large language model can correctly understand the first prompt word.

[0095] The large language model automatically recognizes and optimizes the intent of prompt words, dynamically updates prompt words and the large language model's understanding of prompt words, reduces the frequency of manual debugging and manual correction of prompt words, improves the efficiency of prompt word optimization, saves users' time and energy, and improves the overall efficiency of task execution. At the same time, optimizing prompt words improves the accuracy of prompt words, thereby improving the accuracy of the processing results output by the large language model.

[0096] In some embodiments, the electronic device may implement the above step S204 by the following steps to optimize the first prompt word: input the first prompt word and the first auxiliary information into the large language model to obtain a third prompt word. The first auxiliary information is information that assists the large language model in optimizing the first prompt word, and the first auxiliary information may include at least one of the following information: first information indicating an error in the image recognition result; second information indicating the cause of the error in the image recognition result; and third information indicating the correct intention.

[0097] The following describes how the electronic device obtains the first information, the second information, and the third information.

[0098] 1) First information.

[0099] The first information is information indicating that the image recognition result is wrong. For details, please refer to the description of the first information in the above step S102.

[0100] For the first information, the electronic device may obtain it by using the method a1 or the method a2 in the above step S102. That is, the electronic device may obtain the first judgment result by using the method a1 or the method a2 in the above step S102. When the first judgment result indicates that the image recognition result is wrong, the first judgment result received by the electronic device is the first information. For details, please refer to the relevant description of the above step S102, which will not be described in detail here.

[0101] 2) Second information.

[0102] The second information is information indicating the cause of the error in the image recognition result. The cause of the error may include at least one of the following: incomplete context information, vague prompt words, complex prompt words, and ambiguous prompt words.

[0103] Incomplete context information means that the context of the first prompt word is unclear or the task background is incomplete, which results in the large language model being unable to correctly extract keywords. Ambiguous prompt words mean that the description or words used in the first prompt word are too vague. Complex prompt words mean that the language used in the first prompt word is too complex. Ambiguous prompt words mean that there is ambiguity in the first prompt word. The above-mentioned error reasons may cause the large language model to have deviations or errors in its understanding of the first prompt word, resulting in the large language model requiring more context or explanation to determine its exact meaning in order to correctly understand the intention.

[0104] In the disclosed embodiment, the first auxiliary information may also include other supplementary information, such as more detailed context information, background information, task description information, etc., which is not limited to this.

[0105] In the disclosed embodiment, the electronic device may also acquire the second information in the following two ways.

[0106] In mode b1, the electronic device interacts with the user and receives second information fed back by the user.

[0107] After obtaining the intention recognition result and the first information, the electronic device may display the first prompt word, the intention recognition result and the first information to the user. The user may determine the error cause of the intention recognition result based on the first prompt word, the intention recognition result and the first information, and enter the error cause in the dialog box. The electronic device may receive the error cause entered by the user in the dialog box as the second information.

[0108] When the electronic device uses method a1 to obtain the first information, the electronic device can display the first prompt word and the intention recognition result to the user, and receive the first information and the second information. For example, the user can enter "The current intention recognition result is incorrect, and the prompt word is ambiguous" in the dialog box, and the electronic device receives the content entered by the user in the dialog box, analyzes the input content, and obtains the first information and the second information from the input content. The electronic device can also receive the first information first and then receive the second information, and there is no limitation on this.

[0109] In method b2, the electronic device determines the cause of the error in the intention recognition result by itself and obtains the second information.

[0110] After obtaining the intention recognition result and the first information, the electronic device can obtain third information indicating the correct intention, and input the third information and the intention recognition result into the large language model, use the large language model to analyze the third information and the intention recognition result, determine the error cause of the intention recognition result, and obtain the second information.

[0111] 3) Third information.

[0112] The third information is information indicating the correct intention. For details of the third information and the method for obtaining it, please refer to the relevant description of method a2 in the above step S102.

[0113] In the disclosed embodiment, the electronic device may obtain one or more of the first information, the second information, and the third information as the first auxiliary information in the above manner. After obtaining the first auxiliary information, the electronic device may input the first auxiliary information and the first prompt word into the large language model, and the large language model may optimize the first prompt word according to one or more of the first auxiliary information.

[0114] When the first auxiliary information includes the first information, the large language model can determine that the current intention recognition result is wrong, and adjust the current first prompt word to obtain the third prompt word. For example, the large language model can expand the current first prompt word, adjust the words used in the current first prompt word, etc.

[0115] When the first auxiliary information includes the second information, the large language model can analyze the error cause of the current intention recognition result, and adjust the relevant description corresponding to the error cause in the first prompt word to obtain the third prompt word.

[0116] For example, when the error is caused by the ambiguity of the prompt word, the large language model can replace the ambiguous terms in the first prompt word with clear terms. For another example, when the error is caused by the ambiguity of the prompt word, the large language model can add constraint information to the first prompt word to clarify the intention of the first prompt word.

[0117] The large language model optimizes the first prompt word based on the clear cause of the error to accurately locate the part of the first prompt word that causes the intent recognition error, and provides supplementary information to the large language model based on the specific cause of the error, giving the large language model additional guidance, thereby improving the accuracy and efficiency of the large language model in optimizing the prompt words.

[0118] When the first auxiliary information includes the third information, the large language model can parse the correct intent, determine the difference between the correct intent and the current intent recognition result, adjust the relevant description corresponding to the difference in the first prompt word, and obtain the third prompt word.

[0119] In the technical solution provided by the embodiment of the present disclosure, a large language model is provided with a variety of auxiliary information indicating errors in the diagram recognition results, the causes of the errors in the diagram recognition results, and the correct intentions. In this way, the large language model can more clearly determine the task objectives based on the various auxiliary information provided, and accurately locate the description that needs to be modified in the first prompt word, thereby improving the accuracy and reliability of the optimized prompt word.

[0120] In some embodiments, when it is determined that the intention recognition result is wrong, the electronic device can interact with the user in response to the intention recognition result error to obtain an optimized prompt word, such as Figure 3 As shown, the above-mentioned method for determining prompt words based on a large model may include the following steps:

[0121] Step S301, obtaining a first prompt word; Step S301 is the same as the above step S101.

[0122] Step S302, input the first prompt word into the large language model to obtain the intention recognition result of the first prompt word; step S302 is the same as the above step S102.

[0123] Step S303, in response to the intention recognition result being correct, outputting the first prompt word as the second prompt word; step S303 is the same as the above step S103.

[0124] Step S304: in response to an error in the intention recognition result, outputting the first prompt word to the user so that the user can optimize the first prompt word to obtain a third prompt word.

[0125] Step S305: receiving a third prompt word input by the user.

[0126] Step S306: Update the first prompt word to the third prompt word, and return to execute step S302.

[0127] In step S304, after determining that the intention recognition result is wrong, the electronic device can interact with the user and display the current first prompt word to the user. The user can optimize the displayed prompt word and enter the optimized prompt word (i.e., the third prompt word) in the dialog box. After detecting the user input information, the electronic device can execute step S305 to receive the prompt word entered by the user in the dialog box to obtain the third prompt word.

[0128] When the electronic device adopts method a1 in the above step S102 to obtain the first judgment result, since the electronic device has already displayed the intention recognition result to the user, the electronic device can only display the current first prompt word; when the electronic device adopts method a2 in the above step S102 to obtain the first judgment result, the electronic device can also display the intention recognition result to the user, and the user can optimize the current first prompt word according to the intention recognition result of the large language model.

[0129] In the disclosed embodiment, after obtaining the third prompt word, the electronic device can execute step S306, use the third prompt word as the new first prompt word, execute step S302 again, input the new first prompt word into the large language model, obtain the intention recognition result of the new first prompt word, and obtain a first judgment result indicating whether the intention recognition result is correct, and further execute step S303, or step S304 to step S306 based on the first judgment result.

[0130] In the technical solution provided by the embodiment of the present disclosure, when the intent recognition result is wrong, the electronic device can interact with the user, optimize the current first prompt word, and use the optimized prompt word as the first prompt word to perform intent recognition again. By cyclically inputting the first prompt word into the large language model, determining whether the intent recognition result is correct, and optimizing the first prompt word when the intent recognition result is wrong, the electronic device can perform one or more iterative optimizations on the first prompt word until it is determined that the large language model can correctly understand the first prompt word. By manually identifying and optimizing the intent of the prompt word, the accuracy of the optimized prompt word and its pertinence to different scenarios are improved, thereby improving the accuracy of the processing results output by the large language model.

[0131] In the embodiment of the present disclosure, the electronic device can be combined with the above Figure 2 How to use large language models to optimize prompt words, and Figure 3 The method of optimizing the prompt word by interacting with the user is to optimize the first prompt word.

[0132] For example, the electronic device may first use a large language model to optimize the first prompt word to improve the optimization efficiency of the first prompt word; after the number of optimizations is greater than a preset first number, the electronic device continues to optimize the first prompt word by interacting with the user to fine-tune the first prompt word, thereby ensuring the accuracy and optimization efficiency of the first prompt word.

[0133] In some embodiments, in order to ensure the accuracy of the prompt words in actual applications, the electronic device can further optimize the prompt words in combination with actual application scenarios, such as Figure 4 As shown, the above-mentioned method for determining prompt words based on a large model may include the following steps:

[0134] Step S401, obtaining a first prompt word; Step S401 is the same as the above step S101.

[0135] Step S402, inputting the first prompt word into the large language model to obtain the intention recognition result of the first prompt word; step S402 is the same as the above step S102.

[0136] Step S403, in response to the intention recognition result being correct, outputting the first prompt word as the second prompt word; step S403 is the same as the above step S103.

[0137] Step S404, inputting the second prompt word and the test data into the large language model to obtain a processing result of the test data;

[0138] The test data is actual application information to be processed. For example, the test data may be context information, actual data information, etc., which is not limited.

[0139] The big language model in step S404 can be any pre-trained big language model used to process the task. In the embodiment of the present disclosure, the big language model used to identify the intent, the big language model used to optimize the first prompt word, and the big language model used to process the task can be the same big language model or different big language models. For the convenience of description, the following description will take the big language models for different purposes as the same big language model as an example, and will be referred to as the big language model for short.

[0140] In the disclosed embodiment, after executing step S403 to obtain the second prompt word, the electronic device may continue to execute step S404. After acquiring the test data, the electronic device may use the test data as input data to be processed, and input the test data and the second prompt word into the large language model.

[0141] The large language model analyzes the input second prompt word and test data, processes the test data based on the second prompt word, obtains the processing result of the test data and outputs it to the electronic device. After obtaining the processing result, the electronic device can also display the processing result to the user.

[0142] For example, the second prompt word may be "Please analyze the customer's purchasing habits based on the data provided", and the test data may be "The following is the data report of xx company in xxx year", then the processing result output by the large language model may be "The following is the purchasing habits of xx company's customers...", and the second prompt word, test data and processing result are not limited here.

[0143] In the disclosed embodiment, after obtaining the processing result, the electronic device may obtain a second judgment result indicating whether the processing result is correct. The second judgment result may be information indicating that the processing result is correct, such as "the current processing result is correct", etc.; the second judgment result may also be information indicating that the processing result is wrong, such as "the current processing result is incorrect", etc. For the convenience of description, the information indicating that the processing result is wrong is referred to as fourth information.

[0144] Similar to the above-mentioned method of obtaining the first judgment result, the electronic device may also obtain the second judgment result in the following two ways.

[0145] In mode c1, the electronic device interacts with the user and obtains the content of user feedback as the second judgment result.

[0146] After obtaining the processing result, the electronic device can display the processing result to the user, and receive the content entered by the user in the dialog box to indicate whether the processing result is correct as the second judgment result, analyze the second judgment result, and determine whether the processing result is correct, or determine that the processing result is wrong.

[0147] In the disclosed embodiment, after obtaining the second prompt word, the electronic device can display the second prompt word to the user, and the user can judge whether the processing result is correct based on the processing result and the second prompt word to ensure the accuracy of the second judgment result.

[0148] For details, please refer to the relevant description in the above method a1, which will not be described in detail here.

[0149] In method c2, the electronic device determines by itself whether the processing result is correct, and obtains a second determination result.

[0150] After obtaining the processing result, the electronic device can obtain information indicating the correct processing result. For the convenience of description, this information is referred to as the sixth information.

[0151] The electronic device may analyze the sixth information and the processing result, calculate the similarity between the sixth information and the processing result, and determine whether the processing result is correct based on the similarity.

[0152] In the disclosed embodiment, the electronic device can interact with the user, receive the correct processing result input by the user in the dialog box, and obtain the sixth information. The electronic device can also use other devices to perform keyword analysis on the second prompt word and the test data, determine the correct processing result of the test data based on the second prompt word, and receive the correct processing result sent by other devices to obtain the sixth information indicating the correct processing result. The manner in which the electronic device obtains the sixth information is not limited herein.

[0153] For details, please refer to the relevant description in the above method a2, which will not be described in detail here.

[0154] When it is determined that the processing result is correct, the electronic device may execute step S405 in response to the processing result being correct.

[0155] Step S405: In response to the processing result being correct, a second prompt word is output.

[0156] In step S405, after determining that the processing result is correct, the electronic device determines that the current second prompt word can be output, and then outputs the current second prompt word.

[0157] In the disclosed embodiment, the electronic device can interact with the user, display the output third prompt word to the user, and determine the correct processing result.

[0158] In the technical solution provided by the embodiments of the present disclosure, the prompt words are determined by utilizing the processing results of the test data in the actual application scenario by the large language model, which effectively reduces the result deviation caused by the randomness of the processing results output by the large language model, thereby improving the stability and accuracy of the large language model output.

[0159] In some embodiments, when it is determined that the processing result is wrong, the electronic device can optimize the current second prompt word using the large language model in response to the processing result error, such as Figure 5 As shown, the above-mentioned method for determining prompt words based on a large model may include the following steps:

[0160] Step S501, obtaining a first prompt word; Step S501 is the same as the above step S101.

[0161] Step S502, inputting the first prompt word into the large language model to obtain the intention recognition result of the first prompt word; step S502 is the same as the above step S102.

[0162] Step S503, in response to the intention recognition result being correct, outputting the first prompt word as the second prompt word; step S503 is the same as the above step S103.

[0163] Step S504, input the second prompt word and the test data into the large language model to obtain the processing result of the test data; Step S504 is the same as the above step S404.

[0164] Step S505, in response to the processing result being correct, outputting a second prompt word; Step S505 is the same as the above-mentioned step S405.

[0165] Step S506: In response to the processing result error, the second prompt word is optimized using the large language model to obtain a fourth prompt word.

[0166] Step S507: Update the second prompt word to the fourth prompt word, and return to execute step S504.

[0167] The big language model in step S506 can be any pre-trained big language model used to optimize the second prompt word. In the embodiment of the present disclosure, the big language model used to identify intent, the big language model used to optimize the first prompt word, the big language model used to process tasks, and the big language model used to optimize the second prompt word can be the same big language model or different big language models. For the sake of ease of description, the following explanation will be given by taking the big language models for different purposes as the same big language model as an example, and will be referred to as the big language model for short.

[0168] In the disclosed embodiment, the fourth prompt word is a prompt word optimized in an actual application scenario. After determining that the processing result is wrong, the electronic device determines that the current second prompt word needs to be optimized, and then the current second prompt word can be input into the large language model, and the large language model optimizes the input second prompt word and outputs the optimized prompt word to the electronic device to obtain the fourth prompt word.

[0169] In the disclosed embodiment, the electronic device may also input indication information indicating the optimization prompt word into the large language model. The large language model may analyze the input indication information and optimize the second prompt word.

[0170] In the disclosed embodiment, after obtaining the fourth prompt word, the electronic device can execute step S507, use the fourth prompt word as a new second prompt word, execute step S504 again, input the new second prompt word into the large language model, obtain the processing result of the test data, and obtain a second judgment result indicating whether the processing result is correct, and further execute step S505, or step S506 and step S507 according to the second judgment result, until it is determined that the processing result is correct, and the second prompt word is output.

[0171] In the technical solution provided by the embodiment of the present disclosure, when the processing result is wrong, the electronic device can optimize the current second prompt word using the large language model, and use the optimized prompt word as the second prompt word, and obtain the processing result again based on the test data. The electronic device performs a feedback loop based on the test data, iteratively optimizes the second prompt word, until it is determined that the large language model can output the correct processing result.

[0172] The large language model automatically obtains processing results and optimizes prompt words, which reduces the frequency of manual debugging and manual correction of prompt words, improves the efficiency of prompt word optimization, saves users' time and energy, and improves the overall efficiency of task execution. At the same time, optimizing prompt words improves the accuracy of prompt words and their adaptability and flexibility in different scenarios, thereby improving the accuracy of the processing results output by the large language model.

[0173] In some embodiments, the electronic device may implement the above step S506 by the following steps to optimize the second prompt word: input the second prompt word and the second auxiliary information into the large language model to obtain a fourth prompt word. The second auxiliary information is information that assists the large language model in optimizing the second prompt word, and the second auxiliary information may include at least one of the following information: fourth information indicating that the processing result is wrong; fifth information indicating the reason for the error of the processing result; and sixth information indicating the correct processing result.

[0174] The following describes the manners in which the electronic device obtains the fourth information, the fifth information, and the sixth information respectively.

[0175] 1) The fourth message.

[0176] The fourth information is information indicating that the processing result is wrong. For details, please refer to the description of the fourth information in the above step S404.

[0177] For the fourth information, the electronic device may obtain it by using the method c1 or method c2 in the above step S404. That is, the electronic device may obtain the second judgment result by using the method c1 or method c2 in the above step S404. When the second judgment result indicates that the processing result is wrong, the second judgment result received by the electronic device is the fourth information. For details, please refer to the relevant description of the above step S404, which will not be described in detail here.

[0178] 2) The fifth message.

[0179] The fifth information is information indicating the error reason of the processing result. The error reason may include at least one of the following: incomplete context information, vague prompt word, complex prompt word and ambiguous prompt word. The fifth information is similar to the second information above, and will not be described in detail here.

[0180] In the disclosed embodiment, similar to the above-mentioned method of acquiring the second information, the electronic device may also acquire the fifth information in two ways.

[0181] For example, the electronic device can interact with the user, display the second prompt word, the processing result and the second information to the user, and receive the error reason of the processing result fed back by the user as the fifth information.

[0182] For another example, the electronic device may also obtain sixth information indicating a correct processing result, and determine the cause of the error in the processing result based on the sixth information to obtain the fifth information.

[0183] For details, please refer to the above-mentioned description on how the electronic device obtains the second information, which will not be repeated here.

[0184] 3) The sixth message.

[0185] The sixth information is information indicating a correct processing result. For details of the sixth information and the method for obtaining it, please refer to the relevant description of method c2 in the above step S404.

[0186] In the disclosed embodiment, the second auxiliary information may further include other supplementary information, such as supplementary test data, etc. Furthermore, the large language model may optimize the second prompt word according to the other supplementary information, which is not limited thereto.

[0187] In the disclosed embodiment, the electronic device may obtain one or more of the fourth information, the fifth information, and the sixth information as the second auxiliary information in the above manner. After obtaining the second auxiliary information, the electronic device may input the second auxiliary information and the second prompt word into the large language model, and the large language model may optimize the second prompt word according to one or more of the second auxiliary information.

[0188] The way in which the electronic device optimizes the second prompt word using the second auxiliary information is similar to the way in which the electronic device optimizes the first prompt word using the first auxiliary information, which will not be described in detail herein.

[0189] When the second auxiliary information includes the fifth information, the large language model can optimize the second prompt word according to the clear error cause to accurately locate the part of the second prompt word that causes the error in the processing result, and provide supplementary information to the large language model according to the specific error cause, giving the large language model additional guidance, thereby improving the accuracy and efficiency of the large language model in optimizing the prompt words.

[0190] In the technical solution provided by the embodiment of the present disclosure, a variety of auxiliary information indicating processing result errors, indicating the causes of the errors in the processing results, and indicating the correct processing results are provided for the large language model. In this way, based on the various auxiliary information provided, the large language model can more clearly determine the task objectives and accurately locate the description that needs to be modified in the second prompt word, thereby improving the accuracy and reliability of the optimized prompt word, and further improving the accuracy of the processing results obtained based on the test data.

[0191] In some embodiments, when it is determined that the processing result is wrong, the electronic device can interact with the user in response to the processing result error to obtain an optimized prompt word, such as Figure 6 As shown, the above-mentioned method for determining prompt words based on a large model may include the following steps:

[0192] Step S601, obtaining a first prompt word; Step S601 is the same as the above step S101.

[0193] Step S602, input the first prompt word into the large language model to obtain the intention recognition result of the first prompt word; step S602 is the same as the above step S102.

[0194] Step S603, in response to the intention recognition result being correct, outputting the first prompt word as the second prompt word; step S603 is the same as the above step S103.

[0195] Step S604, input the second prompt word and the test data into the large language model to obtain the processing result of the test data; step S604 is the same as the above step S404.

[0196] Step S605, in response to the processing result being correct, outputting a second prompt word; Step S605 is the same as the above-mentioned step S405.

[0197] Step S606, in response to the processing result being wrong, outputting the second prompt word to the user so that the user can optimize the second prompt word to obtain a fourth prompt word;

[0198] Step S607, receiving a fourth prompt word input by the user;

[0199] Step S608: Update the second prompt word to the fourth prompt word, and return to execute step S604.

[0200] In step S606, after determining that the processing result is wrong, the electronic device can interact with the user and display the current second prompt word to the user. The user can optimize the displayed prompt word and enter the optimized prompt word (i.e., the fourth prompt word) in the dialog box. After detecting the user input information, the electronic device can execute step S607 to receive the prompt word entered by the user in the dialog box to obtain the fourth prompt word.

[0201] When the electronic device adopts method c1 in the above step S404 to obtain the second judgment result, since the electronic device has already displayed the processing result to the user, the electronic device can only display the current second prompt word; when the electronic device adopts method c2 in the above step S404 to obtain the second judgment result, the electronic device can also display the processing result to the user, and the user can optimize the current second prompt word according to the processing result of the large language model.

[0202] In the embodiment of the present disclosure, after obtaining the fourth prompt word, the electronic device can execute step S608, use the fourth prompt word as a new second prompt word, execute step S604 again, input the new second prompt word into the large language model, obtain the processing result of the test data, and obtain a second judgment result indicating whether the processing result is correct, and further execute step S605, or steps S606 to S608 based on the second judgment result.

[0203] In the technical solution provided by the embodiment of the present disclosure, when the processing result is wrong, the electronic device can interact with the user, optimize the current second prompt word, obtain the processing result based on the test data, and iteratively optimize the second prompt word until it is determined that the large language model can output the correct processing result.

[0204] By manually optimizing the prompt words, the accuracy of the optimized prompt words and their pertinence to different scenarios are improved, thereby improving the accuracy of the processing results output by the large language model.

[0205] In the embodiment of the present disclosure, the electronic device can be combined with the above Figure 5How to use large language models to optimize prompt words, and Figure 6 The second prompt word is optimized by interacting with the user to optimize the prompt word.

[0206] For example, the electronic device may first use a large language model to optimize the second prompt word to improve the optimization efficiency of the second prompt word; after the number of optimizations is greater than a preset second number, the electronic device continues to optimize the second prompt word by interacting with the user to fine-tune the second prompt word, thereby ensuring the accuracy and optimization efficiency of the second prompt word.

[0207] Combine the following Figure 7 The method for determining prompt words based on a large model provided in an embodiment of the present disclosure is described in detail.

[0208] Figure 7 A schematic flow chart of optimization and determination of prompt words based on a large model provided in an embodiment of the present disclosure may include the following steps:

[0209] Step S701, receiving a prompt word.

[0210] The user can design a concise prompt word, which covers the following elements: task background, role setting, task goal, task content, key notes and output format, etc. The electronic device receives the prompt word (ie, the first prompt word) input by the user.

[0211] Step S702: output the understanding of the large language model.

[0212] The electronic device inputs the prompt word into the large language model, obtains the understanding result of the large language model on the input prompt word (ie, the intention recognition result), and displays the understanding result to the user.

[0213] Step S703, determining whether the understanding is correct.

[0214] The electronic device can display the understanding results of the large language model to the user. The user judges whether the large language model accurately understands the intention and content of the prompt word based on the understanding results, and feeds back to the electronic device. The electronic device receives the user's feedback as a judgment result (i.e., a first judgment result).

[0215] The electronic device can also determine whether the large language model accurately understands the intention and content of the prompt word based on the understanding results of the large language model and obtain a judgment result.

[0216] If the electronic device determines that the judgment result of step S703 is yes, indicating that the understanding of the large language model is correct, the electronic device does not need to optimize the prompt words, and continues to execute step S706.

[0217] If the electronic device determines that the judgment result of step S703 is no, indicating that the large language model has an understanding error, the electronic device needs to optimize the prompt word and continue to execute step S704.

[0218] Step S704, receiving erroneous understanding.

[0219] After confirming that the large language model has misunderstood the prompt word, the electronic device can receive feedback from the user on the cause of the error, the error location, etc. of the understanding result.

[0220] Step S705, updating the prompt word.

[0221] The electronic device can input the judgment result, error cause, error location and current prompt word into the large language model. The large language model corrects the current prompt word according to the input content to obtain an updated prompt word (i.e., the third prompt word), and returns to execute step S702, inputs the updated prompt word into the large language model, and ensures through multiple rounds of iteration that the large language model's understanding of the prompt word is completely correct.

[0222] Step S706, input test data.

[0223] After confirming that the large language model has no errors in understanding the prompt word, the electronic device inputs the test data and the current prompt word (i.e., the second prompt word, i.e., the prompt word determined by steps S701 to S705) into the large language model to evaluate the performance of the prompt word in the actual task. The electronic device obtains the output result (i.e., the processing result) of the large language model and displays the output result to the user.

[0224] Step S707, determining whether the output is correct.

[0225] The electronic device can display the test data, the current prompt word and the output result to the user. The user can evaluate the output of the large language model based on the test data, the current prompt word and the output result, determine whether the output result is correct and feedback to the electronic device. The electronic device receives the user feedback as the judgment result (i.e., the second judgment result).

[0226] The electronic device can also determine whether the output is correct and obtain a judgment result based on the test data, the current prompt word and the output result.

[0227] If the electronic device determines that the judgment result of step S707 is yes, indicating that the output of the large language model is correct, the electronic device determines that the current prompt word meets the task requirements, continues to execute step S7010, outputs the current prompt word and the correct output result, and displays them to the user.

[0228] If the electronic device determines that the judgment result of step S707 is no, indicating that the output of the large language model is wrong, the electronic device determines that the current prompt word does not meet the task requirements and continues to execute step S708.

[0229] Step S708, receiving an error result.

[0230] The electronic device can receive the error cause, error location, etc. of the output result fed back by the user, and the electronic device can also receive the correct result provided by the user.

[0231] Step S709, updating the prompt word.

[0232] The electronic device can input the judgment result, error cause, error location, correct result and current prompt word into the large language model. The large language model corrects and adjusts the current prompt word according to the input content to obtain an updated prompt word (i.e., the fourth prompt word), and returns to execute step S706, inputs the updated prompt word and test data into the large language model, and ensures that the output result of the large language model is completely correct through multiple rounds of iterations.

[0233] Step S7010, output prompt words.

[0234] The electronic device outputs prompt words and correct output results that have been optimized and verified for correctness through multiple rounds of iterations for subsequent applications.

[0235] In the technical solution provided by the embodiment of the present disclosure, the prompt word is optimized by using the large language model to understand the intention of the prompt word and the output result, and the generated prompt word can be used stably for a long time for specific tasks, thereby greatly reducing the calculation cost of the model. At the same time, the prompt word optimization and determination method provided by the embodiment of the present disclosure is highly versatile and can be adapted to a variety of application scenarios, ensuring flexibility and adaptability in different fields.

[0236] In addition, existing prompt word engineering methods such as Chain-of-Thought Promptin (CoT), Self-Consistency Prompting, and Tree-of-Thoughts Prompting (ToT) have large computational overhead, and the effects of these methods are highly dependent on the basic capabilities of the model. For models with weak basic capabilities or insufficient training data coverage, path redundancy or error accumulation may occur, thereby affecting the reasoning effect. The technical solution provided by the embodiment of the present disclosure greatly reduces the computational overhead. Through systematic design and optimization, the prompt words and input data are refined and constrained to ensure that the large language model can accurately understand the complex task requirements and execute them efficiently. Combined with user feedback information, the prompt words can be optimized efficiently and accurately, thereby ensuring the accuracy of the output results of the large language model. This process fully taps the potential of the large language model, accelerates its widespread application in various industries, and promotes the emergence of high-value scenario solutions.

[0237] Corresponding to the above-mentioned method for determining prompt words based on a large model, the embodiment of the present disclosure provides a device for determining prompt words based on a large model, such as Figure 8 As shown, including:

[0238] An acquisition module 801 is used to acquire a first prompt word;

[0239] A first input module 802, used to input the first prompt word into the large language model to obtain an intention recognition result of the first prompt word;

[0240] The first output module 803 is configured to output the first prompt word as the second prompt word in response to a correct intention recognition result.

[0241] In the technical solution provided by the embodiment of the present disclosure, the large language model is used to perform intent recognition on the first prompt word to be determined, and the second prompt word is determined and output according to the intent recognition result of the large language model on the first prompt word. When the intent recognition result is correct, it means that the large language model can correctly understand the current first prompt word, the current first prompt word has a clear intent expression, and it is determined that the current first prompt word can be output as the second prompt word.

[0242] In the disclosed embodiment, the intent of prompt words is recognized through a large language model to implement screening of prompt words, and only prompt words with correct intent recognition results are output, thereby reducing the possibility that the output prompt words have problems such as ambiguity, semantic ambiguity, or imprecise expression, thereby improving the accuracy of the processing results of the large language model based on the output prompt words.

[0243] The first output module 803 may also be used for:

[0244] In response to an error in the intent recognition result, the first prompt word is optimized using a large language model to obtain a third prompt word; the first prompt word is updated to the third prompt word, and the first prompt word is input into the large language model to obtain the intent recognition result of the first prompt word.

[0245] The first output module 803 may be specifically used for:

[0246] The first prompt word and the first auxiliary information are input into the large language model to obtain a third prompt word; wherein the first auxiliary information includes at least one of the following information: first information indicating that the schematic diagram recognition result is wrong; second information indicating the reason for the error in the schematic diagram recognition result; and third information indicating the correct intention.

[0247] The first output module 803 may also be used for:

[0248] In response to an error in the intention recognition result, outputting the first prompt word to the user so that the user can optimize the first prompt word to obtain a third prompt word;

[0249] receiving a third prompt word input by a user;

[0250] The first prompt word is updated to a third prompt word, and the first prompt word is input into a large language model to obtain an intention recognition result of the first prompt word.

[0251] The above-mentioned prompt word determination device may further include:

[0252] A second input module, used for inputting the second prompt word and the test data into the large language model to obtain a processing result of the test data;

[0253] The second output module is used to output a second prompt word in response to the processing result being correct.

[0254] The second output module can also be used for:

[0255] In response to the processing result error, optimizing the second prompt word by using the large language model to obtain a fourth prompt word;

[0256] The second prompt word is updated to a fourth prompt word, and the second prompt word and the test data are input into the large language model to obtain a processing result of the test data.

[0257] The second output module can be specifically used for:

[0258] The second prompt word and the second auxiliary information are input into the large language model to obtain a fourth prompt word; wherein the second auxiliary information includes at least one of the following information: fourth information indicating that the processing result is wrong; fifth information indicating the cause of the error in the processing result; and sixth information indicating a correct processing result.

[0259] The second output module can also be used for:

[0260] In response to the processing result being wrong, outputting a second prompt word to the user so that the user can optimize the second prompt word to obtain a fourth prompt word;

[0261] receiving a fourth prompt word input by a user;

[0262] The second prompt word is updated to a fourth prompt word, and the second prompt word and the test data are input into the large language model to obtain a processing result of the test data.

[0263] The error causes include at least one of the following: incomplete context information, vague prompt words, complex prompt words, and ambiguous prompt words.

[0264] The first prompt word includes at least one of the following contents: role setting of the large language model, task background, task content, preset requirements and output format.

[0265] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0266] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0267] Fig. 9 A schematic diagram of a structure of an electronic device provided in an embodiment of the present disclosure, the electronic device includes:

[0268] at least one processor 901; and

[0269] A memory 902 that is communicatively connected to the at least one processor 901; wherein,

[0270] The memory 902 stores instructions that can be executed by the at least one processor 901. The instructions are executed by the at least one processor 901 so that the at least one processor 901 can execute any of the large model-based prompt word determination methods.

[0271] Fig.10A schematic block diagram of an example electronic device 1000 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0272] like Fig.10 As shown, the device 1000 includes a computing unit 1001, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1002 or a computer program loaded from a storage unit 1008 into a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the device 1000 can also be stored. The computing unit 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.

[0273] A number of components in the device 1000 are connected to the I / O interface 1005, including: an input unit 1006, such as a keyboard, a mouse, etc.; an output unit 1007, such as various types of displays, speakers, etc.; a storage unit 1008, such as a disk, an optical disk, etc.; and a communication unit 1009, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1009 allows the device 1000 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0274] The computing unit 1001 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1001 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1001 performs the various methods and processes described above, such as a large model-based prompt word determination method. For example, in some embodiments, the large model-based prompt word determination method may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 1008. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 1000 via the ROM 1002 and / or the communication unit 1009. When the computer program is loaded into the RAM 1003 and executed by the computing unit 1001, one or more steps of the large model-based prompt word determination method described above may be performed. Alternatively, in other embodiments, the computing unit 1001 may be configured to execute the large model-based prompt word determination method in any other appropriate manner (for example, by means of firmware).

[0275] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0276] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0277] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0278] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0279] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0280] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0281] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0282] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A method for determining a prompt word based on a large model, comprising: Get the first prompt word; Inputting the first prompt word into a large language model to obtain an intent recognition result of the first prompt word; In response to the intention recognition result being correct, the first prompt word is output as the second prompt word.

2. The method according to claim 1, further comprising: In response to the intention recognition result being wrong, optimizing the first prompt word by using the large language model to obtain a third prompt word; The first prompt word is updated to the third prompt word, and the step of inputting the first prompt word into a large language model to obtain an intention recognition result of the first prompt word is performed.

3. The method according to claim 2, wherein: The step of optimizing the first prompt word by using the large language model to obtain a third prompt word includes: Inputting the first prompt word and the first auxiliary information into the large language model to obtain a third prompt word; The first auxiliary information includes at least one of the following information: First information indicating that the intention recognition result is wrong; second information indicating the cause of error in the image recognition result; A third message indicating the correct intent.

4. The method according to claim 1, further comprising: In response to the intention recognition result being wrong, outputting the first prompt word to the user, so that the user optimizes the first prompt word to obtain a third prompt word; receiving the third prompt word input by the user; The first prompt word is updated to the third prompt word, and the step of inputting the first prompt word into a large language model to obtain an intention recognition result of the first prompt word is performed.

5. The method according to claim 1, further comprising: Inputting the second prompt word and the test data into the large language model to obtain a processing result of the test data; In response to the processing result being correct, the second prompt word is output.

6. The method according to claim 5, further comprising: In response to the processing result being wrong, optimizing the second prompt word by using the large language model to obtain a fourth prompt word; The second prompt word is updated to the fourth prompt word, and the step of inputting the second prompt word and the test data into the large language model is performed to obtain the processing result of the test data.

7. The method according to claim 6, wherein: The step of optimizing the second prompt word by using the large language model to obtain a fourth prompt word includes: Inputting the second prompt word and the second auxiliary information into the large language model to obtain a fourth prompt word; The second auxiliary information includes at least one of the following information: fourth information indicating that the processing result is wrong; fifth information indicating an error reason of the processing result; The sixth information indicates a correct processing result.

8. The method according to claim 5, further comprising: In response to the processing result being wrong, outputting the second prompt word to the user, so that the user optimizes the second prompt word to obtain a fourth prompt word; receiving a fourth prompt word input by a user; The second prompt word is updated to the fourth prompt word, and the step of inputting the second prompt word and the test data into the large language model is performed to obtain the processing result of the test data.

9. The method according to claim 3 or 7, wherein: The error cause includes at least one of the following: incomplete context information, vague prompt words, complex prompt words, and ambiguous prompt words.

10. The method according to any one of claims 1 to 9, wherein: The first prompt word includes at least one of the following contents: role setting of the large language model, task background, task content, preset requirements and output format.

11. A device for determining a prompt word based on a large model, comprising: An acquisition module, used for acquiring a first prompt word; A first input module, used for inputting the first prompt word into a large language model to obtain an intention recognition result of the first prompt word; The first output module is used to output the first prompt word as the second prompt word in response to the intention recognition result being correct.

12. The device according to claim 11, wherein the first output module is further configured to: In response to the intention recognition result being wrong, optimizing the first prompt word by using the large language model to obtain a third prompt word; The first prompt word is updated to the third prompt word, and the step of inputting the first prompt word into a large language model to obtain an intention recognition result of the first prompt word is performed.

13. The device according to claim 12, wherein: The first output module is specifically used for: Inputting the first prompt word and the first auxiliary information into the large language model to obtain a third prompt word; The first auxiliary information includes at least one of the following information: First information indicating that the intention recognition result is wrong; second information indicating the cause of error in the image recognition result; A third message indicating the correct intent.

14. The device according to claim 11, wherein the first output module is further configured to: In response to the intention recognition result being wrong, outputting the first prompt word to the user, so that the user optimizes the first prompt word to obtain a third prompt word; receiving the third prompt word input by the user; The first prompt word is updated to the third prompt word, and the step of inputting the first prompt word into a large language model to obtain an intention recognition result of the first prompt word is performed.

15. The apparatus according to claim 11, further comprising: A second input module, used for inputting the second prompt word and test data into the large language model to obtain a processing result of the test data; The second output module is used to output the second prompt word in response to the processing result being correct.

16. The device according to claim 15, wherein the second output module is further configured to: In response to the processing result being wrong, optimizing the second prompt word by using the large language model to obtain a fourth prompt word; The second prompt word is updated to the fourth prompt word, and the step of inputting the second prompt word and the test data into the large language model is performed to obtain the processing result of the test data.

17. The device according to claim 16, wherein: The second output module is specifically used for: Inputting the second prompt word and the second auxiliary information into the large language model to obtain a fourth prompt word; The second auxiliary information includes at least one of the following information: fourth information indicating that the processing result is wrong; fifth information indicating an error reason of the processing result; The sixth information indicates a correct processing result.

18. The device according to claim 15, wherein the second output module is further configured to: In response to the processing result being wrong, outputting the second prompt word to the user, so that the user optimizes the second prompt word to obtain a fourth prompt word; receiving a fourth prompt word input by a user; The second prompt word is updated to the fourth prompt word, and the step of inputting the second prompt word and the test data into the large language model is performed to obtain the processing result of the test data.

19. The device according to claim 13 or 17, wherein: The error cause includes at least one of the following: incomplete context information, vague prompt words, complex prompt words, and ambiguous prompt words.

20. The device according to any one of claims 11 to 19, wherein: The first prompt word includes at least one of the following contents: role setting of the large language model, task background, task content, preset requirements and output format.

21. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 10.

22. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-10.

23. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 10.

Citation Information

Cited By

  • Cue word layered optimization method for complex problem decomposition

    CN120234399A

  • Control instruction identification method, electronic equipment, storage medium and computer program product

    CN120745645A

  • Searching method and device, electronic equipment and storage medium

    CN121456186A

  • Search method and device, electronic equipment and storage medium

    CN121456186B