Prompt word management method, system, computer device and computer program product based on large language model

By allowing users to select and detect multiple prompt word templates and using a large language model for conflict detection, the problem of poor flexibility in selecting prompt word templates in the prior art is solved, and the application efficiency and accuracy of the large language model are improved.

CN117993382BActive Publication Date: 2024-09-20SHANGHAI SHUZHONG TECH CO LTD

Patent Information

Application Number
CN202410269490.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-08
Publication Date
2024-09-20
Estimated Expiration
2044-03-08

AI Technical Summary

Technical Problem

The existing technology cannot provide multiple prompt word templates for users to choose, resulting in a high user threshold and affecting the application scenarios and implementation of large language models.

Method used

Provide a prompt word management method based on a large language model, allowing users to select multiple prompt word templates at the same time, and detect these templates through a large language model to prevent conflicts, improve accuracy, and lower the user threshold.

Benefits of technology

It improves the accuracy and freedom of users' reasoning using multiple prompt word templates, reduces storage pressure and user workload, and increases the application scenarios and practical applications of large language models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117993382B
    Figure CN117993382B
Patent Text Reader

Abstract

The present invention provides a prompt word management method, system, computer device and computer program product based on a large language model, the prompt word management method based on a large language model includes: obtaining multiple target prompt word templates selected by a user; performing detection based on a large language model, the detection based on a large language model includes: determining a prompt word detection instruction based on the multiple target prompt word templates, sending the prompt word detection instruction to the large language model; wherein the prompt word detection instruction is used to instruct the large language model to detect the multiple target prompt word templates; and receiving the detection result returned by the large language model. In the present invention, it supports the simultaneous selection of multiple prompt word templates, and the selected prompt word templates are detected based on the large language model, which can flexibly meet the diverse needs of users while preventing unskilled users from using prompt word templates incorrectly.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the technical field of large language models, and in particular to a prompt word management method, system, computer device, and computer program product based on a large language model. Background Art

[0002] The output of the large language model depends on the content of the prompt word input by the user. For the same task, different language descriptions of the prompt word may affect the large language model to give different answers. However, it is difficult to write a sophisticated prompt word in one go, and its effect needs to be input into the large language model for verification. It is difficult for the user to know how to write the prompt word to maximize the ability of the large language model in a single use. In the process of using the large language model, the inventor of this application found that the prompt words need to be managed in a unified manner, and the prompt word templates that have been tested and meet the needs should be saved for users to flexibly and conveniently choose each time they use it. Summary of the invention

[0003] The embodiments of the present invention provide a prompt word management method, system, computer device and computer program product based on a large language model, which are used to solve the problem that the prior art cannot provide multiple prompt word templates for users to choose from, so as to lower the user usage threshold, increase the application scenarios of the large language model, and accelerate the implementation of the large language model.

[0004] In order to solve the above-mentioned technical problems, the present invention is achieved as follows:

[0005] In a first aspect, an embodiment of the present invention provides a prompt word management method based on a large language model, comprising:

[0006] Obtain multiple target prompt word templates selected by the user;

[0007] Performing detection based on a large language model, the detection based on the large language model comprising: determining a prompt word detection instruction based on the multiple target prompt word templates, and sending the prompt word detection instruction to the large language model; wherein the prompt word detection instruction is used to instruct the large language model to detect the multiple target prompt word templates;

[0008] Receive the detection result returned by the large language model.

[0009] In a second aspect, an embodiment of the present invention provides a prompt word management system based on a large language model, including:

[0010] An acquisition module, used to acquire multiple target prompt word templates selected by a user;

[0011] A detection module, configured to perform detection based on a large language model, wherein the detection based on the large language model comprises: determining a prompt word detection instruction based on the multiple target prompt word templates, and sending the prompt word detection instruction to the large language model; wherein the prompt word detection instruction is used to instruct the large language model to detect the multiple target prompt word templates;

[0012] The receiving module is used to receive the detection result returned by the large language model.

[0013] In a third aspect, an embodiment of the present invention provides a computer device, comprising: a processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the steps of the prompt word management method based on a large language model as described in the first aspect above are implemented.

[0014] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the prompt word management method based on a large language model as described in the first aspect above are implemented.

[0015] In a fifth aspect, an embodiment of the present invention provides a computer program product, including computer instructions, which, when executed by a processor, implement the steps of the prompt word management method based on a large language model as described in the first aspect above.

[0016] In the embodiment of the present invention, it supports the simultaneous selection of multiple prompt word templates, and the selected prompt word templates are detected based on the large language model, which can flexibly meet the diverse needs of users while preventing unskilled users from using the prompt word templates incorrectly, thereby improving the accuracy and freedom of reasoning based on multiple prompt word templates using the large language model; and lowering the user's threshold for using the large language model, increasing the application scenarios of the large language model, and accelerating the implementation of the large language model. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0018] Figure 1 This is a flow chart of a method for managing prompt words based on a large language model according to an embodiment of the present invention;

