Design method, system and equipment for prompts required by dialogue between user and large language model and storage medium

By designing a prompting method for users to dialogue with large language models, the problem of users being unable to efficiently utilize large language models is solved, high-quality dialogue and result processing are achieved, and dialogue efficiency is improved.

CN118586360APending Publication Date: 2024-09-03ZENTAO SOFTWARE (QINGDAO) CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310969197.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-03
Publication Date
2024-09-03

AI Technical Summary

Technical Problem

Most users are unable to effectively conduct high-quality conversations with large language models. The main reason is the lack of dialogue skills and the ability to process returned results, resulting in the inability to effectively utilize high-quality responses from large language models.

Method used

A prompting method is designed for users to talk to a large language model. By specifying roles, selecting objects, confirming operations and result processing, combined with process guidance, it helps users generate one-click questions and process the returned results. It uses generative large-scale Language model service interface docking to achieve high-quality dialogue.

Benefits of technology

It provides ordinary users with the ability to generate questions and process returned results with one click, reducing user dialogue costs, improving the efficiency of high-quality dialogue with large language models, and ensuring that the answers returned by large language models can be effectively used.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure BDA0004374655680000091
    Figure BDA0004374655680000091
  • Figure BDA0004374655680000101
    Figure BDA0004374655680000101
  • Figure BDA0004374655680000061
    Figure BDA0004374655680000061
Patent Text Reader

Abstract

The invention discloses a method, a system and equipment for designing words required by dialogue between a user and a large language model and a storage medium. The method comprises five steps of role specifying, object selecting, operation confirming, result processing and issuing preparing. According to the method, the system, the equipment and the storage medium disclosed by the invention, aiming at the problem that a common user cannot establish an effective dialogue with a large language model and complete work by using the dialogue, a one-key generation problem (initiating the dialogue to the large language model by one key, processing a return result of the large language model, and completing work by using the dialogue) which can be used by any user is designed. The whole dialogue process is invisible to the user), and finally a plurality of one-key generation problems can be designed for the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of data processing, and in particular relates to a design method, system, device and storage medium for prompting a user for a dialogue with a large language model in the field. Background Art

[0002] Large language models (LLM, Large Language Model, which is essentially a generative model), such as GPT (Generative Pre-trained Transformer, a generative pre-trained language model developed by OpenAI), can generate fluent human-like responses for many downstream tasks (such as helping users solve difficult problems and answer questions at work).

[0003] However, the large language model may return answers that are inconsistent with reality during the conversation with the user. There is a problem that the returned answers cannot be effectively used by ordinary users. It is a challenge for ordinary users to master the conversation skills that can return high-quality replies and improve the efficiency of using the returned results. The main reason is that most users do not have the skills to communicate with large language models, nor the ability to input data and models into large language models and process the returned results.

[0004] For example, questions such as "demand polishing", "demand splitting use cases", and "demand splitting tasks" all require specific data sources and processing of model return results. At the same time, they require that the user's questions can be understood by the large language model and return high-quality answers. In summary, during the entire conversation process with the large language model, most users are unable to effectively complete a high-quality conversation. Summary of the invention

[0005] The technical problem to be solved by the present invention is to provide a design method, system, device and storage medium for prompting required for a user to have a conversation with a large language model, thereby guiding the user and the large language model to have a high-quality conversation through process guidance.

[0006] The present invention adopts the following technical solution:

[0007] A method for designing a prompt for a user to talk with a large language model, the improvement of which is that it includes the following steps:

[0008] Step 1, specify a role: After selecting a large language model, specify a role for it;

[0009] Step 2, select the object: select the data source and data type involved in the conversation between the user and the large language model as the background information for the conversation with the large language model;

[0010] Step 3, confirm the operation: give a dialogue prompt based on the selected object;

[0011] Step 4, result processing: determine the format of the dialogue results returned by the large language model and the form type for the third-party system to process the format;

[0012] Step 5, prepare to publish: publish the set prompts to users for them to choose and use.

[0013] Furthermore, by setting the docking parameters of the large language model service interface, a dialogue basis is established with the large language model. The proxy types include HTTP(S), SOCKS4, and SOCKS5.

