Method, device, equipment, medium and program product for prompt word generation of large model

By dynamically segmenting and selecting system prompts, prompts matching the processing request are generated, solving the problem of prompt complexity affecting response accuracy in existing technologies and achieving efficient response for large models.

CN120632025BActive Publication Date: 2026-06-09BEIJING ZITIAO NETWORK TECH CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING ZITIAO NETWORK TECH CO LTD
Filing Date
2025-05-29
Publication Date
2026-06-09

Smart Images

  • Figure CN120632025B_ABST
    Figure CN120632025B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure provide a method, device, equipment, storage medium and program product for prompt word generation for a large model. In the example method, in response to receiving a processing request initiated to a large model, a system prompt word for processing the request is determined, the system prompt word including multiple parts. At least one part is determined from the multiple parts of the system prompt word based on at least one of the processing request or context information associated with the processing request. Based on the at least one part, prompt word information for the processing request is generated, the prompt word information being used to provide to the large model to obtain a response for the processing request.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The exemplary embodiments disclosed herein generally relate to the field of computers, and particularly to methods, apparatus, devices, computer-readable storage media, and computer program products for generating prompt words for large models. Background Technology

[0002] With the development of information technology, various terminal devices can provide people with a variety of services in work and life. Applications providing these services can be deployed on these terminal devices. Terminal devices or applications can provide users with digital assistant-like functions to support better interaction with users. Digital assistant-like functions can achieve question-and-answer interaction with users through language models to meet various user needs. For example, in an IT customer service scenario, an intelligent customer service assistant can answer user questions through a language model. Summary of the Invention

[0003] In a first aspect of this disclosure, a method for generating prompt words for a large model is provided. The method includes: in response to receiving a processing request initiated to the large model, determining a system prompt word for processing the request, the system prompt word comprising multiple parts; determining at least one part from the multiple parts of the system prompt word based on at least one of the processing request or contextual information associated with the processing request; and generating prompt word information for the processing request based on the at least one part, the prompt word information being provided to the large model to obtain a response to the processing request.

[0004] In a second aspect of this disclosure, an apparatus for generating prompt words for a large model is provided. The apparatus includes: a first determining module configured to, in response to receiving a processing request initiated to the large model, determine a system prompt word for processing the request, the system prompt word comprising a plurality of parts; a second determining module configured to determine at least one part from the plurality of parts of the system prompt word based at least on at least one of the processing request or contextual information associated with the processing request; and a generating module configured to generate prompt word information for the processing request based on the at least one part, the prompt word information being provided to the large model to obtain a response to the processing request.

[0005] In a third aspect of this disclosure, an electronic device is provided. The device includes at least one processor; and at least one memory coupled to the at least one processor and storing instructions for execution by the at least one processor. When executed by the at least one processor, the instructions cause the device to perform the method of the first aspect.

[0006] In a fourth aspect of this disclosure, a computer-readable storage medium is provided. The computer-readable storage medium stores computer-executable instructions that can be executed by a processor to implement the method of the first aspect.

[0007] In a fifth aspect of this disclosure, a computer program product is provided, the program product including computer-executable instructions that can be executed by a processor to implement the method of the first aspect.

[0008] It should be understood that the content described in this content section is not intended to limit the key or essential features of the embodiments of this disclosure, nor is it intended to restrict the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0009] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. In the drawings, the same or similar reference numerals denote the same or similar elements, wherein:

[0010] Figure 1 A schematic diagram is shown of an example environment in which embodiments of the present disclosure may be implemented;

[0011] Figure 2 A schematic diagram of an example architecture for generating prompt word information according to some embodiments of the present disclosure is shown;

[0012] Figure 3 A schematic diagram of an example architecture for determining at least one part from system prompt words according to some embodiments of the present disclosure is shown;

[0013] Figure 4 A flowchart illustrating an example process for generating prompt word information according to some embodiments of this disclosure is shown;

[0014] Figure 5 A schematic structural block diagram of an example apparatus for generating prompt word information according to some embodiments of the present disclosure is shown; and

[0015] Figure 6 A block diagram of an electronic device capable of implementing several embodiments of the present disclosure is shown. Detailed Implementation

[0016] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.

[0017] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.

[0018] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0019] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.

[0020] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.

[0021] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0022] It should be noted that the headings of any section / subsection provided herein are not limiting. Various embodiments are described throughout this document, and embodiments of any type may be included under any section / subsection. Furthermore, embodiments described in any section / subsection may be combined in any way with any other embodiments described in the same section / subsection and / or different sections / subsections.

[0023] In this document, unless explicitly stated otherwise, performing a step in response to A does not mean that the step is performed immediately after A, but may include one or more intermediate steps.

[0024] In the description of embodiments of this disclosure, the term "comprising" and similar terms should be understood as open-ended inclusion, i.e., "including but not limited to". The term "based on" should be understood as "at least partially based on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The term "some embodiments" should be understood as "at least some embodiments". Other explicit and implicit definitions may also be included below. The terms "first", "second", etc., may refer to different or the same objects. Other explicit and implicit definitions may also be included below.