[0019] Figure 2 The second flowchart of the prompt word management method based on the large language model according to the embodiment of the present invention;

[0020] Figure 3 A schematic diagram of a conflict detection prompt word template according to an embodiment of the present invention;

[0021] Figure 4 It is a structural diagram of a prompt word management system based on a large language model according to an embodiment of the present invention;

[0022] Figure 5 Schematic diagram of the structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0023] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0024] In some embodiments, although the prompt word management system can save and manage prompt word templates, in actual use, only a single prompt word template can be selected each time, and multiple prompt word templates cannot be selected at the same time. In this case, the prompt word management system may need to store a large number of prompt word templates to meet the diverse needs of users. Some prompt word templates may contain similar content, which is less flexible. For example, if a task involves three prompt word templates A, B, and C, if any combination of A, B, and C is to be achieved, six prompt word templates (A, B, C, AB, AC, ABC) need to be saved.

[0025] In order to solve the problem that the prompt word management system can only select a single prompt word template each time, resulting in the need to store a large number of prompt word templates, wasting storage resources and poor flexibility, the embodiments of the present application provide a prompt word management method, system and computer device based on a large language model, which supports the simultaneous selection of multiple prompt word templates and detects the selected prompt word templates based on the large language model, which can flexibly meet the diverse needs of users while preventing inexperienced users from using prompt word templates incorrectly.

[0026] First, the technical terms involved in the present invention are briefly explained below.

[0027] The “large language model” described in the embodiments of the present invention refers to a large-scale language model (LLM), which can also be referred to as a large model. It is a language model with a large parameter scale, which is designed to understand and generate human language. It is trained with a large amount of text data and can perform a wide range of tasks including text summarization, translation, sentiment analysis, etc.

[0028] The prompt described in the embodiment of the present invention refers to a prompt or instruction designed based on natural language to guide the large language model to perform a specific task.

[0029] The prompt word template described in the embodiment of the present invention refers to the basic structure and content of the designed prompt word, which is used to generate the prompt word.

[0030] Please refer to Figure 1 The embodiment of the present invention provides a prompt word management method based on a large language model, which can be applied to a prompt word management system. The method includes:

[0031] Step S10: obtaining multiple target prompt word templates selected by the user;

[0032] Optionally, the prompt word template may be stored in a prompt word template library, and the prompt word template library may store multiple prompt word templates. For example, the multiple target prompt word templates are 2 or more.

[0033] In an embodiment of the present invention, the prompt word management system may have a user interface, on which a user may view relevant information (such as name, introduction, prompt word template content, etc.) of a prompt word template in a prompt word template library, and select a prompt word template. The user interface supports the user to select multiple target prompt word templates at the same time.

[0034] Step S20: performing detection based on a large language model, wherein the detection based on the large language model comprises: determining a prompt word detection instruction based on the multiple target prompt word templates, and sending the prompt word detection instruction to the large language model; wherein the prompt word detection instruction is used to instruct the large language model to detect the multiple target prompt word templates;

[0035] Step S30: receiving the detection result returned by the large language model.

[0036] In the embodiment of the present invention, it supports the simultaneous selection of multiple prompt word templates, and the selected prompt word templates are detected based on the large language model, which can flexibly meet the diverse needs of users while preventing unskilled users from using the prompt word templates incorrectly, thereby lowering the user's usage threshold and improving the accuracy and freedom of the user's reasoning based on multiple prompt word templates using the large language model; and lowering the user's usage threshold for the large language model, increasing the application scenarios of the large language model, and accelerating the implementation of the large language model.

[0037] The multiple target prompt word templates selected in the embodiment of the present invention can be, for example, multiple prompt word templates corresponding to multiple functions of a task, that is, a larger task requirement can be divided into smaller functional modules, each functional module corresponding to a prompt word template. For example, the task can be a task of analyzing chart data, or a task of generating an image based on text, or a task of analyzing a document, or a task of performing comparative analysis on multiple documents, charts, images, etc., and the embodiment of the present invention does not limit this. Taking the task of analyzing a document as an example, the document task can include the following functional modules: a layout analysis module, an optical character recognition module, a table recognition module, and an information extraction module, and each functional module can correspond to at least one prompt word template. In this case, it is no longer necessary to save multiple prompt word templates with high overlap, and these prompt word templates can be arranged and combined as needed each time. This approach not only reduces the workload of the user when presetting the prompt word template, but also reduces the storage pressure of the prompt word management system.

