Method and system for resource allocation for large language model collaborative inference in wireless network

By caching intermediate computation results and optimizing resource allocation on the base station side, the problems of repetitive computation and communication overhead in the collaborative inference process of large language models in wireless networks are solved, achieving faster collaborative inference speed and higher system efficiency.

CN120378960BActive Publication Date: 2025-10-17BEIJING UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510840439.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-23
Publication Date
2025-10-17
Estimated Expiration
2045-06-23

AI Technical Summary

Technical Problem

In wireless networks, the redundant computation and communication overhead between terminal devices and base stations during collaborative inference of large language models leads to increased latency and wasted resources. Especially in multi-round inference, cache resources cannot be effectively utilized, resulting in low system efficiency.

Method used

By caching intermediate computation results on the base station side and optimizing resource allocation strategies, including the allocation of CPU frequency, uplink transmission bandwidth and power on both the terminal side and the base station side, redundant data transmission on the terminal side and redundant computation on the base station side are reduced, thereby accelerating collaborative inference by utilizing the computing and caching resources of the base station.

Benefits of technology

It effectively reduces the latency of collaborative reasoning, improves the overall efficiency of the system, reduces redundant data uploads on the terminal side and redundant calculations on the base station side, and improves the collaborative reasoning speed of large language models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120378960B_ABST
    Figure CN120378960B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of wireless communication, and particularly relates to a resource allocation method and system for large language model cooperative inference in a wireless network. In each cooperative inference round, a base station obtains channel gains of each terminal to the base station, generates a resource allocation scheme, each terminal performs terminal-side large language model inference according to a terminal-side central processing unit frequency, an uplink transmission bandwidth, an uplink transmission power allocation scheme and a base station-side buffer allocation scheme, and calculates a terminal-side output sequence. After receiving the terminal-side output sequence and the buffer sequence, the base station performs base station-side large language model inference according to a base station-side central processing unit frequency allocation scheme, obtains an output token, and sends the output token to each terminal. The present application accelerates large language model cooperative inference in a wireless network by using the computing and buffer resources of the base station, and reduces the cooperative inference delay.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of wireless communication, in particular to a resource allocation method and system for large language model collaborative inference in wireless networks. BACKGROUND

[0002] In future wireless networks, large language models will play a crucial role in intelligent services and applications, especially in collaborative inference processes. As the computing resources of terminal devices and base stations gradually increase, how to efficiently allocate these resources to achieve low latency and efficient inference has become a key challenge. Effective resource allocation not only improves the speed of large language model inference, but also reduces 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 local inference tasks and upload the computation results to the base station for further processing. The specific process is as follows: the terminal performs local inference tasks, generates the corresponding output sequence, and returns the results to the base station; the base station receives the output sequence from the terminal, then performs large language model inference on the base station side, and finally returns the results to the terminal.

[0004] However, the current collaborative inference framework has significant problems without the assistance of caching. First, since the same model parameters or information need to be recalculated each time, the communication overhead and computational burden between the terminal and the base station increase significantly. Especially in multi-round inference, the terminal needs to frequently upload the computation 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, resulting in increased latency in the collaborative inference process and reducing the overall system response speed. SUMMARY

[0005] To solve the above technical problems, the present application provides a resource allocation method and system for large language model collaborative inference in wireless networks, which improves the existing technology by caching the intermediate computation results generated by the base station side inference, 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 purpose, the technical solution adopted by the present application is as follows: first, a resource allocation method for large language model collaborative inference in wireless networks is provided, including the following steps:

[0007] S1 In each collaborative inference round, the base station obtains the local inference results of each terminal The channel gain to the base station, generating a resource allocation scheme, including: terminal side central processor frequency, uplink transmission bandwidth and uplink transmission power allocation scheme, base station side central processor frequency allocation scheme, base station side cache allocation scheme;

[0008] S2 each terminal According to the terminal side central processor frequency, uplink transmission bandwidth and uplink transmission power allocation scheme and the base station side cache allocation scheme, the terminal side large language model is performed Inference, and calculate the terminal side output sequence ;

[0009] S3 After the base station receives the terminal side output sequence and the cache sequence, the base station side large language model is performed according to the base station side central processor frequency allocation scheme Inference, obtain the output token, and send the output token to each terminal.

[0010] Preferably, the terminal side large model of S2 The required time delay for inference is:

[0011] ,