[0025] As used in this paper, the term "model" refers to a system that learns the relationship between inputs and outputs from training data, enabling it to generate corresponding outputs for a given input after training. Model generation can be based on machine learning techniques. Deep learning is a machine learning algorithm that uses multiple layers of processing units to process inputs and provide corresponding outputs. In this paper, "model" may also be referred to as a "machine learning model," a "machine learning network," or simply a "network," and these terms are used interchangeably. A model can also include different types of processing units or networks.

[0026] Figure 1 A schematic diagram of an example environment 100 in which embodiments of the present disclosure can be implemented is shown. In this example environment 100, a digital assistant 130 of application 120 is installed on a terminal device 110. A user 140 can interact with application 120 via terminal device 110 and / or an attached device of terminal device 110. Exemplarily, application 120 may be a chat application (also known as an instant messaging application), a document application, an audio / video conferencing application, an email application, a task application, a calendar application, a goal and key results (OKR) application, etc. It can be understood that, although... Figure 1 The image shows a single application 120, but in reality, multiple applications 120 can be installed on the terminal device 110. In some embodiments, application 120 may include a multi-functional collaboration platform, such as an office collaboration platform (also known as an office suite) that can provide integration of various types of applications to facilitate people's office work, communication, and other activities. In a multi-functional collaboration platform, people can launch different business components as needed to complete corresponding information processing, sharing, communication, etc.

[0027] The digital assistant 130 can be configured to have intelligent conversational capabilities. Figure 1 In the example shown, digital assistant 130 can be configured to run as a standalone application, such as a web application or other type of application. In other examples, digital assistant 130 can be integrated into application 120.

[0028] Users can interact with the digital assistant 130 through a client. During the interaction, the user inputs interactive messages, and the digital assistant 130 responds to the user's input by providing reply messages. Typically, the digital assistant 130 supports users inputting questions in natural language and performs tasks and provides replies based on its understanding of the natural language input and logical reasoning capabilities. In some embodiments, depending on the configuration of the application 120, the interaction messages with the application 120 may include multimodal messages, such as text messages (e.g., natural language text), voice messages, image messages, video messages, and so on.

[0029] exist Figure 1 In environment 100, terminal device 110 can display user interface 150 of application 120. User interface 150 may include various interfaces provided by application 120, such as the interaction interface between user 140 and digital assistant 130. The interaction interface may include, for example, a conversation window between user 140 and digital assistant 130.

[0030] In some embodiments, terminal device 110 communicates with server 160 to provide services to application 120. Terminal device 110 can be any type of mobile terminal, fixed terminal, or portable terminal, including mobile phones, desktop computers, laptop computers, notebook computers, netbook computers, tablet computers, media computers, multimedia tablets, personal communication system (PCS) devices, personal navigation devices, personal digital assistants (PDAs), audio / video players, digital cameras / camcorders, positioning devices, television receivers, radio receivers, e-book devices, gaming devices, or any combination thereof, including accessories and peripherals of these devices or any combination thereof. In some embodiments, terminal device 110 can also support any type of user-facing interface (such as "wearable" circuitry). Server 160 can be various types of computing systems / servers capable of providing computing power, including but not limited to mainframes, edge computing nodes, computing devices in cloud environments, etc.

[0031] It should be understood that the structure and function of the various elements in environment 100 are described for illustrative purposes only and do not imply any limitation on the scope of this disclosure. For example, embodiments of this disclosure can be applied to any suitable one or more applications, and are not limited to office suites.

[0032] As mentioned above, digital assistant functions can use machine learning models (e.g., language models) to achieve question-and-answer interactions with users, thereby meeting various user needs. In one approach, digital assistant functions can leverage machine learning models to provide services such as operations and maintenance information queries to users (e.g., operations and maintenance personnel). In this approach, for different processing requests, digital assistant functions mostly generate prompts based on Standard Operating Procedures (SOPs) to utilize machine learning models to complete the processing requests.

[0033] In situations where there is a significant amount of background knowledge related to the request or the request itself is complex, the prompts generated based on the Standard Operating Procedure (SOP) can be quite complex. However, complex prompts can impact the inference or generation of machine learning models. For example, irrelevant or useless information in the prompts may affect the machine learning model's reasoning. This can further lead to the machine learning model's output failing to meet requirements, impacting the performance of digital assistant functions in resolving requests.

[0034] In view of this, embodiments of the present disclosure provide a scheme for generating prompt words for large models, which can be applied to large models. In this scheme, in response to receiving a processing request initiated to a large model, a system prompt word for processing the request is determined, the system prompt word comprising multiple parts; at least one part is determined from the multiple parts of the system prompt word based on at least one of the processing request or context information associated with the processing request; and based on the at least one part, prompt word information for the processing request is generated, the prompt word information being provided to the large model to obtain a response to the processing request.