[0038] For example, the prompt word templates corresponding to the same type of tasks are of the same category. In other examples, the prompt word templates corresponding to the same functional module in a task are of the same category.

[0039] In the embodiment of the present invention, the detection based on the large language model may be detecting the relationship between multiple prompt word templates, such as conflict detection, relevance detection, similarity detection or importance detection.

[0040] Conflict detection refers to detecting whether there is a conflict between multiple prompt word templates, such as whether they are allowed to be used at the same time, whether the tasks indicated are opposite, etc. For example, if there is a conflict between multiple prompt word templates, inputting task instructions to the large language model based on the multiple prompt word templates at the same time will cause the accuracy of the results returned by the large language model to be low, which will reduce the user experience.

[0041] Association detection refers to detecting whether there is an association between multiple prompt word templates. For example, the association is based on the category corresponding to the template prompt word (such as task types such as document parsing, text for video generation, etc.), field type (financial field, intelligent manufacturing field, automotive field or communication field, etc.), etc., to detect whether multiple prompt word templates can be used at the same time, whether the indicated tasks are related, etc. For example, if there is no association or low association between multiple prompt word templates, and task instructions are input into the large language model based on the multiple prompt word templates at the same time, the performance of the large language model will be reduced, which will reduce the user experience.

[0042] Importance detection refers to detecting the importance or priority between multiple prompt word templates. When multiple prompt word templates are fused into a fused template, the prompt word templates can be sorted according to the importance or priority of the multiple prompt word templates. For example, if multiple prompt word templates are not sorted according to importance or priority, and task instructions are input to the large language model based on the multiple prompt word templates, the performance of the large language model will be reduced, affecting the user experience.

[0043] In the embodiment of the present invention, optionally, a plurality of prompt word templates are stored in the prompt word template library, and the prompt word template includes configuration information, and the configuration information includes, for example, information about the category and whether the category allows the simultaneous use of multiple prompt word templates. The categories include, for example, translation category, sentiment analysis category, question-and-answer category, chart data analysis category, and text-generated image category. In the prompt word template library, prompt word templates can be stored according to category, for example, prompt word templates of the same category are stored in the same folder. When prompt word templates are displayed on the user interface for user selection, they can also be displayed according to different categories.

[0044] In some embodiments of the present invention, optionally, before performing the detection based on the large language model, the method further includes:

[0045] Based on the categories of the multiple target prompt word templates, determine to perform the first detection or the second detection;

[0046] Wherein, the first detection is directly performing detection based on a large language model;

[0047] The second detection is to determine a judgment result based on the configuration information of the plurality of target prompt word templates, and determine the detection results of the plurality of target prompt word templates according to the judgment result.

[0048] Taking conflict detection as an example, firstly, M target prompt word templates selected by the user are obtained; based on the categories of the M target prompt word templates, it is determined whether to perform the first detection or the second detection. M is a positive integer.

[0049] A preliminary determination can be made based on the configuration information to determine whether multiple prompt word templates can be used simultaneously, thereby effectively reducing the complexity of detection.

[0050] In the embodiment of the present invention, for the selected multiple target prompt word templates, the second detection is: first determine whether there is a prompt word template of the target category, and if so, perform intra-category detection (determine the determination result based on the configuration information of the multiple target prompt word templates); then determine whether there is a prompt word template of a different category, and if so, perform cross-category detection (detection based on a large language model). The so-called intra-category detection refers to determining the determination result of prompt word templates belonging to the same category based on the configuration information of the multiple target prompt word templates. The so-called cross-category detection refers to performing detection based on a large language model on prompt word templates containing different categories.

[0051] In some embodiments of the present invention, optionally, determining to perform the first detection or the second detection based on the categories of the multiple target prompt word templates includes: determining to perform the first detection when the multiple target prompt word templates belong to different categories respectively.

[0052] If the words belong to different categories, the category configuration information cannot be used for detection, and detection based on the large language model is performed directly.

[0053] Taking the above selection of M target prompt word templates as an example, when the categories of the M target prompt word templates are all different, the first detection is performed. M is a positive integer.

[0054] In some embodiments of the present invention, optionally, determining to perform the first detection or the second detection based on the categories of the multiple target prompt word templates includes:

[0055] In a case where there are a plurality of first prompt word templates belonging to the target category among the plurality of target prompt word templates, determining to perform the second detection;

[0056] Wherein, the second detection includes:

[0057] Determining a determination result based on configuration information of target categories corresponding to the plurality of first prompt word templates, wherein the configuration information of the target category is used to indicate whether the target category allows the plurality of first prompt word templates to be used simultaneously;