[0012] Wherein, The terminal side central processor frequency, The number of central processor cycles required by the terminal to process each input token;

[0013] The terminal side large model The energy required for inference is:

[0014] ,

[0015] Wherein, The central processor capacitance coefficient of the terminal .

[0016] Preferably, the process of calculating the terminal side output sequence of S2 is:

[0017] Each terminal uses the terminal side large language model and the input sequence to calculate , wherein The hidden dimension of the terminal side output sequence .

[0018] Preferably, S2 further comprises: the terminal transmits the last row of the terminal side output sequence , that is, , to the base station by uplink transmission; wherein Length of the input token sequence held before the start of the cooperative inference round , is the buffer sequence length of terminal k for the base station.

[0019] Each terminal communicates with the base station by using frequency division multiple access;

[0020] The terminal The uplink transmission rate of the terminal

[0021] ,

[0022] wherein, and are the allocated uplink transmission bandwidth and uplink transmission power of the terminal , is the one-sided noise power spectral density, is the channel gain of the terminal to the base station;

[0023] The uplink transmission delay of the terminal is:

[0024] ,

[0025] wherein is the number of bits required for transmitting a row of terminal-side output sequences;

[0026] The required uplink transmission energy of the terminal is:

[0027] ,

[0028] wherein, is the allocated uplink transmission power of the terminal .

[0029] Preferably, the output token calculation process of S3 is:

[0030] The base station calculates:

[0031] ,

[0032] wherein, Length of the input token sequence held before the start of the cooperative inference round , is the buffer sequence length of terminal k for the base station.

[0033] Preferably, the required delay for base station-side large language model inference is:

[0034] ,

[0035] wherein, is a base station side central processor frequency allocation scheme, is the number of central processor cycles required by the base station to process each output token;

[0036] is the number of bits used by the base station to cache the intermediate computation results of each token of the base station side large language model, is the number of bits used by the base station to cache the intermediate computation results of each token of the base station side large language model,

[0037] ,

[0038] wherein, is the number of bits used by the base station to cache the intermediate computation results of each token of the base station side large language model, is the cache sequence length of the base station to terminal k;

[0039] is the number of tokens of the base station side large language model, is the collaborative inference latency,

[0040] .

[0041] wherein, is the terminal side large model, is the latency required for inference, is the transmission latency of the terminal, is the latency required for inference of the base station side large language model. Preferably, S1 further comprises, before generating the resource allocation scheme:

[0042] presetting an uplink transmission power constraint of each terminal:

[0043]

[0044] , wherein

[0045] is the maximum uplink transmission power of each terminal; presetting a central processor frequency constraint of each terminal:

[0046]

[0047] , wherein

[0048] is the maximum central processor frequency of each terminal; presetting an energy consumption constraint of each terminal:

[0049]

[0050] , wherein

[0051] is the maximum energy consumption of each terminal;

[0052] ​​Pre-set terminal side uplink transmission bandwidth constraint:

[0053] ,

[0054] wherein is the maximum transmission bandwidth in the wireless network;

[0055] Pre-set base station side central processor frequency constraint:

[0056] ,

[0057] wherein is the maximum central processor frequency of the base station;

[0058] Pre-set base station side cache constraint:

[0059] ,

[0060] wherein is the maximum cache amount of the base station side;

[0061] Pre-set maximum inference delay constraint:

[0062] ,

[0063] wherein is the maximum inference delay;

[0064] The equation for solving the pre-set average cooperative inference delay minimization problem is:

[0065] ;

[0066] The average cooperative inference delay minimization equation satisfies the above constraints.

[0067] Preferably, the pre-set average cooperative inference delay minimization problem is divided 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 base station side cache, the optimization variable of the second sub-optimization equation is the terminal side central processor frequency and uplink transmission power, and the optimization variable of the third sub-optimization equation is the terminal side uplink transmission bandwidth and the base station side central processor frequency;

[0069] The first sub-optimization equation is:

[0070]

[0071] wherein ;

[0072] The first sub-optimization equation has the following constraint conditions:

[0073]

[0074] wherein , ;

[0075] Further, the base station side cache allocation scheme in the resource allocation scheme is obtained by solving the first sub-optimization equation by using a linear optimization method.

[0076] The second sub-optimization equation is:

[0077]

[0078] The second sub-optimization equation has the following constraint conditions:

[0079] ,

