Method and device for interacting with generative language model, equipment, medium and product

By setting context thresholds and token consumption thresholds, the generative language model displays a prompt message when the thresholds are reached or exceeded. This solves problems such as reduced answer quality and excessive billing when the generative language model exceeds the context window, and improves the user experience.

CN120671848APending Publication Date: 2025-09-19BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510847369.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-23
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

When a generative language model processes tokens outside the context window, the answer quality deteriorates, the billing is high, and the inference time is too long, affecting the user experience.

Method used

By setting context thresholds and token consumption thresholds, the generative language model displays prompt information when the thresholds are reached or exceeded, allowing users to adjust tasks to reduce token consumption and avoid performance limitations and excessive billing.

Benefits of technology

This effectively avoids the decline in the answer quality of the generative language model, reduces inference time and billing, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120671848A_ABST
    Figure CN120671848A_ABST
Patent Text Reader

Abstract

The invention relates to a method and device for interacting with a generative language model, equipment, a medium and a product. The method comprises the following steps: determining at least one lexical symbol threshold value for an interaction process of the generative language model; displaying prompt information for adjusting the current task on the basis of comparison between the lexical symbol usage amount in the interaction process and at least one lexical symbol threshold value; and in response to confirmation of the adjustment of the current task, generating an answer based on the adjusted task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computers, and more particularly to methods, apparatuses, computing devices, computer storage media, and computer program products for interacting with a generative language model. Background Art

[0002] In generative language models, a token is the smallest unit of text processing (such as a word, subword, or punctuation mark), while the context window is the range of tokens that a generative language model can simultaneously utilize when generating or understanding text. The size of the context window directly limits the maximum number of tokens a generative language model can process at a time. Tokens outside the context window are truncated or forgotten, preventing the generative language model from utilizing this information, resulting in poor quality responses. Summary of the Invention

[0003] In a first aspect of an embodiment of the present disclosure, a method for interacting with a generative language model is provided. The method includes: determining at least one token threshold for an interaction process with the generative language model; displaying a prompt for adjusting a current task based on a comparison of token usage during the interaction process and the at least one token threshold; and generating an answer based on the adjusted task in response to confirmation of the adjustment to the current task.

[0004] In a second aspect of an embodiment of the present disclosure, a device for interacting with a generative language model is provided. The device includes: a determination unit configured to determine at least one token threshold for an interaction process with the generative language model; a display unit configured to display a prompt for adjusting a current task based on a comparison between token usage during the interaction process and the at least one token threshold; and a generation unit configured to generate an answer based on the adjusted task in response to confirmation of the adjustment to the current task.

[0005] In a third aspect of the embodiments of the present disclosure, an electronic device is provided, comprising: at least one processing unit; and at least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, wherein the instructions, when executed by the at least one processing unit, cause the computing device to perform the method according to the first aspect of the present disclosure.

[0006] In a fourth aspect of the embodiments of the present disclosure, a non-transitory computer storage medium is provided, comprising machine-executable instructions, which, when executed by a device, cause the device to perform the method according to the first aspect of the present disclosure.

[0007] In a fifth aspect of the embodiments of the present disclosure, a computer program product is provided, comprising machine-executable instructions, which, when executed by a device, cause the device to perform the method according to the first aspect of the present disclosure.

[0008] This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. It is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to limit the scope of the claimed subject matter. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings, wherein:

[0010] Figure 1 A flowchart illustrating a method for interacting with a generative language model according to some embodiments of the present disclosure is shown;

[0011] Figures 2 to 4 A schematic diagram illustrating an interface for interacting with a generative language model according to some embodiments of the present disclosure is shown;

[0012] Figure 5 A flowchart illustrating a method for adjusting tasks according to token usage according to some embodiments of the present disclosure is shown;

[0013] Figure 6 A block diagram illustrating an apparatus for interacting with a generative language model according to some embodiments of the present disclosure; and

[0014] Figure 7 A block diagram of a device capable of implementing various embodiments of the present disclosure is shown.

[0015] Throughout the drawings, the same or similar reference numbers denote the same or similar elements. DETAILED DESCRIPTION