[0058] When the determination result indicates that the multiple first prompt word templates are allowed to be used simultaneously, the step of detecting based on the large language model is performed on the multiple target prompt word templates, or a detection result indicating that the multiple target prompt word templates do not conflict is obtained.

[0059] By making a pre-determination based on the configuration information, it can be preliminarily determined whether multiple prompt word templates can be used simultaneously, thereby effectively reducing the complexity of detection.

[0060] In the embodiment of the present invention, optionally, the prompt word management method based on the large language model further includes:

[0061] When the multiple target prompt word templates all belong to the target category (i.e., the number of the target category is one), and the determination result indicates that the multiple first prompt word templates are allowed to be used simultaneously, a detection result that the multiple target prompt word templates do not have conflicts is determined, and a prompt word template to be fused is determined based on the multiple target prompt word templates. This method does not need to perform detection based on a large language model, reduces detection complexity, and improves detection efficiency.

[0062] In some embodiments, optionally, when the multiple target prompt word templates all belong to the target category (i.e., the number of the target category is one), and the determination result indicates that the multiple first prompt word templates are allowed to be used simultaneously, the step of performing the detection based on the large language model on the multiple target prompt word templates can also be continued. In this way, the configuration information is first used for detection, and then the large language model is used for re-detection, which can improve the detection accuracy.

[0063] For example, among the three selected target prompt word templates, two target prompt word templates have the same category. In this case, the target type is one.

[0064] In the embodiment of the present invention, optionally, the prompt word management method based on the large language model further includes:

[0065] When the determination result indicates that the plurality of first prompt word templates are allowed to be used simultaneously, and there are prompt word templates that do not belong to the target category among the plurality of target prompt word templates, the step of performing the large language model-based detection on the plurality of target prompt word templates.

[0066] That is, when there are multiple target categories and the determination results corresponding to all the target categories indicate that the multiple first prompt word templates are allowed to be used simultaneously, the step of detecting based on the large language model is performed on the multiple target prompt word templates.

[0067] For example, among the four selected target prompt word templates, two target prompt word templates belong to the first category, and the other two belong to the second category. At this time, there are two target categories.

[0068] For example, see Figure 2, the user selects three prompt word templates A1, A3 and B2 from the prompt word template library, wherein the prompt word templates A1 and A3 belong to the same category (category A), that is, two first prompt word templates belonging to the same category are selected from the three prompt word templates. At this time, it is necessary to perform intra-category detection for A1 and A3, that is, to obtain the configuration information of the target category (category A) corresponding to the prompt word templates A1 and A3 (in this embodiment, it can also be called conflict determination configuration information, or conflict determination rules, etc.). When the configuration information of the target category (category A) corresponding to the prompt word templates A1 and A3 indicates that the target category (category A) does not allow the use of multiple prompt word templates at the same time, it is determined that there is a conflict between the prompt word templates A1 and A3, and the prompt word template needs to be reselected. When the configuration information of the target category (category A) corresponding to the prompt word templates A1 and A3 indicates that the target category (category A) allows the use of multiple prompt word templates at the same time, cross-category detection (conflict detection based on a large language model) can continue to be performed.

[0069] In an embodiment of the present invention, there may be multiple target categories in the categories of the selected multiple prompt word templates. For example, the user selects four prompt word templates A1, A3, B1 and B2 from the prompt word template library, wherein prompt word templates A1 and A3 belong to the same category (category A), and prompt word templates B1 and B2 belong to the same category (category B). At this time, it is necessary to perform intra-category detection for A1 and A3. That is, the configuration information of the target category (category A) corresponding to the prompt word templates A1 and A3 is obtained. When the configuration information of the target category (category A) corresponding to the prompt word templates A1 and A3 indicates that the target category (category A) does not allow the use of multiple prompt word templates at the same time, it is determined that there is a conflict between the prompt word templates A1 and A3, and the prompt word template needs to be reselected. It is also necessary to perform intra-category detection for B1 and B2. That is, the configuration information of the target category (category B) corresponding to the prompt word templates B1 and B2 is obtained. When the configuration information of the target category (category B) corresponding to the prompt word templates B1 and B2 indicates that the target category (category B) does not allow the use of multiple prompt word templates at the same time, it is determined that there is a conflict between the prompt word templates B1 and B2, and the prompt word template needs to be reselected. When the configuration information of the target category (category A) corresponding to the prompt word templates A1 and A3 indicates that the target category (category A) allows the use of multiple prompt word templates at the same time, and the configuration information of the target category (category B) corresponding to the prompt word templates B1 and B2 indicates that the target category (category B) allows the use of multiple prompt word templates at the same time, then cross-category detection (conflict detection based on a large language model) can continue to be performed.