[0014] Furthermore, the dialogue answers given by the large language model can return results according to the data format and type of the form items in the third-party system.

[0015] Furthermore, the published word prompts are presented to users in a process-guided manner, so that users can describe their needs and goals, prompt the large language model with one click, and directly obtain the results.

[0016] A system for designing prompts required for a user to talk with a large language model, the improvement of which includes:

[0017] The role assignment module is used to assign a role to a selected language model.

[0018] An object selection module is used to select the data source and data type involved in the conversation between the user and the large language model as background information for the conversation with the large language model;

[0019] A confirmation operation module, used to give a dialogue prompt based on the selected object;

[0020] The result processing module is used to determine the format of the dialogue results returned by the large language model and the form type of the third-party system processing the format;

[0021] The preparation and release module is used to release the set prompts to users for their selection.

[0022] Furthermore, the object selection module establishes a dialogue basis with the large language model by setting the docking parameters of the large language model service interface, and the proxy types include HTTP(S), SOCKS4, and SOCKS5.

[0023] Furthermore, the dialogue answers given by the large language model can return results according to the data format and type of the form items in the third-party system.

[0024] Furthermore, the published word prompts are presented to users in a process-guided manner, so that users can describe their needs and goals, prompt the large language model with one click, and directly obtain the results.

[0025] A device for designing prompts required for a user to communicate with a large language model, the improvement of which is that it includes: a processor; a memory in which executable instructions of the processor are stored; wherein the processor is configured to execute the steps of the above method by executing the executable instructions.

[0026] A computer-readable storage medium is used to store a program, wherein the improvement lies in that the steps of the above method are implemented when the program is executed.

[0027] The beneficial effects of the present invention are:

[0028] The method, system, device and storage medium disclosed in the present invention are designed to solve the problem that ordinary users cannot establish an effective dialogue with a large language model and use the dialogue to complete work. A one-click question generation method that can be used by any user is designed (a dialogue is initiated to the large language model with one click, and the return results of the large language model are processed. The entire dialogue process is invisible to the user). Ultimately, multiple one-click question generation methods can be designed for the user.

[0029] The method, system, device and storage medium disclosed in the present invention are based on the service interface docking of the commonly used generative large language model to build a basic dialogue. The dialogue skills of various generative large language models are embedded, and the user is guided to complete a high-quality dialogue with the large language model through process guidance. The data and form item data types of the third-party system can be obtained, and the data source and the processing method for the results returned by the large language model can be confirmed. Based on the generative large language model, the process guidance method is used to guide the user to design a one-click generation question based on the large language model. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 It is a schematic flow diagram of the method of the present invention;

[0031] Figure 2 It is a block diagram of the composition of the system of the present invention. DETAILED DESCRIPTION

[0032] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0033] Example 1. This example discloses a method for designing the prompts required for a user to have a conversation with a large language model. General conversation skills are extracted from conversations with various generative large language models, and developed into built-in conversation skill models to ensure that different large language models can return high-quality answers under different conversation skill models. By having frequent conversations with different large language models and statistically analyzing the correctness and rationality of all returned results, a specific conversation skill model is abstracted. For example, when asking questions to a large language model, the questions are asked according to the text structure that specifies the role, describes the problem, confirms the goal, and supplements the requirements for the large language model. Then the large language model will most likely return high-quality answers. Figure 1 As shown, the specific steps include:

[0034] Step 1, specify the role: After selecting the large language model, specify a role for it; this can guide the generative large language model into a scene, give it a professional identity, and translate the set parameter content into the conversation content with the generative large language model.

[0035] Step 2, select the object: select the data source and data type involved in the conversation between the user and the large language model as the background information for the conversation with the large language model;

[0036] Step 3, confirm the operation: give a dialogue prompt based on the selected object;

[0037] Step 4, result processing: determine the format of the dialogue results returned by the large language model and the form type for the third-party system to process the format; select the form page and form item format of the third-party system, and translate the set parameter content into the dialogue content with the generative large language model. Select the form item format of the third-party system's creation, editing, etc. form as the format requirement for the return result of the generative large language model. When the third party recognizes that the format requirement for the return result of the generative large language model is correct, it can automatically open the corresponding form page in the third-party system and enter the returned result into the form item.