[0016] It is understood that all user-related data involved in this technical solution must be obtained and used only after authorization by the user. This means that if a user's personal information is to be used in this technical solution, the user's explicit consent and authorization must be obtained before such data is obtained; otherwise, the relevant data will not be collected or used. It is also understood that when implementing this technical solution, relevant laws and regulations must be strictly observed during the data collection, use, and storage process, and necessary technologies and measures must be implemented to protect the user's data security and ensure the safe use of data.

[0017] It is understandable that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0018] For example, upon receiving a user's active request, a prompt message is sent to the user to clearly inform the user 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 electronic device, application, server, storage medium, or other software or hardware that performs the operations of the disclosed technical solution based on the prompt message.

[0019] As an optional but non-limiting implementation, in response to receiving a user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. Furthermore, the pop-up window may also contain a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.

[0020] It is understandable that the above notification and user authorization process are merely illustrative and do not limit the implementation of the present disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0021] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.

[0022] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc. can refer to different or the same objects, unless explicitly stated. Other explicit and implicit definitions may also be included below.

[0023] In question-answering systems based on generative language models, context is crucial to the quality of their answers. However, due to computational resource and cost constraints, as well as the inherent architecture of the model, question-answering systems set a context window to limit the maximum number of tokens corresponding to the context that can be used. When the number of tokens corresponding to the used context exceeds the context window, some context is automatically truncated, resulting in poor quality answers generated by the generative language model. For example, the generative language model may forget the task objectives and roles, answer irrelevant questions, and fail to understand the context. Furthermore, during user interaction with the question-answering system, the system charges based on the sum of the number of tokens input by the user and the number of tokens output by the system. Excessive input and output tokens can lead to high system charges and prolonged inference time, thus affecting the user experience. Therefore, designing a new method for interacting with generative language models is urgently needed.

[0024] To this end, the present disclosure provides a method for interacting with a generative language model. In this method, at least one token threshold for an interaction process with the generative language model is determined. The at least one token threshold includes a context threshold and / or a token consumption threshold, wherein the context threshold represents an upper limit value for the number of tokens corresponding to the context that the generative language model can use, and can be set to be less than the upper limit value of the context window of the generative language model. The token consumption threshold represents an upper limit value for the sum of the total number of tokens that have been input to the generative language model and the total number of tokens that have been output by the generative language model. Based on a comparison between the token usage of the interaction process and the at least one token threshold, a prompt message for adjusting the current task is displayed. When the number of tokens used by the generative language model reaches or exceeds the context threshold or the token consumption threshold, a prompt message for adjusting the current task is displayed to reduce the token consumption of the generative language model. Upon receiving a confirmation indication to adjust the current task, the generative language model can generate an answer based on the adjusted task.

[0025] It should be understood that during the interaction with the generative language model, the number of tokens compared with the context threshold is the number of tokens corresponding to the context that the generative language model can utilize, while the number of tokens compared with the token consumption threshold is the sum of the total number of tokens input to the generative language model and the total number of tokens output by the generative language model, that is, the number of tokens consumed by the generative language model during the interaction. It should also be understood that because the model processes the tokens input to the model during inference (for example, discarding some tokens), the number of tokens corresponding to the context that the generative language model can utilize is less than the number of tokens consumed during the interaction.

[0026] This method, on the one hand, allows the user to adjust the current task when the number of tokens corresponding to the context used by the generative language model during task execution reaches or exceeds the context threshold. This allows the user to modify the task in advance, avoiding issues such as limited model performance leading to reduced answer quality. On the other hand, when the sum of the total number of tokens input to the generative language model and the total number of tokens output by the model reaches or exceeds the token consumption threshold, the generative language model can also prompt the user to adjust the current task, avoiding issues such as excessive model inference time and high billing.

[0027] Figure 1 A flowchart of method 100 for interacting with a generative language model according to some embodiments of the present disclosure is shown. The method can be implemented by any electronic device with computing and display capabilities, including but not limited to mobile phones, tablet computers, wearable devices, in-vehicle devices, augmented reality / virtual reality devices, laptops, ultra-mobile personal computers, netbooks, personal digital assistants, Internet of Things devices, industrial terminals, and various electronic devices with interface display functions. The embodiments of the present disclosure do not impose any restrictions on the specific type of electronic device.

