Large model reasoning optimization method and device, computer equipment and medium

By caching and storing large model input requests and output results on the client side, and judging whether to store them based on importance and frequency, the problem of unstable large model output and waste of repeated calculations is solved, and more efficient computing and cache management are achieved.

CN118607640APending Publication Date: 2024-09-06GUANGXI GUIYUNTONG TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410780029.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-17
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

Large models cannot guarantee stable output in actual implementation scenarios, and at the same time lead to serious waste of repeated calculations.

Method used

By storing input requests and corresponding output results in the client-side cache, the importance and frequency of input requests are judged, large model inference calculations on the cloud are performed only when necessary, and the cache is cleared when the large model is updated to avoid repeated calculations.

Benefits of technology

It improves the stability of output results, reduces repeated waste of large model calculations, and optimizes cache management strategies to improve efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118607640A
    Figure CN118607640A
Patent Text Reader

Abstract

The invention relates to the technical field of large models, and discloses a large model reasoning optimization method and device, computer equipment and a medium. The method comprises the steps that a current input request is received, and whether the current input request exists in an end side cache or not is judged; if the current input request exists in the end-side cache, determining that an output result corresponding to the current input request in the end-side cache is an output result deserved by reasoning calculation based on the current input request; and if the current input request does not exist in the end-side cache, performing reasoning calculation based on the current input request by using a large model of the cloud to obtain a corresponding output result, and storing the current input request and the corresponding output result in the end-side cache at the same time. According to the scheme, the output stability can be effectively improved, and meanwhile serious repeated waste of a large model is avoided to a certain extent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of large model technology, and in particular to a large model reasoning optimization method, device, computer equipment and medium. Background Art

[0002] In actual application scenarios, the big model needs to be called to perform calculations every time the same problem is raised. Due to the unstable nature of the big model itself, the output content after each calculation may be inconsistent. This makes it impossible to guarantee output stability and causes serious duplication and waste. Summary of the invention

[0003] In view of this, the present invention provides a large model reasoning optimization method, device, computer equipment and medium to solve the problem that the existing large model cannot guarantee output stability in actual implementation scenarios and also causes serious duplication and waste.

[0004] In a first aspect, the present invention provides a large model reasoning optimization method, the method comprising:

[0005] Receive the current input request and determine whether the current input request exists in the client-side cache;

[0006] If the current input request exists in the end-side cache, determining that the output result corresponding to the current input request in the end-side cache is the output result that should be obtained by inference calculation based on the current input request;

[0007] If the current input request does not exist in the end-side cache, the large model in the cloud is used to perform inference calculation based on the current input request to obtain the corresponding output result, and the current input request and the corresponding output result are stored in the end-side cache.

[0008] The large model reasoning optimization method provided by the present invention has the following advantages:

[0009] This solution stores part of the input requests and the corresponding output results in the end-side cache, so that after receiving this part of the input requests in the future, the corresponding output results are directly obtained from the end-side cache. This not only makes the output results corresponding to the same input requests stored in the end-side cache fixed, but also avoids repeated calculation of the output results corresponding to the input requests stored in the end-side cache. It can be seen that this solution can effectively improve the output stability while avoiding repeated waste of large model calculations to a certain extent.

[0010] In an optional implementation manner, before storing the current input request and the corresponding output result in the client-side cache, the method further includes:

[0011] Determine whether the output result corresponding to the current input request is fixed. If so, execute the step of storing the current input request and the corresponding output result in the end-side cache. Otherwise, determine that the current input request and the corresponding output result do not need to be stored in the end-side cache.

[0012] In an optional implementation manner, before executing the step of storing the current input request and the corresponding output result in the terminal side cache, the method further includes:

[0013] After determining that the output result corresponding to the current input request is fixed, determine whether the importance of the current input request reaches the importance threshold. If so, execute the step of storing the current input request and the corresponding output result in the end-side cache. Otherwise, determine that there is no need to store the current input request and the corresponding output result in the end-side cache.

[0014] In an optional implementation manner, before executing the step of storing the current input request and the corresponding output result in the terminal side cache, the method further includes:

[0015] After determining that the importance of the current input request reaches the importance threshold, determine whether the frequency of the current input request being received in the current time period reaches the input frequency threshold. If so, execute the step of storing the current input request and the corresponding output result in the end-side cache. Otherwise, determine that there is no need to store the current input request and the corresponding output result in the end-side cache.

[0016] In an optional implementation manner, before executing the step of storing the current input request and the corresponding output result in the terminal side cache, the method further includes:

[0017] After determining that the frequency at which the current input request is received within the current time period reaches the input frequency threshold, determine whether the update frequency of the large model corresponding to the current input request is lower than the update frequency threshold; if so, execute the step of storing the current input request and the corresponding output result in the end-side cache; otherwise, determine that there is no need to store the current input request and the corresponding output result in the end-side cache.

[0018] In an optional implementation, it also includes:

[0019] Regularly determine whether the amount of data in the end-side cache has reached a preset amount of data. If so, delete the input request with the lowest importance, and / or the lowest frequency of being received in the current time period, and / or the input request with the highest update frequency of the corresponding large model and the corresponding output results.

[0020] In an optional implementation, it also includes:

[0021] Monitor update notifications of the large models in the cloud, and if a notification of update of any large model is monitored, delete the input request and the corresponding output result corresponding to any large model in the client-side cache.

[0022] In an optional implementation manner, before storing the current input request and the corresponding output result in the client-side cache, the method further includes:

[0023] Vectorize the current input request and the corresponding output result.

[0024] In a second aspect, the present invention provides a large model reasoning optimization device, the device comprising:

[0025] A determination module, configured to: receive a current input request and determine whether the current input request exists in a client-side cache;

[0026] A determination module, configured to: if the current input request exists in the end-side cache, determine that the output result corresponding to the current input request in the end-side cache is the output result that should be obtained by inference calculation based on the current input request;

[0027] The computing module is used to: if the current input request does not exist in the end-side cache, use the large model in the cloud to perform inference calculation based on the current input request to obtain the corresponding output result, and store the current input request and the corresponding output result in the end-side cache.

[0028] The large model reasoning optimization device provided by the present invention has the following advantages:

[0029] This solution stores part of the input requests and the corresponding output results in the end-side cache, so that after receiving this part of the input requests in the future, the corresponding output results are directly obtained from the end-side cache. This not only makes the output results corresponding to the same input requests stored in the end-side cache fixed, but also avoids repeated calculation of the output results corresponding to the input requests stored in the end-side cache. It can be seen that this solution can effectively improve the output stability while avoiding repeated waste of large model calculations to a certain extent.

[0030] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, computer instructions being stored in the memory, and the processor executing the large model reasoning optimization method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0031] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the large model reasoning optimization method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0033] Figure 1 It is a flowchart of a large model reasoning optimization method provided according to an embodiment of the present invention;

[0034] Figure 2 This is a structural block diagram of a large model reasoning optimization device according to an embodiment of the present invention;

[0035] Figure 3 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0036] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0037] In the existing big model field, most of them will first classify the voice control commands, fix some commonly used voice control commands, and use NLP to conduct targeted training on the intentions and answers of these commonly used voice control commands; at the same time, a big model is used to serve as a "backup" for dialogues, to understand and respond to dialogues that are not processed by NLP, thereby achieving intelligence at the perception end.

[0038] However, in the above technical solution, for repeated input requests, it is necessary to request the large model to perform corresponding calculations each time, resulting in repeated calculations of the large model and waste of computing resources; at the same time, the output results corresponding to the same input request may be different, resulting in unstable output results.

[0039] To solve the above problems, an embodiment of the present invention provides a large model reasoning optimization embodiment. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system (computer device) including a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0040] In this embodiment, a large model inference optimization method is provided, which can be used in terminal devices such as mobile phones, tablet computers, etc. Figure 1 is a flow chart of a large model reasoning optimization method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:

[0041] S11: Receive a current input request, and determine whether the current input request exists in the client-side cache.

[0042] The end side is the terminal side located locally relative to the cloud. The end side is provided with a cache, and some input requests and corresponding output results are stored in the cache of the end side to achieve inference optimization of the large model based on the end side cache. The current input request is the currently received input request, which can also be understood as an input token, specifically a request to request the large model to perform corresponding calculations to obtain the calculated output results.

[0043] S12: If the current input request exists in the end-side cache, determine that the output result corresponding to the current input request in the end-side cache is the output result that should be obtained based on the inference calculation of the current input request.

[0044] S13: If the current input request does not exist in the end-side cache, the large model in the cloud is used to perform inference calculation based on the current input request to obtain a corresponding output result, and the current input request and the corresponding output result are stored in the end-side cache.