[0080] wherein, is an auxiliary variable of the maximum terminal side large model inference required delay, is an auxiliary variable of the maximum terminal side output sequence transmission required delay;

[0081] Further, the terminal side central processor frequency and the uplink transmission power in the resource allocation scheme are obtained by solving the second sub-optimization equation by using a convex optimization method.

[0082] The third sub-optimization equation is:

[0083] ,

[0084] The third sub-optimization equation has the following constraint conditions:

[0085] ,

[0086] wherein, is an auxiliary variable of the maximum base station side large model inference required delay;

[0087] Further, the terminal side uplink transmission bandwidth and the base station side central processor frequency allocation scheme in the resource allocation scheme are obtained by solving the third sub-optimization equation by using a convex optimization method.

[0088] The application also includes a large language model cooperative inference resource allocation system for a wireless network, characterized by comprising:

[0089] The terminal side resource allocation module is configured to, in each cooperative inference round, acquire the channel gain of each terminal to the base station by the base station, and generate a resource allocation scheme.

[0090] The terminal side large language model inference module is configured to control each terminal to perform large language model inference according to the resource allocation scheme. ​The terminal side large language model is inferred according to a terminal side central processor frequency, an uplink transmission bandwidth and an uplink transmission power allocation scheme and a base station side buffer allocation scheme reasoning, and calculating a terminal side output sequence ;

[0091] The base station side large language model reasoning module is configured to control the base station to receive the terminal side output sequence and the buffer sequence, and to perform base station side large language model reasoning according to a base station side central processor frequency allocation scheme reasoning, obtaining an output token and sending the output token to each terminal.

[0092] The application also includes an electronic device, characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus.

[0093] The memory is used to store a computer program.

[0094] The processor is used to execute the program stored on the memory to realize the method steps of any of the above.

[0095] The above technical solution has the following advantages or beneficial effects:

[0096] The application utilizes the base station's calculation and buffer data to not only accelerate the large language model collaborative reasoning process, but also effectively reduce the collaborative reasoning latency. Compared with the traditional model collaborative reasoning framework, the application reduces the repeated data upload on the terminal side and the repeated calculation on the base station side by introducing the large language model buffer, thereby improving the overall system efficiency.

[0097] Due to the fading of the wireless channel and the noise interference, in the traditional collaborative reasoning framework, the signal transmission between the base station and the terminal device will be greatly affected, thereby causing distortion of the reasoning result. The signal transmission in the wireless channel will experience channel fading, thereby affecting the communication quality between the terminal and the base station. In this case, the traditional resource allocation method mainly relies on the resource allocation without buffer. However, the application lies in optimizing the resource allocation strategy, fully utilizing the calculation and buffer resources on the base station side, reducing repeated communication and calculation, thereby accelerating the large language model collaborative reasoning process and significantly reducing the collaborative reasoning latency.

[0098] The above summary is only for the purpose of the description and is not intended to limit in any way. In addition to the illustrative aspects, embodiments and features described above, further aspects, embodiments and features will be readily apparent to those skilled in the art by reference to the drawings and the following detailed description. BRIEF DESCRIPTION OF DRAWINGS

[0099] In the drawings, like reference numerals refer to like elements throughout the various drawings. The drawings are not necessarily to scale, the emphasis instead being placed upon illustrating certain principles of the application. It should be understood that the drawings are merely depictions of some embodiments of the application and that no limitations of the scope of the application are intended to be implied therefrom.

[0100] Figure 1 A large language model cooperative inference resource allocation model schematic diagram for a wireless network provided by the application;

[0101] Figure 2 A flow chart of a large language model cooperative inference resource allocation method for a wireless network provided by the application;

[0102] Figure 3 A large language model cooperative inference resource allocation system structure diagram for a wireless network provided by the application;

[0103] Figure 4 A structure schematic diagram of an electronic device of a large language model cooperative inference resource allocation method for a wireless network provided by the application. DETAILED DESCRIPTION

[0104] In the following, only some exemplary embodiments are simply described. As those skilled in the art can recognize, the described embodiments can be modified in various different ways without departing from the spirit or scope of the application. Therefore, the drawings and the description are considered to be exemplary in nature rather than limiting.

[0105] As Figure 1 shown, the large language model cooperative inference system includes: a terminal and a base station. Each terminal is equipped with a terminal-side large language model , 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 constitute a large language model ; at the same time, the terminal holds an input token sequence with a length of before the start of the current cooperative inference round, and the base station has a cache sequence length of for the terminal .