[0070] It should be noted that, when the detection is a correlation detection, the above-obtained conflict or non-conflict detection result or judgment result may be associated or non-associated. When the detection is an importance detection, the above-obtained conflict or non-conflict detection result or judgment result may be whether the importance ranking of the prompt word template is correct.

[0071] In the embodiment of the present invention, optionally, the configuration information of each category of the prompt word template library can be set in advance. Optionally, the configuration information of the category can be set when a new category is created in the prompt word template library.

[0072] In the embodiment of the present invention, optionally, the prompt word management method based on the large language model further includes: when the determination result indicates that the multiple first prompt word templates are not allowed to be used simultaneously, obtaining a detection result that the multiple first prompt word templates have conflicts. This method does not need to perform detection based on the large language model, reduces detection complexity, and improves detection efficiency.

[0073] In an embodiment of the present invention, optionally, the prompt word management method based on a large language model further includes: generating first reminder information based on the detection result that the multiple first prompt word templates have conflicts, wherein the first reminder information is used to remind the user that the target category selected by the user is only allowed to retain one prompt word template, and / or remind the user to reselect the prompt word template. Through the first reminder information, the user can be reminded that the selected prompt word template is incorrect, so that the user can reselect.

[0074] In the embodiment of the present invention, optionally, after receiving the detection result returned by the large language model, the method further includes: generating a second reminder message when the detection result returned by the large language model indicates that the multiple target prompt word templates conflict, wherein the second reminder message is used to remind the user that the multiple target prompt word templates conflict, and / or to remind the user to reselect the target prompt word template. The second reminder message can remind the user that the selected prompt word template is incorrect, so that the user can reselect the template.

[0075] In the embodiment of the present invention, the user can reselect the prompt word template according to the first reminder information or the second reminder information, for example, only retain one prompt word template in the target category. After the user reselects the prompt word template, the above detection can be performed again.

[0076] In the embodiment of the present invention, optionally, the prompt word management method based on the large language model further includes:

[0077] Iteratively executing updating of the plurality of target prompt word templates based on the prompt word template reselected by the user; and

[0078] Based on the categories of the multiple target prompt word templates, the step of performing the first detection or the second detection is determined until the multiple target prompt word templates have no conflicts, and the prompt word template to be fused is obtained.

[0079] In the embodiment of the present invention, step S1: if there is a conflict between the multiple target prompt word templates selected by the user, the user can be reminded to reselect the prompt word template; step S2: the prompt word template reselected by the user is replaced with the multiple target prompt word templates, and based on the categories of the updated multiple target prompt word templates, the first detection or the second detection is performed again to obtain the detection results of the updated multiple target prompt word templates; step S3: if the detection result indicates that the updated multiple target prompt word templates do not conflict, the prompt word template to be merged is obtained based on the updated multiple target prompt word templates; step S4: if the updated multiple target prompt word templates conflict, return to continue to execute step S1 until the prompt word template to be merged is obtained.

[0080] The embodiment of the present invention can obtain the final prompt word template to be fused based on multiple selections and detections by the user, thereby improving the effectiveness of the final fusion template.

[0081] In some embodiments, the selected multiple target prompt word templates may be directly input into the large language model, and the large language model may be used to detect whether the selected multiple prompt word templates have conflicts. In this embodiment, the categories of the selected multiple target prompt word templates may not be detected.

[0082] In the above embodiments of the present invention, optionally, determining the prompt word detection instruction based on the multiple target prompt word templates includes: inserting the multiple target prompt word templates into the conflict detection prompt word template to obtain the prompt word detection instruction. The conflict detection prompt word template can effectively generate prompt words, reducing the difficulty of prompt word generation.

[0083] In the embodiment of the present invention, optionally, the conflict detection prompt word template may indicate that the detection result is in the form of a yes / no type to facilitate process judgment.

[0084] In an embodiment of the present invention, optionally, the conflict detection prompt word template can also indicate to return the conflict resolution, for example, pointing out the contradictory points in the prompt word template to guide the user to locate the conflicting prompt word template and reselect the prompt word template, thereby avoiding the user from blindly selecting the prompt word template and saving the number of times the system performs detection.

[0085] Please refer to Figure 3 , Figure 3 Schematic diagram of the conflict detection prompt word template of the embodiment of the present invention. Of course, the structure of the conflict detection prompt word template of the embodiment of the present invention can also be adjusted as needed, and is not limited thereto.

[0086] In the above embodiments of the present invention, the large language model performs conflict detection on the prompt word templates, which may include input conflict detection and / or output conflict detection, etc. For example, assuming that the selected multiple prompt word templates include: a prompt word template translated from Chinese to English and a prompt word template translated from Japanese to Chinese, there is a conflict between the inputs of the prompt word template translated from Chinese to English and the prompt word template translated from Japanese to Chinese, and thus it can be determined that there is a conflict between the two prompt word templates.