[0035] In embodiments of this disclosure, system prompts are divided into multiple parts. For a received processing request, one or more parts are determined from these parts to generate prompt information. That is, the parts included in the prompt information provided to the machine learning model are not static but determined specific to the processing request. This is a dynamic prompt generation scheme. In this way, more accurate and concise prompt information can be obtained while ensuring that the prompt information corresponds to the processing request. Furthermore, this improves the accuracy of obtaining responses to processing requests.

[0036] The following section provides a detailed description of various example implementations of this scheme, with reference to the accompanying drawings.

[0037] Example Architecture

[0038] Figure 2 A schematic diagram of an example architecture 200 for generating prompt word information according to some embodiments of the present disclosure is shown. For example... Figure 2As shown, architecture 200 can be implemented or included at terminal device 110 or server 160. Alternatively, architecture 200 can be implemented collaboratively by server 160 and terminal device 110. For illustrative purposes only, the following description uses the example of architecture 200 being implemented at server 160.

[0039] In some embodiments, if a processing request initiated to a large model is determined, a system prompt word for processing the request is determined. The large model may include, but is not limited to, a large language model or a multimodal model. A multimodal model can, for example, handle input from multiple modalities such as text, images, or video. For example, processing request 210 may be a request input by user 140, such as a query for system operation and maintenance information or a query for system files. For example, processing request 210 may be a query request input by the user. For example, processing request 210 may be the user-input "Query the weather in region A". In some embodiments, processing request 210 may be a request generated by application 120 or other applications during preprocessing. For example, if application 120 detects an anomaly in the execution of task A during preprocessing, processing request 210 is generated to query the execution progress of task A.

[0040] In some embodiments, the system prompt (SP) comprises multiple parts. Hereinafter, these parts may also be referred to as prompt parts or SP parts. As an example, Figure 2 The system prompt words 232-1, 232-2, 232-3, and 232-4 are shown, and are individually or collectively referred to as part 232. It should be understood that... Figure 2 The number of portions 232 shown is merely exemplary and is not intended to be limiting. Exemplarily, a system prompt can be implemented as a prompt template, and multiple portions may include multiple sub-templates. It is understood that the embodiments described below with respect to prompt templates and sub-templates can be applied to system prompts and portions of system prompts.

[0041] In some embodiments, multiple candidate system prompts can be set for the large model based on different application scenarios. These multiple candidate system prompts can be applied to different task types. For example, the multiple candidate system prompts may include system prompts corresponding to operation and maintenance scenarios or system prompts corresponding to information query scenarios. If server 160 receives a processing request sent to the large model, it determines the task type indicated by the processing request. Server 160 can select a system prompt for that task type from the multiple candidate system prompts based on the determined task type. For example, server 160 can determine the system prompt corresponding to the task type indicated by processing request 210 from a pre-determined set of multiple candidate system prompts. For instance, if the task type indicated by processing request 210 is operation and maintenance information query, then the system prompt corresponding to the operation and maintenance information query task is determined from the multiple candidate system prompts. In some embodiments, server 160 can utilize a machine learning model to generate corresponding system prompts based on the task type indicated by processing request 210.

[0042] In some embodiments, at least one part is determined from multiple parts of a system prompt based at least on at least one of a processing request or context information associated with the processing request. In some embodiments, server 160 determines at least one part from multiple parts of a system prompt based on at least one of a processing request 210 or context information 220 associated with the processing request 210. The context information 220 associated with the processing request 210 may include information related to the task corresponding to the processing request 210. For example, if the processing request 210 is a weather query request, the context information 220 may include location information and time information corresponding to the weather query request. If the processing request 210 is a maintenance request for a robot, the context information 220 may include the robot's operating information. In some embodiments, the processing request 210 may only include processing instructions. Server 160 may determine the context information 220 from a predetermined data source (e.g., the Internet, a specified database) based on the processing instructions and the task type corresponding to the processing request 210. For example, if the processing request 210 is a postponement request for task A, the context information 220 is determined from a data source that includes maintenance information related to task A. In some embodiments, processing request 210 may include processing instructions and reference information related to processing request 210, and context information 220 may be determined based on the reference information. For example, if processing request 210 is "I am in city A, check today's weather", context information 220 may be determined based on "city A" and "today".

[0043] In some embodiments, for a determined system prompt word, server 160 may obtain prompt word configuration information 230 for that system prompt word. The prompt word configuration information 230 may indicate corresponding prompt word generation logic for multiple parts of the system prompt word. Server 160 selects at least one part of the multiple parts of the system prompt word from which the prompt word generation logic is satisfied, based on at least one of a processing request or context information 220 and the corresponding prompt word generation logic. As an example, Figure 2 The diagram illustrates the first prompt word generation logic 231-1, the second prompt word generation logic 231-2, the third prompt word generation logic 231-3, and the fourth prompt word generation logic 231-4, corresponding to multiple parts of the system prompt word. These are individually or collectively referred to as prompt word generation logic 231. It should be understood that... Figure 2 The number of prompt word generation logic 231 shown is merely exemplary and is not intended to be any limitation.