[0106] According to an embodiment of the large language model cooperative inference resource allocation method for a wireless network provided by the application, the flow is as shown in Figure 2 , and the specific implementation steps are as follows:

[0107] S1 In each cooperative inference round, the base station obtains the channel gain of each terminal to the base station.

[0108] The terminals The definition of the channel gain from each terminal to the base station is the direct wireless link between each terminal device and the base station.

[0109] The method for the base station to obtain the channel gain from each terminal to the base station includes but is not limited to the following, for which the embodiments of the present application do not make specific limitations:

[0110] The base station control device can obtain the channel gain from each terminal to the base station using a channel estimation method. Wherein, the channel estimation method can be any method that can obtain system global channel state information (Channel State Information, CSI), and the embodiments of the present application do not make specific limitations on the channel estimation method.

[0111] The base station can use a channel estimation method to obtain system global channel state information, that is, the base station can have the channel gain from each terminal to the base station, so that when entering each preset information aggregation interval, the control device can obtain the channel gain from each terminal to the base station in 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 terminal to the base station from each terminal, it can be uploaded by each terminal to the base station when entering each preset information aggregation interval, or it can be obtained by the base station sending a request when entering each preset information aggregation interval. For this, the embodiments of the present application do not make specific limitations.

[0113] After the base station obtains the channel gain from each terminal to the base station, a resource allocation scheme is generated, including: terminal side central processor frequency, uplink transmission bandwidth and uplink transmission power allocation scheme, base station side central processor frequency allocation scheme, and base station side cache allocation scheme.

[0114] Before generating the resource allocation scheme, it further includes:

[0115] The maximum uplink transmission power of each terminal is preset:

[0116] ,

[0117] Wherein is the maximum uplink transmission power of each terminal;

[0118] The maximum central processor frequency of each terminal is preset:

[0119] ,

[0120] Wherein is the maximum central processor frequency of each terminal;

[0121] Pre-set each terminal energy consumption constraint:

[0122] ,

[0123] wherein is the maximum energy consumption of each terminal;

[0124] Pre-set terminal side uplink transmission bandwidth constraint:

[0125] ,

[0126] wherein is the maximum transmission bandwidth in the wireless network;

[0127] Pre-set base station side central processor frequency constraint:

[0128] ,

[0129] wherein is the maximum central processor frequency of the base station;

[0130] Pre-set base station side cache constraint:

[0131] ,

[0132] wherein is the maximum cache amount of the base station side;

[0133] Pre-set maximum inference delay constraint:

[0134] ,

[0135] wherein is the maximum inference delay;

[0136] The equation for solving the pre-set average cooperative inference delay minimization problem is:

[0137] ;

[0138] The average cooperative inference delay minimization equation satisfies the above constraints, that is, it satisfies the following pre-set condition formula:

[0139] .

[0140] The pre-set average cooperative inference delay minimization problem is divided into a first sub-optimization equation, a second sub-optimization equation, and a third sub-optimization equation;

[0141] The optimization variable of the first sub-optimization equation is the base station side cache, the optimization variable of the second sub-optimization equation is the terminal side central processor frequency and uplink transmission power, and the optimization variable of the third sub-optimization equation is the terminal side uplink transmission bandwidth and base station side central processor frequency.

[0142] The first sub-optimization equation is:

[0143] ,

[0144] Wherein ;

[0145] The first sub-optimization equation has the following constraint conditions:

[0146] ,

[0147] Wherein, , ;

[0148] Further, the first sub-optimization equation is solved by using a linear optimization method to obtain a 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 constraint conditions:

[0152] ,

[0153] Wherein, is an auxiliary variable of the maximum terminal side large model inference required delay, is an auxiliary variable of the maximum terminal side output sequence transmission required delay;

[0154] Further, the second sub-optimization equation is solved by using a convex optimization method to obtain a terminal side central processor frequency and uplink transmission power in the resource allocation scheme.

[0155] The third sub-optimization equation is:

[0156] ,

[0157] The third sub-optimization equation has the following constraint conditions:

[0158] ,

[0159] Wherein, is an auxiliary variable of the maximum base station side large model inference required delay;