[0028] For ease of understanding, we will combine Figures 2 to 4 The schematic diagram of interaction with the generative language model is shown to describe Figure 1 100, but it should be understood that Figures 2 to 4 The exemplary display interface for interacting with the generative language model in is non-limiting.

[0029] like Figure 1 As shown, in block 102, at least one token threshold for an interactive process of a generative language model is determined. In some embodiments, the at least one token threshold may include a context threshold and / or a token consumption threshold.

[0030] It should be understood that the generative language model uses tokens as units for input, processing, and output. Therefore, the number of tokens is crucial to model performance and user experience. For example, the provider of the generative language model can calculate the cost of using the generative language model by the total number of tokens that have been input into the generative language model and the total number of tokens that have been output. The token consumption threshold can be determined based on the cost, and excessive billing can be avoided by setting the token consumption threshold. In addition, the generative language model generally has a context cache for storing context information of the current interaction. The size of the context cache is limited and depends on the model architecture, computing resources, etc. By setting the context threshold, the user can be reminded in time to pay attention to the number of tokens corresponding to the context that the model has utilized, so as to avoid exceeding the maximum capacity of the context cache. In some embodiments, an interactive element can be provided to determine the context threshold based on the user's operation on the interactive element. How to select the context threshold through the interactive element will be described in detail below. The token consumption threshold can be set by a similar method.