[0044] In some embodiments, the prompt configuration information may include configuration items for each prompt portion. Each configuration item may include the text of the corresponding prompt portion and the prompt generation logic.

[0045] In some embodiments, the prompt generation logic may include a judgment condition corresponding to a certain part and a logic type for that part. The judgment condition may represent the logic to be followed in the process of selecting at least one part from multiple parts of the system prompt. For a certain part 232 in the system prompt, if it is detected that at least one of the processing request 210 or the context information 220 satisfies the judgment condition corresponding to that part, it is determined that the prompt generation logic for that part is satisfied. This part may be determined to be one of at least one parts. For example, the judgment condition corresponding to a certain part is "whether task A is completed". If it can be determined based on the processing request 210 and the context information 220 that task A has been completed, it is determined that the judgment condition is satisfied, and that part is determined to be one of at least one parts.

[0046] The logical type of a portion of the system prompt indicates the logic upon which the prompt is generated. In some embodiments, the logical type of the prompt generation logic may include a default inclusion type, a stop generation type, a continue generation type, or a branch selection type. In some embodiments, for the prompt portion of the default inclusion type, the prompt configuration information may include text or necessary text that is included by default in the prompt information. In some embodiments, for the prompt portion of the stop generation type (i.e., the stop type), the prompt configuration information may include a tuple with three elements. This tuple may include a condition, the prompt text to be output if the condition is true, and a stop label corresponding to the condition not being true. In some embodiments, for the prompt portion of the continue generation type (i.e., the continue type), the prompt configuration information may include a tuple with three elements. This tuple may include a condition, the prompt text to be output if the condition is true, and a jump label corresponding to the condition not being true. In some embodiments, for the prompt portion of the branch selection type (i.e., the if-else type), the prompt configuration information may include a tuple with three elements. This tuple can include the condition, the prompt to be output if the condition is true, and the prompt to be output if the condition is false.

[0047] In some embodiments, for a first portion 232-1 of a plurality of portions 232, server 160 may determine state information 310 for the first prompt word generation logic corresponding to the first portion 232-1 based on at least one of processing request 210 or context information 220 associated with processing request 210. If the determined state information 310 matches the conditions indicated by the first prompt word generation logic 231-1 corresponding to the first sub-template 232-1, server 160 may select the first portion 232-1 as one of at least one portion. Figure 2 As shown, the identified at least one portion may include a first portion 240-1 and a second portion 240-2, which may be individually or collectively referred to as at least one portion 240. It should be understood that... Figure 2 The number of at least one portion 240 shown is merely exemplary and is not intended to be any limitation.

[0048] Figure 3 A schematic diagram of an example architecture 300 for determining at least one portion according to some embodiments of the present disclosure is shown. For example... Figure 3As shown, for a given portion 232, server 160 determines status information 310 corresponding to the prompt generation logic of that sub-template based on processing request 210 and / or context information 220. For example, if the condition indicated by the prompt generation logic is "output B if task A has been completed", server 160 can obtain status information 310 related to the completion progress of task A based on processing request 210 and / or context information 220. Subsequently, it is determined whether the status information 310 matches the condition indicated by the prompt generation logic of that sub-portion. If they match, that portion is included as one of at least two portions 240.

[0049] In some embodiments, the matching of state information 310 with the conditions indicated by the prompt generation logic can indicate that state information 310 meets the judgment conditions of the prompt generation logic. In this case, at least one selected portion 240 can be used to generate prompts. For example, if task A has been completed, it indicates that state information 310 matches the prompt generation logic. If task A has not been completed, it indicates that state information 310 does not match the prompt generation logic, and that portion will be discarded.

[0050] In some embodiments, server 160 may determine status information 310 based solely on processing request 210, solely on context information 220, or based on both processing request 210 and context information 220. For example, if the task type corresponding to processing request 210 is an operation and maintenance request, server 160 may determine status information 310 based on processing request 210 and context information 220. In some embodiments, server 160 may determine the basis for determining status information 310 based on the task type corresponding to processing request 210.

[0051] In some embodiments, server 160 may determine state information 310 based on pre-determined data extraction rules. For example, if context information 220 includes structured information, server 160 may determine information extraction rules for the first prompt word generation logic based on the data structure of the structured information. Subsequently, state information 310 is determined from the context information based on the information extraction rules. For instance, if context information 220 includes tabular data, server 160 may determine state information 310 using information extraction rules for extracting tabular information.

[0052] In some embodiments, server 160 may predetermine different information extraction rules for different forms of structured information. As an example, context information 220 may include JavaScript object notation (JSON) data. Server 160 may use JSON data extraction rules to determine status information 310. Table 1 shows an example of structured information. As shown in Table 1, context information 220 can be presented in the form of structured information. In this case, status information 310 in Table 1 can be extracted using information extraction rules. For example, for context information 220 in Table 1, the information extraction rule could be to obtain the field values ​​of the "Basic Risk Information" field and the "Remediation Recommendation" field. Furthermore, server 160 can generate status information 310 based on the extracted field values.

[0053] Table 1

[0054]

[0055]

