Cooperative reasoning resource allocation method and system for large language model in wireless network
By cached intermediate calculation results on the base station side and optimized resource allocation, the duplicate data transmission and calculation problems in the collaborative inference process of large language models in wireless networks are solved, and more efficient collaborative inference speed and reduced latency are achieved.
Patent Information
- Application Number
- CN202510840439.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-23
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-06-23
AI Technical Summary
In wireless networks, during the collaborative inference process of large language models, terminal devices need to frequently upload calculation results, resulting in increased communication overhead and calculation burden, repeated data transmission and processing, resulting in increased delay and inefficiency of the system.
By caching intermediate calculation results on the base station side, optimizing resource allocation strategies, reducing duplicate data transmission on the terminal side and duplicate calculation on the base station side, the base station calculation and cache resources are used to accelerate the cooperative inference process.
It effectively reduces the delay of collaborative inference, improves the overall efficiency of the system, reduces duplicate data upload on the terminal side and duplicate calculation on the base station side, and improves the inference speed of large language models.
Smart Images

Figure CN120378960A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of wireless communication technologies, and particularly to a resource allocation method and system for collaborative inference of large language models in wireless networks. Background Art
[0002] In future wireless networks, large language models will play a crucial role in intelligent services and applications, especially in the collaborative inference process. As the computing resources of terminal devices and base stations become gradually abundant, how to efficiently allocate these resources to achieve low latency and efficient inference has become a key challenge. Effective resource allocation can not only improve the speed of large language model inference, but also reduce the network burden and device power consumption, promoting the rapid development of intelligent services.
[0003] Currently, in the collaborative inference of large language models, terminal devices perform inference tasks locally and upload the calculation results to the base station for further processing. The specific process is as follows: the terminal executes the local inference task, generates the corresponding output sequence, and returns the result to the base station; the base station receives the output sequence from the terminal, then performs the large language model inference on the base station side, and finally returns the result to the terminal.
[0004] However, the current collaborative inference framework has significant problems without cache assistance. First, due to the need to recalculate the same model parameters or information for each inference, the communication overhead and computational burden between the terminal and the base station increase significantly. Especially in multi-round inferences, the terminal needs to frequently upload calculation results, while the base station needs to repeatedly process the same data from each terminal, resulting in resource waste and low system efficiency. Without the support of caching, terminal devices cannot avoid repeated data transmission, leading to an increase in latency during the collaborative inference process and reducing the overall system response speed. Summary of the Invention
[0005] To solve the above technical problems, the present invention provides a resource allocation method and system for collaborative inference of large language models in wireless networks, which improves the existing technology by caching the intermediate calculation results generated by the inference on the base station side, reducing the repeated transmission of the same data on the terminal side and the repeated calculation of the same data on the base station side, and accelerating the speed of large language model collaborative inference.
[0006] To achieve the above object, the technical solution adopted by the present invention is: First, a resource allocation method for collaborative inference of large language models in wireless networks is provided, including the following steps:
[0007] S1 In each collaborative inference round, the base station obtains each terminal Channel gains to the base station are used to generate a resource allocation plan, including: the central processor frequency, uplink transmission bandwidth, and uplink transmission power allocation plan on the terminal side, the central processor frequency allocation plan on the base station side, and the cache allocation plan on the base station side;
[0008] S2 Each terminal According to the central processor frequency, uplink transmission bandwidth, and uplink transmission power allocation plan on the terminal side and the cache allocation plan on the base station side, perform large language model inference on the terminal side and calculate the output sequence on the terminal side ;
[0009] After the base station receives the output sequence and cache sequence on the terminal side, perform large language model inference according to the central processor frequency allocation plan on the base station side, obtain the output token, and send the output token to each terminal.
[0010] Preferably, the latency required for the large model on the terminal side in S2 is:
[0011] ,
[0012] where is the central processor frequency on the terminal side, is the number of central processor cycles required for the terminal to process each input token;
[0013] The energy required for the large model on the terminal side is:
[0014] ,
[0015] where is the central processor capacitance coefficient of the terminal .
[0016] Preferably, the process of calculating the output sequence on the terminal side in S2 is:
[0017] Each terminal uses the large language model on the terminal side and the input sequence to calculate and obtain , where is the output sequence on the terminal side hidden dimension.
[0018] Preferably, S2 also includes: the terminal sends the last rows of the output sequence on the terminal side, that is , uplink to the base station; where , The input token sequence held before the start of the collaborative inference round The length of is the cache sequence length of the base station for terminal k.
[0019] Each terminal communicates with the base station using frequency division multiple access;
[0020] The terminal The uplink transmission rate of is:
[0021] ,
[0022] where and are the allocated uplink transmission bandwidth and uplink transmission power of the terminal respectively, is the unilateral noise power spectral density, for the terminal to the channel gain of the base station;
[0023] The terminal The uplink transmission delay of is:
[0024] ,
[0025] where is the number of bits required to transmit one line of the terminal-side output sequence;
[0026] The terminal The required uplink transmission energy is:
[0027] ,
[0028] where is the allocated uplink transmission power of the terminal respectively.
[0029] Preferably, the output token calculation process in S3 is:
[0030] The base station calculates using the terminal-side output sequence and the cache sequence:
[0031] ,
[0032] where The input token sequence held before the start of the collaborative inference round The length of is the cache sequence length of the base station for terminal k.
[0033] Preferably, the delay required for the large language model inference on the base station side is:
[0034] ,
[0035] Among them, is the central processor frequency allocation scheme on the base station side, The number of central processor cycles required for the base station to process each output token;
[0036] The base station is used to cache the terminals The number of bits for caching the intermediate calculation results of collaborative inference is:
[0037] ,
[0038] Among them, is the number of bits for caching the intermediate calculation results of each token of the large language model on the base station side, is the cache sequence length of the base station for terminal k;
[0039] The terminal The collaborative inference delay is
[0040] .
[0041] Among them, The large model on the terminal side The delay required for inference, is the transmission delay of the terminal , is the large language model on the base station side The delay required for inference.
[0042] Preferably, before S1 generates the resource allocation scheme, it further includes:
[0043] Preset the uplink transmission power constraints of each terminal:
[0044] ,
[0045] Among them is the maximum uplink transmission power of each terminal;
[0046] Preset the central processor frequency constraints of each terminal:
[0047] ,
[0048] Among them is the maximum central processor frequency of each terminal;
[0049] Preset the energy consumption constraints of each terminal:
[0050] ,
[0051] Among them is the maximum energy consumption of each terminal;
[0052] Preset uplink transmission bandwidth constraint on the terminal side:
[0053] ,
[0054] where is the maximum transmission bandwidth in the wireless network;
[0055] Preset central processor frequency constraint on the base station side:
[0056] ,
[0057] where is the maximum central processor frequency of the base station;
[0058] Preset cache constraint on the base station side:
[0059] ,
[0060] where is the maximum cache capacity on the base station side;
[0061] Preset maximum inference delay constraint:
[0062] ,
[0063] where is the maximum inference delay;
[0064] The equation for solving the preset average collaborative inference delay minimization problem is:
[0065] ;
[0066] The average collaborative inference delay minimization equation satisfies the above constraints.
[0067] Preferably, the preset average collaborative inference delay minimization problem is split into a first sub-optimization equation, a second sub-optimization equation, and a third sub-optimization equation;
[0068] The optimization variable of the first sub-optimization equation is: the cache on the base station side, the optimization variable of the second sub-optimization equation is: the central processor frequency and uplink transmission power on the terminal side, and the optimization variable of the third sub-optimization equation is: the uplink transmission bandwidth on the terminal side and the central processor frequency on the base station side;
[0069] The first sub-optimization equation is:
[0070]
[0071] where ;
[0072] The first sub-optimization equation has the following constraint conditions:
[0073]
[0074] Among them , ;
[0075] Furthermore, by using the linear optimization method, solve the first sub-optimization equation to obtain the base station side cache allocation scheme in the resource allocation scheme;
[0076] The second sub-optimization equation is:
[0077]
[0078] The second sub-optimization equation has the following constraint conditions:
[0079] ,
[0080] Among them, is the auxiliary variable of the maximum delay required for large model inference on the terminal side, is the auxiliary variable of the maximum delay required for transmitting the output sequence on the terminal side;
[0081] Furthermore, by using the convex optimization method, solve the second sub-optimization equation to obtain the central processor frequency and uplink transmission power on the terminal side in the resource allocation scheme;
[0082] The third sub-optimization equation is:
[0083] ,
[0084] The third sub-optimization equation has the following constraint conditions:
[0085] ,
[0086] Among them, is the auxiliary variable of the maximum delay required for large model inference on the base station side;
[0087] Furthermore, by using the convex optimization method, solve the third sub-optimization equation to obtain the uplink transmission bandwidth on the terminal side and the central processor frequency allocation scheme on the base station side in the resource allocation scheme.
[0088] The present invention also includes a resource allocation system for collaborative inference of large language models in a wireless network, characterized in that it includes:
[0089] A terminal side resource allocation module, used to obtain the channel gain from each terminal to the base station within each collaborative inference round and generate a resource allocation scheme; to the base station, and generate a resource allocation scheme;
[0090] A terminal side large language model inference module, used to control each terminal Perform large language model inference on the terminal side according to the central processor frequency, uplink transmission bandwidth, and uplink transmission power allocation scheme on the terminal side and the cache allocation scheme on the base station side, and calculate the output sequence on the terminal side. ;
[0091] The large language model inference module on the base station side is used to control the base station to receive the output sequence and cache sequence on the terminal side, and then perform large language model inference on the base station side according to the central processor frequency allocation scheme on the base station side, obtain the output token, and send the output token to each terminal.
[0092] The present invention further includes an electronic device, which is characterized in that it includes: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory complete communication with each other through the communication bus;
[0093] The memory is used to store computer programs;
[0094] The processor is used to implement the method steps described in any one of the above when executing the program stored on the memory.
[0095] The above technical solution has the following advantages or beneficial effects:
[0096] The present invention utilizes the computing and caching data of the base station to not only accelerate the collaborative inference process of the large language model, but also effectively reduce the latency of collaborative inference. Compared with the traditional model collaborative inference framework, the present invention reduces the repeated data upload on the terminal side and the repeated calculation on the base station side by introducing large language model caching, thereby improving the overall efficiency of the system.
[0097] Due to the fading and noise interference of the wireless channel, in the traditional collaborative inference framework, the signal transmission between the base station and the terminal device will be greatly affected, resulting in the distortion of the inference result. The signal transmission in the wireless channel will experience channel fading, which will affect the communication quality between the terminal and the base station. In this case, the traditional resource allocation method mainly relies on resource allocation without caching. However, the innovation of the present invention lies in optimizing the resource allocation strategy, making full use of the computing and caching resources on the base station side, reducing repeated communication and calculation, thereby accelerating the collaborative inference process of the large language model and significantly reducing the collaborative inference latency.
[0098] The above summary is only for the purpose of the specification and is not intended to be limiting in any way. In addition to the illustrative aspects, embodiments, and features described above, further aspects, embodiments, and features of the present invention will be readily apparent by reference to the drawings and the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0099] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the several views denote the same or similar components or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings depict only some embodiments disclosed in accordance with the present invention and should not be regarded as limiting the scope of the present invention.
[0100] Figure 1 Schematic diagram of a resource allocation model for collaborative inference of large language models in a wireless network provided by the present invention;
[0101] Figure 2 Flowchart of a method for resource allocation of collaborative inference of large language models in a wireless network provided by the present invention;
[0102] Figure 3 Structural diagram of a resource allocation system for collaborative inference of large language models in a wireless network provided by the present invention;
[0103] Figure 4 Schematic structural diagram of an electronic device for a method of resource allocation of collaborative inference of large language models in a wireless network provided by the present invention. Detailed implementation manners
[0104] In the following, only some exemplary embodiments are briefly described. As those skilled in the art will recognize, the described embodiments can be modified in various different ways without departing from the spirit or scope of the present invention. Therefore, the drawings and the description are to be regarded as illustrative in nature and not restrictive.
[0105] As Figure 1 shown, the large language model collaborative inference system includes: A number of terminals and 1 base station. Each terminal is equipped with a terminal-side large language model , and the base station is equipped with a base-station-side large language model . The terminal-side large language model and the base-station-side large language model together form the large language model ; meanwhile, the terminal holds an input token sequence of length before the start of the current collaborative inference round, and the base station has a cache sequence length of for the terminal .
[0106] According to an embodiment of a method for resource allocation of collaborative inference of large language models in a wireless network according to the present invention, the process is as Figure 2 shown, and the specific implementation steps are as follows:
[0107] S1 In each collaborative inference round, the base station obtains the channel gains from each terminal to the base station.
[0108] Each of the terminals The definition of the channel gain from each terminal to the base station is: a wireless link where the signal between each terminal device and the base station can reach directly.
[0109] The methods for the base station to obtain the channel gain from each terminal to the base station include but are not limited to the following. In this regard, the embodiments of the present invention do not make specific limitations:
[0110] The base station control device can use the channel estimation method to obtain the channel gain from each of the terminals to the base station. Among them, the channel estimation method can be any method that can obtain the system global channel state information (Channel State Information, CSI). The embodiments of the present invention do not specifically limit the channel estimation method.
[0111] The base station can adopt the channel estimation method to obtain the system global channel state information. That is to say, the base station can have the channel gain from each of the above terminals to the base station. Thus, when entering each preset information aggregation interval, the control device can obtain the channel gain from each of the above terminals to the base station within the current information aggregation interval from the base station.
[0112] It should be noted that when the base station obtains the channel gain from each of the terminals to the base station, it can be actively uploaded by each terminal to the base station when entering each preset information aggregation interval, or obtained by the base station sending a request for acquisition when entering each preset information aggregation interval. In this regard, the embodiments of the present invention do not make specific limitations.
[0113] After the base station obtains the channel gain from each terminal to it, it generates a resource allocation plan, including: the central processor frequency on the terminal side, the uplink transmission bandwidth and the uplink transmission power allocation plan, the central processor frequency allocation plan on the base station side, and the cache allocation plan on the base station side.
[0114] Before generating the resource allocation plan, it also includes:
[0115] Preset the uplink transmission power constraint for each terminal:
[0116] ,
[0117] where is the maximum uplink transmission power of each terminal;
[0118] Preset the central processor frequency constraint for each terminal:
[0119] ,
[0120] where is the maximum central processor frequency of each terminal;
[0121] Preset the energy consumption constraints of each terminal:
[0122] ,
[0123] where is the maximum energy consumption of each terminal;
[0124] Preset the uplink transmission bandwidth constraint on the terminal side:
[0125] ,
[0126] where is the maximum transmission bandwidth in the wireless network;
[0127] Preset the central processor frequency constraint on the base station side:
[0128] ,
[0129] where is the maximum central processor frequency of the base station;
[0130] Preset the cache constraint on the base station side:
[0131] ,
[0132] where is the maximum cache capacity on the base station side;
[0133] Preset the maximum inference delay constraint:
[0134] ,
[0135] where is the maximum inference delay;
[0136] The equation for solving the preset average collaborative inference delay minimization problem is:
[0137] ;
[0138] The average collaborative inference delay minimization equation satisfies the above constraints, that is, it satisfies the following preset condition formula:
[0139] .
[0140] The preset average collaborative inference delay minimization problem is split into a first sub-optimization equation, a second sub-optimization equation, and a third sub-optimization equation;
[0141] The optimization variables of the first sub-optimization equation are: the base station side cache, the optimization variables of the second sub-optimization equation are: the central processor frequency and uplink transmission power on the terminal side, and the optimization variables of the third sub-optimization equation are: the uplink transmission bandwidth on the terminal side and the central processor frequency on the base station side;
[0142] The first sub-optimization equation is:
[0143] ,
[0144] where ;
[0145] The first sub-optimization equation has the following constraints:
[0146] ,
[0147] where, , ;
[0148] Furthermore, using the linear optimization method, the first sub-optimization equation is solved to obtain the base station side cache allocation scheme in the resource allocation scheme;
[0149] The second sub-optimization equation is:
[0150] ,
[0151] The second sub-optimization equation has the following constraints:
[0152] ,
[0153] where, is the auxiliary variable for the maximum delay required for large model inference on the terminal side, is the auxiliary variable for the maximum delay required for transmitting the output sequence on the terminal side;
[0154] Furthermore, using the convex optimization method, the second sub-optimization equation is solved to obtain the central processor frequency and uplink transmission power on the terminal side in the resource allocation scheme;
[0155] The third sub-optimization equation is:
[0156] ,
[0157] The third sub-optimization equation has the following constraints:
[0158] ,
[0159] where, is the auxiliary variable for the maximum delay required for large model inference on the base station side;
[0160] Further, by using the convex optimization method, solve the third sub-optimization equation to obtain the uplink transmission bandwidth at the terminal side and the central processor frequency allocation scheme at the base station side in the resource allocation scheme.
[0161] S2 Each terminal Perform terminal-side large language model inference based on the central processor frequency, uplink transmission bandwidth, uplink transmission power allocation scheme at the terminal side, and the cache allocation scheme at the base station side, and calculate the terminal-side output sequence where the terminal transmits the last lines of the terminal-side output sequence , that is , uplink to the base station;
[0162] where the length of the input token sequence held before the start of the collaborative inference round is the cache sequence length of the base station for terminal k.
[0163] The latency required for the terminal-side large model inference is:
[0164] ,
[0165] where is the central processor frequency of the terminal , and is the number of central processor cycles required to process each input token;
[0166] The energy required for the terminal-side large model inference is:
[0167] ,
[0168] where is the central processor capacitance coefficient of the terminal .
[0169] The process of calculating the terminal-side output sequence is:
[0170] Each terminal uses the terminal-side large language model and the input token sequence to calculate , where is the hidden dimension of the terminal-side output sequence .
[0171] Each terminal communicates with the base station using frequency division multiple access;
[0172] The terminal The uplink transmission rate is:
[0173] ,
[0174] where and are the allocated uplink transmission bandwidth and uplink transmission power of the terminal respectively, is the unilateral noise power spectral density, is the channel gain from the terminal to the base station;
[0175] For the output sequence on the terminal side, only the last rows need to be uploaded to the base station for collaborative inference. The uplink transmission delay of the terminal is:
[0176] ,
[0177] where is the number of bits required to transmit one row of the output sequence on the terminal side;
[0178] The uplink transmission energy required by the terminal is:
[0179] ,
[0180] where is the allocated uplink transmission power of the terminal .
[0181] After the S3 base station receives the output sequence and cache sequence on the terminal side, it performs inference on the large language model on the base station side according to the base station side central processor frequency allocation scheme, obtains the output token, and sends the output token to each terminal.
[0182] The calculation process of the output token is:
[0183] The base station calculates using the output sequence and cache sequence on the terminal side to obtain:
[0184] ,
[0185] where is the length of the input token sequence held before the start of the collaborative inference round , is the length of the cache sequence of the base station for terminal k.
[0186] The latency required for inference of the large language model on the base station side is:
[0187] ,
[0188] Among them, is the central processor frequency allocation scheme on the base station side, The number of central processor cycles required for the base station to process each output token;
[0189] In addition, the scale of an output token is extremely small, and the delay in sending the output token to each terminal can be ignored.
[0190] The base station is used to cache the terminals The number of bits for caching the intermediate calculation results of collaborative inference is:
[0191] ,
[0192] Among them, is the number of bits for the base station to cache the intermediate calculation results of each token of the large language model on the base station side, is the cache sequence length of the base station for terminal k;
[0193] The terminal The collaborative inference delay is:
[0194] ,
[0195] Among them, The inference delay required by the large model on the terminal side , is the transmission delay of the terminal , is the inference delay required by the large language model on the base station side .
[0196] The present invention also proposes a resource allocation system for collaborative inference of large language models in a wireless network, as Figure 3 shown, including:
[0197] The terminal-side resource allocation module is used to obtain the channel gains from each terminal to the base station within each collaborative inference round, and generate a resource allocation scheme;
[0198] The terminal-side large language model inference module is used to control each terminal to perform inference on the terminal-side large language model according to the terminal-side central processor frequency, uplink transmission bandwidth, uplink transmission power allocation scheme, and base station-side cache allocation scheme, and calculate the terminal-side output sequence ;
[0199] The large language model inference module on the base station side is used to control the base station to receive the output sequence and cache sequence from the terminal side, and then perform large language model inference on the base station side according to the frequency allocation scheme of the central processor on the base station side, obtain the output token, and send the output token to each terminal. inference, obtain the output token, and send the output token to each terminal.
[0200] The present invention also provides an electronic device, such as Figure 4 shown, including: a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete mutual communication through the communication bus;
[0201] The memory is used to store computer programs;
[0202] The processor is used to execute the programs stored on the memory.
[0203] The above technical solution has the following advantages or beneficial effects: The present invention utilizes the computing and caching data of the base station to not only accelerate the collaborative inference process of the large language model, but also effectively reduce the latency of collaborative inference. Compared with the traditional model collaborative inference framework, the present invention reduces the repeated data upload on the terminal side and the repeated calculation on the base station side by introducing large language model caching, thereby improving the overall efficiency of the system.
[0204] Due to the fading and noise interference of the wireless channel, in the traditional collaborative inference framework, the signal transmission between the base station and the terminal device will be greatly affected, resulting in the distortion of the inference result. The signal transmission in the wireless channel will experience channel fading, which will further affect the communication quality between the terminal and the base station. In this case, the traditional resource allocation method mainly relies on resource allocation without caching. However, the innovation of the present invention is to optimize the resource allocation strategy, make full use of the computing and caching resources on the base station side, reduce repeated communication and calculation, thereby accelerating the collaborative inference process of the large language model and significantly reducing the collaborative inference latency.
[0205] In the description of this specification, the description with reference to terms such as "one embodiment", "one preferred embodiment", "example", "specific example", or "some examples" means that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0206] Any process or method description represented in a flowchart or otherwise described herein can be understood to represent a module, segment, or portion of code including one or more executable instructions for implementing a specific logical function or process. The scope of the preferred embodiments of the present invention includes additional implementations, where functions may be executed in a substantially simultaneous manner or in a reverse order according to the functions involved, rather than in the order shown or discussed, which should be understood by those skilled in the art to which the embodiments of the present invention pertain.
[0207] Logic and / or steps represented in a flowchart or otherwise described herein, for example, can be considered a sequenced list of executable instructions for implementing a logical function, and can be embodied specifically in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device. As used in this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (but not an exhaustive list) of the computer-readable medium include the following: an electrical connection having one or more wires (electronic device), a portable computer diskette (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or other suitable medium on which the program can be printed, as the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpretation, or other appropriate processing as necessary, and then stored in a computer memory.
[0208] It should be understood that various parts of the present invention can be implemented by hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application specific integrated circuits having appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.
[0209] Those of ordinary skill in the art can understand that all or part of the steps carried out in implementing the above-described embodiment methods can be completed by instructing relevant hardware through a program. The said program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiment. Among them, the device implementation mode corresponds to the method implementation mode. Therefore, the description of the device implementation mode is relatively brief, and the relevant description can refer to the description of the method implementation mode.
[0210] In addition, in each embodiment of the present invention, each functional unit can be integrated into a processing module, or each unit can exist physically alone, or two or more units can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. When the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. The storage medium can be a read-only memory, a disk, an optical disc, etc.
[0211] The above is only the specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of various changes or substitutions, and these should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the said claims.
Claims
1. A resource allocation method for collaborative inference of large language models in wireless networks, characterized in that It includes the following steps: In each collaborative inference round, the base station obtains each terminal channel gains to the base station and generates a resource allocation scheme, including: the central processor frequency, uplink transmission bandwidth, and uplink transmission power allocation schemes on the terminal side, the central processor frequency allocation scheme on the base station side, and the cache allocation scheme on the base station side; Each terminal of S2 Perform large language model inference on the terminal side according to the central processor frequency, uplink transmission bandwidth and uplink transmission power allocation scheme on the terminal side and the cache allocation scheme on the base station side And calculate the output sequence on the terminal side ; After the S3 base station receives the output sequence and the cache sequence from the terminal side, it performs large language model inference on the base station side according to the frequency allocation scheme of the central processing unit on the base station side, obtains the output token, and sends the output token to each terminal. Inference is performed to obtain the output token, and the output token is sent to each terminal.
2. The resource allocation method for collaborative inference of large language models in a wireless network according to claim 1, characterized in that: The large model on the terminal side described in S2 The latency required for inference is as follows: , Among them, is the terminal CPU frequency, is the number of CPU cycles required to process each input token; Large model on the terminal side The energy required for inference is: , Among them, is the central processing unit capacitance coefficient of the terminal .
3. A resource allocation method for collaborative inference of large language models in wireless networks according to claim 1, characterized in that: The process of outputting the sequence on the computing terminal side described in S2 is as follows: Each terminal Utilize the large language model on the terminal side And the input token sequence Perform calculations to obtain , where Is the output sequence on the terminal side Hidden dimension.
4. The resource allocation method for collaborative inference of large language models in a wireless network according to claim 1, wherein: S2 also includes: a terminal The subsequent part of the output sequence on the terminal side is transmitted uplink to the base station; where the length of the input token sequence held before the start of the collaborative inference round is the cache sequence length of the base station for terminal k; Each terminal communicates with the base station by using frequency division multiple access. Terminal The uplink transmission rate is: , Among them, and are the allocated uplink transmission bandwidth and uplink transmission power of the terminal respectively, is the unilateral noise power spectral density, is the channel gain from the terminal to the base station; Terminal The uplink transmission delay is as follows: , wherein is the number of bits required to transmit one line of the output sequence on the terminal side; Terminal The required uplink transmission energy is as follows: , Among them, is the allocated uplink transmission power of the terminal .
5. The resource allocation method for collaborative inference of large language models in a wireless network according to claim 1, wherein: The process of calculating the output token described in S3 is as follows: The base station calculates using the output sequence on the terminal side and the cache sequence: , Among them, The length of the input token sequence held before the start of the collaborative inference round is the cache sequence length of the base station for terminal k.
6. The resource allocation method for collaborative inference of large language models in a wireless network according to claim 1, characterized in that: The latency required for the large language model inference on the base station side is: , Among them, is the central processor frequency allocation scheme on the base station side, the number of central processor cycles required for the base station to process each output token; The base station is used to cache the terminal The number of bits of the intermediate calculation result for collaborative inference is: , Among them, is the number of bits used by the base station to cache the intermediate calculation results of each token of the large language model on the base station side, is the cache sequence length of the base station for terminal k; Terminal The collaborative inference latency is as follows: , Among them, the large model on the terminal side the latency required for inference, is the transmission latency of the terminal and is the latency required for inference of the large language model on the base station side. 7. A resource allocation method for collaborative inference of large language models in wireless networks according to claim 1, characterized in that: Before generating the resource allocation scheme in S1, it also includes: Presetting the uplink transmission power constraint for each terminal: , wherein is the maximum uplink transmission power of each terminal; Presetting the central processor frequency constraint for each terminal: , wherein is the maximum central processing unit frequency of each terminal; Presetting the energy consumption constraint for each terminal: , Among them is the maximum energy consumption of each terminal; Presetting the uplink transmission bandwidth constraint on the terminal side: , wherein is the maximum transmission bandwidth in the wireless network; Presetting the central processor frequency constraint on the base station side: , wherein is the maximum central processor frequency of the base station; Presetting the cache constraint on the base station side: , Among them is the maximum buffer capacity on the base station side; Presetting the maximum inference latency constraint: , Among them is the maximum inference delay; The equation for solving the preset average collaborative inference latency minimization problem is: ; The average collaborative inference latency minimization equation satisfies the above constraints.
8. The method for resource allocation of collaborative inference of large language models in a wireless network according to claim 7, wherein: The preset average collaborative inference latency minimization problem is split into a first sub-optimization equation, a second sub-optimization equation, and a third sub-optimization equation; The optimization variable of the first sub-optimization equation is: the cache on the base station side. The optimization variables of the second sub-optimization equation are: the central processor frequency and uplink transmission power on the terminal side. The optimization variables of the third sub-optimization equation are: the uplink transmission bandwidth on the terminal side and the central processor frequency on the base station side; The first sub-optimization equation is: , Among them ; The first sub-optimization equation has the following constraint conditions: , Among them , ; Further, using the linear optimization method, solve the first sub-optimization equation to obtain the cache allocation scheme on the base station side in the resource allocation scheme; The second sub-optimization equation is: , The second sub-optimization equation has the following constraint conditions: , Among them, is the delay auxiliary variable required for the largest large model inference on the terminal side, and is the delay auxiliary variable required for the transmission of the largest output sequence on the terminal side; Further, using the convex optimization method, solve the second sub-optimization equation to obtain the central processor frequency and uplink transmission power on the terminal side in the resource allocation scheme; The third sub-optimization equation is: , The third sub-optimization equation has the following constraint conditions: , Among them, is the delay auxiliary variable required for the large model inference on the maximum base station side; Further, using the convex optimization method, solve the third sub-optimization equation to obtain the uplink transmission bandwidth on the terminal side and the central processor frequency allocation scheme on the base station side in the resource allocation scheme.
9. A resource allocation system for collaborative inference of large language models in wireless networks, characterized in that, It includes: The terminal-side resource allocation module is used to, within each collaborative inference round, enable the base station to obtain the channel gains from each terminal to the base station and generate a resource allocation scheme; The large language model inference module on the terminal side is used to control each terminal Perform large language model inference on the terminal side according to the central processing unit frequency, uplink transmission bandwidth and uplink transmission power allocation scheme on the terminal side and the cache allocation scheme on the base station side And calculate the output sequence on the terminal side ; The large language model inference module on the base station side is used to control the base station to receive the output sequence from the terminal side and cache the data, and then perform large language model inference on the base station side according to the central processor frequency allocation scheme on the base station side to obtain the output token and send the output token to each terminal.
10. An electronic device, characterized in that, It includes: A processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete communication with each other through the communication bus; The memory is used to store computer programs; The processor is used to implement the method steps described in any one of claims 1-8 when executing the programs stored on the memory.
Citation Information
Patent Citations
Edge-end collaborative adaptive deduction acceleration method and device, equipment and storage medium
CN118673795A
Dynamic reasoning method and system under large language model
CN119150863A
Communication method and device
CN120186637A
Model processing method and apparatus, device, and storage medium
WO2025092523A1
Reasoning method and communication apparatus
WO2025108413A1