[0031] Figure 2 Schematic diagram 200 of a conversation with a generative language model according to some embodiments of the present disclosure is shown. Figure 2 As shown, the schematic diagram 200 includes a dialog window 202 for communicating with the generative language model, and a display box 204 for displaying the number of tokens used by the generative language model is included at the top of the dialog window 202. The display box 204 includes a display showing the total number of tokens that have been input into the generative language model (e.g. Figure 2 9.3m tokens in ) and the total number of tokens that the generative language model has output (e.g. Figure 2 Display frame 204 also includes an interactive element 206, wherein the interactive element 206 can be used to set a context threshold.

[0032] Display box 204 can also display the number of tokens and context thresholds corresponding to the context used by the generative language model. Figure 2 In the example, when the user inputs the task "generate a travel plan to country A" and "plan to go for 5 days", the generative language model can determine that the current task is "a 5-day travel plan in country A". Based on this task, the generative language model can determine that the number of tokens corresponding to the context used is 40.5k tokens. Figure 2 In

[15] , the context threshold is 200k tokens. The context threshold can be set by default to the maximum allowed length supported by the model.

[0033] In response to the user clicking on the interactive element 206, an interface for setting the context threshold is displayed. Figure 3 The diagram 300 includes a context threshold setting block 302 .

[0034] In some embodiments, an operation (e.g., dragging a slider) on interactive element 206 is received to set a context threshold, wherein the context threshold is less than the maximum allowed length of the context (i.e., 200k tokens). For example, a selection of a context threshold interval in context threshold setting box 302 is received, for example, a threshold of 160k tokens may be selected, i.e., the context threshold is set to 160k tokens.

[0035] It should be understood that the manner of setting the context threshold may include: Figure 3 The sliding bar selection shown may also include selecting a specific context threshold through an input box. The present disclosure does not limit the method for determining the context threshold.

[0036] Back to Figure 1 , method 100 includes: in box 104, based on the comparison of the word token usage in the interaction process and at least one word token threshold, displaying a prompt message for adjusting the current task. In some embodiments, in response to determining that the number of word tokens corresponding to the context used by the generative language model reaches or exceeds the context threshold during the execution of the current task, the execution of the current task is suspended, and a prompt message for adjusting the current task is displayed. Exemplarily, the context threshold can be set to 160k words. In the process of generating an answer to the current task "5-day travel plan in country A" input by the user, when the number of word tokens corresponding to the context used by the generative language model reaches or exceeds 160k words, the execution of the current task is suspended, and a prompt message for adjusting the current task is displayed. It should be understood that the above description of the context threshold is only an example, and the context threshold can be any suitable value and is not limited here.

[0037] By executing the above method, when the number of tokens corresponding to the context used by the generative language model during task execution reaches or even exceeds the context threshold, the generative language model can display a prompt message to the user to adjust the current task, reminding the user to modify the task in advance to avoid the problem of reduced answer quality.

[0038] In some embodiments, the number of tokens consumed during the interaction with the generative language model is determined. When it is determined that the number of tokens consumed during the execution of the current task "5-day travel plan in country A" reaches or exceeds a token consumption threshold, the generation of an answer to the current task "5-day travel plan in country A" is suspended. For example, the number of tokens consumed can be, for example, the total number of tokens input to the generative language model (e.g., Figure 2 9.3m tokens in ) and the total number of tokens that the generative language model has output (e.g. Figure 2When the token consumption threshold is 10m tokens, it is determined that the number of consumed tokens has not reached the token consumption threshold, and the current task continues to be executed. When the token consumption threshold is 9.5m tokens, it is determined that the number of consumed tokens has exceeded the token consumption threshold, the current task is suspended, and a prompt message for adjusting the current task is displayed. It should be understood that the above description of the token consumption threshold is only an example, and the token consumption threshold can be any suitable value and is not limited here.

[0039] By executing the above method, users can be promptly reminded of the number of tokens consumed by the generative language model, avoiding problems such as excessive billing or the model taking too long to generate answers.

[0040] Figure 4 A schematic diagram 400 is shown for displaying prompt information for adjusting the current task according to some embodiments of the present disclosure. Figure 4 In the example, a selection of a context threshold interval in the context threshold setting box 302 is received. For example, a threshold of 160k tokens may be selected. During the process of answering the current task "5-day travel plan in Country A" input by the user, if it is determined that the number of tokens corresponding to the context used by the generative language model reaches or exceeds 160k tokens, the current task is suspended and prompts for adjusting the current task are displayed, such as "Ignore prompt" and "Simplify task."

[0041] In some embodiments, in response to receiving a selected "simplify task" indication, the generative language model displays modification suggestions for the current task. In some embodiments, the generative language model may provide one or more suggestions for adjusting the current task. Among them, the one or more suggestions may include: reducing the time range for the answer to the current task, reducing the search scope of the generative language model, or reducing the number of pages browsed by the generative language model. For example, for the current task "5-day travel plan in country A", the task modification suggestions include "changing the 5-day tour plan to a 3-day tour plan", "adjusting the number of browsed web pages from 7 to 3", and "reducing the type of food search".

[0042] It should be understood that when the number of tokens consumed by the generative language model during the interaction process reaches or exceeds the token consumption threshold, the description of displaying the prompt information for adjusting the current task is similar to the above and will not be repeated here.

[0043] Back to Figure 1 , the method 100 includes: in block 106, in response to confirming the adjustment of the current task, generating an answer based on the adjusted task. In some embodiments, in response to confirming at least one of the one or more suggestions, adjusting the current task based on the at least one suggestion. Figure 4In response to checking and confirming all of the suggested modifications for at least one task, including "Change 5-day tour plan to 3-day tour plan," "Adjust number of web pages browsed from 7 to 3," and "Reduce food search types," the generative language model can modify the current task based on the three suggested modifications and generate an answer based on the modified current task. It should be understood that the selection of modification suggestions may include one or more, for example, only one modification suggestion or multiple modifications may be checked and confirmed. This disclosure does not limit the number of selected modification suggestions.

[0044] By implementing the above method, on the one hand, when the number of tokens corresponding to the context used by the generative language model during task execution reaches the context threshold, the generative language model can display a prompt to the user to adjust the current task, allowing the task to be modified in advance, avoiding the problem of reduced answer quality due to limited model performance. On the other hand, when the sum of the total number of tokens input to the generative language model by the user and the total number of tokens output by the model reaches the token consumption threshold, the generative language model can also display a prompt to the user to adjust the current task, avoiding the problem of excessive model inference time and excessive billing.

[0045] Figure 5 A flowchart of a method 500 for adjusting a task according to token usage according to some embodiments of the present disclosure is shown. The method 500 may be executed by an electronic device, for example.

[0046] like Figure 5 As shown, in box 502, in response to the number of tokens corresponding to the context used in the process of executing the current task reaching or exceeding the context threshold, or in response to the number of tokens consumed in the process of executing the current task reaching or exceeding the token consumption threshold, a prompt is triggered to ask the user whether to modify the current task. In response to confirming that the current task needs to be modified, box 504 is entered, the execution of the current task is paused, and modification suggestions are displayed. The modification suggestions include task dimension suggestions 508 and tool dimension suggestions 510. Task dimension suggestions 508 can be, for example, suggestions for reducing the amount of tasks of the generative language model, such as Figure 4 The tool dimension suggestion 510 may be, for example, a suggestion for reducing the retrieval workload of the generative language model. In some embodiments, the tool dimension suggestion 510 may be to reduce the retrieval scope of the generative language model or to reduce the number of pages browsed by the generative language model. Figure 4 ” The number of browsed web pages is adjusted from 7 to 3” and “The food search type is reduced” are displayed in FIG. 5 . In block 512 , in response to the user selecting and confirming the task modification suggestion, an answer is generated based on the modified current task.

[0047] In box 502, in response to determining that the number of tokens corresponding to the context used in the process of executing the current task reaches or exceeds the context threshold, or in response to determining that the number of tokens consumed in the process of executing the current task reaches or exceeds the token consumption threshold, a prompt is triggered to ask the user whether to modify the current task. In response to confirming that the current task is to be modified, box 506 is entered, the execution of the current task is paused, and an input box is displayed to receive input text for adjusting the current task input by the user. In some embodiments, the input text for adjusting the current task is received, and the current task is adjusted based on the input text. For example, for the current task "5-day travel plan in country A", a custom input text is received, for example, it can be "cancel the planned hotel arrangement in country A", and the generative language model can generate an answer based on the modified current task. In box 512, confirmation of the modified current task is received, and the answer generation task is executed.

[0048] By executing the above method, when the number of tokens corresponding to the context used by the generative language model during task execution reaches or exceeds the context threshold, or when the number of tokens consumed by the generative language model during task execution reaches or exceeds the token consumption threshold, a prompt message for adjusting the current task can be displayed to the user, allowing the user to select modification suggestions for the current task or customize the modification of the current task, thereby improving the quality of the generated answer.

[0049] It should be understood that the above description of the current task and the modification suggestions for the current task are only examples, and the types of the current task and the modification suggestions for the current task may include more types, which are not limited here.

[0050] The above reference Figures 1 to 5 The described exemplary embodiment provides a method for interacting with a generative language model. Compared with the prior art, its advantages are: on the one hand, when the number of tokens corresponding to the context used by the generative language model during task execution reaches or exceeds the context threshold, the generative language model can display a prompt message to the user to adjust the current task, so that the task can be modified in advance, avoiding the problem of reduced answer quality due to limited model performance. On the other hand, when the sum of the total number of tokens input to the generative language model by the user and the total number of tokens output by the model reaches or exceeds the token consumption threshold, the generative language model can also display a prompt message to the user to adjust the current task, avoiding the problem of too long model inference time and too high billing.

[0051] Figure 6A block diagram of an apparatus 600 for interacting with a generative language model according to some embodiments of the present disclosure is shown. As shown in Figure 600, the apparatus 600 includes a determination unit 602 configured to determine at least one token threshold for an interaction process with the generative language model. The apparatus 600 also includes a display unit 604 configured to display a prompt message for adjusting the current task based on a comparison between the token usage of the interaction process and at least one token threshold. The apparatus 600 also includes a generation unit 606 configured to generate an answer based on the adjusted task in response to confirmation of the adjustment of the current task.

[0052] In some embodiments, where at least one token threshold includes a context threshold, the determination unit 602 can also be configured to: display an interactive element for setting the context threshold, the interactive element presenting the maximum allowed length of the context; and determine the context threshold based on the operation on the interactive element, the context threshold being less than the maximum allowed length.

[0053] In some embodiments, where the token usage includes the number of tokens in the context of the interaction process, the display unit 604 can also be configured to: suspend execution of the current task in response to determining that the number of tokens in the context exceeds or reaches a context threshold during execution of the current task; and display prompt information for adjusting the current task.

[0054] In some embodiments, where at least one token threshold includes a token consumption threshold, and the token usage includes the number of tokens consumed during the interaction process, the display unit 604 can also be configured to: in response to determining that the number of tokens consumed exceeds or reaches the token consumption threshold during the execution of the current task, suspend the execution of the current task; and display a prompt message for adjusting the current task.

[0055] In some embodiments, the display unit 604 may be further configured to: provide one or more suggestions for adjusting the current task; and in response to confirming at least one of the one or more suggestions, adjust the current task based on the at least one suggestion.

[0056] In some embodiments, the one or more suggestions include one or more of: reducing the time range of the answer to the current task; reducing the search scope of the generative language model; or reducing the number of pages browsed by the generative language model.

[0057] In some embodiments, the apparatus 600 may be further configured to: receive input text for adjusting the current task; and adjust the current task based on the input text.

[0058] In some embodiments, the apparatus 600 may further be configured to display the total number of tokens that have been input to the generative language model and the total number of tokens that have been output by the generative language model.

[0059] In some embodiments, the device 600 can also be configured to: determine the cost of using the generative language model based on the total number of tokens input to the generative language model and the total number of tokens output by the generative language model; and determine at least one token threshold of the generative language model based on the cost.

[0060] Figure 7 1 shows a block diagram of a device 700 capable of implementing various embodiments of the present disclosure. Figure 7 As shown, the device 700 includes a computing unit 701, which can be a central processing unit (CPU) and / or a graphics processing unit (GPU), which can perform various appropriate gestures and processes according to computer program instructions stored in a read-only memory (ROM) 702 or loaded from a storage unit 708 into a random access memory (RAM) 703. Various programs and data required for the operation of the device 700 can also be stored in the RAM 703. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704. Although not shown in FIG. Figure 7 As shown in FIG, device 700 may further include a co-processor.

[0061] Various components in device 700 are connected to I / O interface 705, including an input unit 706, such as a keyboard, mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a magnetic disk, optical disk, etc.; and a communication unit 709, such as a network card, modem, wireless communication transceiver, etc. The communication unit 709 allows device 700 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0062] The various methods or processes described above can be performed by the computing unit 701. For example, in some embodiments, the methods can be implemented as computer software programs that are tangibly embodied in a machine-readable medium, such as the storage unit 708. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 700 via the ROM 702 and / or the communication unit 709. When the computer program is loaded into the RAM 703 and executed by the computing unit 701, one or more steps or gestures in the methods or processes described above can be performed.

[0063] In some embodiments, the methods and processes described above may be implemented as a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present disclosure.

[0064] Computer-readable storage medium can be a tangible device that can keep and store the instructions used by the instruction execution device.Computer-readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device or any suitable combination thereof.More specific examples (non-exhaustive list) of computer-readable storage medium include: 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), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a convex structure in a groove having instructions stored thereon, and any suitable combination thereof.Computer-readable storage medium used herein is not interpreted as a transient signal itself, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagated by waveguides or other transmission media (for example, light pulses by fiber optic cables), or electrical signals transmitted by wires.