[0056] In some embodiments, server 160 may utilize a machine learning model to process contextual information to obtain state information 310. The machine learning model may be a language model (e.g., a large language model). This machine learning model may be the same as or different from the large model described above. For example, for one of the multiple parts 232, server 160 may generate a prompt for the machine learning model based on processing request 210, contextual information 220, and prompt generation logic for that part. Server 160 then provides the prompt to the machine learning model to obtain its output. Based on the output of the machine learning model, server 160 determines the state information 310.

[0057] In some embodiments, the context information 220 processed by the machine learning model can be unstructured information (e.g., text descriptions, images, or audio). Table 2 is an example of context information 220.

[0058] Table 2

[0059]

[0060] As shown in Table 2, the context information 220 can be in the form of a textual description. In this case, the server 160 can use a machine learning model to process the context information 220 to obtain state information 310. In some embodiments, the machine learning model can be used to process the context information 220 in the form of structured information or other forms. In some embodiments, the machine learning model can be a lightweight model to improve the efficiency of obtaining state information 310.

[0061] In some embodiments, during the selection of at least one part 240 from a plurality of parts 232, server 160 may sequentially determine whether the conditions indicated by the prompt word generation logic of each part match the corresponding status information 310, following the order of the parts in the system prompt. During the selection of at least one part 240 from a plurality of parts 232, server 160 needs to refer to the generation type of each part. For example, for a part of the plurality of parts 232, if it is detected that the status information 310 matches the conditions indicated by the prompt word generation logic of that part, server 160 may first determine the logic type indicated by the prompt word generation logic of that part. If the logic type indicated by the prompt word generation logic of that part is a stop generation type, server 160 stops selecting a part from the plurality of parts. Subsequently, server 160 generates at least one sub-prompt based on the currently determined at least one part 240 (e.g., that part or other parts determined before that part). If the logic type of the prompt word generation logic of that part is a continue generation type, server 160 may continue to select at least a portion of at least one part 240 from the subsequent parts of that part from the plurality of parts.

[0062] The above describes an example process for generating prompt word information. To better understand the embodiments of this disclosure, taking the task type indicated by request 210 as "work order delay query task" as an example, the types of multiple parts of the system prompt words and the prompt word information generation process will be explained. The generation of prompt word information will be explained below with reference to Table 3, which is an example of prompt word configuration information.

[0063] Table 3

[0064]

[0065] As shown in Table 3, the system prompt words may include multiple parts (e.g., parts 1-5). Correspondingly, the prompt word configuration information 230 may include configuration items for these prompt word parts. Parts 1 and 4 are prompt word parts of the default inclusion type. For parts 1 and 4, the prompt word configuration information includes the corresponding text to be included in the prompt word information 260. Part 2 is a system prompt word part of the stop generation type. For part 2, the prompt word configuration information includes the logical condition "work order status == 'complete'", the logical type "STOP", and the text to be output. During the selection of at least one part 240 from multiple parts 232, if a stop tag corresponding to a part of the stop generation type is detected, the server 160 may stop the selection operation. For part 2, if the judgment condition corresponding to that part is true (i.e., the status information 310 matches the corresponding prompt word generation logic), the server 160 includes that part as one of at least one part 240 and selects from the parts after stopping part 2. If the condition is not met, the server 160 can evaluate the condition indicated by the subsequent part of the multiple parts in order to continue the operation of selecting at least one part 240.

[0066] Part 3 is the prompt word section for the "continue generation" type. For Part 3, if the corresponding judgment condition is true (i.e., work order extension == 'True'), server 160 can include this part as one of at least two parts 240 and continue to perform the selection operation on the subsequent parts of this part. If the judgment condition is false, server 160 can judge the subsequent parts of this part among multiple parts to continue performing the selection operation. Part 4 is the branch selection type section. For Part 4, if the corresponding judgment condition is true (i.e., user NOT IN the list of handlers), server 160 can add "Inform the user that 'non-work order handlers cannot apply for acceptable risk / waiver'" to prompt word information 260. If the judgment condition is false, server 160 can add "Inform the user: 'If necessary, the risk handler can click the operation control to perform the corresponding operation and fully explain the reason for the application to facilitate assessment approval'" to prompt word information 260.

[0067] In some embodiments, server 160 may generate prompt word information 260 for processing request 210 based on at least one portion 240. Exemplarily, at least one selected portion 240 may be concatenated based on the order of the at least one portion in the system prompt words to generate a template for processing request 210. Subsequently, prompt word information 260 is generated based on the template for processing request 210, context information 220, and processing request 210. In some embodiments, sub-prompt words corresponding to each portion 240 may be generated separately. Then, at least one sub-prompt word is combined according to the order of the at least one portion in the system prompt words to determine prompt word information 260.

[0068] In one example, the extracted work order status is "completed," meaning that status information 310 matches the prompt word generation logic corresponding to part 2. In this case, prompt word information 260 as shown in Table 4 can be generated based on the prompt word configuration information shown in Table 3.

[0069] Table 4

[0070]