[0087] In the embodiment of the present invention, optionally, after receiving the detection result returned by the large language model, the method further includes: when the detection result returned by the large language model indicates that there is no conflict between the multiple target prompt word templates, determining the prompt word template to be merged based on the multiple target prompt word templates.

[0088] In the embodiment of the present invention, optionally, the prompt word management method based on the large language model further includes:

[0089] Fusing the prompt word templates to be fused to obtain a fused template;

[0090] The user query is added to the fusion template to obtain a target prompt word, where the target prompt word is used to instruct the large language model to respond to the user query.

[0091] In the embodiment of the present invention, optionally, the prompt word template library further stores various prompt word templates, and the prompt word template has configuration information, and the configuration information includes priority information, that is, the importance of the prompt word template in the task.

[0092] In the embodiment of the present invention, optionally, the prompt word templates to be fused are fused to obtain a fused template, including:

[0093] According to the priority information of the prompt word templates to be merged, the prompt word templates to be merged are sorted to obtain a merged template, wherein the prompt word template with a higher priority in the merged template is arranged later;

[0094] After obtaining the target prompt word, the method further includes:

[0095] The target prompt word is input into the large language model, and a query answer output by the large language model is received.

[0096] Since the large language model has a better memory for descriptions that are closer to the problem, the more important the prompt word template is, the further back it will be ranked, which can further improve the relevance and usefulness of the large model output. Of course, it should be noted that in some embodiments, if multiple non-conflicting prompt word templates have a dependency relationship, the multiple non-conflicting prompt word templates cannot be simply sorted according to the importance of the prompt word templates. In this case, the multiple prompt word templates can be sorted according to the importance and dependency relationship. For example, multiple prompt word templates with dependencies are arranged in adjacent positions.

[0097] In the embodiment of the present invention, when adding the user query to the fusion template, the user query can be inserted into the prompt position of the fusion template according to the specific form of the fusion template. If there are blanks in the fusion template, the user is also required to fill in these parts to form the final prompt words.

[0098] Please refer to Figure 4 The embodiment of the present invention further provides a prompt word management system 10 based on a large language model, comprising:

[0099] An acquisition module 11 is used to acquire multiple target prompt word templates selected by a user;

[0100] The detection module 12 is used to perform detection based on the large language model, wherein the detection based on the large language model includes: determining a prompt word detection instruction based on the multiple target prompt word templates, and sending the prompt word detection instruction to the large language model; wherein the prompt word detection instruction is used to instruct the large language model to detect the multiple target prompt word templates;

[0101] The receiving module 13 is used to receive the detection result returned by the large language model.

[0102] Optionally, the prompt word management system 10 based on the large language model further includes:

[0103] A first determination module, configured to determine whether to perform a first detection or a second detection based on the categories of the plurality of target prompt word templates;

[0104] Wherein, the first detection is directly performing detection based on a large language model;

[0105] The second detection is to determine a judgment result based on the configuration information of the plurality of target prompt word templates, and determine the detection results of the plurality of target prompt word templates according to the judgment result.

[0106] Optionally, determining to perform the first detection or the second detection based on the categories of the multiple target prompt word templates includes:

[0107] In a case where the plurality of target prompt word templates belong to different categories respectively, it is determined to perform the first detection.

[0108] Optionally, determining to perform the first detection or the second detection based on the categories of the multiple target prompt word templates includes:

[0109] In a case where there are a plurality of first prompt word templates belonging to the target category among the plurality of target prompt word templates, determining to perform the second detection;

[0110] Wherein, the second detection includes:

[0111] Determining a determination result based on configuration information of target categories corresponding to the plurality of first prompt word templates, wherein the configuration information of the target category is used to indicate whether the target category allows the plurality of first prompt word templates to be used simultaneously;

[0112] When the determination result indicates that the multiple first prompt word templates are allowed to be used simultaneously, the step of detecting based on the large language model is performed on the multiple target prompt word templates, or a detection result indicating that the multiple target prompt word templates do not conflict is obtained.

[0113] Optionally, the detection module 12 is further configured to, when the determination result indicates that the multiple first prompt word templates are allowed to be used simultaneously and there is a second prompt word template that does not belong to the target category among the multiple target prompt word templates, perform the step of detecting based on the large language model on the multiple target prompt word templates;

[0114] The detection module 12 is further configured to, when all of the multiple target prompt word templates belong to the target category and the determination result indicates that the multiple first prompt word templates are allowed to be used simultaneously, determine a detection result that there is no conflict between the multiple target prompt word templates, and determine a prompt word template to be merged based on the multiple target prompt word templates.