[0038] Step 5, prepare for release: release the set prompts to users for their selection. Check the basic information of the user-defined prompts to ensure the consistency between the function and description of the dialogue skill template when it is applied.

[0039] Based on the docking with various generative large language model service interfaces, the dialogue foundation is built. By setting the docking parameters of the large language model service interface (for example: API Key, proxy server settings), the dialogue foundation with the large language model is established. The proxy types include HTTP(S), SOCKS4, and SOCKS5. Due to network operations, a separate test button is provided to test whether the combination of the model parameters and the proxy parameters can successfully access and call the model.

[0040] The dialogue answers given by the large language model can be displayed in third-party systems as data and form item data types.

[0041] The published prompts are presented to users in a process-guided manner so that users can describe their needs and goals, submit prompts to the large language model with one click, and directly obtain results.

[0042] The method of the present invention is based on the dialogue skill templates with various generative large language models, and solves the problem of reuse in high-frequency scenarios by encapsulating them into a prompt application. By encapsulating the dialogue skill template into a prompt reference, the prompt application is initiated in high-frequency scenarios with one click, the content in the dialogue skill template is input into various generative large language models, and the result is recognized and input into the form item through the result processing function of the third-party system.

[0043] The method of the present invention obtains data from a third-party system and data types of form items, confirms the data source and the processing method for the results returned by the large language model. It helps users obtain the target data of the third-party system and the processing method for the returned results, and integrates the data and the processing method into the dialogue with the large language model to reduce the user's dialogue cost and the cost of using the results returned by the large language model.

[0044] The method of the present invention is based on a generative large language model, and guides the user in a process-guided manner to design a dialogue with the large language model and process the results returned by the large language model according to the process, and can design any one-key generation question for the dialogue with the large language model.

[0045] This embodiment also discloses a system for designing prompts required for a user to communicate with a large language model, such as Figure 2 As shown, including:

[0046] The role assignment module is used to assign a role to a selected language model.

[0047] An object selection module is used to select the data source and data type involved in the conversation between the user and the large language model as background information for the conversation with the large language model;

[0048] Design and implementation of embedding data in the large language model Prompt:

[0049] Large language models in the field of natural language processing are one of the most popular research areas at present, among which GPT-3 is one of the most advanced large language models. Although these models have achieved great success in language processing tasks, in actual application scenarios, we often need to embed some knowledge or data in specific fields into the model to improve the performance of the model. Usually, Fine tuning or Embedding can be used, but for data that is only used once, the first two methods are too expensive. Therefore, this application introduces a design and implementation method for embedding data in a large language model Prompt, which can effectively improve the performance of the model in specific fields and has practical application value.

[0050] Design idea: Based on GPT-3, the most advanced large language model. In the prompt of GPT-3, data can be embedded into the model by adding specific language tags or placeholders. Specifically, the data is converted into a series of text descriptions and embedded into the prompt. During model training or prediction, the model automatically converts these text descriptions into corresponding values ​​or vectors and uses them in the model calculation process.

[0051] Implementation steps:

[0052] For the data to be embedded, it is serialized and converted into a series of text descriptions. These text descriptions can be the characteristics, attributes, labels, etc. of the data.

[0053] Add specific language tags or placeholders in the prompt to indicate that the content is embedded data. These tags or placeholders can be custom or predefined.

[0054] Implementation example: An experiment was conducted on a software product plan description summary task.

[0055]

[0056]

[0057]

[0058] Simple multi-column data is directly serialized as a text description with a table header of CSV type. If the data object has a complex nested relationship, it is serialized as a text description of JSON type, and the text is compressed to remove useless blank characters. For the large language model, the presence or absence of blank characters does not affect its understanding. When the data is serialized as a text description, it is supplemented with appropriate descriptions to help the large language model understand the data.

[0059] const role = 'You are a product manager with many years of experience in software development.';

[0060] const supplement = 'This is the data of a phase of software product plan. Usually, a phase plan contains information such as title, description and software requirements to be done in this phase.'; / / Supplementary description of the data structure.

[0061] const action = 'Supplement and improve the plan description based on the data provided, and briefly summarize what needs to be done in this period.';