[0071] In one example, the extracted work order status is "Completed," the work order extension is "True," and the user is in the list of handlers. That is, status information 310 matches the prompt word generation logic corresponding to part 3. In this case, based on the prompt word configuration information shown in Table 3, prompt word information 260 as shown in Table 5 can be generated.

[0072] Table 5

[0073]

[0074] In one example, the extracted work order status is "Completed," the work order extension is "False," and the user is not in the list of handlers. That is, status information 310 matches the prompt word generation logic corresponding to part 4. In this case, based on the prompt word configuration information shown in Table 3, prompt word information 260 as shown in Table 6 can be generated.

[0075] Table 6

[0076]

[0077]

[0078] Based on at least one determined part 240 (e.g., first part 240-1 and second part 240-2), at least one sub-prompt word can be generated. For example... Figure 2As shown, the generated sub-prompt words include the first sub-prompt word 250-1 and the second sub-prompt word 250-2, which can be referred to individually or collectively as sub-prompt word 250. It should be understood that... Figure 2 The number of sub-prompt words 250 shown is merely exemplary and is not intended to be any limitation.

[0079] In some embodiments, server 160 may generate prompt word information 260 based on context information 220, at least one determined sub-template, and corresponding prompt word generation logic. For example, if context information 220 includes "task manager is A" and partially includes "send exception information to the manager of task B", the prompt word information 260 generated based on the portion and context information 220 may include "send exception information to A". In some embodiments, if context information 220 includes "processing method for task B", the prompt word information 260 generated based on the portion and context information 220 may include a response for performing the aforementioned processing method.

[0080] In some embodiments, the prompt word information 260 is provided to the large model to obtain a response to the processing request 210. For example, if the processing request 210 includes a weather query request, the server 160 generates the corresponding prompt word information 260 based on the processing request. The server 160 then provides the prompt word information to the large model to obtain the output of the large model (i.e., weather information).

[0081] Example process

[0082] Figure 4 A flowchart of an example process 400 for generating prompt word information according to some embodiments of the present disclosure is shown. Process 400 may be implemented or include terminal device 110 or server 160; alternatively, process 400 may be implemented collaboratively by server 160 and terminal device 110. For illustrative purposes only, the following description uses the implementation of process 400 at server 160 as an example.

[0083] like Figure 4 As shown in box 410, in response to receiving a processing request initiated to the large model, server 160 determines a system prompt word for processing the request, the system prompt word comprising multiple parts.

[0084] In some embodiments, determining a system prompt word includes: in response to receiving a processing request, determining the task type indicated by the processing request; and, based on the task type, selecting a system prompt word for the determined task type from a plurality of candidate system prompt words for different task types.

[0085] In box 420, server 160 determines at least one part from a plurality of parts of the system prompt word based at least one of the processing request or contextual information associated with the processing request.

[0086] In some embodiments, determining at least one part from a plurality of parts includes: obtaining prompt word configuration information for system prompt words, the prompt word configuration information indicating corresponding prompt word generation logic for the plurality of parts; and selecting at least one part from the plurality of parts whose prompt word generation logic is satisfied based on at least one of a processing request or context information.

[0087] In some embodiments, selecting at least one part from a plurality of parts for which the prompt word generation logic is satisfied includes: for a first part of the plurality of parts, determining state information of a first prompt word generation logic for the first part based on at least one of a processing request or context information; and selecting the first part as one of at least one part in response to the state information matching the conditions indicated by the first prompt word generation logic.

[0088] In some embodiments, process 400 further includes: determining the logic type of the first prompt word generation logic in response to a match between the status information and a condition indicated by the first prompt word generation logic; generating prompt word information based on at least one part in response to the logic type being a stop generation type; and determining the status information of the second prompt word generation logic for a second part following the first part of a plurality of parts in response to the logic type being a continue generation type.

[0089] In some embodiments, the context information includes structured information, and determining the state information includes: determining information extraction rules for the first prompt word generation logic based on the data structure of the structured information; and determining the state information from the context information based on the information extraction rules.

[0090] In some embodiments, determining state information includes: generating a prompt for a machine learning model based on at least one of context information or a processing request and a first prompt generation logic; providing the prompt for the machine learning model to the machine learning model to obtain the output of the machine learning model; and determining state information based on the output of the machine learning model.

[0091] In some embodiments, the logical type of the prompt word generation logic includes at least one of the following: default inclusion type, stop generation type, continue generation type, or branch selection type.

[0092] In box 430, server 160 generates prompt word information for processing requests based on at least one part, the prompt word information being provided to the large model to obtain a response for processing requests.

[0093] In some embodiments, generating prompt word information includes: generating at least one sub-prompt word corresponding to at least one part based on at least one part; and determining prompt word information by combining at least one sub-prompt word according to the order of at least one part in system prompt words.

[0094] Example devices and equipment