[0115] Optionally, the prompt word management system 10 based on the large language model further includes:

[0116] The obtaining module is configured to obtain a detection result indicating that the plurality of first prompt word templates are in conflict when the determination result indicates that the plurality of first prompt word templates are not allowed to be used simultaneously.

[0117] Optionally, the prompt word management system 10 based on the large language model further includes:

[0118] The first generating module is used to generate first reminder information based on the detection result of the conflict between the multiple first prompt word templates, wherein the first reminder information is used to remind the user that only one prompt word template is allowed to be retained for the target category selected by the user, and / or to remind the user to reselect the prompt word template.

[0119] Optionally, the prompt word management system 10 based on the large language model further includes:

[0120] The second generation module is used to generate second reminder information when the detection result returned by the large language model indicates that there is a conflict between the multiple target prompt word templates, and the second reminder information is used to remind the user that there is a conflict between the multiple target prompt word templates and / or to remind the user to reselect the target prompt word template.

[0121] Optionally, the prompt word management system 10 based on the large language model further includes:

[0122] The second determination module is configured to determine the prompt word template to be merged based on the multiple target prompt word templates when the detection result returned by the large language model indicates that there is no conflict between the multiple target prompt word templates.

[0123] Optionally, the detection module 12 is used to insert the multiple target prompt word templates into the conflict detection prompt word template to obtain a prompt word detection instruction.

[0124] Optionally, the prompt word management system 10 based on the large language model further includes:

[0125] A more detailed module, configured to iteratively execute updating of the plurality of target prompt word templates based on the prompt word template reselected by the user;

[0126] The detection module 12 is used to determine whether to perform the first detection or the second detection based on the categories of the multiple target prompt word templates until there is no conflict between the multiple target prompt word templates, thereby obtaining the prompt word template to be fused.

[0127] Optionally, the prompt word management system 10 based on the large language model further includes:

[0128] A fusion module, used for fusing the prompt word templates to be fused to obtain a fused template;

[0129] The adding module is used to add the user query to the fusion template to obtain a target prompt word, wherein the target prompt word is used to instruct the large language model to respond to the user query.

[0130] Optionally, the fusion module is used to sort the prompt word templates to be fused according to the priority information of the prompt word templates to be fused to obtain a fused template, wherein the prompt word template with a higher priority in the fused template is arranged later;

[0131] The prompt word management system 10 based on the large language model further includes:

[0132] The receiving module is used to input the target prompt word into the large language model and receive the query answer output by the large language model.

[0133] Please refer to Figure 5 The embodiment of the present invention further provides a computer device 20, including a processor 21, a memory 22, and a computer program stored in the memory 22 and executable on the processor 21. When the computer program is executed by the processor 21, each process of the embodiment of the prompt word management method based on the large language model is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0134] The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, each process of the above-mentioned prompt word management method embodiment based on a large language model is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0135] The embodiment of the present application also provides a computer program product, including computer instructions, which, when executed by a processor, implement the various processes of the above-mentioned prompt word management method embodiment based on a large language model and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0136] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0137] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, computer, computer equipment, air conditioner, or network equipment, etc.) to execute the methods described in each embodiment of the present invention.

[0138] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.

Claims

1. A prompt word management method based on a large language model, characterized in that: include: Obtain multiple target prompt word templates selected by the user; Performing detection based on a large language model, the detection based on the large language model comprising: determining a prompt word detection instruction based on the multiple target prompt word templates, and sending the prompt word detection instruction to the large language model; wherein the prompt word detection instruction is used to instruct the large language model to detect the multiple target prompt word templates; Receiving the detection result returned by the large language model; Before performing the detection based on the large language model, the method further includes: Based on the categories of the multiple target prompt word templates, determine to perform the first detection or the second detection; Wherein, the first detection is directly performing detection based on a large language model; The second detection is to determine a judgment result based on the configuration information of the plurality of target prompt word templates, and determine the detection results of the plurality of target prompt word templates according to the judgment result.

2. The method according to claim 1, characterized in that The step of determining whether to perform the first detection or the second detection based on the categories of the plurality of target prompt word templates includes: In a case where the plurality of target prompt word templates belong to different categories respectively, it is determined to perform the first detection.

3. The method according to claim 1, characterized in that The step of determining whether to perform the first detection or the second detection based on the categories of the plurality of target prompt word templates includes: In a case where there are a plurality of first prompt word templates belonging to the target category in the plurality of target prompt word templates, determining to perform the second detection; Wherein, the second detection includes: Determining a determination result based on configuration information of target categories corresponding to the plurality of first prompt word templates, wherein the configuration information of the target category is used to indicate whether the target category allows the plurality of first prompt word templates to be used simultaneously; When the determination result indicates that the multiple first prompt word templates are allowed to be used simultaneously, the step of detecting based on the large language model is performed on the multiple target prompt word templates, or a detection result indicating that the multiple target prompt word templates do not conflict is obtained.