[0045] After receiving the current input token, if the input token is in the end-side cache, the output result corresponding to the input token in the end-side cache is directly obtained, and the subsequent business process is implemented based on this; and when judging whether the input token is in the end-side cache, a fast query can be implemented through a preset efficient data retrieval algorithm, such as a tree table search algorithm, a hash table search algorithm, etc. If the input token is not in the end-side cache, the corresponding inference calculation is performed using the cloud-based large model to obtain the corresponding output result, and the subsequent business process is implemented based on this; at the same time, the input token and the corresponding output result are stored in the end-side cache, so that they can be directly obtained from the end-side cache later.

[0046] This solution stores part of the input requests and the corresponding output results in the end-side cache, so that after receiving this part of the input requests in the future, the corresponding output results are directly obtained from the end-side cache. This not only makes the output results corresponding to the same input requests stored in the end-side cache fixed, but also avoids repeated calculation of the output results corresponding to the input requests stored in the end-side cache. It can be seen that this solution can effectively improve the output stability while avoiding repeated waste of large model calculations to a certain extent.

[0047] A large model reasoning optimization method provided in this embodiment may further include, before storing the current input request and the corresponding output result in the client-side cache:

[0048] Determine whether the output result corresponding to the current input request is fixed. If so, execute the step of storing the current input request and the corresponding output result in the end-side cache. Otherwise, determine that the current input request and the corresponding output result do not need to be stored in the end-side cache.

[0049] Before executing the step of storing the current input request and the corresponding output result in the terminal side cache, the method may further include:

[0050] After determining that the output result corresponding to the current input request is fixed, determine whether the importance of the current input request reaches the importance threshold. If so, execute the step of storing the current input request and the corresponding output result in the end-side cache. Otherwise, determine that there is no need to store the current input request and the corresponding output result in the end-side cache.

[0051] Before executing the step of storing the current input request and the corresponding output result in the terminal side cache, the method may further include:

[0052] After determining that the importance of the current input request reaches the importance threshold, determine whether the frequency of the current input request being received in the current time period reaches the input frequency threshold. If so, execute the step of storing the current input request and the corresponding output result in the end-side cache. Otherwise, determine that there is no need to store the current input request and the corresponding output result in the end-side cache.

[0053] Since the storage space of the end-side cache is limited, the embodiment of the present invention can also judge the importance of the current input request, the cache hit rate (reflected by the frequency of being received in the current time period) and the stability of the corresponding output result before storing the current input request and the corresponding output result in the end-side cache, so that the input request and the corresponding output result stored in the end-side cache can be data information with fixed output results, more important and higher hit rate, thereby improving the optimization effect. Specifically, analyze and determine whether the output result corresponding to the input request is fixed. If it is fixed, there is no need to call the large model every time to perform inference calculation based on the input request, so it is preferred to store it in the end-side cache; analyze and determine whether the input request is important enough (whether the importance reaches the importance threshold set in advance according to actual needs). If it is important enough, its stability is required to be high, so it is preferred to store it in the end-side cache; analyze and determine the frequency of the input request being received within the current time period (the time period of the preset duration to which the current moment belongs, the preset duration can be set according to actual needs, such as 10 minutes, 15 minutes, etc.). If the frequency of reception is high (whether the frequency of reception reaches the input frequency threshold set in advance according to actual needs), it means that the possibility of subsequent reception is very high, so it is preferred to store it in the end-side cache.

[0054] A large model reasoning optimization method provided in this embodiment may further include, before executing the step of storing the current input request and the corresponding output result in the client-side cache:

[0055] After determining that the frequency at which the current input request is received within the current time period reaches the input frequency threshold, determine whether the update frequency of the large model corresponding to the current input request is lower than the update frequency threshold; if so, execute the step of storing the current input request and the corresponding output result in the end-side cache; otherwise, determine that there is no need to store the current input request and the corresponding output result in the end-side cache.

[0056] It should be noted that the embodiment of the present invention comprehensively determines whether to cache the input token and its output result to the end-side device based on factors such as the importance of the input token, the stability of the output result, the cache hit rate, and the update frequency of the large model, so as to further improve the optimization effect. Specifically, after the large model is updated, the output result corresponding to the same input request is likely to change. Therefore, in the embodiment of the present invention, the update frequency threshold can be set in advance according to actual needs; correspondingly, if the update frequency of the large model is lower than the update frequency threshold, it means that its update frequency is low, and the output result corresponding to the input request will not change due to the update of the large model in a short period of time. Therefore, it is preferred to store the output result corresponding to the input request in the end-side cache.

[0057] A large model reasoning optimization method provided in this embodiment may also include:

[0058] Regularly determine whether the amount of data in the end-side cache has reached a preset amount of data. If so, delete the input request with the lowest importance, the lowest frequency of being received in the current time period, and / or the highest update frequency of the corresponding large model and the corresponding output results.