[0065] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions to be stored in the computer-readable storage medium in each computing / processing device.

[0066] The computer program instructions for performing the disclosed operation can be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data or source code or the object code written in any combination of one or more programming languages, programming languages ​​include object-oriented programming languages, and conventional procedural programming languages.Computer-readable program instructions can be performed completely on a user's computer, partially on a user's computer, performed as an independent software package, partly on a user's computer and partly on a remote computer, or performed completely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer by any type of network-including local area network (LAN) or wide area network (WAN), or can be connected to an external computer (such as utilizing an internet service provider to connect by the internet). In certain embodiments, by utilizing the state information of computer-readable program instructions to carry out personalized customization electronic circuits, such as programmable logic circuits, field programmable gate arrays (FPGAs) or programmable logic arrays (PLA), this electronic circuit can perform computer-readable program instructions, thereby realizing various aspects of the present disclosure.

[0067] 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 device, thereby producing a machine such that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device is generated that implements the functions / attitudes specified in one or more blocks in the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, where these instructions cause the computer, programmable data processing device, and / or other device to operate in a specific manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing various aspects of the functions / attitudes specified in one or more blocks in the flowchart and / or block diagram.

[0068] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / attitudes specified in one or more boxes in the flowchart and / or block diagram.

[0069] The flow charts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and the part of the module, program segment or instruction includes one or more executable instructions for realizing the prescribed logical function. In some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart, can be implemented by a dedicated hardware-based system that performs the prescribed function or gesture, or can be implemented by a combination of dedicated hardware and computer instructions.