4. The method according to claim 3, characterized in that Also includes: When the determination result indicates that the plurality of first prompt word templates are allowed to be used simultaneously, and there is a second prompt word template that does not belong to the target category among the plurality of target prompt word templates, performing the step of detecting based on the large language model on the plurality of target prompt word templates; When the multiple target prompt word templates all belong to the target category and the determination result indicates that the multiple first prompt word templates are allowed to be used simultaneously, a detection result that there is no conflict between the multiple target prompt word templates is determined, and a prompt word template to be merged is determined based on the multiple target prompt word templates.

5. The method according to claim 3, characterized in that: Also includes: When the determination result indicates that the plurality of first prompt word templates are not allowed to be used simultaneously, a detection result indicating that the plurality of first prompt word templates conflict is obtained.

6. The method according to claim 5, characterized in that Also includes: Based on the detection result that the multiple first prompt word templates have conflicts, first reminder information is generated, where the first reminder information is used to remind the user that only one prompt word template is allowed to be retained for the target category selected by the user, and / or to remind the user to reselect a prompt word template.

7. The method according to claim 1, characterized in that After receiving the detection result returned by the large language model, the method further includes: When the detection result returned by the large language model indicates that there is a conflict between the multiple target prompt word templates, second reminder information is generated, and the second reminder information is used to remind the user that there is a conflict between the multiple target prompt word templates and / or to remind the user to reselect a target prompt word template.

8. The method according to claim 1, characterized in that After receiving the detection result returned by the large language model, the method further includes: When the detection result returned by the large language model indicates that there is no conflict between the multiple target cue word templates, a cue word template to be fused is determined based on the multiple target cue word templates.

9. The method according to claim 1, characterized in that: The determining of the prompt word detection instruction based on the multiple target prompt word templates includes: The multiple target prompt word templates are inserted into the conflict detection prompt word template to obtain a prompt word detection instruction.

10. The method according to claim 6 or 7, characterized in that: Also includes: Iteratively executing updating of the plurality of target prompt word templates based on the prompt word template reselected by the user; as well as Based on the categories of the multiple target prompt word templates, the step of performing the first detection or the second detection is determined until the multiple target prompt word templates have no conflicts, and the prompt word template to be fused is obtained.

11. The method according to any one of claims 1 to 9, characterized in that: Also includes: Fusing the prompt word templates to be fused to obtain a fused template; The user query is added to the fusion template to obtain a target prompt word, where the target prompt word is used to instruct the large language model to respond to the user query.

12. The method according to claim 11, characterized in that The step of fusing the prompt word templates to be fused to obtain a fused template includes: According to the priority information of the prompt word templates to be merged, the prompt word templates to be merged are sorted to obtain a merged template, wherein the prompt word template with a higher priority in the merged template is arranged later; After obtaining the target prompt word, the method further includes: The target prompt word is input into the large language model, and a query answer output by the large language model is received.

13. A prompt word management system based on a large language model, characterized in that: include: An acquisition module, used to acquire multiple target prompt word templates selected by a user; A detection module, configured to perform detection based on a large language model, wherein the detection based on the large language model comprises: determining a prompt word detection instruction based on the multiple target prompt word templates, and sending the prompt word detection instruction to the large language model; wherein the prompt word detection instruction is used to instruct the large language model to detect the multiple target prompt word templates; A receiving module, used to receive the detection result returned by the large language model; Also includes: A first determination module, configured to determine whether to perform a first detection or a second detection based on the categories of the plurality of target prompt word templates; Wherein, the first detection is directly performing detection based on a large language model; The second detection is to determine a judgment result based on the configuration information of the plurality of target prompt word templates, and determine the detection results of the plurality of target prompt word templates according to the judgment result.

14. A computer device, characterized in that: include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the steps of the prompt word management method based on a large language model as described in any one of claims 1 to 12 are implemented.

15. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the steps of the prompt word management method based on a large language model as described in any one of claims 1 to 12.

Citation Information

Patent Citations

  • Generation method and device of cue word information of large language model, equipment and medium

    CN117539975A

  • Data link generation method and device based on large language model

    CN117592568A

  • Method and device for pre-training models, method and device for generating text, electronic device, storage medium, and computer program

    JP2022153441A

  • Content positioning method and related apparatus

    WO2024021598A1

Cited By

  • AI application cue word management and test method, platform, equipment and medium

    CN122263901A