[0059] Monitor update notifications of the large models in the cloud, and if a notification of update of any large model is monitored, delete the input request and the corresponding output result corresponding to any large model in the client-side cache.

[0060] It should be noted that, in order to achieve efficient management of the end-side cache, the embodiment of the present invention will also design a cache strategy, including the data structure, storage format and cache size limit of the cache; the cache management strategy can also be set, including cache update, deletion, etc., to ensure the accuracy and efficiency of the cached data, which can be triggered by regularly evaluating the accuracy of the cached data or monitoring the notification of model update. Specifically, the preset data volume is the cache size limit, that is, the maximum data volume that the end-side cache can reach. It is regularly determined whether the data volume in the end-side cache has reached the maximum data volume. If so, in order to ensure the storage of subsequent data, the input request with the lowest importance in the end-side cache, and / or the lowest frequency of reception in the current time period, and / or the highest update frequency of the corresponding large model and the corresponding output result can be deleted from the end-side cache. In addition, in order to avoid the invalidation of the input request and the corresponding output result in the end-side cache due to the update of the large model, the update notification of the large model in the cloud can also be monitored, so that after monitoring the update of any large model, it is considered that the output result of the same input request based on the large model is likely to change, so in order to avoid invalid storage, the input request and the corresponding output result of the large model are deleted from the end-side cache.

[0061] A large model reasoning optimization method provided in this embodiment may further include, before storing the current input request and the corresponding output result in the client-side cache:

[0062] Vectorize the current input request and the corresponding output result.

[0063] After the input request and the corresponding output result are vectorized, they are stored in the client-side cache, which can facilitate the management of the input request and the corresponding output result.

[0064] The technical solution of the present invention reduces the computing requirements on the cloud and reduces the computing cost by caching the output results of common input tokens on the terminal device. At the same time, it improves the cache hit rate and utilization rate through vectorized storage and caching strategies.

[0065] In this embodiment, a large model reasoning optimization device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0066] This embodiment provides a large model reasoning optimization device, such as Figure 2 may include:

[0067] The judgment module 11 is used to: receive a current input request and judge whether the current input request exists in the client-side cache;

[0068] The determination module 12 is used to: if the current input request exists in the end-side cache, determine that the output result corresponding to the current input request in the end-side cache is the output result that should be obtained by inference calculation based on the current input request;

[0069] The computing module 13 is used to: if the current input request does not exist in the end-side cache, use the large model in the cloud to perform inference calculation based on the current input request to obtain the corresponding output result, and store the current input request and the corresponding output result in the end-side cache.

[0070] The large model reasoning optimization device in this embodiment is presented in the form of a functional module, where the module refers to an application specific integrated circuit (ASIC), a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0071] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0072] A large model reasoning optimization device provided by an embodiment of the present invention further includes an execution module, which can be used to:

[0073] Before storing the current input request and the corresponding output result in the end-side cache, determine whether the output result corresponding to the current input request is fixed. If so, execute the step of storing the current input request and the corresponding output result in the end-side cache. Otherwise, determine that there is no need to store the current input request and the corresponding output result in the end-side cache.

[0074] Before executing the step of storing the current input request and the corresponding output result in the end-side cache, after determining that the output result corresponding to the current input request is fixed, determine whether the importance of the current input request reaches the importance threshold. If so, execute the step of storing the current input request and the corresponding output result in the end-side cache. Otherwise, determine that there is no need to store the current input request and the corresponding output result in the end-side cache.

[0075] Before executing the step of storing the current input request and the corresponding output result in the end-side cache, after determining that the importance of the current input request reaches the importance threshold, determine whether the frequency at which the current input request is received within the current time period reaches the input frequency threshold; if so, execute the step of storing the current input request and the corresponding output result in the end-side cache; otherwise, determine that there is no need to store the current input request and the corresponding output result in the end-side cache.

[0076] Before executing the step of storing the current input request and the corresponding output result in the end-side cache, after determining that the frequency at which the current input request is received within the current time period reaches the input frequency threshold, determine whether the update frequency of the large model corresponding to the current input request is lower than the update frequency threshold; if so, execute the step of storing the current input request and the corresponding output result in the end-side cache; otherwise, determine that there is no need to store the current input request and the corresponding output result in the end-side cache.

[0077] The large model reasoning optimization device provided by the embodiment of the present invention may further include a cache management module, which may be used to:

[0078] Regularly determine whether the amount of data in the end-side cache has reached a preset amount of data. If so, delete the input request with the lowest importance, and / or the lowest frequency of being received in the current time period, and / or the input request with the highest update frequency of the corresponding large model and the corresponding output results.

[0079] Monitor update notifications of the large models in the cloud, and if a notification of update of any large model is monitored, delete the input request and the corresponding output result corresponding to any large model in the client-side cache.

[0080] A large model reasoning optimization device provided by an embodiment of the present invention may also include:

[0081] The vectorization module is used to: vectorize the current input request and the corresponding output result before storing the current input request and the corresponding output result in the end-side cache.

[0082] The embodiment of the present invention also provides a computer device having the above Figure 2 The large model inference optimization device shown.

[0083] See also Figure 3 , Figure 3 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 3 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 3 A processor 10 is taken as an example.

[0084] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0085] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.

[0086] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the use of a computer device based on the presentation of a small program landing page, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0087] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0088] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 3 The example of connecting through bus is taken in the following.

[0089] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.

[0090] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0091] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A large model reasoning optimization method, characterized in that: include: Receive the current input request and determine whether the current input request exists in the client-side cache; If the current input request exists in the end-side cache, determining that the output result corresponding to the current input request in the end-side cache is the output result that should be obtained by inference calculation based on the current input request; If the current input request does not exist in the end-side cache, the large model in the cloud is used to perform inference calculation based on the current input request to obtain the corresponding output result, and the current input request and the corresponding output result are stored in the end-side cache.

2. The method according to claim 1, characterized in that Before storing the current input request and the corresponding output result in the client-side cache, the method further includes: Determine whether the output result corresponding to the current input request is fixed. If so, execute the step of storing the current input request and the corresponding output result in the end-side cache. Otherwise, determine that the current input request and the corresponding output result do not need to be stored in the end-side cache.

3. The method according to claim 2, characterized in that Before executing the step of storing the current input request and the corresponding output result in the terminal side cache, the method further includes: After determining that the output result corresponding to the current input request is fixed, determine whether the importance of the current input request reaches the importance threshold. If so, execute the step of storing the current input request and the corresponding output result in the end-side cache. Otherwise, determine that there is no need to store the current input request and the corresponding output result in the end-side cache.

4. The method according to claim 3, characterized in that Before executing the step of storing the current input request and the corresponding output result in the terminal side cache, the method further includes: After determining that the importance of the current input request reaches the importance threshold, determine whether the frequency of the current input request being received in the current time period reaches the input frequency threshold. If so, execute the step of storing the current input request and the corresponding output result in the end-side cache. Otherwise, determine that there is no need to store the current input request and the corresponding output result in the end-side cache.

5. The method according to claim 4, characterized in that Before executing the step of storing the current input request and the corresponding output result in the terminal side cache, the method further includes: After determining that the frequency at which the current input request is received within the current time period reaches the input frequency threshold, determine whether the update frequency of the large model corresponding to the current input request is lower than the update frequency threshold; if so, execute the step of storing the current input request and the corresponding output result in the end-side cache; otherwise, determine that there is no need to store the current input request and the corresponding output result in the end-side cache.

6. The method according to claim 5, characterized in that Also includes: Regularly determine whether the amount of data in the end-side cache has reached a preset amount of data. If so, delete the input request with the lowest importance, and / or the lowest frequency of being received in the current time period, and / or the input request with the highest update frequency of the corresponding large model and the corresponding output results.

7. The method according to claim 6, characterized in that Also includes: Monitor update notifications of the large models in the cloud, and if a notification of update of any large model is monitored, delete the input request and the corresponding output result corresponding to any large model in the client-side cache.

8. The method according to claim 7, characterized in that Before storing the current input request and the corresponding output result in the client-side cache, the method further includes: Vectorize the current input request and the corresponding output result.

9. A large model reasoning optimization device, characterized in that: include: A determination module, configured to: receive a current input request and determine whether the current input request exists in a client-side cache; A determination module, configured to: if the current input request exists in the end-side cache, determine that the output result corresponding to the current input request in the end-side cache is the output result that should be obtained by inference calculation based on the current input request; The computing module is used to: if the current input request does not exist in the end-side cache, use the large model in the cloud to perform inference calculation based on the current input request to obtain the corresponding output result, and store the current input request and the corresponding output result in the end-side cache.

10. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the large model reasoning optimization method according to any one of claims 1 to 8 by executing the computer instructions.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the large model reasoning optimization method according to any one of claims 1 to 8.

Citation Information

Cited By

  • Model reasoning system, method and device, electronic equipment, medium and product

    CN120235251A