[0160] Furthermore, the convex optimization method is used to solve the third sub-optimization equation to obtain the terminal side uplink transmission bandwidth and base station side central processing unit frequency allocation scheme in the resource allocation scheme.

[0161] S2 terminals The terminal side large language model is constructed based on the terminal side CPU frequency, uplink transmission bandwidth and uplink transmission power allocation scheme and base station side cache allocation scheme. Reasoning and calculating the terminal side output sequence ,terminal Output sequence on the terminal side After OK, that is , uplink transmission to the base station;

[0162] in, The input word sequence held before the collaborative reasoning round begins length, is the cache sequence length of the base station for terminal k.

[0163] The terminal side large model The delay required for inference is:

[0164] ,

[0165] in, For terminal CPU frequency, The number of CPU cycles required to process each input word;

[0166] Terminal side large model The energy required for inference is:

[0167] ,

[0168] in, For terminal The CPU capacitance coefficient.

[0169] The output sequence process of the computing terminal side is:

[0170] Each terminal Leveraging a large language model on the terminal side and the input word sequence Calculate and get ,in Output sequence for the terminal side Hide dimensions.

[0171] Each terminal communicates with the base station by using frequency division multiple access;

[0172] terminal The uplink transmission rate is:

[0173] ,

[0174] in, and Terminal Allocation of uplink transmission bandwidth and uplink transmission power, is the one-sided noise power spectral density, For terminal Channel gain to the base station;

[0175] For the terminal side output sequence , only after The line needs to be uploaded to the base station for collaborative reasoning, and the terminal The uplink transmission delay is:

[0176] ,

[0177] in The number of bits required to transmit a row of terminal-side output sequences;

[0178] terminal The required uplink transmission energy is:

[0179] ,

[0180] in, For terminal Allocated uplink transmission power.

[0181] After the S3 base station receives the terminal side output sequence and the cache sequence, it performs a large language model on the base station side according to the frequency allocation plan of the central processor on the base station side. Inference, obtain output word units, and send the output word units to each terminal.

[0182] The output word unit calculation process is:

[0183] The base station uses the terminal side output sequence and the cache sequence to calculate:

[0184] ,

[0185] in, The input word sequence held before the collaborative reasoning round begins length, is the cache sequence length of the base station for terminal k.

[0186] The base station side large language model The delay required for inference is:

[0187] ,

[0188] wherein, is a base station side central processor frequency allocation scheme, the number of central processor cycles required by the base station to process each output token;

[0189] In addition, the size of one output token is extremely small, and the time delay of sending the output token to each terminal can be ignored.

[0190] The base station is used to buffer the terminal The number of bits of the intermediate calculation result of the cooperative inference is:

[0191] ,

[0192] wherein, is the number of bits of the intermediate calculation result of the base station used to buffer each token of the base station side large language model, is the buffer sequence length of the base station to the terminal k;

[0193] The terminal The cooperative inference delay is:

[0194] ,

[0195] wherein, The terminal side large model The delay required for inference, is the transmission delay of the terminal , is the delay required for inference of the base station side large language model .

[0196] The present application also proposes a large language model cooperative inference resource allocation system for a wireless network, as shown in Figure 3 , comprising:

[0197] The terminal side resource allocation module is used to obtain the channel gain of each terminal to the base station in each cooperative 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 terminal side large language model inference according to the terminal side central processor frequency, the uplink transmission bandwidth and the uplink transmission power allocation scheme and the base station side buffer allocation scheme, and calculate the terminal side output sequence ;

[0199] The base station side large language model inference module is configured to control the base station to receive the terminal side output sequence and the cache sequence, and perform base station side large language model inference according to a base station side central processing unit frequency allocation scheme Inference is performed, output tokens are obtained, and the output tokens are sent to each terminal.

[0200] The application also provides an electronic device, such as Figure 4 As shown in the figure, the electronic device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory can communicate with each other through the communication bus.

[0201] The memory is configured to store a computer program.

[0202] The processor is configured to execute the program stored in the memory.

[0203] The above technical solution has the following advantages or beneficial effects: The application utilizes the base station's calculation and cache data to not only accelerate the large language model collaborative inference process, but also effectively reduce the collaborative inference latency. Compared with the traditional model collaborative inference framework, the application introduces a large language model cache to reduce the repeated data upload on the terminal side and the repeated calculation on the base station side, thereby improving the overall system efficiency.