[0063] In addition to the data, the prompt body also includes the role of the large language model, a description of the data supplement, and the requirements for the large language model. The role is very important here. It can improve the quality of the large language model's answers by suggesting that the large language model is a very intelligent or experienced assistant. Good role information will change the probability distribution of high-quality content in the model.

[0064] Prompt template:

[0065] constprompt=`

[0066] ${role}

[0067] This is a piece of data about ${dataType}:

[0068] \`\`\`

[0069] ${serializeData}

[0070] \`\`\`

[0071] ${supplement}

[0072] ${action}

[0073] Think step by step. `;

[0074] "Think step by step" is a simple but practical prompt, a simplified version of CoT (Chain of Thought), which can improve the quality of large language models' answers to most questions.

[0075] Some domain-specific data is embedded into the Prompt of GPT-3 and compared with the model without embedded data. The experimental results show that the performance of the model with embedded data on the test set has been significantly improved, proving the effectiveness of the method.

[0076] Summary: The above design and implementation method of embedding data in the large language model Prompt can effectively improve the performance of the model in specific fields and has practical application value. In future research, we will further explore how to optimize the way of embedding data to further improve the performance of the model.

[0077] The format of the returned data is as follows:

[0078] Use JSON Schema to specify the format of the returned data. JSON Schema (https: / / json-schema.org / ) is a general JSON data format validation tool. It provides a way to define the JSON data format using JSON. The official example is as follows:

[0079]

[0080] Therefore, this application uses JSON Schema to organize the required return value format. For example, a large language model is required to return data of a research and development requirement type. Research and development requirements usually include three attributes: requirement title, requirement description, and acceptance criteria. The data format of the research and development requirement type is specified using JSON Schema as follows:

[0081]

[0082]

[0083] In this way, the data format of the R&D requirement type can be clearly defined to ensure that the required data can be obtained when using a large language model. The above is the specification method of the return value data format.

[0084] Make the return value of the large language model conform to the data format specification:

[0085] In the OpenAI API in June 2023, OpenAI provides a Function calling mechanism (https: / / platform.openai.com / docs / guides / gpt / function-calling). Through this mechanism, the large language model can intelligently choose whether to output a JSON object containing the parameters required for the function call, which can increase the reliability of the return value of the large language model and reduce processing costs.

[0086] By utilizing this mechanism, we can reliably obtain JSON return values ​​that can be processed by the program. The specific implementation method is as follows:

[0087] 1. Construct a JSON Schema for the return value data format, referring to the above "Regulations on the Format of Return Data".

[0088] 2. Add two parameters to the API request, namely:

[0089] οfunctions, with the content [{"name": "function", "parameters": <JSON Schema content>}], which is used to declare a function named function and specify that the parameters received by this function are the corresponding return value data format;

[0090] οfunctionCall, with the content {"name": "function"}, which is used to force the call of the function function to ensure that the return value must be the JSON object we need;

[0091] 3. Construct the request body and make a request to obtain the JSON return value.

[0092] In this way, a JSON return value suitable for program processing can be obtained.

[0093] Taking the scenario of using a large language model to help polish requirements as an example, there is the following input:

[0094]

[0095]

[0096] This application obtains the JSON-formatted return value from the arguments attribute of function_call. The above is the method of obtaining the JSON return value from the large language model.

[0097] Confirmation operation module, used to give dialogue prompts based on the selected object;

[0098] Result processing module, used to determine the format of the dialogue result returned by the large language model and the form type processed by the third-party system for this format;

[0099] Preparation for release module, used to publish the set prompts to users for them to choose to use.

[0100] The selected object module establishes a dialogue basis with the large language model by setting the docking parameters of the large language model service interface, and the proxy types include HTTP(S), SOCKS4, and SOCKS5.

[0101] In the result processing module, the dialogue answers given by the large language model can return results according to the data format and type of the form items in the third-party system.

[0102] The prompts released by the module are presented to the user in a process-guided manner, so that the user can describe the requirements and goals to be achieved, and then prompt the large language model with one click and directly obtain the results.

[0103] A device for designing prompts required for a user to communicate with a large language model, comprising: a processor; a memory in which executable instructions of the processor are stored; wherein the processor is configured to execute the steps of the above method by executing the executable instructions.