[0070] The embodiments of the present disclosure have been described above. The above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is selected to best explain the principles of the embodiments, practical applications, or technical improvements to existing technologies, or to enable other persons skilled in the art to understand the embodiments disclosed herein.

Claims

1. A method for interacting with a generative language model, comprising: determining at least one token threshold for an interaction process with the generative language model; displaying prompt information for adjusting the current task based on a comparison between the token usage amount during the interaction process and the at least one token threshold; as well as In response to confirmation of the adjustment of the current task, an answer is generated based on the adjusted task.

2. The method according to claim 1, wherein The at least one token threshold comprises a context threshold, wherein determining the at least one token threshold for the interaction process for the generative language model comprises: displaying an interactive element for setting the context threshold, the interactive element presenting a maximum allowed length of the context; and The context threshold is determined based on the operation on the interactive element, and the context threshold is less than the maximum allowed length.

3. The method according to claim 1, wherein The token usage includes the number of tokens in the context of the interaction process, wherein based on the comparison between the token usage of the interaction process and the at least one token threshold, displaying prompt information for adjusting the current task includes: In response to determining that the number of tokens in the context exceeds or reaches the context threshold during execution of the current task, suspending execution of the current task; and Displays prompt information for adjusting the current task.

4. The method according to claim 1, wherein The at least one token threshold includes a token consumption threshold, the token usage includes the number of tokens consumed during the interaction process, wherein based on the comparison between the token usage during the interaction process and the at least one token threshold, displaying prompt information for adjusting the current task includes: In response to determining that the number of consumed tokens exceeds or reaches the token consumption threshold during execution of the current task, pausing execution of the current task; and Displays prompt information for adjusting the current task.