[0095] Embodiments of this disclosure also provide corresponding apparatus for implementing the above methods or processes. Figure 5 A schematic structural block diagram of an example apparatus for generating prompt word information according to some embodiments of the present disclosure is shown. Apparatus 500 may be implemented as or included in terminal device 110 or server 160. Alternatively, apparatus 500 may be implemented collaboratively by server 160 and terminal device 110. Various modules / components in apparatus 500 may be implemented by hardware, software, firmware, or any combination thereof. For illustrative purposes only, the following description uses an example of apparatus 500 implemented at server 160.

[0096] like Figure 5 As shown, the apparatus 500 includes a first determining module 510 configured to determine a system prompt word for processing the request in response to receiving a processing request initiated to a large model. The system prompt word includes multiple parts. The apparatus 500 also includes a second determining module 520 configured to determine at least one part from the multiple parts of the system prompt word based at least on at least one of the processing request or context information associated with the processing request. The apparatus 500 also includes a generating module 530 configured to generate prompt word information for the processing request based on at least one part. The prompt word information is used to provide the large model to obtain a response to the processing request.

[0097] In some embodiments, the first determining module 510 is further configured to, in response to receiving a processing request, determine the task type indicated by the processing request; and, based on the task type, select a system prompt word for the determined task type from a plurality of candidate system prompt words for different task types.

[0098] In some embodiments, the second determining module 520 is further configured to acquire prompt word configuration information for system prompt words, the prompt word configuration information indicating corresponding prompt word generation logic for multiple parts; and to select at least one part from the multiple parts whose prompt word generation logic is satisfied based on at least one of a processing request or context information.

[0099] In some embodiments, the second determining module 520 is further configured to, for a first part of a plurality of parts, determine state information of a first prompt word generation logic for the first part based on at least one of a processing request or context information; and select the first part as one of at least one part in response to a match between the state information and the conditions indicated by the first prompt word generation logic.

[0100] In some embodiments, the apparatus 500 further includes a state information generation module configured to determine the logic type of the first prompt word generation logic in response to a match between the state information and a condition indicated by the first prompt word generation logic; generate prompt word information based on at least one part in response to a stop generation type; and determine the state information of a second prompt word generation logic for a second part following a first part of a plurality of parts in response to a continue generation type.

[0101] In some embodiments, the state information generation module is further configured to generate a prompt for the machine learning model based on at least one of context information or a processing request and a first prompt generation logic; provide the prompt for the machine learning model to the machine learning model to obtain the output of the machine learning model; and determine state information based on the output of the machine learning model.

[0102] In some embodiments, the logical type of the prompt word generation logic includes at least one of the following: default inclusion type, stop generation type, continue generation type, or branch selection type.

[0103] In some embodiments, the second determining module is further configured such that the context information includes structured information, and determining the state information includes: determining information extraction rules for the first prompt word generation logic based on the data structure of the structured information; and determining state information from the context information based on the information extraction rules.

[0104] In some embodiments, the generation module 530 is further configured to generate at least one sub-prompt word corresponding to at least one part based on at least one part; and to determine prompt word information by combining at least one sub-prompt word in the order of at least one part in the system prompt words.

[0105] Figure 6 A block diagram of an electronic device 600 capable of implementing various embodiments of the present disclosure is shown. (See diagram for reference.) Figure 6As shown, electronic device 600 is in the form of a general-purpose electronic device. Components of electronic device 600 may include, but are not limited to, one or more processors 610 or processing units, memory 620, storage device 630, one or more communication units 640, one or more input devices 650, and one or more output devices 660. Processor 610 may be a physical or virtual processor and is capable of performing various processes according to programs stored in memory 620. In a multiprocessor system, multiple processors execute computer-executable instructions in parallel to improve the parallel processing capability of electronic device 600.

[0106] Electronic device 600 typically includes multiple computer storage media. Such media can be any accessible media that is accessible to electronic device 600, including but not limited to volatile and non-volatile media, removable and non-removable media. Memory 620 can be volatile memory (e.g., registers, cache, random access memory (RAM)), non-volatile memory (e.g., read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory), or some combination thereof. Storage device 630 can be removable or non-removable media and can include machine-readable media, such as flash drives, disks, or any other media that can be used to store information and / or data and can be accessed within electronic device 600.

[0107] Electronic device 600 may further include additional removable / non-removable, volatile / non-volatile storage media. Although not explicitly stated... Figure 6 As shown, disk drives for reading from or writing to removable, non-volatile disks (e.g., "floppy disks") and optical disk drives for reading from or writing to removable, non-volatile optical disks can be provided. In these cases, each drive can be connected to a bus (not shown) via one or more data media interfaces. Memory 620 may include computer program product 625 having one or more program modules configured to perform various methods or actions of various embodiments of this disclosure.

[0108] The communication unit 640 enables communication with other electronic devices via a communication medium. Additionally, the functionality of the components of the electronic device 600 can be implemented using a single computing cluster or multiple computing machines capable of communicating via communication connections. Therefore, the electronic device 600 can operate in a networked environment using logical connections to one or more other servers, network personal computers (PCs), or another network node.