[0104] A computer-readable storage medium is used to store a program, and the program implements the steps of the above method when executed.

[0105] Various embodiments of the systems and methods described above herein may 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 embodiments may 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 may 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.

[0106] The program code for implementing the method of the present invention can be written in any combination of one or more programming languages. These program codes can 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 can be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.

[0107] In the context of the present invention, 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, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, 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.

[0108] To provide interaction with a user, the systems and methods described herein may 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 a pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0109] The systems and methods described herein can be implemented in a computing system that includes backend 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 frontend 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 backend components, middleware components, or frontend components. The components of the system can 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), a blockchain network, and the Internet.

[0110] 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 between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services. The server may also be a server of a distributed system, or a server combined with a blockchain.

[0111] Cloud computing refers to a technology system that uses network access to elastically scalable shared physical or virtual resource pools. Resources can include servers, operating systems, networks, software, applications, and storage devices, and can be deployed and managed on demand and in a self-service manner. Cloud computing technology can provide efficient and powerful data processing capabilities for technical applications such as artificial intelligence and blockchain, as well as model training.

[0112] Artificial intelligence is a discipline that studies how to use computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, machine learning / deep learning technology, big data processing technology, knowledge graph technology, and other major directions.

[0113] 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 described in the present invention can be performed in parallel, sequentially, or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0114] The above specific implementations do not constitute a limitation on the protection scope of the present invention. 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 invention should be included in the protection scope of the present invention.

Claims

1. A method for designing a prompt for a user to talk with a large language model, characterized in that: The steps include: Step 1, specify a role: After selecting a large language model, specify a role for it; Step 2, select the object: select the data source and data type involved in the conversation between the user and the large language model as the background information for the conversation with the large language model; Step 3, confirm the operation: give a dialogue prompt based on the selected object; Step 4, result processing: determine the format of the dialogue results returned by the large language model and the form type for the third-party system to process the format; Step 5, prepare to publish: publish the set prompts to users for them to choose and use.

2. The method for designing a prompt for a conversation between a user and a large language model according to claim 1, characterized in that: By setting the docking parameters of the large language model service interface, a dialogue basis is established with the large language model. The proxy types include HTTP(S), SOCKS4, and SOCKS5.

3. The method for designing a prompt for a user to talk with a large language model according to claim 1, characterized in that: The dialogue answers given by the large language model can return results according to the data format and type of the form items in the third-party system.

4. The method for designing a prompt for a user to talk with a large language model according to claim 1, characterized in that: The published prompts are presented to users in a process-guided manner so that users can describe their needs and goals, submit prompts to the large language model with one click, and directly obtain results.

5. A system for designing prompts required for a user to talk to a large language model, characterized in that: include: The role assignment module is used to assign a role to a selected language model. An object selection module is used to select the data source and data type involved in the conversation between the user and the large language model as background information for the conversation with the large language model; A confirmation operation module, used to give a dialogue prompt based on the selected object; The result processing module is used to determine the format of the dialogue results returned by the large language model and the form type of the third-party system processing the format; The preparation and release module is used to release the set prompts to users for their selection.

6. The system for designing prompts required for a user to talk with a large language model according to claim 5, characterized in that: The object selection module establishes a dialogue basis with the large language model by setting the docking parameters of the large language model service interface. The proxy types include HTTP(S), SOCKS4, and SOCKS5.

7. The system for designing prompts required for a user to talk with a large language model according to claim 5, characterized in that: The dialogue answers given by the large language model can return results according to the data format and type of the form items in the third-party system.

8. The system for designing prompts required for a user to talk with a large language model according to claim 5, characterized in that: The published prompts are presented to users in a process-guided manner so that users can describe their needs and goals, submit prompts to the large language model with one click, and directly obtain results.

9. A device for designing a prompt for a user to talk to a large language model, characterized in that: include: processor; A memory in which executable instructions of the processor are stored; wherein the processor is configured to perform the steps of the method according to any one of claims 1 to 4 by executing the executable instructions.

10. A computer-readable storage medium for storing a program, characterized in that: When the program is executed, the steps of the method according to any one of claims 1 to 4 are implemented.

Citation Information

Cited By

  • Method for creating a system design for a micro-electromechanical system

    DE102025117514A1