5. The method according to claim 1, wherein The prompt information for adjusting the current task includes: providing one or more suggestions for adjusting the current task; and In response to confirming at least one of the one or more suggestions, the current task is adjusted based on the at least one suggestion.

6. The method according to claim 5, wherein: The one or more suggestions include one or more of the following: Reduce the time frame for answering the current task; reducing the search scope of the generative language model; or Reduce the number of pages browsed by the generative language model.

7. The method according to claim 1, further comprising: receiving input text for adjusting the current task; as well as The current task is adjusted based on the input text.

8. The method according to claim 1, further comprising: The total number of tokens input to the generative language model and the total number of tokens output by the generative language model are displayed.

9. The method according to claim 7, wherein: Determining at least one token threshold for an interaction process with the generative language model includes: determining a fee for using the generative language model based on the total number of tokens input to the generative language model and the total number of tokens output by the generative language model; and A token consumption threshold of the generative language model is determined based on the cost.

10. A device for interacting with a generative language model, comprising: a determining unit configured to determine at least one token threshold for an interaction process of the generative language model; a display unit configured to display prompt information for adjusting the current task based on a comparison between the token usage amount in the interaction process and the at least one token threshold; as well as The generating unit is configured to generate an answer based on the adjusted task in response to confirmation of the adjustment of the current task.

11. An electronic device comprising: processor; as well as A memory coupled to the processor, the memory having instructions stored therein, wherein when the instructions are executed by the processor, the electronic device executes the method according to any one of claims 1 to 9.

12. A computer-readable storage medium having computer-executable instructions stored thereon, wherein the computer-executable instructions are executed by a processor to implement the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Model calling method and device, electronic equipment and storage medium

    CN117973523A

  • Question and answer processing method and device, equipment, storage medium and program product

    CN118692450A

  • Information flow recommendation method and device based on large language model and electronic equipment

    CN119202385A

  • Session method and device, computer equipment, storage medium and program product

    CN119831035A