[0204] Due to the fading of the wireless channel and the noise interference, in the traditional collaborative inference framework, the signal transmission between the base station and the terminal device will be greatly affected, thereby causing the distortion of the inference result. The signal transmission in the wireless channel will experience channel fading, thereby affecting the communication quality between the terminal and the base station. In this case, the traditional resource allocation method mainly relies on the resource allocation without cache. However, the application has the innovation of optimizing the resource allocation strategy, fully utilizing the calculation and cache resources on the base station side, reducing the 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 the present specification, the description of the terms "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 application. Moreover, the specific features, structures, materials or characteristics described can be combined in any suitable manner in any one or more embodiments or examples. In addition, the skilled person in the art can combine and combine the different embodiments or examples described in the specification and the features of the different embodiments or examples without contradiction.

[0206] Any processes or methods described in the flowcharts or otherwise described herein can be understood as representing modules, segments, or portions of code that include one or more executable instructions for implementing specific logic functions (or steps) and / or portions of a preferred embodiment of the application, and alternate implementations are possible. The various steps or functions described in the flowcharts or otherwise described herein can be implemented as program instructions (i.e., as one or more programs or computer program products) in any of a variety of system architectures including but not limited to general purpose computers, system on a chip architectures, special purpose computer or controller-based architecture, networked

[0207] The logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be embodied 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, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. As used in this description, a "computer-readable medium" can be any tangible means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. The computer-readable medium can be a computer- readable storage medium or a computer-readable signal medium. The computer-readable storage medium can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium include the following: an electrical connection having one or more wires (electrical connections), a portable computer diskette (magnetic), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber (optical), and a portable compact disc read-only memory (CDROM). Note that the computer-readable medium can even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, for example, via optical scanning of the paper or other medium, then compiled, interpreted, or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.

[0208] While it is possible for portions of the application to be implemented in software, in other embodiments, the steps or functions can be implemented in software, firmware, or hardware, or a combination thereof. In the embodiments described above, the steps or functions can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, the hardware can include any or a combination of the following technologies, which are all well known in the art: a discrete logic circuit(s) having logic gates for implementing logic functions upon an application of data signals; an application specific integrated circuit(s) having appropriate combinational logic gates; a programmable gate array(s) (PGA), a field programmable gate array(s) (FPGA), etc.

[0209] Those skilled in the art can understand that all or part of the steps of the foregoing method embodiments can be completed by a program instructing relevant hardware, and the program can be stored in a computer readable storage medium. When the program is executed, one or a combination of the steps of the method embodiments is included. The device embodiments correspond to the method embodiments, and thus the device embodiments are described briefly. For related description, refer to the description of the method embodiments.

[0210] In addition, each functional unit in each embodiment of the present application can be integrated in one processing module, or each unit can exist physically independently, or two or more units can be integrated in one module. The integrated module can be realized in the form of hardware or in the form of a software functional module. When the integrated module is realized 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 magnetic disk or an optical disk, etc.