[0109] Input device 650 can be one or more input devices, such as a mouse, keyboard, trackball, etc. Output device 660 can be one or more output devices, such as a monitor, speaker, printer, etc. Electronic device 600 can also communicate with one or more external devices (not shown) via communication unit 640 as needed. These external devices include storage devices, display devices, etc., and can communicate with one or more devices that enable user interaction with electronic device 600, or with any device that enables electronic device 600 to communicate with one or more other electronic devices (e.g., network card, modem, etc.). Such communication can be performed via input / output (I / O) interface (not shown).

[0110] According to an exemplary implementation of this disclosure, a computer-readable storage medium is provided that stores computer-executable instructions thereon, wherein the computer-executable instructions are executed by a processor to implement the methods described above. According to an exemplary implementation of this disclosure, a computer program product is also provided, which is tangibly stored on a non-transitory computer-readable medium and includes computer-executable instructions, which are executed by a processor to implement the methods described above.

[0111] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatuses, devices, and computer program products implemented according to this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.

[0112] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processing unit of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.

[0113] Computer-readable program instructions can be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions that execute on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.

[0114] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction, which contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0115] Various implementations of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed implementations. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described implementations. The terminology used herein is chosen to best explain the principles, practical applications, or improvements to technology in the market, or to enable others skilled in the art to understand the various implementations disclosed herein.

Claims

1. A method for generating prompt words for large models, comprising: In response to receiving a processing request initiated to the large model, a system prompt word for the processing request is determined, the system prompt word comprising multiple parts; At least one part is determined from a plurality of parts of the system prompt word, based at least on at least one of the processing request or contextual information associated with the processing request; as well as Based on the at least one portion, prompt word information for the processing request is generated, the prompt word information being provided to the large model to obtain a response to the processing request, wherein determining at least one portion from multiple portions of the system prompt word includes: Regarding the first of the plurality of parts, Based on at least one of the processing request or the context information, determine the state information of the first prompt word generation logic for the first part; as well as In response to the state information matching the conditions indicated by the first prompt word generation logic, the first part is selected as one of the at least one part.

2. The method according to claim 1, further comprising: Obtain prompt word configuration information for the system prompt words, the prompt word configuration information indicating the corresponding prompt word generation logic of the plurality of parts, the first prompt word generation logic being indicated by the prompt word configuration information.

3. The method according to claim 1, further comprising: In response to the state information matching the conditions indicated by the first prompt word generation logic, the logic type of the first prompt word generation logic is determined; In response to the logic type being a stop generation type, the prompt word information is generated based on at least one of the components; as well as In response to the logic type being a continued generation type, state information of the second prompt word generation logic for the second part following the first part of the plurality of parts is determined.

4. The method according to claim 1, wherein generating the prompt word information includes: Based on the at least one part, generate at least one sub-prompt word corresponding to each of the at least one part; as well as The prompt information is determined by combining the at least one sub-prompt word in the order of the at least one part in the system prompt word.

5. The method of claim 1, wherein the context information includes structured information, and determining the state information includes: Based on the data structure of the structured information, information extraction rules for the first prompt word generation logic are determined; as well as Based on the information extraction rules, the state information is determined from the context information.

6. The method according to claim 3, wherein determining the status information includes: Based on at least one of the context information or the processing request and the first prompt word generation logic, a prompt word for the machine learning model is generated; Providing cue words to the machine learning model to obtain its output; and The state information is determined based on the output of the machine learning model.

7. The method according to claim 2, wherein the logic type of the prompt word generation logic includes at least one of the following: The default includes the type. Stop generating types. Continue generating types, or Branch selection type.

8. The method of claim 1, wherein determining the system prompt word comprises: In response to receiving the processing request, determine the task type indicated by the processing request; as well as Based on the task type, a system prompt word for the determined task type is selected from multiple candidate system prompt words for different task types.

9. An apparatus for generating cue words for large models, comprising: The first determining module is configured to, in response to receiving a processing request initiated to the large model, determine a system prompt word for the processing request, the system prompt word comprising multiple parts; The second determining module is configured to determine at least one part from the plurality of parts of the system prompt based at least on at least one of the processing request or context information associated with the processing request; as well as A generation module is configured to generate prompt word information for the processing request based on at least one of the components, the prompt word information being provided to the large model to obtain a response to the processing request, wherein the second determining module is further configured to: Regarding the first of the plurality of parts, Based on at least one of the processing request or the context information, determine the state information of the first prompt word generation logic for the first part; as well as In response to the state information matching the conditions indicated by the first prompt word generation logic, the first part is selected as one of the at least one part.

10. An electronic device, comprising: At least one processor; as well as At least one memory coupled to the at least one processor and storing instructions for execution by the at least one processor, the instructions causing the electronic device to perform the method according to any one of claims 1 to 8 when executed by the at least one processor.

11. A computer-readable storage medium having stored thereon computer-executable instructions that can be executed by a processor to implement the method according to any one of claims 1 to 8.

12. A computer program product comprising computer-executable instructions, wherein the computer-executable instructions, when executed by a processor, implement the method according to any one of claims 1 to 8.