[0211] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited to this. Any person skilled in the art can easily think of various changes or replacements within the technical range disclosed by the present application, and these should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A method for allocating resources for collaborative reasoning of large language models in wireless networks, characterized by: The steps include: In each collaborative reasoning round, the base station obtains the channel gain from each terminal k to the base station and generates a resource allocation plan, including the terminal-side central processing unit frequency, uplink transmission bandwidth, and uplink transmission power allocation plan, the base station-side central processing unit frequency allocation plan, and the base station-side cache allocation plan. Before generating a resource allocation plan, the following steps are also required: Preset uplink transmission power constraints for each terminal: in The maximum uplink transmission power of each terminal; Preset CPU frequency constraints for each terminal: in is the maximum CPU frequency of each terminal; Preset energy consumption constraints for each terminal: in is the maximum energy consumption of each terminal; Preset terminal-side uplink transmission bandwidth constraints: Wherein W is the maximum transmission bandwidth in the wireless network; Preset base station side CPU frequency constraints: in is the maximum CPU frequency of the base station; Preset base station side cache constraints: Where H is the number of bits used by the base station to cache the intermediate calculation results of each word in the large language model on the base station side, The maximum cache size on the base station side; Preset maximum inference latency constraint: Where T is the maximum inference delay; The equation for solving the preset average collaborative reasoning delay minimization problem is: The average collaborative reasoning delay minimization equation satisfies the above constraints; S2 Each terminal k performs a large language model M 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 buffer allocation scheme on the base station side. V Reasoning and calculating the terminal side output sequence y k ; Terminal k outputs the terminal side sequence y k The rear L k -S k Row, that is, y k [L k -S k +1:L k ], uplink transmission to the base station; where L k is the input word sequence x held by terminal k before the start of the collaborative reasoning round k Length, S k 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; The uplink transmission rate of terminal k is: Among them, W k and p k are the allocated uplink transmission bandwidth and uplink transmission power of terminal k, N0 is the one-sided noise power spectrum density, h k is the channel gain from terminal k to the base station; The uplink transmission delay of terminal k is: Where D is the number of bits required to transmit a row of terminal-side output sequence; The uplink transmission energy required by terminal k is: Among them, p k Allocate uplink transmission power for terminal k; The output sequence process of the computing terminal side is: Each terminal k uses the terminal-side large language model M V And the input word sequence x k Calculate and get Where Q is the terminal side output sequence y k Hidden dimensions; After receiving the terminal side output sequence and the cache sequence, the S3 base station performs the large language model M on the base station side according to the frequency allocation plan of the central processor on the base station side. S Reasoning, obtaining output tokens, and sending the output tokens to each terminal; The output word unit calculation process is: The base station uses the terminal side output sequence and the cache sequence to calculate: Token k =argmax{M S (y k [L k -S k +1:L k ])[L k -S k ]}, Among them, L k is the input word sequence x held by terminal k before the start of the collaborative reasoning round k Length, S k is the cache sequence length of the base station for terminal k.

2. The method for allocating resources for collaborative reasoning of large language models in wireless networks according to claim 1, wherein: S2 terminal side large model M V The latency required for inference is: in, is the CPU frequency on the terminal side, κ k The number of CPU cycles required to process each input word, L k is the input word sequence x held by terminal k before the start of the collaborative reasoning round k length; Terminal side large model M V The energy required for inference is: Among them, ∈ k is the capacitance coefficient of the CPU at terminal k.

3. The method for allocating resources for collaborative reasoning of large language models in wireless networks according to claim 1, wherein: The latency required for large language model inference on the base station side is: in, is the frequency allocation scheme of the central processor at the base station side, κ RSU The number of CPU cycles required by the base station to process each output word; The number of bits used by the base station to cache the intermediate calculation results of the cooperative reasoning of terminal k is: C k =HS k , Where H is the number of bits used by the base station to cache the intermediate calculation results of each word in the large language model on the base station side, S k is the cache sequence length of the base station for terminal k; The collaborative reasoning delay of terminal k is: in, For the terminal side large model M V The latency required for inference, is the transmission delay of terminal k, is the large language model M at the base station side S The latency required for inference.

4. The method for allocating resources for collaborative reasoning of large language models in wireless networks according to claim 1, wherein: The preset average collaborative reasoning delay minimization problem is divided into a first sub-optimization equation, a second sub-optimization equation and a third sub-optimization equation; The optimization variables of the first sub-optimization equation are: base station side cache, the optimization variables of the second sub-optimization equation are: terminal side central processing unit frequency and uplink transmission power, and the optimization variables of the third sub-optimization equation are: terminal side uplink transmission bandwidth and base station side central processing unit frequency. The first sub-optimization equation is: in The first sub-optimization equation has the following constraints: in Furthermore, a linear optimization method is used to solve the first sub-optimization equation to obtain a base station side cache allocation scheme in the resource allocation scheme; The second sub-optimization equation is: The second sub-optimization equation has the following constraints: in, It is the auxiliary variable for the time delay required for large model inference on the maximum terminal side. The auxiliary variable for the maximum delay required for the terminal-side output sequence transmission; Furthermore, the convex optimization method is used to solve the second sub-optimization equation to obtain the terminal-side central processing unit frequency and uplink transmission power in the resource allocation solution; The third sub-optimization equation is: The third sub-optimization equation has the following constraints: in, It is the auxiliary variable for the time delay required for the large model inference at the largest base station side; Furthermore, the convex optimization method is used to solve the third sub-optimization equation to obtain the terminal side uplink transmission bandwidth and base station side central processing unit frequency allocation scheme in the resource allocation scheme.

5. An electronic device, characterized in that: include: A processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus; Memory for storing computer programs; A processor, configured to implement the method steps described in any one of claims 1 to 3 when executing a program stored in a 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