Systems and methods for running a transformer model in a communication system

By splitting transformer models into components and optimizing resource utilization through caching and filtering, the method addresses computational and privacy challenges in network distribution, achieving efficient and secure execution across multiple network entities.

WO2026051229A1PCT designated stage Publication Date: 2026-03-12HUAWEI TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2026-03-12

AI Technical Summary

Technical Problem

Existing methods for distributing transformer models in communication networks face challenges in reducing computational loads while ensuring data privacy and efficient resource utilization.

Method used

A method for splitting a transformer model into components executed across multiple network entities, utilizing caching and filtering mechanisms to optimize computational and communication resources, and coordinating activation states based on resource availability.

Benefits of technology

This approach reduces computational loads, balances resource utilization, and ensures data privacy by distributing transformer models across network entities, minimizing communication costs and protecting data integrity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024136579_12032026_PF_FP_ABST
    Figure CN2024136579_12032026_PF_FP_ABST
Patent Text Reader

Abstract

Methods and systems for distributing a transformer model across multiple devices connected by a communications network are provided. In embodiments, the transformer model is split into multiple components. In some embodiments, the transformer model is split between its constituent blocks, whereas in others, the model is split between sub-blocks of the blocks themselves. In some embodiments, caching and / or filtering of results from one component is done before and / or after transmitting those results between devices. In some embodiments, coordination of the caching and / or filtering enables communication and computation costs to be minimized while respecting availability of resources for caching at the devices. In some embodiments, the splitting of the transformer model enables data to remain private as it is exchanged between devices.
Need to check novelty before this filing date? Find Prior Art

Description

SYSTEMS AND METHODS FOR RUNNING A TRANSFORMER MODEL IN A COMMUNICATION SYSTEM

[0001] CROSS REFERENCE TO RELATED APPLICATIONS

[0002] This application claims the benefit of and priority to U.S. Patent Application No. 63 / 691, 604 filed on September 6, 2024, the contents of which is hereby incorporated by reference.TECHNICAL FIELD

[0003] The present disclosure generally relates to communication networks, and more particularly methods, apparatus, and systems for distributing transformer models in communication networks.BACKGROUND

[0004] Network-for-AI (NET4AI) functionality is expected to be an important concept in future communication networks (e.g., sixth generation or 6G networks) , which may emphasize support for artificial intelligence (AI) technologies. This architecture is expected to enable future networks, as a whole, to provide distributed and collaborative AI learning and inference services, adaptability to an expected widespread application of AI, data privacy, and real-time AI.

[0005] In the field of AI, a transformer model is a neural network that can take sequential data (e.g., text) as input and, by leveraging attention or self-attention mechanisms, can comprehend context and meaning contained in the input data. Transformer models can generate output data based on the input data, wherein the output data can comprise text and / or pictures, for example. Transformer models can be used in a wide range of application domains such as natural language processing or healthcare.

[0006] Performing inference or generative operations with transformer models is typically expected to require a lot of computational resources and may strain devices. Remote servers may be used to perform the computations, however, these themselves can be strained by the computation loads. Furthermore, sending input and output data between a device and a server may make the data vulnerable to privacy breaches. Although the NET4AI architecture is expected to enable distributive AI functions, which would enable the computational load to be shared, methods and systems are not available for distributing transformer models to reduce computational loads while protecting user privacy.

[0007] Therefore, there is a need for methods, apparatus, and systems for distributing transformer models that obviates or mitigates one or more limitations of the prior art.

[0008] This background information is provided to reveal information believed by the applicant to be of possible relevance to the present invention. No admission is necessarily intended, nor should be construed, that any of the preceding information constitutes prior art against the present invention.SUMMARY

[0009] An object of embodiments of the present disclosure is to provide methods, apparatus, and systems for distributing transformer models.

[0010] A first aspect of the present disclosure is to provide a method for supporting execution of a transformer model split into a first component at a first network entity (NE) and a second component at a second NE connected to the first NE through a communications network. The method may comprise, at the first NE, for a generating round of prediction generating, by one or more prediction operations of the first component of the transformer model, a result depending from data input to the transformer model, the result defining either a hidden state matrix or a hidden state vector. The method may further comprise executing a first set of actions when the result defines the hidden state vector and when a cache of the first component is active, or a second set of actions when the result defines the hidden state matrix and when a filter of the first component is active. The first set of actions may include: constructing the hidden state matrix from the hidden state vector and one or more previous hidden state vectors each stored at the cache and corresponding to a respective previous generating round of prediction, and updating the result to define the hidden state matrix. The second set of actions may include: obtaining, by the filter, the hidden state vector from the result, and updating the result to define the hidden state vector. The method may further comprise sending, through the communications network, the result to the second component of the transformer model at the second NE.

[0011] In some embodiments of the first aspect, the method may further comprise, at the first NE, obtaining a configuration defining a respective target activation state for each of the cache of the first component and the filter of the first component. In some of these embodiments, the method may further comprise, at the first NE, performing, in accordance with the respective target activation state for the cache of the first component, one of: activating the cache of the first component to cause the cache to become active; and deactivating the cache of the first component to cause the cache to become inactive. In some embodiments, the method may further comprise, performing, in accordance with the respective target activation state for the filter of the first component, one of: activating the filter of the first component to cause the filter to become active; and deactivating the filter of the first component to cause the filter to become inactive. In some embodiments, obtaining the configuration may include determining the configuration in accordance with at least one of: a respective state of the first NE indicating at least one of a respective availability of caching resources and a respective computational capacity; a respective state of the second NE indicating at least one of a respective availability of caching resources and a respective computational capacity; and a network state indicating a communication capacity of the communications network. For each NE, the respective availability of caching resources may indicate a respective sufficiency for caching the hidden state vector at the respective NE, and the respective computational capacity may indicate a respective sufficiency for processing the hidden state matrix at the respective NE. In some embodiments, the first NE may be connected to a network controller through the communications network and obtaining the configuration may include receiving, from the network controller, the configuration. In some embodiments, obtaining the configuration may include negotiating, with the second NE, the configuration.

[0012] In some embodiments of the first aspect, the method may further comprise, at the first NE, sending, through the communications network, a message identifying the result as being either the hidden state matrix or the hidden state vector.

[0013] In some embodiments of the first aspect, the first set of actions may further include storing, at the cache of the first component, the hidden state vector.

[0014] A second aspect of the present disclosure is to provide another method for supporting execution of a transformer model split into a first component at a first NE and a second component at a second NE connected to the first NE through a communications network. The method may comprise, at the second NE, for a generating round of prediction, receiving, from the first component of the transformer model at the first NE and through the communications network, a result depending from data input to the transformer model and defining either a hidden state vector or a hidden state matrix. The method may further comprise executing a first set of actions when the result defines the hidden state vector and when a cache of the second component is activated, or a second set of actions when the result defines the hidden state matrix and when a filter of the second component is activated. The first set of actions may include constructing the hidden state matrix from the hidden state vector and one or more previous hidden state vectors each stored at the cache and corresponding to a respective previous generating round of prediction, and updating the result to define the hidden state matrix. The second set of actions may include obtaining, by the filter, the hidden state vector from the result, and updating the result to define the hidden state vector. The method may further include processing, by one or more prediction operations of the second component of the transformer model, the result to produce an updated result.

[0015] In some embodiments of the second aspect, the method may further comprise, at the second NE obtaining a configuration defining a respective target activation state for each of the cache of the second component and the filter of the second component. In some of these embodiments, the method may further comprise, at the second NE, performing, in accordance with the respective target activation state for the cache of the second component, one of: activating the cache of the second component to cause the cache to become active; and deactivating the cache of the second component to cause the cache to become inactive. In some embodiments, the method may further comprise, at the second NE, performing, in accordance with the respective target activation state for the filter of the second component, one of: activating the filter of the second component to cause the filter to become active; and deactivating the filter of the second component to cause the filter to become inactive. In some embodiments, obtaining the configuration may include determining the configuration in accordance with at least one of: a respective state of the first NE indicating at least one of a respective availability of caching resources and a respective computational capacity; a respective state of the second NE indicating at least one of a respective availability of caching resources and a respective computational capacity; and a network state indicating a communication capacity of the communications network. For each NE, the respective availability of caching resources indicating a respective sufficiency for caching the hidden state vector at the respective NE, the respective computational capacity indicating a respective sufficiency for processing the hidden state matrix at the respective NE. In some embodiments, the second NE may be connected to a network controller through the communications network and obtaining the configuration may include receiving, from the network controller, the configuration. In some embodiments, method may further comprise, at the second NE, receiving, through the communications network, a message identifying the result as being either the hidden state matrix or the hidden state vector. In these embodiments, obtaining the configuration may include determining, in accordance with the message, the configuration. In some embodiments, obtaining the configuration may include negotiating, with the first NE, the configuration.

[0016] In some embodiments of the second aspect, the first set of actions may further include storing, at the cache of the second component, the hidden state vector.

[0017] In some embodiments of the second aspect, executing the second set of actions when the result defines the hidden state matrix and when the filter of the second component is activated may include executing the second set of actions when the result defines the hidden state matrix, when the filter of the second component is activated, and when a further cache of the second component is activated. In these embodiments, the second set of actions may further include: processing, by a further prediction operation of the second component of the transformer model, the result to produce an intermediate result, constructing an intermediate hidden state matrix from the intermediate result and one or more previous intermediate hidden state vectors each stored at the further cache and corresponding to a respective previous generating round of prediction, and updating the result to define the intermediate hidden state matrix. In some of these embodiments, processing, by the further prediction operation of the second component of the transformer model, the result to produce the intermediate result may include executing, when the result defines the hidden state vector, a third set of actions. The third set of actions may include: calculating, in accordance with the hidden state vector, a key vector, a value vector, and a query vector through at least one prediction operation of the one or more prediction operations; storing, at a further cache of the of the second component of the transformer model, the key vector, the value vector, and the query vector; and constructing a key matrix from the key vector and one or more previous key vectors each stored at the further cache and corresponding to a respective previous generating round of prediction, a value matrix from the value vector and one or more previous value vectors each stored at the further cache and corresponding to a respective previous generating round of prediction, and a query matrix from the query vector and one or more previous query vectors each stored at the further cache and corresponding to a respective previous generating round of prediction. In some embodiments, the method may further comprise, at the second NE, obtaining a configuration defining a respective target activation state for the further cache of the second component. In some of these embodiments, the method may further comprise, at the second NE, performing, in accordance with the respective target activation state for the further cache of the second component, one of: activating the further cache of the second component to cause the further cache to become active; and deactivating the further cache of the second component to cause the further cache to become inactive.

[0018] In some embodiments of the second aspect, processing, by the one or more prediction operations of the second component of the transformer model, the result to produce the updated result may include calculating, when the result defines the hidden state matrix, a key matrix, a value matrix, and a query matrix in accordance with the updated hidden state matrix and through at least one prediction operation of the one or more prediction operations.

[0019] In some embodiments of the second aspect, processing, by the one or more prediction operations of the second component of the transformer model, the result to produce the updated result may include executing, when the result defines the hidden state vector, a third set of actions. The third set of actions may include: calculating, in accordance with the hidden state vector, a key vector, a value vector, and a query vector through at least one prediction operation of the one or more prediction operations; storing, at a further cache of the of the second component of the transformer model, the key vector, the value vector, and the query vector; and constructing a key matrix from the key vector and one or more previous key vectors each stored at the further cache and corresponding to a respective previous generating round of prediction, a value matrix from the value vector and one or more previous value vectors each stored at the further cache and corresponding to a respective previous generating round of prediction, and a query matrix from the query vector and one or more previous query vectors each stored at the further cache and corresponding to a respective previous generating round of prediction.

[0020] A third aspect of the present disclosure is to provide another method for supporting execution of a transformer model split into respective components at a first NE and a second NE each connected to a network controller through a communications network. The method may comprise, at the network controller: obtaining a status indication for the second NE indicating an availability of caching resources at the second NE, wherein the availability of caching resources at the second NE may indicate a sufficiency of the caching resources at the second NE for caching one or more hidden state vectors; generating, in accordance with the status indication for the second NE, a configuration for the respective component of the transformer model at the first NE, the configuration defining a respective target activation state for each of at least one of a cache and a filter of the respective component at the first NE; and sending, to the first NE, the configuration.

[0021] In some embodiments of the third aspect, the status indication for the second NE may further indicate a computational capacity at the second NE. The computational capacity at the second NE may indicate a sufficiency for processing a hidden state matrix at the second NE. In some embodiments, obtaining the status indication for the second NE may include receiving, from a network function, the status indication for the second NE.

[0022] In some embodiments of the third aspect, the method may further comprise, at the network controller, obtaining a status indication for the first NE indicating an availability of caching resources at the first NE and a computational capacity at the first NE.The availability of caching resources at the first NE may indicate a sufficiency of the caching resources at the first NE for caching the one or more hidden state vectors, and the computational capacity at the first NE may indicate a sufficiency for processing the hidden state matrix at the first NE. In these embodiments, generating, in accordance with the status indication for the second NE, the configuration for the respective component of the transformer model at the first NE may include generating, in accordance with each of the status indications for the first NE and the second NE, the configuration for the respective component of the transformer model at the first NE. In some of these embodiments, obtaining the status indication for the first NE may include receiving, from a network function, the status indication for the first NE.

[0023] In some embodiments of the third aspect, the method may further comprise, at the network controller, obtaining a status indication for the communications network indicating a communication capacity. The communication capacity may indicate a sufficiency of the communications network for transmitting the hidden state matrix from the first NE to the second NE. In these embodiments, generating, in accordance with the status indication for the second NE, the configuration for the respective component of the transformer model at the first NE may include generating, in accordance with each of the status indications for the first NE and the second NE, the configuration for the respective component of the transformer model at the first NE. In some of these embodiments, obtaining the status indication for the communications network may include receiving, from a network function, the status indication for the communications network.

[0024] In some embodiments of the third aspect, generating, in accordance with the status indication for the second NE, the configuration for the respective component of the transformer model at the first NE may include generating the configuration for the respective component of the transformer model at the first NE to define an expected output in agreement with an expected input defined by a further configuration for the respective component of the transformer model at the second NE. In some other embodiments, generating, in accordance with the status indication for the second NE, the configuration for the respective component of the transformer model at the first NE may include generating the configuration for the respective component of the transformer model at the first NE to define an expected input in agreement with an expected output defined by a further configuration for the respective component of the transformer model at the second NE

[0025] A fourth aspect of the present disclosure is to provide a network system comprising a first NE and a second NE connected to the first NE. The first NE may have a first component of a transformer model, which may be configured to generate, by one or more prediction operations for a generating round of prediction, a result depending from data input to the transformer model. The result may define either a hidden state vector or a hidden state matrix. The first component may include at least one of a first filter and a first cache, which may each be either active or inactive. The first filter may be configured to obtain from the hidden state matrix the hidden state vector when the first filter is active and when the result defines the hidden state matrix. The first cache may be configured to store the hidden state vector when the first cache is active and when the result defines the hidden state vector. The second NE may have a second component of the transformer model, which may be configured to receive the result from the first component of the transformer model at the first NE. The second component may include at least one of a second filter and a second cache, which may each be either active or inactive. The second filter may be configured to obtain from the hidden state matrix the hidden state vector when the second filter is active and when the result defines the hidden state matrix. The second cache may be configured to store the hidden state vector when the second cache is active and when the result defines the hidden state vector. The second component may be further configured to process, by one or more further prediction operations for the generating round of prediction, the result to produce an updated result.

[0026] In some embodiments of the fourth aspect, the first component of the transformer model may be further configured to: when the first filter is active, update the result to define the hidden state vector, and when the first cache is active, construct the hidden state matrix from the hidden state vector and one or more previous hidden state vectors each stored at the first cache and update the result to define the hidden state matrix. In these embodiments, the second component of the transformer model may be further configured to: when the second filter is active, update the result to define the hidden state vector, and when the second cache is active, construct the hidden state matrix from the hidden state vector and one or more previous hidden state vectors each stored at the second cache and update the result to define the hidden state matrix.

[0027] In some embodiments of the fourth aspect, the transformer model may include a plurality of blocks. In these embodiments, the first component of the transformer model may include a first set of blocks of the plurality of blocks, and the second component of the transformer model may include a second set of blocks of the plurality of blocks, wherein the second set of blocks is different from the first set of blocks. In some embodiments, the first set of blocks may include one or more decoder blocks, and the second set of blocks may include one or more further decoder blocks. In some embodiments, at least one block of the plurality of blocks may include a plurality of sub-blocks. In these embodiments, the first component of the transformer model may include at least one sub-block of the plurality of sub-blocks of the at least one block, and the second component of the transformer model may include a different at least one sub-block of the plurality of sub-blocks of the at least one block. In some embodiments, the at least one block may include a decoder block having a self-attention sub-block and a cross-attention sub-block. In these embodiments, the at least one sub-block may include the self-attention sub-block, and the different at least one sub-block includes the cross-attention sub-block. In some other embodiments, the at least one block may include a decoder block having a cross-attention sub-block and a feed-forward sub-block. In these embodiments, the at least one sub-block may include the cross-attention sub-block, and the different at least one sub-block includes the feed-forward sub-block. In some other embodiments, the at least one block may include a decoder block having a self-attention sub-block and a feed-forward sub-block. In these embodiments, the at least one sub-block may include the self-attention sub-block, and the different at least one sub-block may include the feed-forward sub-block.

[0028] In some embodiments of the fourth aspect, the first NE may further have a third component of the transformer model, which may be configured to receive the updated result from the second component of the transformer model at the second NE. The third component may include at least one of a third filter and a third cache, which may each be either active or inactive. The third filter may be configured to obtain, from the hidden state matrix, the hidden state vector when the third filter is active and when the result defines the hidden state matrix. The third cache may be configured to store the hidden state vector when the third cache is active and when the result defines the hidden state vector. The third component may be further configured to process, by one or more further prediction operations for the generating round of prediction, the updated result to produce a further updated result. In some embodiments, the third component of the transformer model may be further configured to, when the third cache is active, construct the hidden state matrix from the hidden state vector and one or more previous hidden state vectors each stored at the third cache and update the result to define the hidden state matrix.

[0029] In some embodiments of the fourth aspect, the first NE may be a user equipment, and the second NE may be a server.

[0030] In some embodiments of the fourth aspect, the network system may further comprise a network controller configured to generate a configuration defining a respective target activation state for each of the at least one of the first cache and the first filter. In these embodiments, the first component of the transformer model at the first NE may be further configured to: receive, from the network controller, the configuration; and activate, in accordance with the configuration, at least one of the first cache and the first filter. In some embodiments, the configuration may further define a respective target activation state for each the at least one of the second filter and the second cache. In these embodiments, the second component of the transformer model at the second NE may be further configured to: receive, from the network controller, the configuration; and activate, in accordance with the configuration, at least one of the second filter and the second cache. In some embodiments, the network controller may be configured to generate a configuration defining a respective target activation state for each of the at least one of the third cache and the third filter of a third component of the transformer model at the first NE. In these embodiments, the third component of the transformer model at the first NE may be configured to: receive, from the network controller, the configuration; and activate, in accordance with the configuration, at least one of the third filter and the third cache. In some embodiments, the network system may further comprise one or more network functions each configured to generate one or more respective status indications each indicating one of: a first availability of caching resources at the first NE, a first computational capacity at the first NE, a second availability of caching resources at the second NE, a second computation capacity at the second NE, and a communication capacity between the first NE and the second NE. In these embodiments, the network controller may be configured to receive each status indication from each network function and generate the configuration in accordance with at least one status indication.

[0031] Embodiments of the present disclosure may facilitate distribution of transformer models to multiple network entities. This may enable computational loads to be reduced at any particular network entity. Embodiments may effectively balance computational benefits with burdens placed on network communication and memory availability. Embodiments may further enable privacy of data and prediction results to be protected while still enabling distribution of a transformer model.

[0032] Embodiments have been described above in conjunction with aspects of the present invention upon which they can be implemented. Those skilled in the art will appreciate that embodiments may be implemented in conjunction with the aspect with which they are described but may also be implemented with other embodiments of that aspect. When embodiments are mutually exclusive, or are incompatible with each other, it will be apparent to those skilled in the art. Some embodiments may be described in relation to one aspect, but may also be applicable to other aspects, as will be apparent to those of skill in the art.BRIEF DESCRIPTION OF THE DRAWINGS

[0033] FIG. 1A shows a schematic of an encoder-decoder transformer.

[0034] FIG. 1B shows a schematic of a decoder-only transformer.

[0035] FIG. 2 shows a schematic of an encoder block of a transformer.

[0036] FIG. 3A shows a schematic of a decoder block of an encoder-decoder transformer.

[0037] FIG. 3B shows a schematic of a decoder block of a decoder-only transformer.

[0038] FIG. 4 shows a schematic of an apparatus that may be used to implement, at least in part, embodiments of the present disclosure.

[0039] FIG. 5A shows a schematic of caching and filtering in a decoder block of an encoder-decoder transformer, in accordance with an embodiment of the present disclosure.

[0040] FIG. 5B shows a schematic of caching and filtering in a decoder block of a decoder-only transformer, in accordance with an embodiment of the present disclosure.DETAILED DESCRIPTION

[0041] To reduce processing times and computational loads at individual devices when executing transformer models, embodiments of the present disclosure are generally directed towards enabling distribution of the models across multiple devices connected by a network. In embodiments, a transformer model may be split into a plurality of components, which may be processed at respective network devices. In some embodiments, the transformer model may be split between blocks of the model, such as between decoder blocks, or may be split between sub-blocks of individual blocks, such as between sub-blocks of a decoder block. In some embodiments, caching and / or filtering of intermediate results produced during the generation of prediction sequences from input data may be done prior to and after transmitting the intermediate results between network devices. In some embodiments, caching and / or filtering may be coordinated to minimize computational and communication costs while respecting availability of resources for caching the intermediate results at the network devices. In some embodiments, splitting of the transformer model may ensure data privacy such that only intermediate results are communicated between network devices.

[0042] The present disclosure sets forth various embodiments via the use of block diagrams, flowcharts, and examples. Insofar as such block diagrams, flowcharts, and examples contain one or more functions and / or operations, it will be understood by a person skilled in the art that each function and / or operation within such block diagrams, flowcharts, and examples can be implemented, individually or collectively, by a wide range of hardware, software, firmware, or combination thereof. As used herein, the term “about” should be read as including variation from the nominal value, for example, a + / -10%variation from the nominal value. It is to be understood that such a variation is always included in a given value provided herein, whether or not it is specifically referred to.

[0043] FIGs. 1A and 1B show schematics of transformer models respectively including an encoder stack and a decoder stack, and a decoder stack only. Embodiments of the present disclosure may be implemented towards the transformer models shown. A transformer model may comprise multiple blocks. As shown in FIG. 1A, the transformer model may comprise an encoder stack 101, which may include one or multiple encoder blocks 102 (encoders 1, …, s; s ≥ 1) . As shown in FIGs. 1A and 1B, the transformer model may further comprise a decoder stack 103, which may include one or multiple decoder blocks 104 (decoders 1, …, t, t ≥ 1) . In some embodiments, the transformer model (or simply, transformer) may include both an encoder stack 101 and a decoder stack 103, as shown in FIG. 1A, and may be referred to as an encoder-decoder transformer. In some embodiments, the transformer may not include an encoder stack 101, as shown in FIG. 1B, and may be referred to as decoder-only transformer.

[0044] As shown in FIGs. 1A and 1B, the transformer model may include: one or two positional embedding blocks (i.e., positional embedding blocks 105 and 106) , which may correspond to the initial input and prediction output of the transformer model, respectively; one or more encoder blocks 102 (i.e., the block (s) in the encoder stack 101) , one or more decoder blocks 104 (i.e., the block (s) in the decoder stack 103) , and a final layers block 107 corresponding to the final layers of the transformer model. The final layers may include a linear layer and a SoftMax layer. The linear layer may provide un-embedding functionality. In some embodiments, the positional embedding blocks 105 and 106 may be integrated as a single block.

[0045] FIG. 2 shows a schematic of an encoder block 102, towards which embodiments of the present disclosure may be implemented. Here, an encoder block 102 Bi (where 1 ≤ i ≤ s) in a transformer model, as shown in FIG. 1A, is considered. In FIG. 2, the arrows indicated a flow of data going through the encoder block 102 Bi from input 201 to output 202. For 1 < i ≤ s, the input 201 to the encoder block 102 Bi may comprise the output 202 of the encoder block 102 Bi-1; for i = 1, the input 201 to the encoder block 102 Bi may comprise the output of the positional embedding block 105. For i = s, (i.e., when that encoder block 102 is the last, or top encoder block in the encoder stack 101) , the output 202 of the encoder block 102 may be provided to decoder block (s) 104 D1, …, Dt, in the decoder stack 103 as input.

[0046] FIGs. 3A and 3B respectively show schematics for decoder blocks 104 in an encoder-decoder model and a decoder-only model. A decoder block 104 in an encoder-decoder model and a decoder block 104 in a decoder-only model may have different structures.

[0047] FIG. 3A shows a schematic of the internal structure of a decoder block 104 Di (1 ≤ i ≤ t) in an encoder-decoder transformer model, as shown in FIG. 1A. Input to the decoder block 104 may include two parts: a first input 301 (input 1) and a second input 302 (input 2) . The second input 302 may comprise the output 202 of the encoder block 102 Bs. The encoder block 102 Bs may be the top, or last, encoder block 102 in the encoder stack 101. For 1 < i ≤ t, the first input 301 may comprise output 303 of the decoder block 104 Di-1 in the decoder stack 103. For i = 1, the first input 301 may comprise output of the positional embedding block 106. For i < t, the output 303 of the decoder block 104 Di may be provided to decoder block 104 Di+1 as its respective first input 301. For i = t, (i.e., when the decoder block 104 Di is the last, or top, decoder block 104 in the decoder stack 103) , the output 303 of the decoder block 104 Dt may be provided to the final layers block 107 as its respective input.

[0048] FIG. 3B shows a schematic of the internal structure of a decoder block 104 Di (1 ≤ i ≤ t) in a decoder-only transformer model, as shown in FIG. 1B. For 1 < i ≤ t, input 304 to the decoder block 104 Di may comprise the output 303 of the decoder block 104 Di-1 in the decoder stack 103. For i = 1, the input 304 to the decoder block 104 Di may comprise a concatenation of output of the positional embedding blocks 105 and 106. For i = t, (i.e., when the decoder block 104 Di is the last, or top, decoder block 104 in the decoder stack 103) , the output 303 of the decoder block 104 Dt may be provided to the final layers block 107 as its respective input.

[0049] When executing a transformer model, an input sequence may be provided to the transformer model as initial input 108. The original input (e.g., text) may be encoded with the tokenizer to become a sequence of tokens (or words) , i.e., the input sequence, which may be referred to as the initial input 108. The encoding processed by the tokenizer may include one or more steps, e.g., tokenization, token to integer mapping, and / or padding / truncation. The length of the input sequence (i.e., the number of tokens in the input sequence) may be denoted by m. Based on the input sequence, the transformer model may generate a prediction sequence. The prediction sequence may include a sequence of tokens (or words) , which may be referred to as the final output or output 109 in FIGs. 1A and 1B. The length of the prediction sequence (i.e., the number of tokens in the prediction sequence) may be denoted by n. The prediction sequence may be decoded with a de-tokenizer to produce the final prediction result (e.g., text) .

[0050] The pre-sequence of a token in the prediction sequence refers to the sequence of tokens before that token in the prediction sequence. The pre-sequence of the first token in the prediction sequence may be empty. For 0 < j < n, the pre-sequence of the (j+1) -th token in the prediction sequence may be a concatenation of the pre-sequence of the j-th token and the j-th token itself, to comprise both the pre-sequence of the j-th token and the j-th token itself.

[0051] If the transformer model is an encoder-decoder transformer as illustrated in FIG. 1A, the positional embedding block 105 may receive the input sequence (i.e., the initial input 108) and generate a hidden state matrix based on the input sequence. The positional embedding block 105 may use an embedding matrix to generate the hidden state matrix. The embedding matrix may be pre-determined or pre-configured. The width of the embedding matrix (i.e., the number of columns in the embedding matrix) may be denoted by d. The width of the hidden state matrix may be a function f (. ) of the width of the embedding matrix. In other words, the number of columns in the hidden state matrix may be equal to f (d) . In some embodiments, the width of the hidden state matrix may be equal to the width of the embedding matrix. A row in the hidden state matrix may correspond to a token in the input sequence and may be referred to as a hidden state vector. The hidden state matrix may have m rows, wherein the i-th row corresponds to the i-th token in the input sequence for 1 ≤ i ≤ m. The size of the hidden state matrix may be expressed as m × f (d) .

[0052] The hidden state matrix may be provided from the positional embedding block 105 to the encoder stack 101 for processing. Within the encoder stack 101, the hidden state matrix may be further processed and updated by a sequence of encoder blocks 102 B1, …, Bs, sequentially, one after another. Afterward, the hidden state matrix may be provided to the decoder stack 103, or more precisely, to each of the decoder blocks 104 Di (1 ≤ i ≤ t) . The hidden state matrix may be provided to the decoder stack 103 from the topmost, or last encoder block 102 Bs in the encoder stack 101. Each decoder block 104 Di (1 ≤ i ≤ t) in the decoder stack 103 may calculate (e.g., by an operation O2 305 further shown in FIG. 3A and described hereinbelow) a key matrix Ki and a value matrix Vi based on the hidden state matrix provided from the encoder stack 101.

[0053] If the transformer model is a decoder-only transformer, as shown in FIG. 1B, the positional embedding block 105 may receive the input sequence (i.e., the initial input 108) and generate a hidden state matrix based on the input sequence. The positional embedding block 105 may use an embedding matrix to generate the hidden state matrix. The embedding matrix may be pre-determined or pre-configured. The width of the embedding matrix (i.e., the number of columns in the embedding matrix) may be denoted by d. The width of the hidden state matrix may be a function f (. ) of the width of the embedding matrix. In other words, the number of columns in the hidden state matrix may be equal to f (d) . In some embodiments, the width of the hidden state matrix may be equal to the width of the embedding matrix. A row in the hidden state matrix may correspond to a token in the input sequence and may be referred to as a hidden state vector. The hidden state matrix may have m rows, wherein the i-th row corresponds to the i-th token in the input sequence for 1 ≤ i ≤ m. The size of the hidden state matrix may be expressed as m ×f(d) .

[0054] The prediction sequence may be generated incrementally through the prediction process. The prediction process may comprise n+1 generating rounds of prediction. Operations performed by blocks involved in the prediction process may be referred to as prediction operations.

[0055] If the transformer model is an encoder-decoder transformer, as shown in FIG. 1A, the first generating may round take a special token, referred to as the start token or the 0-th token in the prediction sequence, as input (i.e., as the input sequence) and accordingly may produce or generate an output sequence, which may be the first token in the prediction sequence.

[0056] For 0 < j < n, the (j+1) -th generating round may take a concatenation of the start token and the pre-sequence of the (j+1) -th token (the pre-sequence being the output sequence of the previous generating round and being provided from the final layers block 107 and being shifted right 110 to concatenate it with the start token) as input and accordingly may produce or generate an output sequence, which may comprise the pre-sequence of the (j+1) -th token and the (j+1) -th token and may be a concatenation thereof. Thus, after each of these generating rounds, the prediction sequence may grow by one token.

[0057] The last, (n+1) -th generating round may take a concatenation of the start token and the entire prediction sequence (i.e., the output sequence of the previous generating round, which is provided from the final layers block 107 and is shifted right 110) as input and may accordingly produce or generate an output sequence that comprises the entire prediction sequence and a special token, referred to as the end token or the (n+1) -th token in prediction sequence. When the end token is generated, the prediction process may finish and produce the prediction sequence as final output 109. The (j+1) -th (0 ≤ j ≤ n) generating round of prediction is described in more detail hereinbelow. Operations performed by the final layers block 107 may be referred to as prediction operations.

[0058] The input (referred to as the input sequence) to the (j+1) -th generating round may be provided to the positional embedding block 106. Based on the input sequence, the positional embedding block 106 may generate a hidden state matrix. The positional embedding block 106 may use an embedding matrix to generate the hidden state matrix. The embedding matrix may be pre-determined or pre-configured. The width of the embedding matrix (i.e., the number of columns in the embedding matrix) may be denoted by d. The width of the hidden state matrix may be a function f () of the width of the embedding matrix. In other words, the number of columns in the hidden state matrix may be equal to f (d) . A row in the hidden state matrix may correspond to a token in the input sequence and may be referred to as a hidden state vector. The hidden state matrix may have j+1 rows, wherein the i-th row corresponds to the i-th token in the input sequence for 1 ≤ i ≤ j+1. The size of the hidden state matrix may be expressed as (j+1) × f (d) .

[0059] The hidden state matrix may be provided from the positional embedding block 106 to the decoder stack 103 for processing. Within the decoder stack 103, the hidden state matrix may be further processed and updated by a sequence of decoder blocks 104 D1, …, Dt, sequentially, one after another. When processing and updating the hidden state matrix, a decoder block 104 Di (1 ≤ i ≤ t) may use the key matrix Ki and the value matrix Vi. The matrices Ki and Vi may have been calculated (e.g., by the operation O2 305 in FIG. 3A) based on the hidden state matrix of the initial input 108 provided to the encoders stack 101 B, as described hereinabove.

[0060] Afterward, the hidden state matrix may be provided from the decoder stack 103, or more precisely, from the top or last decoder block 104 Dt to the final layers block 107. Based on the hidden state matrix, the final layers block 107 may generate an output sequence, which may be a concatenation of a sequence (which is identical to the input sequence excluding the start token) and a token. The token may be the (j+1) -th token in the prediction sequence when j < n, and may be the end token when j = n. If the token is not the end token, the final layers block 107 may provide the output sequence to the positional embedding block 106, and the positional embedding block 106 may use it as part of the input sequence in the next generating round of prediction. The next generating round of prediction may be triggered by the positional embedding block 106 receiving the output sequence.

[0061] If the transformer is a decoder-only transformer, as shown in FIG. 1B, in each generating round of prediction, the transformer may take the initial input 108 (i.e., a sequence of m tokens) and a suffix sequence as input (in other words, as the input sequence) and accordingly produce or generate an output sequence. The initial input 108 may be provided to the positional embedding block 105 of the transformer, while the suffix sequence may be provided to the positional embedding block 106 of the transformer. In the first generating round, the suffix sequence may comprise the start token, and the output sequence may comprise the initial input sequence and the first token in the prediction sequence. In the (j+1) -th generating round for 0 < j < n, the suffix sequence may be a concatenation comprising the start token and the pre-sequence of the (j+1) -th token in the prediction sequence, and the output sequence may be a concatenation comprising the initial input 108, the pre-sequence of the (j+1) -th token and the (j+1) -th token in the prediction sequence. The pre-sequence of the (j+1) -th token may have been produced or generated as part of the output sequence in the previous generating round and may have been shifted right 110 to concatenate it with the start token into the suffix sequence. Thus, after each of these generating rounds, the prediction sequence grows by one token. In the last, (n+1) -th generating round, the suffix sequence may be a concatenation comprising the start token and the entire prediction sequence, and the output sequence may be a concatenation comprising the initial input 108, the entire prediction sequence (which may have been produced or generated as part of the output sequence in the previous generating round) and the end token.

[0062] When the end token is generated, the prediction process may finish and the transformer may produce the prediction sequence as the final output 109.

[0063] The (j+1) -th generating round of prediction for 0 ≤ j ≤ n is described in more detail hereinbelow.

[0064] In the (j+1) -th generating round, the suffix sequence may be provided to the positional embedding block 106. Based on the suffix sequence, the positional embedding block 106 may generate a hidden state matrix. The positional embedding block 106 may use an embedding matrix to generate the hidden state matrix. The embedding matrix may be pre-determined or pre-configured. The width of the embedding matrix (i.e., the number of columns in the embedding matrix) may be denoted by d. The width of the hidden state matrix may be a function f () of the width of the embedding matrix. In other words, the number of columns in the hidden state matrix may be equal to f (d) . A row in the hidden state matrix may correspond to a token in the input sequence and may be referred to as a hidden state vector. The hidden state matrix may have j+1 rows, wherein the i-th row corresponds to the i-th token in the suffix sequence for 1 ≤ i ≤ j+1. The size of the hidden state matrix may be expressed as (j+1) × f(d) .

[0065] The hidden state matrix generated (as described hereinabove) by the positional embedding block 105 and that generated (as described in hereinabove) by the positional embedding block 106 may be concatenated into an overall hidden state matrix. The size of the overall hidden state matrix may be expressed as (m+j+1) × f (d) . The overall hidden state matrix may be provided to the decoder stack 103 for processing. Within the decoder stack 103, the overall hidden state matrix may be further processed and updated by a sequence of decoder blocks 104 D1, …, Dt, sequentially, one after another.

[0066] Afterward, the overall hidden state matrix may be provided from the decoder stack 103, or more precisely, from the top or last decoder block 104 Dt to the final layers block 107. Based on the overall hidden state matrix, the final layers block 107 may generate an output sequence, which may be a concatenation of a sequence (which is identical to the input sequence excluding the start token) and a token. The token may be the (j+1) -th token in the prediction sequence when j < n, and may be the end token when j = n. When the token is not the end token, and after the part that is identical to the initial input sequence has been removed from the output sequence, the output sequence may be provided to the positional embedding block 106, and the positional embedding block 106 may use it as part of the suffix sequence in the next generating round of prediction. The next generating round of prediction may be triggered by the positional embedding block 106 receiving the output sequence.

[0067] A transformer model as described above may be expected to require a lot of resources to run. If a device (e.g., a user equipment (UE) ) has sufficient resources (e.g., computation, energy) , the device may run the transformer model locally and feed input data (i.e., inference data) to the transformer model for inferencing (e.g., generating text) and get output data (i.e., inference result) from the transformer model locally.

[0068] If a device has limited resources, the device may not be able to run the transformer model, or may run the transformer model with degraded performance (e.g., with a response delay) . To address this issue, the transformer model may be hosted and run on a remote, resource-rich server, and be accessed and thus used by a device for training or inferencing through a communication network (e.g., through a 3GPP network) that connects the device and the server. The server may be a network entity in a data network or a network entity in a cloud environment. The server may also be a network entity in the communication network, such as a network function or a wireless access point (e.g., a radio access network node or RAN node, or a base station) .

[0069] In some scenarios, when data privacy is a concern, it may not be desirable for the device to send the input data to or receive the output data from the remote server. To address this concern, the transformer model may be split into two components, a device-side component running on the device and a network-side component running on the server. During the inferencing, the device and the server may communicate to provide intermediate data (which are generated by the device-side component or the network-side component) to each other. As the intermediate data would not be expected to reveal the content of the input data or the content of the output data, data privacy would be expected to be protected.

[0070] In some scenarios, a single server may not have sufficient resources to host and run the entire transformer or the network-side component. The transformer or the network-side component may be further split into multiple components and run distributively on multiple such servers. Embodiments of the present disclosure provide systems and methods of running a transformer model in a network environment, wherein the transformer model may be split into multiple components and each component may be run on a network entity (e.g., a UE or a server) .

[0071] As described above, in the (j+1) -th generating round of prediction, for 0 ≤ j ≤ n, a transformer may take a concatenation of the start token and the pre-sequence of the (j+1) -th token in the prediction sequence as part of the input (in other words, as part of the input sequence) and may accordingly produce or generate an output sequence. The output sequence may comprise the pre-sequence of the (j+1) -th token and the (j+1) -th token in the prediction sequence. The pre-sequence of the (j+1) -th token may be regenerated during this generating round. Although that pre-sequence may have been generated in the previous generating round (if any) , it would be the first time that the (j+1) -th token is generated. It can therefore be seen that the (j+1) -th token may then be regenerated in all the subsequent generating rounds, i.e., from the (j+2) -th generating round to the (n+1) -th generating round. If the transformer is a decoder-only transformer, as shown in FIG. 1B, the initial input sequence (i.e., a sequence of m tokens) may be regenerated as part of the output sequence in addition to the pre-sequence of the (j+1) -th token. To improve computation and communication efficiency, the computation and, if the transformed is split and run distributively in a network, communication associated with the regeneration should be avoided.

[0072] Embodiments of the present disclosure are generally directed towards performing caching and / or filtering at a decoder block 104 to avoid the regeneration. The caching and / or filtering may be performed at a block or sub-block of the transformer model during a generating round, wherein related computation results are cached and may be used in subsequent generating rounds of prediction. As such, repeated computation is expected to be reduced, and communication overhead is expected to be minimized.

[0073] The UE in the present disclosure may be a user device, a terminal device, a wireless transmit / receive unit (WTRU) , a mobile station, a fixed or mobile subscriber unit, a cellular telephone, a station (STA) , a MTC device, a personal digital assistant (PDA) , a smartphone, a laptop, a computer, a tablet, a wireless sensor, a consumer electronics device, a smart book, a vehicle, a car, a truck, a bus, a train, an internet-of-things (IoT) device, a wearable device (such as a watch, a pair of glasses, head mounted equipment, etc. ) , an industrial device, or an apparatus in (e.g. module, modem, or chip) or comprising the forgoing devices, among other possibilities. The UE in the present disclosure may be interpreted as a circuit or chip, or a combination thereof in the UE.The circuit or chip may include a modem chip, also referred to as a baseband chip, a system on chip (SoC) including a modem core, or system in package (SIP) , and the like, and may be responsible for one or more communication functions in the UE.

[0074] FIG. 4 shows an example of an apparatus 400 in a communication system, in accordance with embodiments of the present disclosure. The apparatus 400 may be the device (e.g., the UE) , a component in the UE, a network node such as a RAN node, any components in a RAN or control network (CN) , or any network function of a CN. As shown in FIG. 4, apparatus 400 may include at least one processor 410. Only one processor 410 is illustrated to avoid congestion in the drawing. The processor 410 may perform (or control the apparatus 400 to perform) operations (or methods) described herein as being performed by the apparatus 400.

[0075] When the apparatus 400 is a RAN node, components of the RAN, the UE, or components of the UE, the apparatus 400 may further include a transmitter 420 and a receiver 430 coupled to one or more antennas. One, some, or all of the antennas may alternatively be panels. The transmitter 420 and the receiver 430 may be integrated, e.g., as a transceiver. The transceiver may be configured to modulate data or other content for transmission by at least one antenna or network interface controller (NIC) . The transceiver may be also configured to demodulate data or other content received by the at least one antenna. Each transceiver may include any suitable structure for generating signals for wireless or wired transmission and / or processing signals received wirelessly or by wire. Each antenna may include any suitable structure for transmitting and / or receiving wireless or wired signals. In the present disclosure, the transceiver (or transmitter 420 and / or receiver 430) may be viewed as an interface circuit.

[0076] The apparatus 400 may include at least one memory 440. The memory 440 may store instructions used to perform operations described herein. The memory 440 may also store data used, generated, or collected by the apparatus 400. For example, the memory 440 could store software instructions or modules configured to implement some or all of the functionality and / or embodiments described herein and that are executed by the one or more processors 410.

[0077] A person skilled in the art should understand that embodiments of the present disclosure may be provided as a method, an apparatus (or system) , computer-readable storage medium, or a computer program product. Therefore, the present disclosure may provide a form of a hardware-only embodiment, a software-only embodiment, or an embodiment with a combination of software and hardware. Moreover, the present disclosure may provide a form of a computer program product that is implemented on one or more computer-usable storage media (including but not limited to a disk memory, an optical memory, and the like) that include computer-usable program code.

[0078] A transformer, e.g., the encoder-decoder or the decoder-only transformers, shown respectively in FIGs. 1A and 1B, can be split into multiple components. The splitting may be performed between blocks of the transformer. In this case, a component includes one or multiple blocks of the transformer. The splitting may further be performed on a block of the transformer (e.g., an encoder block 102 or a decoder block 104) such that the block is split into multiple sub-blocks. In this case, a component may include a sub-block of the block of the transformer. When the splitting between blocks and the splitting on a block are both performed, a component may include one or more blocks of the transformer and one or more sub-blocks of a further block of the transformer.

[0079] In FIG. 2, the dashed line 203 indicates where the splitting may be performed on the encoder block 102. As shown in FIG. 2, the encoder block 102 may be split into two sub-blocks, one on each of the two sides of the dashed line 203. Similarly, a decoder block 104 may be split into two sub-blocks at a position indicated by the dashed lines in FIGs. 3A and 3B. When the transformer is an encoder-decoder transformer, as shown in FIG. 3A, the splitting may be performed at either or both of two positions (dashed lines 306 and 307) , thereby leading to three sub-blocks. In FIG. 3A, one of the three sub-blocks is in between the two dashed lines 306 and 307. When the transformer is a decoder-only transformer, as shown in FIG. 3B, the decoder block 104 may be split into two sub-blocks, one on either side of dashed line 308.

[0080] When the transformer is split into multiple components as described above, the multiple components may be run or executed on multiple network entities in a network. When the multiple components are run on different network entities, information flows (indicated by arrowed lines in FIGs. 1A, 1B, 2, 3A, and 3B) between blocks and / or sub-blocks may be transmitted between the different network entities running the different components.

[0081] If the transformer model is an encoder-decoder transformer, as shown in FIG. 1A, when processing the initial input, the hidden state matrix of the initial input may be first generated by the positional embedding block 105 and then passed between blocks, from the positional embedding block 105 to the decoder block (s) 104 through the encoder block (s) 102 in the encoder stack 101 in order; along the passing of the hidden state matrix, the hidden state matrix may be updated by each of those blocks. An information flow, as indicated by an arrow line in FIGs. 1A, 2, and 3A, may comprise the hidden state matrix. When the information flow is transmitted through the network (as a result of the ends of the information flow being located in two different network entities, with each of the two ends corresponding to a respective block or a sub-block of the transformer model) , the associated communication overhead may be therefore dependent on (e.g., a function of) the size of the hidden state matrix.

[0082] In the (j+1) -th generating round of prediction, for 0 ≤ j ≤ n, the transformer may take a concatenation of the start token and the pre-sequence of the (j+1) -th token as input (in other words, input sequence) and may accordingly produce or generate an output sequence, which may be a concatenation comprising the pre-sequence of the (j+1) -th token and the (j+1) -th token itself. During the generating round, the hidden state matrix of the input (i.e., the start token and the pre-sequence of the (j+1) -th token in the prediction sequence) may be generated by the positional embedding block 106 and passed between blocks, from the positional embedding block 106 to the final layers block 107 through the decoder block (s) 104 in the decoder stack 103 in order; along the passing of the hidden state matrix, the hidden state matrix may be updated by each of those blocks. An information flow, as indicated by an arrow line in FIGs. 1A, 2 and 3A, may comprise the hidden state matrix. When the information flow is transmitted through the network (as a result of the two ends of the information flow being located in two different network entities, with each of the two ends corresponding to a respective block or a sub-block of the transformer model) , the associated communication overhead may be therefore dependent on (e.g., a function of) the size of the hidden state matrix.

[0083] If the transformer is a decoder-only transformer, as shown in FIG. 1B, in the (j+1) -th generating round of prediction, for 0 ≤ j ≤ n, the transformer takes the initial input sequence (i.e., a sequence of m tokens) and a suffix sequence as input (in other words, the input sequence) and may accordingly produce or generate an output sequence. The initial input sequence may be provided to the positional embedding block 105 of the transformer, while the suffix sequence may be provided to the positional embedding block 106 of the transformer. The positional embedding block 105 may generate a first hidden state matrix, based on the initial input sequence. The positional embedding block 106 may generate a second hidden state matrix, based on the suffix sequence. These two matrices may be concatenated into an overall hidden state matrix, the size of which may be expressed as (m+j+1) × f (d) . The overall hidden state matrix is passed to the final layers block 107 through the decoder block (s) 104 in the decoder stack 103 in order; when being passed through a block (e.g., any of the decoder blocks 104 D1, …, Dt) , the overall hidden state matrix may be further processed and updated by that block. An information flow, as indicated by an arrow line in FIGs. 1A and 3A, may comprise the overall hidden state matrix. When the information flow is transmitted through the network (as a result of the two ends of the information flow being located in two different network entities, with each of the two ends corresponding to a respective block or sub-block of the transformer) , the associated communication overhead may be therefore dependent on (e.g., a function of) the size of the overall hidden state matrix.

[0084] The following describes processing for generating rounds of prediction in an encoder-decoder transformer, in accordance with embodiments of the present disclosure.

[0085] For the (j+1) -th (0 ≤ j ≤ n) generating round of prediction, the transformer may generate the (j+1) -th token in the prediction sequence for the first time. In this generating round, the positional embedding block 106 may receive the j-th token in the prediction sequence or a concatenation of the start token and the pre-sequence of the (j+1) -th token in the prediction. The positional embedding block 106 may be configured to generate, based on the j-th token or the concatenation of the start token and the pre-sequence of the (j+1) -th token and by using an embedding matrix, a hidden state vector h or a hidden state matrix M, respectively. When generating the hidden state vector based on the j-th token, the positional embedding block 106 may be configured to process also based on the positional information of the token input to it; for example, the positional embedding block 106 may maintain the position of the j-th token in the input sequence (i.e., the concatenation of the start token and the pre-sequence of the (j+1) -th token) , which may be (j+1) due to the shift right 110, and may generate the hidden state vector correspondingly. The size / dimension of (i.e., number of values in) the hidden state vector h and the width of (i.e., number of columns in) the hidden state matrix M may be identical. The height of (i.e., number of rows in) the hidden state matrix M may be equal to j+1. The pre-sequence of the (j+1) -th token may include the j-th token as the last token. The hidden state matrix M therefore may include the hidden state vector h as a row (e.g., the last row) . The j-th token or the concatenation of the start token and the pre-sequence of the (j+1) -th token may be part of the output of previous generating rounds (if there is any) , which may be provided from the final layers block 107.

[0086] The positional embedding block 106 may provide the hidden state vector h or the hidden state matrix M to the decoder stack 103 for processing, which may trigger a chain of processing actions performed by the decoder block (s) 104 within the decoder stack 103. The bottom, or first decoder block 104 D1 in the decoder stack 103 may receive the hidden state vector h or the hidden state matrix M, as shown in FIG. 1A. As a result of the chain of processing, the decoder stack 103 may generate an intermediate result, which may be an updated version of the hidden state vector h or an updated version of the hidden state matrix M. The decoder stack 103 (or more precisely, the top or last decoder block 104 Dt, as shown in FIG. 1A) may provide the intermediate result to the final layers block 107 for further processing. The final layers block 107 may process the intermediate result and may accordingly generate an output for the (j+1) -th generating round of prediction, which may include the (j+1) -th token in the prediction sequence. In the following, operations that may be performed by each decoder block 104 Di (1 ≤ i ≤ t) in the decoder stack 103 during the chain of processing are described.

[0087] The decoder block 104 Di may receive first input 301 from a block of the transformer, with the block of the transformer being either the positional embedding block 106 when i = 1 or the decoder block 104 Di-1 when i > 1. In the former case, the first input 301 may comprise the hidden state vector h or the hidden state matrix M, as described above. In the latter case, the first input 301 may be the output 303 of the decoder block 104 Di-1 during the chain of processing. The decoder block 104 Di also may receive a second input 302 from the encoder stack 101, more precisely, from the top, last encoder block 102 Bs as shown in FIG. 1A. The decoder block 104 Di may process the first input 301 and the second input 302. The decoder block 104 Di may be configured to generate an output 303 based on the first input 301 and the second input 302 when processing the first input 301. Depending on the configuration, the output generated by the decoder block 104 Di-1 may be a single vector, i.e., an updated version of the hidden state vector h, or a matrix, i.e., an updated version of the hidden state matrix M. For ease of presentation, the updated version of the hidden state vector h or the updated version of the hidden state matrix M in the output 303 may still be referred to as the hidden state vector h or the hidden state matrix M, with the understanding that its content has been updated by the decoder block 104 Di during the processing of the first input 301.

[0088] The decoder block 104 Di may provide the output 303 to a block of the transformer for further processing, which may be the decoder block 104 Di+1 when i < t, or the final layers block 107 when i = t. When i = t, the output 303 of the decoder block 104 Di may be the intermediate result described above. FIG. 5A shows a schematic of the structure and operations of a decoder block 104 in an encoder-decoder transformer, in accordance with an embodiment of the present disclosure. The decoder block 104 Di may include a self-attention sub-block 501, a cross-attention sub-block 502, and / or a feed-forward sub-block 503, as shown in FIG. 5A. The operations performed by the decoder block 104 Di are described below on a per-sub-block basis.

[0089] The decoder block 104 Di may include a self-attention sub-block 501, as shown in FIG. 5A. The self-attention sub-block 501 may process the first input 301. As a result of the processing of the first input 301, the self-attention sub-block 501 may generate an information-a. The self-attention sub-block 501 may provide the information-ato the cross-attention sub-block 502 for further processing. The providing of the information-ais indicated by the arrow across the dashed line 306 in FIG. 5A. As described below, the information-amay comprise either an updated version of the hidden state vector h or an updated version of the hidden state matrix M.

[0090] The decoder block 104 Di (or more precisely, the self-attention sub-block 501 of the decoder block 104 Di) may be configured to activate (i.e., use and make active) or deactivate (i.e., not to use and make inactive) an initial filter 505 (filter 0) , a first filter 506 (filter 1) , a first cache 507 (cache 1) , and / or a second cache 508 (cache 2) for processing the first input 301, based on whether the first input 301 comprises only the hidden state vector h or the hidden state matrix M. When the initial filter 505 is active or inactive, ingress filtering may be considered to be active or inactive, respectively. When the first filter 506 is active or inactive, egress filtering may be considered to be active or inactive, respectively. When at least one of the first cache 507 and the second cache 508 is active or inactive, ingress caching may be considered to be active or inactive, respectively. Activation and deactivation of the filters and caches may be configured as follows:

[0091] · When the first input 301 comprises the hidden state vector h, the self-attention sub-block 501 may be configured to activate (use) the first cache 507 and the second cache 508, and to deactivate (not use) the initial filter 505.

[0092] · When the first input 301 comprises the hidden state matrix M, the self-attention sub-block 501 may be configured to deactivate (not use) the first cache 507. The self-attention sub-block 501 may be configured either to activate (use) both the initial filter 505 and the second cache 508, or to deactivate both (not use any) of them.

[0093] · Whether the first input 301 comprises the hidden state vector h or the hidden state matrix M, the self-attention sub-block 501 may be further configured to activate (use) or deactivate (not use) the first filter 506.

[0094] When processing the first input 301, the self-attention sub-block 501 may compute a hidden state matrix M’ based on a key matrix, a value matrix and a query matrix through an operation at the masked multi-head attention layer 509 shown in the FIG. 5A. How the self-attention sub-block 501 obtains the key matrix, the value matrix and the query matrix is described hereinbelow. The hidden state matrix M’ may have the same dimensions (i.e., width and height) as the hidden state matrix M and may be considered an updated version of the hidden state matrix M. Afterward, through an operation at an add &norm layer 510, the self-attention sub-block 501 may compute a hidden state matrix M” based on the hidden state matrix M’a nd the hidden state matrix M. How the self-attention sub-block 501 obtains the hidden state matrix M is described hereinbelow. The hidden state matrix M” may have the same dimensions as the hidden state matrix M’a nd may be considered as a result of updating the hidden state matrix M’a nd thus as a further updated version of the hidden state matrix M.

[0095] If the self-attention sub-block 501 is configured not to use the first filter 506, the self-attention sub-block 501 may output or provide the hidden state matrix M” to the cross-attention sub-block 502; in other words, the information-a provided from the self-attention sub-block 501 to the cross-attention sub-block 502 may include the hidden state matrix M” . If the self-attention sub-block 501 is configured to use the first filter 506, the self-attention sub-block 501 may obtain an updated version of the hidden state vector h and output or provide an updated version of the hidden state vector h to the cross-attention sub-block 502; in other words, the information-a provided from the self-attention sub-block 501 to the cross-attention sub-block 502 may include the updated version of the hidden state vector h. The self-attention sub-block 501 may obtain the updated version of the hidden state vector h from the hidden state matrix M” by using the first filter 506, i.e., by performing egress filtering. During the egress filtering, the self-attention sub-block 501 may filter out all other rows (which may be included in the hidden state matrix M” that may have been computed in the previous j-th generating round, if existing) in the hidden state matrix M” and may retain the row corresponding to the hidden state vector h, e.g., the last row, as the updated version of the hidden state vector h.

[0096] The following describes how the self-attention sub-block 501 may obtain the hidden state matrix M, the key matrix, the value matrix, and the query matrix.

[0097] If the first input 301 comprises the hidden state matrix M, the self-attention sub-block 501 may obtain the hidden state matrix M from the first input 301.

[0098] If the first input 301 comprises only the hidden state vector h (in this case, the self-attention sub-block 501 is configured to activate (use) the first cache 507) , the self-attention sub-block 501 may perform ingress caching, wherein it may store or cache the hidden state vector h in the first input 301 into the first cache 507. The first cache 507 may thus store or cache the hidden state vectors that are input to the self-attention sub-block 501 of decoder block 104 Di in previous generating rounds of prediction and in the current (j+1) -th generating round. The hidden state vectors stored in the first cache 507 may be used to construct the hidden state matrix M, and the self-attention sub-block 501 may therefore obtain the hidden state matrix M from the first cache 507. To reconstruct the hidden state matrix M, the self-attention sub-block 501 may stack the stored or cached hidden state vectors according to their round of caching (e.g., in the reconstructed hidden state matrix M, the hidden state vector h cached in the current (j+1) -th generating round may become the last row, while the vector cached in the previous j-th generating round may become the penultimate row, and so forth) .

[0099] If the first input 301 comprises the hidden state matrix M (in this case, the self-attention sub-block 501 is configured to deactivate both (not use any) of the initial filter 505 and the second cache 508) , the self-attention sub-block 501 may compute, through an operation O1 511 and based on the hidden state matrix M, the key matrix, the value matrix and the query matrix. Any of the operations performed at the masked multi-head attention layer 509 or add &norm layer 510, as described above, or at the operation O1 511 may be referred to as prediction operations.

[0100] If the first input 301 comprises the hidden state matrix M (in this case, the self-attention sub-block 501 is configured to activate (use) both the initial filter 505 and the second cache 508) , the self-attention sub-block 501 may obtain the hidden state vector h from the hidden state matrix M by using the initial filter 505, i.e., performing ingress filtering. During the ingress filtering, the self-attention sub-block 501 may filter out all other rows (which may be included in the hidden state matrix M that had been input in the previous j-th generating round, if existing) in the hidden state matrix M and may retain the row of the hidden state vector h, e.g., the last row, as the hidden state vector h. Through the operation O1 511 and based on the hidden state vector h, the self-attention sub-block 501 may compute three vectors: a key vector, a value vector, a query vector. The self-attention sub-block 501 may perform ingress caching, wherein it may store or cache the three vectors in the second cache 508. The second cache 508 thus may store three such types of vectors computed based on the hidden state vectors that have been input to the decoder block 104 Di (more precisely, the hidden state vectors obtained by the self-attention sub-block 501 through the initial filter 505) in the previous generating rounds of prediction and in the current (j+1) -th generating round. The key vectors, the value vectors and the query vectors stored in the second cache 508 may be used to construct the key matrix, the value matrix and the query matrix respectively. Thus, the self-attention sub-block 501 may obtain the key matrix, the value matrix and the query matrix from the second cache 508. To reconstruct the three matrices, for each type (i.e., key, value, and query) , the self-attention sub-block 501 may stack the corresponding stored or cached vectors according to their round of caching (e.g., in the reconstructed key matrix, the key vector cached in the current (j+1) -th generating round may become the last row, while the vector cached in the previous j-th generating round may become the penultimate row, and so forth) .

[0101] If the first input 301 comprises only the hidden state vector h (in this case, the self-attention sub-block 501 is configured to activate (use) the second cache 508 and deactivate (not use) the initial filter 505) , through the operation O1 511 and based on the hidden state vector h (which may be obtained from the first input 301) , the self-attention sub-block 501 may compute three vectors: a key vector, a value vector, a query vector. The self-attention sub-block 501 may perform ingress caching, wherein it may store or cache the three vectors in the second cache 508. The second cache 508 may thus store three such types of vectors computed based on the hidden state vectors input to the decoder block 104 Di (or more precisely, the self-attention sub-block 501) in the previous generating rounds of prediction and in the current (j+1) -th generating round. The key vectors, the value vectors, and the query vectors stored in the second cache 508 may be used to construct the key matrix, the value matrix and the query matrix respectively. Thus, the self-attention sub-block 501 may obtain or construct the key matrix, the value matrix, and the query matrix from the second cache 508. To reconstruct the three matrices, for each type (i.e., key, value, and query) , the self-attention sub-block 501 may stack the corresponding stored or cached vectors according to their round of caching (e.g., in the reconstructed key matrix, the key vector cached in the current (j+1) -th generating round may become the last row, while the vector cached in the previous j-th generating round may become the penultimate row, and so forth) .

[0102] The decoder block 104 Di may include a cross-attention sub-block 502, as shown in FIG. 5A. The cross-attention sub-block 502 may receive the information-a from the self-attention sub-block 501, and the information-amay comprise the output of the self-attention sub-block 501, which may be a result of the self-attention sub-block’s 501 processing of the first input 301 as described above. The output of the self-attention sub-block 501 may include either an updated version of the hidden state vector h or an updated version of the hidden state matrix M, which may be still referred to as the hidden state vector h or the hidden state matrix M in the following for ease of presentation, with the understanding that its content has been updated compared to that before the self-attention sub-block’s 501 processing of the first input 301.

[0103] The cross-attention sub-block 502 may process the information-a. As a result of the processing of the information-a, the cross-attention sub-block 502 may generate an information-b and provide the information-b to the feed-forward sub-block 503 for further processing. Providing the information-b is indicated by the arrow across the dashed line 307 in FIG. 5A. As described below, the information-b may comprise either an updated version of the hidden state vector h or an updated version of the hidden state matrix M.

[0104] The decoder block 104 Di (or more precisely, the cross-attention sub-block 502 of the decoder block 104 Di) may be configured to use or not to use a second filter 513 (filter 2) or a third cache 514 (cache 3) , and / or a third filter 515 (filter 3) for processing the information-a, based on whether the information-acomprises the hidden state vector h or the hidden state matrix M. When the third filter 515 is active or inactive, ingress filtering may be considered to be active or inactive, respectively. When the second filter 513 is active or inactive, egress filtering may be considered to be active or inactive, respectively. When the third cache 514 is active or inactive, egress caching may be considered to be active or inactive, respectively. Activation and deactivation of the filters and caches may be configured as follows:

[0105] · When the information-acomprises the hidden state vector h, the cross-attention sub-block 502 may be configured to deactivate (not use) the third filter 515 and may be further configured to activate (use) or deactivate (not use) the third cache 514.

[0106] · When the information-acomprises the hidden state matrix M, the cross-attention sub-block 502 may be configured to activate (use) or deactivate (not use) the third filter 515. The cross-attention sub-block 502 may be further configured to activate (use) any of the second filter 513 and the third cache 514, but not both of them (i.e., to deactivate at least one of them) . If the cross-attention sub-block 502 is configured to activate (use) the third filter 515, the cross-attention sub-block 502 may be further configured to activate (use) third cache 514 and to deactivate (not use) the second filter 513;otherwise, the cross-attention sub-block 502 may be further configured to activate (use) the second filter 513 and to deactivate (not use) the third cache 514.

[0107] When processing the information-a, the cross-attention sub-block 502 may use a key matrix Ki and a value matrix Vi, as further described hereinbelow. These two matrices may be computed by the cross-attention sub-block 502 through the operation O2 305, based on the second input 302. The second input 302 may be provided from the top or last encoder block 102 Bs in the encoder stack 101, as shown in FIG. 1A, to the cross-attention sub-block 502. When processing the information-a, the cross-attention sub-block 502 may perform an operation O3 516, an operation at a multi-head attention layer 517, an operation at an add &norm layer 518, and operations related to the third filter 515, third cache 514 or second filter 513, as further described below. Any of these operations may be referred to as prediction operations.

[0108] If the information-a includes the hidden state matrix M and if the cross-attention sub-block 502 is configured to activate (use) the third filter 515, the cross-attention sub-block 502 may obtain the hidden state vector h from the hidden state matrix M by using the third filter 515, i.e., by performing ingress filtering. During the ingress filtering, the cross-attention sub-block 502 may filter out all other rows (which may be included in the hidden state matrix M that has been input in the previous j-th generating round, if existing) in the hidden state matrix M and may retain the row corresponding to the hidden state vector h, e.g., the last row, as the hidden state vector h.

[0109] In a first scenario, the information-amay include only the hidden state vector h or the hidden state vector h and may be obtained through the third filter 515 (i.e., ingress filtering) as described above. In this scenario, the cross-attention sub-block 502 may generate a query vector based on the hidden state vector h through the operation O3 516. Then, through the operation at the multi-head attention layer 517 and based on the query vector, the key matrix Ki and the value matrix Vi, the cross-attention sub-block 502 may compute a hidden state vector h’ , which may have the same size or dimension as the hidden state vector h and may be considered an updated version of the hidden state vector h. Through the operation at the add &norm layer 518 and based on the hidden state vector h’a nd the hidden state vector h, the cross-attention sub-block 502 may compute a hidden state vector h” . The hidden state vector h” may have the same dimension as the hidden state vector h’ , and may be considered as a result of updating the hidden state vector h’a nd thus as a further updated version of the hidden state vector h.

[0110] If the cross-attention sub-block 502 is configured to deactivate (not use) the third cache 514, the cross-attention sub-block 502 may output the hidden state vector h” to the feed-forward sub-block 503; in other words, the information-b provided from the cross-attention sub-block 502 to the feed-forward sub-block 503 may include the hidden state vector h” . If the sub-block is configured to activate (use) the third cache 514, the cross-attention sub-block 502 may perform egress caching, wherein it may store or cache the hidden state vector h” in the third cache 514, and may output an updated version of the hidden state matrix M to the feed-forward sub-block 503; in other words, the information-b provided from the cross-attention sub-block 502 to the feed-forward sub-block 503 may include the updated version of the hidden state matrix M. The updated version of the hidden state matrix M may be obtained or constructed from the third cache 514. This is possible because the third cache 514 may have stored the hidden state vectors that may have been generated through the operation at the add &norm layer 518 in the previous generating rounds of prediction and the current (j+1) -th generating round and that these hidden state vectors can be used together to constitute the updated version of the hidden state matrix M. To reconstruct the updated version of hidden state matrix M, the cross-attention sub-block 502 may stack the corresponding stored or cached vectors according to their round of caching (e.g., in the reconstructed updated version of hidden state matrix M, the hidden state vector h” cached in the current (j+1) -th generating round may become the last row, while the vector cached in the previous j-th generating round may become the penultimate row, and so forth) .

[0111] In a second scenario, the information-amay include the hidden state matrix M and the cross-attention sub-block 502 may be configured to deactivate (i.e., not to use) the third filter 515. In this scenario, the cross-attention sub-block 502 may generate a query matrix based on the hidden state matrix M through the operation O3 516. Then, through the operation at the multi-head attention layer 517 and based on the query matrix, the key matrix Ki and the value matrix Vi, the cross-attention sub-block 502 may compute a hidden state matrix M’ , which may have the same dimensions (i.e., width and height) as the hidden state matrix M and may be considered an updated version of the hidden state matrix M. Through the operation at the add &norm layer 518 and based on the hidden state matrix M’a nd the hidden state matrix M, the cross-attention sub-block 502 may compute a hidden state matrix M” . The hidden state matrix M” may have the same dimensions as the hidden state matrix M’a nd may be viewed as a result of updating the hidden state matrix M’a nd thus as a further updated version of the hidden state matrix M.

[0112] If the cross-attention sub-block 502 is configured to deactivate (not use) the second filter 513, the cross-attention sub-block 502 may output the hidden state matrix M” to the feed-forward sub-block 503; in other words, the information-b provided from the cross-attention sub-block 502 to the feed-forward sub-block 503 may include the hidden state matrix M” . If the cross-attention sub-block 502 is configured to activate (use) the second filter 513, the cross-attention sub-block 502 may obtain an updated version of the hidden state vector h and output the updated version of the hidden state vector h to the feed-forward sub-block 503; in other words, the information-b provided from the cross-attention sub-block 502 to the feed-forward sub-block 503 may include the updated version of the hidden state vector h. The cross-attention sub-block 502 may obtain the updated version of the hidden state vector h from the hidden state matrix M” by using the second filter 513, i.e., by performing egress filtering. During the egress filtering, the cross-attention sub-block 502 may filter out all other rows (which may be included in the hidden state matrix M” and may have been computed in the previous j-th generating round, if existing) in the hidden state matrix M” and may retain the row corresponding to the hidden state vector h, e.g., the last row, as the updated version of the hidden state vector h.

[0113] The decoder block 104 Di may include a feed-forward sub-block 503, as shown in FIG. 5A. The feed-forward sub-block 503 may receive the information-b from the cross-attention sub-block 502, and the information-b may comprise the output of the cross-attention sub-block 502, which may be a result of the cross-attention sub-block’s 502 processing of the information-aas described above. The output of the cross-attention sub-block 502 may include either an updated version of the hidden state vector h or an updated version of the hidden state matrix M, which may still be referred to as the hidden state vector h or the hidden state matrix M in the following for ease of presentation, with the understanding that its content has been updated compared to that before the cross-attention sub-block’s 502 processing of the information-a.

[0114] The feed-forward sub-block 503 may process the information-b. As a result of the processing of the information-b, the feed-forward sub-block 503 may generate an output, which is the output 303 of the decoder block 104 Di, and may provide the output 303 to a further block of the transformer for further processing, which may be the next decoder block 104 Di+1 when i < t and the final layers block 107 when i = t. Providing the output 303 is indicated by the arrow pointing out of the decoder block 104 in FIG. 5A. As described below, the output may comprise either an updated version of the hidden state vector h or an updated version of the hidden state matrix M.

[0115] The decoder block 104 Di (or more precisely, the feed-forward sub-block 503 of the decoder block 104 Di) may be configured to use or not to use a fourth filter 519 (filter 4) , and / or a fifth cache 520 (cache 5) or a fifth filter 521 (filter 5) for processing the information-b, based on whether the information-b comprises the hidden state vector h or the hidden state matrix M. When the fourth filter 519 is active or inactive, ingress filtering may be considered to be active or inactive, respectively.When the fifth filter 521 is active or inactive, egress filtering may be considered to be active or inactive, respectively. When the fifth cache 520 is active or inactive, egress caching may be considered to be active or inactive. Activation and deactivation of the filters and caches may be configured as follows:

[0116] · When the information-b comprises the hidden state vector h, the feed-forward sub-block 503 may be configured to deactivate both (not use any) of the fourth filter 519 and the fifth filter 521. The feed-forward sub-block 503 may be further configured to activate (use) or deactivate (not use) the fifth cache 520.

[0117] · When the information-b comprises the hidden state matrix M, the feed-forward sub-block 503 may be configured to activate (use) or deactivate (not use) the fourth filter 519. The feed-forward sub-block 503 may be further configured to activate (use) one of the fifth filter 521 and the fifth cache 520, but not both of them (i.e., to deactivate at least one of them) . If the feed-forward sub-block 503 is configured to activate (use) the fourth filter 519, the feed-forward sub-block 503 may be further configured to activate (use) fifth cache 520 and deactivate (not use) the fifth filter 521;

[0118] otherwise, the feed-forward sub-block 503 may be further configured to activate (use) the fifth filter 521 and deactivate (not use) the fifth cache 520.

[0119] When processing the information-b, the feed-forward sub-block 503 may first perform a filtering operation (i.e., ingress filtering) using the fourth filter 519. If the information-b includes the hidden state matrix M and if the feed-forward sub-block 503 is configured to activate (use) the fourth filter 519, the feed-forward sub-block 503 may obtain the hidden state vector h from the hidden state matrix M by using the fourth filter 519, i.e., by performing ingress filtering. During the ingress filtering, the feed-forward sub-block 503 may filter out all other rows (which may be included in the hidden state matrix M that may have been input in the previous j-th generating round, if existing) in the hidden state matrix M and may retain the row corresponding to the hidden state vector h, e.g. the last row, as the hidden state vector h. The feed-forward sub-block 503 may then perform operations at a feed forward layer 522 and an add &norm layer 523 based on the hidden state vector h. In other words, the feed-forward sub-block 503 may perform prediction operations.

[0120] If the feed-forward sub-block 503 is configured to deactivate (not use) the fourth filter 519, the feed-forward sub-block 503 may not perform the filtering operation (i.e., ingress filtering described above) and may perform the operations at the feed forward layer 522 and the add &norm layer 523, based on the hidden state vector h or the hidden state matrix M in the information-b.

[0121] When the feed-forward sub-block 503 performs the operations at the feed forward layer and the add &norm layer based on the hidden state vector h, a hidden state vector h’ may be generated as a result. The hidden state vector h’ may have the same size or dimension as the hidden vector h and may be considered an updated version of the hidden state vector h. When the feed-forward sub-block 503 performs the operations at the feed forward layer 522 and the add &norm layer 523 based on the hidden state matrix M, a hidden state matrix M’ may be generated as a result. The hidden state matrix M’ may have the same dimensions (i.e., width and height) as the hidden matrix M and may be considered an updated version of the hidden state matrix M.

[0122] If the feed-forward sub-block 503 is configured to activate (use) the fifth filter 521 (in this case, the result of the operations at the feed forward layer 522 and the add &norm layer 523 is the hidden state matrix M’ ) , the feed-forward sub-block 503 may obtain an updated version of the hidden state vector h and may output the updated version of the hidden state vector h; in other words, the output of the feed-forward sub-block 503 may comprise the updated version of the hidden state vector h. The feed-forward sub-block 503 may obtain the updated version of the hidden state vector h from the hidden state matrix M’ by using the fifth filter 521, i.e., by performing egress filtering. During the egress filtering, the feed-forward sub-block 503 may filter out all other rows (which may be included in the hidden state matrix M’ that may have been generated in the previous j-th generating round, if existing) in the hidden state matrix M’a nd may retain the row corresponding to the hidden state vector h, e.g., the last row, as the updated version of the hidden state vector h.

[0123] If the feed-forward sub-block 503 is configured to activate (use) the fifth cache 520 (in this case, the result of the operations at the feed forward layer 522 and the add &norm layer 523 may be the hidden state vector h’ ) , the feed-forward sub-block 503 may perform egress caching, wherein it may store or cache the hidden state vector h’ in the fifth cache 520, and may output an updated version of the hidden state matrix M; in other words, the output 303 of the feed-forward sub-block 503 may comprise the updated version of the hidden state matrix M. The updated version of the hidden state matrix M may be obtained from the fifth cache 520. This is possible because the fifth cache 520 may store the hidden state vectors that are generated through the operations at the feed forward layer 522 and the add &norm layer 523 in the previous generating rounds of prediction and in the current (j+1) -th generating round, and that these hidden state vectors can be used together to constitute or construct the updated version of the hidden state matrix M. To reconstruct the updated version of the hidden state matrix M, the feed-forward sub-block 503 may stack the corresponding stored or cached vectors according to their round of caching (e.g., in the reconstructed updated version of hidden state matrix M, the hidden state vector h’ cached in the current (j+1) -th generating round may become the last row, while the vector cached in the previous j-th generating round may become the penultimate row, and so forth) .

[0124] If the feed-forward sub-block 503 is configured to deactivate both (not use any) of the fifth filter 521 and the fifth cache 520, the feed-forward sub-block 503 may output the result of the operations at the feed forward layer 522 and the add &norm layer 523, which may be either the hidden state vector h’ or the hidden state matrix M’ .

[0125] The following describes processing for generating rounds of prediction in a decoder-only transformer, in accordance with embodiments of the present disclosure

[0126] For the (j+1) -th (0 ≤ j ≤ n) generating round of prediction, the transformer may generate the (j+1) -th token in the prediction sequence for the first time. In this generating round, the positional embedding block 106 may receive the j-th token in the prediction sequence or the suffix sequence (i.e., a concatenation of the start token and the pre-sequence of the (j+1) -th token in the prediction) , which may be obtained from the output of previous generating rounds (if there is any) that may have been provided by the final layers block 107. The positional embedding block 106 may be configured to generate, based on the j-th token or the suffix sequence and by using an embedding matrix, a hidden state vector or a hidden state matrix respectively. When generating the hidden state vector based on the j-th token, the positional embedding block 106 may be configured to process also based on the positional information of the input token; for example, the positional embedding block 106 may maintain the position of the j-th token in the suffix sequence (i.e., the concatenation of the start token and the pre-sequence of the (j+1) -th token) , which may be the (j+1) -th token due to the shift right 110, and may generate the hidden state vector correspondingly. Afterward, either a single hidden state vector h or an overall hidden state matrix M (aconcatenation of two hidden state matrices) may be provided to the decoder stack 103 for processing. In the former case, the single hidden state vector may be generated by the positional embedding block 106 (as described in above, which may be based on the j-th token in the prediction sequence) . In the latter case, the two hidden state matrices may be generated by the positional embedding block 105 (as described hereinabove and which may be based on the initial input sequence) and the positional embedding block 106 (as described hereinabove and which is based on the suffix sequence) , respectively. The two matrices may be concatenated into the overall hidden state matrix M. The size or dimension of (i.e., number of values in) the hidden state vector h and the width of (i.e., number of columns in) the overall hidden state matrix M may be identical. The height of (i.e., number of rows in) the overall hidden state matrix M may be equal to m+j+1. The overall hidden state matrix M may include the hidden state vector h as a row (e.g., the last row) . In other words, the positional embedding block (s) 106 (and 105) may generate the hidden state vector h (in this case, the positional embedding block 105 might not be involved) or the hidden state matrix M (in this case, the positional embedding block 105 may be involved) based on the initial input sequence (if block A is involved) and the output of previous generating rounds (if there is any) provided from the final layers block 107.

[0127] The positional embedding block (s) 106 (and 105) may provide the hidden state vector h or the hidden state matrix M to the decoder stack 103 for processing, which may trigger a chain of processing performed by the decoder blocks 104 within the decoder stack 103. The bottom or first decoder block 104 D1 in the decoder stack 103 may receive the hidden state vector h or the hidden state matrix M, as shown in FIG. 1B. As a result of the chain of processing, the decoder stack 103 may generate an intermediate result, which may be either an updated version of the hidden state vector h or an updated version of the hidden state matrix M. The decoder stack 103 (or more precisely, the top or last decoder block 104 Dt as shown in FIG. 1B) may provide the intermediate result to the final layers block 107 for further processing. The final layers block 107 may process the intermediate result and accordingly generate an output for the (j+1) -th generating round of prediction, which may include the (j+1) -th token in the prediction sequence. In the following, operations performed by each decoder block 104 Di (1 ≤ i ≤ t) in the decoder stack 103 during the chain of processing are described.

[0128] The decoder block 104 Di may receive an input 304 from a block of the transformer, with the block of the transformer being either the positional embedding block (s) 106 (and 105) when i = 1 or the decoder block 104 Di-1 when i > 1. In the former case, the input 304 may comprise the hidden state matrix M when j = 0 (wherein the transformer may receive the initial input sequence for the first time) or may comprises either the hidden state vector h or the hidden state matrix M when 0 < j ≤ n, as described above. In the latter case, the input 304 may be the output 303 of the decoder block 104 Di-1 during the chain of processing. The decoder block 104 Di may be configured to process the input 304 and generate an output 303 based on the input 304. Depending on the configuration, the output 303 generated by the decoder block 104 Di-1 may be a single vector, i.e., an updated version of the hidden state vector h, or a matrix, i.e., an updated version of the hidden state matrix M. For ease of presentation, the updated version of the hidden state vector h or the updated version of the hidden state matrix M in the output may still be referred to as the hidden state vector h or the hidden state matrix M, with the understanding that its content may have been updated by the decoder block 104 Di during the processing of the input 304.

[0129] The decoder block 104 Di may provide the output 303 to a block of the transformer for further processing, which may be the decoder block 104 Di+1 when i < t, or the final layers block 107 when i = t. When i = t, the output 303 of the decoder block 104 Di may be the intermediate result described above. The decoder block 104 Di may include a self-attention sub-block 501 and a feed-forward sub-block 503, as shown in FIG. 5B, which may perform operations in a similar way as the corresponding sub-blocks of an encoder-decoder transformer, as described in relation to FIG. 5A, with the exception those operations performed by a cross-attention sub-block 502, which may not be included in decoder block 104 Di of a decoder-only transformer. The self-attention sub-block 501, as shown in FIG. 5B, may process the input 304 and provide the information-a to the feed-forward sub-block 503 (instead of the cross-attention sub-block 502 as described in relation to FIG. 5A for an encoder-decoder transformer) . The feed-forward sub-block 503 may process the information-a (instead of the information-b) and may provide the output 303. In other words, the self-attention sub-block 501 and the feed-forward sub-block 503 of Di may process the input 304 and the information-a as described in relation to FIG. 5A, wherein the content of the input 304 and that of the information-a (e.g., whether it comprises the hidden state vector h or the hidden state matrix M) may depend on the condition of the (j+1) -th generating round when 0 < j ≤ n. As described in relation to FIG. 5A, the self-attention sub-block 501 of FIG. 5B may be configured to activate or deactivate ingress filtering (at the initial filter 505) , ingress caching (at the second cache 508) , ingress caching (at the first cache 507) , and / or egress filtering (at the first filter 506) , and the feed-forward sub-block 503 of FIG. 5B may be configured to activate or deactivate ingress filtering, egress filtering or egress caching.

[0130] The transformer may be split into multiple components, as described hereinabove. Each of the multiple components may include one or more blocks of the transformer. A block of the transformer may be any of the blocks shown in FIG. 1A or 1B, or any of the sub-blocks of a decoder block 104 of the transformer shown in either of FIG. 1A or 1B. A sub-block of a decoder block 104 of the transformer may be included in a component alone, together with another sub-block of the decoder block 104, or together with another sub-block of another decoder block 104.

[0131] The multiple components may run on different network entities. A first component among multiple components may include a first block or sub-block of the transformer (denoted as the first block / sub-block) , and a second component among the multiple components may include a second block or sub-block of the transformer (denoted as the second block / sub-block) . The first block / sub-block and the second block / sub-block may be adjacent in the transformer. The first component may run on a first network entity (NE) , and a second component may run on a second NE. The first NE and the second NE may communicatively coupled through a network.

[0132] As described above an NE may be a device (e.g., a UE) or a server.

[0133] In some embodiments, the first block / sub-block may be the self-attention sub-block 501 or the cross-attention sub-block 502 of a decoder block 104 of the transformer, and the second block / sub-block may be the next sub-block of the same decoder block 104 (e.g., respectively, the cross-attention sub-block 502 or the feed-forward sub-block 503) . In some other embodiments, the first block / sub-block may be the feed-forward sub-block 503 of a decoder block 104 of the transformer, and the second block / sub-block may be the self-attention sub-block 501 of the next decoder block 104 in the decoder stack 103 of the transformer or the final layers block 107 of the transformer.

[0134] During a generating round of prediction (e.g., the (j+1) -th round as described above) , the first block / sub-block may receive a hidden state vector h or a hidden state matrix M as input for processing. The first block / sub-block may process the input and may output the processing result, which may be an updated version of the vector h (i.e., updated vector h) or an updated version of the matrix M (i.e., updated matrix M) . The first block / sub-block may send the processing result, i.e., the updated vector h or the updated matrix M, to the second block / sub-block for processing. The matrix M includes the vector h, and likewise the updated matrix M includes the updated vector h. When it is said that the first block / sub-block receives h, it may be implied that the first block / sub-block receives only the vector h. When it is said that the first block / sub-block sends the updated vector h, it may be implied that the first block / sub-block sends only the updated vector h.

[0135] The first NE and the second NE may communicate to support the sending of the processing result from the first block / sub-block to the second block / sub-block. In other words, the first NE will send the updated vector h or the updated matrix M to the second NE. To minimize the associated communication cost, the first block / sub-block may be configured to (de) activate caching or filtering.

[0136] There are two types of filtering: ingress filtering and egress filtering. Each type of filtering may be applied to different entities, as described in relation to FIGs. 5A and 5B. When filtering is applied to the input of the first block / sub-block, it may be referred to as ingress filtering. When filtering is applied to the output of the first block / sub-block, it may be referred to as egress filtering. The filtering may cause a hidden state vector to be obtained from a hidden state matrix. The hidden state matrix may be included in the data (i.e., the input data in the case of ingress filtering, and the output data in the case of egress filtering) that the filtering is applied to.

[0137] Hence, ingress filtering may be performed to lower computation overhead within the first block / sub-block, while egress filtering can be performed to lower communication overhead between the first component and the second component.

[0138] · When the first block / sub-block is a self-attention sub-block 501, as shown in FIG. 5A or 5B, ingress filtering may encompass the operations of the initial filter 505, and the egress filtering may encompass the operations of the first filter 506.

[0139] · When the first block / sub-block is a cross-attention sub-block 502, as shown in FIG. 5A, ingress filtering may be related to the operations of the third filter 515, and the egress filtering may encompass the operations of the second filter 513.

[0140] · When the first block / sub-block is a feed-forward sub-block 503, as shown in FIGs. 5A and 5B, ingress filtering may encompass the operations of the fourth filter 519, and the egress filtering may encompass the operations of the fifth filter 521.

[0141] Egress filtering, when active within the first block / sub-block, may be applied to the processing result of the first block / sub-block before the processing result is provided to the second block / sub-block. When egress filtering is inactive, the first block / sub-block may send the processing result to the second block / sub-block, regardless of whether the processing result is the updated vector h or the updated matrix M. If the processing result is the updated vector h, the first block / sub-block may send the processing result to the second block / sub-block regardless of whether egress filtering is inactive or active. If the processing result is the updated matrix M, when egress filtering is active, the first block / sub-block may identity the updated vector h in the updated matrix M and may send the updated vector h (rather than the updated matrix M) to the second block / sub-block, thus reducing the communication overhead.

[0142] As described in relation to FIGs. 5A and 5B, caching may be performed to store compute results in each generating round of prediction and to enable reconstruction of the hidden state matrix in subsequent generating round of prediction. In embodiments, there may be two types of caching: ingress caching and egress caching.

[0143] When the first block / sub-block is a self-attention sub-block 501, ingress caching (i.e., operation of the first cache 507 or the second cache 508, as described in relation to FIG. 5A) may be available in the first block / sub-block. Ingress caching may be active if the first block / sub-block receives the hidden state vector h rather than the hidden state matrix M for the current generating round as input. This may be because the hidden state matrix M may be needed for the processing performed by the first block / sub-block. When ingress caching is active, the first block / sub-block may cache the hidden state vector h and construct the hidden state matrix M using the hidden state vector h and hidden state vectors cached in previous generating rounds. The first block / sub-block may process the hidden state matrix M, and the processing result therefore may be the updated matrix M. When ingress caching is inactive, the first block / sub-block may not cache any hidden state vectors and, if the hidden state matrix M is needed for the first block processing, may have to receive the hidden state matrix M in whole.

[0144] Egress caching may be active if the processing result of the first block / sub-block is the updated vector h rather than the updated matrix M for the current generating round and if the updated matrix M is needed by the second block / sub-block. When egress caching is active, the first block / sub-block may cache the updated vector h and construct the updated matrix M using the updated vector h and updated vectors cached in previous generating rounds. The first block / sub-block may output the updated matrix M to the second block / sub-block. When egress caching is inactive, the first block / sub-block may not cache any updated vectors and, if the updated matrix M is needed for the second block, may have to output the updated matrix M in whole.

[0145] The above description relating to caching may apply to the second block / sub-block, wherein the hidden state vector h or the hidden state matrix M received by the second block / sub-block may be the updated vector h and the updated matrix M that followed from the processing performed by the first block / sub-block. If the second NE has sufficient caching resources, the second block / sub-block may be configured to activate ingress caching. Otherwise, the second block / sub-block may be configured to deactivate the ingress caching. The first block / sub-block may be configured to activate egress filtering to reduce communication overhead when ingress caching is active in the second block / sub-block. The first block / sub-block may be configured to deactivate egress filtering or activate egress caching to ensure information sufficiency (i.e., provide the updated hidden state matrix M instead of the update hidden state vector h to the second block / sub-block when ingress caching is inactive in the second block / sub-block) . In other words, the egress caching of the first block / sub-block and the ingress caching of the second block / sub-block may provide the same functionality and may not be active at the same time, i.e., at most one of the egress caching of the first block / sub-block and the ingress caching of the second block / sub-block may be configured to be active.

[0146] If the first block / sub-block is not a sub-block of a decoder block 104, the first block / sub-block may still implement the filtering or caching functionality (filtering is to reduce a hidden state matrix to a hidden state vector, and caching is to store computation results in each generate round of prediction and enable reconstructing of a hidden state matrix based on the cached data in subsequent generating rounds of prediction) and may be configured to activate or deactivate filtering (ingress filtering or egress filtering) or caching (ingress caching or egress caching) , following the same principle as described above. The first block / sub-block may then perform or not perform the filtering or caching as configured.

[0147] It can be seen that the (de) activation of caching and / or filtering in the first block / sub-block and the second block / sub-block may be coordinated in order to reduce communication overhead and respect availability or sufficiency of caching resources.

[0148] The coordination can be performed through communication between the first NE and the second NE, as described below. The (de) activaiton of a cache and / or filter can further be done in accordance with respective target activation states for that cache and / or filter as defined by a particular configuration for the component including that cache and / or filter.

[0149] In some embodiments, the second NE may send a notification to the first NE, with the notification indicating whether ingress caching is active or inactive in the second block / sub-block (or in other words, whether the updated hidden state vector h or the updated hidden state matrix M is expected from the first NE) . According to the notification, the first NE may configure the first block / sub-block to (de) activate caching and / or filtering. For example, if ingress caching is active in the second block / sub-block, the first NE may configure the first block / sub-block to activate egress filtering. If ingress caching is inactive in the second block / sub-block, the first NE may configure the first block / sub-block to deactivate egress filtering, and if the first block / sub-block receives the hidden state vector h (rather than the hidden state matrix M) as input, the first NE may further configure the first block / sub-block to activate egress caching.

[0150] In some embodiments, the first NE may send a notification to the second NE, with the notification indicating whether the updated hidden state vector h or the updated hidden state matrix M is to be sent from the first NE to the second NE. According to the notification, the second NE may configure the second block / sub-block to (de) activate ingress caching. For example, if the notification indicates that the updated hidden state vector h will be sent to the second NE, the second NE may configure the second block / sub-block to activate ingress caching. If the notification indicates that the updated hidden state matrix M will be sent to the second NE, the second NE may configure the second block / sub-block to deactivate ingress caching.

[0151] In some embodiments, the coordination may be performed by a network controller, as described below. The network controller may belong to the network coupling the first NE to the second NE.

[0152] If the second NE does not have sufficient caching resources, the second NE may be configured not to perform the ingress caching (to save the caching resources) . In this case, the first NE may be configured to send the entire hidden state matrix to the second NE if the hidden state matrix is needed for the processing at the second block / sub-block (which may thus result in a higher communication cost) . In order to send the entire hidden state matrix, the first NE may need to be configured to perform egress caching (for constructing the hidden state matrix) . In this case, the first NE may be configured not to perform the egress filtering.

[0153] The network controller may make configuration decisions for the first block / sub-block and the second block / sub-block according to information about the conditions of the network (e.g., throughput, delay, available bandwidth) between the first NE and the second NE as well as information about the availability or sufficiency of caching resources (e.g., whether the memory is sufficient for storing the hidden state vector and constructing the hidden state matrix) and / or computational capacity at the first NE and / or second NE (e.g., whether the computational power is sufficient for performing the one or more prediction operations based on the hidden state matrix) . In other words, the network conditions (i.e., the network state) may identify a communication capacity for the network. In embodiments, the information about the conditions of the network, the availability of caching resources, and / or computational capacity may be provided through a respective status indication. The network controller may receive the information about network conditions (directly or indirectly) from a first network function (NF) that monitors the status of the network, and may receive the information about the availability or sufficiency of caching resources (directly or indirectly) from the first NE and the second NE, or (directly or indirectly) from a second NF that monitors the status of the first NE and the second NE. In some embodiments, the first NF and the second NF may be the same NF. In some embodiments, the first NF, or the second NF or both of them may be implemented by the network controller. Each network function may send information indicating the network conditions to the network controller.

[0154] The network controller may send configuration information indicating configuration decisions related to the first NE (or the second NE) to the first NE (or the second NE) . The configuration information may describe or indicate whether to activate or deactivate ingress caching, egress caching, ingress filtering, and / or egress filtering (this information may be referred to as target activation states) . The first NE (or the second NE) may configure the first block / sub-block (or the second block / sub-block) according to the configuration information. If the configuration information describes or indicates to activate ingress caching (and more specifically, which one of the first cache 507 and the second cache 508 or both of them) , egress caching, ingress filtering, and / or egress filtering, the first NE (or the second NE) may accordingly configure the first block / sub-block (or the second block / sub-block) to activate ingress caching (and more specifically, which one of the first cache 507 and the second cache 508 or both of them) , egress caching, ingress filtering, and / or egress filtering. If the configuration information describes or indicates to deactivate ingress caching, egress caching, ingress filtering, and / or egress filtering, the first NE (or the second NE) may accordingly configure the first block / sub-block (or the second block / sub-block) to deactivate ingress caching, egress caching, ingress filtering, and / or egress filtering. In other words, the configurations of each NE may be coordinated such that the expected output (i.e., a hidden state matrix or vector) from one NE may agree with the expected input (i.e., a hidden state matrix or vector) for the other NE.

[0155] In some embodiments, the coordination may be done by one of or both the first NE and the second NE.

[0156] In some embodiments, the (de) activation of egress caching and filtering of the first component and ingress caching or filtering of the second component may consider jointly several factors, including the availability of caching resources at the first NE and / or the second NE, computational capacity for the first NE and / or the second NE, and / or the network conditions for communications between the first NE and second NE. Such factors may be provided through status indications. For example, a network controller may consider one or more of these factors when providing configuration information to the first NE and / or the second NE. Alternatively, the first NE and the second NE may negotiate their respective configurations in accordance with one or more of those factors. In some embodiments, a pre-determined or adaptive network policy may prioritize one factor over another. In some embodiments, the coordination may balance one or more of the factors according to a pre-determined weighting scheme.

[0157] When a device (e.g., a UE) uses a transform for inferencing or prediction, the device may provide an input sequence to the transformer, and the transformer may generate a prediction sequence based on the input sequence and return the prediction sequence to the device. In some applications, where data privacy is a concern (e.g., when the input sequence and the prediction sequence comprise sensitive information) , the input sequence and the prediction sequence may not be transmitted in the network as plain text. Thus, a transformer may be split into two components, a device-side component and a network-side component, and may be executed distributively, between the device and the network, with the device-side component on the device and network-side component in the network, as described above.

[0158] The splitting may, for example, be done according to the dotted square 111 in FIGs. 1A and 1B. More specifically, the network-side component may include the blocks or sub-blocks of the transformer that are enclosed by the dotted square 111: a part of the first decoder block 104 D1, the decoder blocks 104 D2, …, Dt-1, and a part of the last decoder block 104 Dt. The part of the D1 comprises the feed-forward sub-block 503 of the D1. In some embodiments, the part of the decoder block 104 D1 may comprise the cross-attention sub-block 502 of that block. The part of the last decoder block 104 Dt may comprise the self-attention sub-block 501 of that block. In some embodiments, the part of the decoder block 104 Dt may further include the cross-attention sub-block 502 of that block. The device-side component may include the remaining part of the decoder block 104 D1, the remaining part of the decoder block Dt, and all the other remaining blocks of the transformer that are not enclosed by the dotted square 111. In some embodiments, the remaining part of the decoder block 104 D1 and any preceding remaining blocks may be referred to as belonging to a first component of the transformer model, while the remaining part of the decoder block Dt and all the other successive remaining blocks may be referred to as belonging to a third component of the transformer model. In these embodiments, the network-side component may be referred to as a second component of the transformer model.

[0159] This method for distributed execution of the transformer may ensure that the input sequence and the prediction sequence are not communicated between the device and the network as plain text. The information communicated between the device (i.e., the device-side component) and the network (i.e., the network-side component) may comprise intermediate results of the inferencing / prediction (in the form of a hidden state matrix or a hidden state vector) , from which the input sequence or the prediction sequence cannot be derived. The network-side component may be executed on a single NE in the network, or may be further split into multiple network-side components and executed on multiple NEs, as described elsewhere in this disclosure. As described above in relation to the FIGs. 5A and 5B, the device executing the device-side component of the transformer or a NE executing a network-side component of the transformer may be configured to (de) activate caching and / or filtering in a block / sub-block of the transformer in that component.

[0160] In some embodiments, the transformer may be split between the top or last decoder block 104 Dt of a decoder stack 103 and the final layers block 107. In these embodiments, egress filtering may be active in the last decoder block 104 Dt, such as at a fifth filter 521 of a respective feed forward sub-block 503, and ingress caching may be active in the final layers block 107. More specifically, when the processing result of the last decoder block 104 Dt is an updated matrix M, egress filtering may be active such that the processing result may be sent as an updated vector h to the final layers block 107, where ingress caching may be performed to reconstruct the updated matrix M for generation of the output sequence. As described hereinabove, this may be done to reduce communication overhead.

[0161] In some embodiments, the transformer may be split between the positional embedding block 106 and the first decoder block 104 D1 of a decoder stack 103. In these embodiments, egress filtering may be active in the positional embedding block 106 and ingress caching may be active in the first decoder block 104 D1, such as at a first cache 507 of a respective self-attention sub-block 501. More specifically, egress filtering may be active in the positional embedding block 106 such that its output may be sent as a hidden matrix vector h to the first decoder block 104 D1, where ingress caching may be performed, to reconstruct the updated matrix M for processing. As described hereinabove, this may be done to reduce communication overhead.

[0162] A person skilled in the art will appreciate that coordination of filtering and / or caching between two network entities executing a split transformer, as described hereinabove, may be applied to embodiments where the transformer is split between the top or last decoder block 104 Dt of a decoder stack 103 and the final layers block 107, and / or between the positional embedding block 106 and the first decoder block 104 D1 of a decoder stack 103

[0163] The present disclosure provides a way of splitting a decoder block 104 of a transformer into sub-blocks (i.e., self-attention sub-block 501, cross-attention sub-block 502, feed-forward sub-block 503) , each of which may be hosted and run on a network entity. In particular, a network-side component of the transformer may be configured to include: a part of a first decoder block 104 D1, decoder blocks 104 D2, …, Dt-1, and a part of a last decoder block 104 Dt. These blocks may be executed in the network, on one server or distributively on multiple servers. In addition, a device-side component may include the remaining blocks of the transformer and may be executed on a device. This particular arrangement may protect data privacy when the transformer is executed for inferencing. The present disclosure further provides caching or filtering operations in a sub-block of a decoder block 104 of a transformer. It still further provides a configuration for performing the caching or filtering in a sub-block of a decoder block 104 of a transformer. For example, a network controller may send a message to a network entity, with the message indicating whether to (de) activate the caching or filtering in the sub-block. Alternatively, two network entities may communicate to determine whether to (de) activate caching or filtering in their respective sub-blocks.

[0164] Embodiments of the present disclosure may be implemented using electronics hardware, software, or a combination thereof. Some embodiments may be implemented by one or multiple computer processors executing program instructions stored in memory. Some embodiments may be implemented partially or fully in hardware, for example, using one or more field programmable gate arrays (FPGAs) or application specific integrated circuits (ASICs) to rapidly perform processing operations.

[0165] It will be appreciated that, although specific embodiments of the technology have been described herein for purposes of illustration, various modifications may be made without departing from the scope of the technology. The specification and drawings are, accordingly, to be regarded simply as an illustration of the invention as defined by the appended claims, and are contemplated to cover any and all modifications, variations, combinations or equivalents that fall within the scope of the present invention. In particular, it is within the scope of the technology to provide a computer program product or program element, or a program storage or memory device such as a magnetic or optical wire, tape or disc, or the like, for storing signals readable by a machine, for controlling the operation of a computer according to the method of the technology and / or to structure some or all of its components in accordance with the system of the technology.

[0166] Acts associated with the method described herein may be implemented as coded instructions in a computer program product. In other words, the computer program product may be a computer-readable medium upon which software code may be recorded to execute the method when the computer program product is loaded into memory and executed on the microprocessor of the wireless communication device.

[0167] Further, each operation of the method may be executed on any computing device, such as a personal computer, server, PDA, or the like and pursuant to one or more, or a part of one or more, program elements, modules or objects generated from any programming language, such as C++, Java, or the like. In addition, each operation, or a file or object or the like implementing each said operation, may be executed by special purpose hardware or a circuit module designed for that purpose.

[0168] Embodiments of the present disclosure may be implemented by using hardware only or by using software and a necessary universal hardware platform. Based on such understandings, the technical solution of the present disclosure may be embodied in the form of a software product. The software product may be stored in a non-volatile or non-transitory storage medium, which may be a compact disk read-only memory (CD-ROM) , USB flash disk, or a removable hard disk. The software product includes a number of instructions that enable a computer device (personal computer, server, or network device) to execute the methods provided in the embodiments of the present disclosure. For example, such an execution may correspond to a simulation of the logical operations as described herein. The software product may additionally or alternatively include a number of instructions that enable a computer device to execute operations for configuring or programming a digital logic apparatus in accordance with embodiments of the present disclosure.

[0169] The word “a” or “an” when used in conjunction with the term “comprising” or “including” in the claims and / or the specification may mean “one” , but it is also consistent with the meaning of “one or more” , “at least one” , and “one or more than one” unless the content clearly dictates otherwise. Similarly, the word “another” may mean at least a second or more unless the content clearly dictates otherwise. The phrase "at least one" means one or more, and "a plurality of" means two or more. In addition, "and / or" describes an association relationship of associated objects, and indicates that there may be three relationships. For example, A and / or B may indicate cases including “only A” , “both A and B” , and “only B” , where A and B may be singular or plural. The character " / " generally indicates that the associated objects are in an OR relationship. "At least one of the following items" or a similar expression thereof refers to any combination of these items, including any combination of a single item or a plurality of items. For example, “at least one of a, b, or c” may represent “a” , “b” , “c” , “a and b” , “a and c” , “b and c” , or “a, b and c” , where a, b, and c may be a single or multiple form.

[0170] The terms “coupled” , “coupling” or “connected” as used herein can have several different meanings depending on the context in which these terms are used. For example, as used herein, the terms coupled, coupling, or connected can indicate that two elements or devices are directly connected to one another or connected to one another through one or more intermediate elements or devices via a mechanical element depending on the particular context. The term “and / or” herein when used in association with a list of items means any one or more of the items comprising that list.

[0171] Although a combination of features is shown in the illustrated embodiments, not all of them need to be combined to realize the benefits of various embodiments of this disclosure. In other words, a system or method designed according to an embodiment of this disclosure will not necessarily include all features shown in any one of the Figures or all portions schematically shown in the Figures. Moreover, selected features of one example embodiment may be combined with selected features of other example embodiments.

[0172] Although the present invention has been described with reference to specific features and embodiments thereof, it is evident that various modifications and combinations can be made thereto without departing from the invention. The specification and drawings are, accordingly, to be regarded simply as an illustration of the invention as defined by the appended claims, and are contemplated to cover any and all modifications, variations, combinations or equivalents that fall within the scope of the present invention.

Claims

A method for supporting execution of a transformer model split into a first component at a first network entity (NE) and a second component at a second NE connected to the first NE through a communications network, the method comprising, at the first NE, for a generating round of prediction:generating, by one or more prediction operations of the first component of the transformer model, a result depending from data input to the transformer model, the result defining either a hidden state matrix or a hidden state vector;executing:a first set of actions when the result defines the hidden state vector and when a cache of the first component is active, the first set of actions including:constructing the hidden state matrix from the hidden state vector and one or more previous hidden state vectors each stored at the cache and corresponding to a respective previous generating round of prediction,andupdating the result to define the hidden state matrix;ora second set of actions when the result defines the hidden state matrix and when a filter of the first component is active, the second set of actions including:obtaining, by the filter, the hidden state vector from the result,andupdating the result to define the hidden state vector;andsending, through the communications network, the result to the second component of the transformer model at the second NE.The method of claim 1 further comprising, at the first NE:obtaining a configuration defining a respective target activation state for each of the cache of the first component and the filter of the first component.The method of claim 2 further comprising, at the first NE:performing, in accordance with the respective target activation state for the cache of the first component, one of:activating the cache of the first component to cause the cache to become active;anddeactivating the cache of the first component to cause the cache to become inactive.The method of any one of claims 2 and 3 further comprising, at the first NE:performing, in accordance with the respective target activation state for the filter of the first component, one of:activating the filter of the first component to cause the filter to become active;anddeactivating the filter of the first component to cause the filter to become inactive.The method of any one of claims 2 to 4 wherein obtaining the configuration includes:determining the configuration in accordance with at least one of:a respective state of the first NE indicating at least one of a respective availability of caching resources and a respective computational capacity, the respective availability of caching resources indicating a respective sufficiency for caching the hidden state vector at the first NE, the respective computational capacity indicating a respective sufficiency for processing the hidden state matrix at the first NE;a respective state of the second NE indicating at least one of a respective availability of caching resources and a respective computational capacity, the respective availability of caching resources indicating a respective sufficiency for caching the hidden state vector at the second NE, the respective computational capacity indicating a respective sufficiency for processing the hidden state matrix at the second NE;anda network state indicating a communication capacity of the communications network.The method of any one of claims 2 to 5 wherein:the first NE is connected to a network controller through the communications network;andobtaining the configuration includes:receiving, from the network controller, the configuration.The method of any one of claims 2 to 5 wherein obtaining the configuration includes:negotiating, with the second NE, the configuration.The method of any one of claims 1 to 7 further comprising, at the first NE:sending, through the communications network, a message identifying the result as being either the hidden state matrix or the hidden state vector.The method of any one of claims 1 to 8 wherein the first set of actions further includes:storing, at the cache of the first component, the hidden state vector.A method for supporting execution of a transformer model split into a first component at a first network entity (NE) and a second component at a second NE connected to the first NE through a communications network, the method comprising, at the second NE, for a generating round of prediction:receiving, from the first component of the transformer model at the first NE and through the communications network, a result depending from data input to the transformer model and defining either a hidden state vector or a hidden state matrix;executing:a first set of actions when the result defines the hidden state vector and when a cache of the second component is activated, the first set of actions including:constructing the hidden state matrix from the hidden state vector and one or more previous hidden state vectors each stored at the cache and corresponding to a respective previous generating round of prediction,andupdating the result to define the hidden state matrix;ora second set of actions when the result defines the hidden state matrix and when a filter of the second component is activated, the second set of actions including:obtaining, by the filter, the hidden state vector from the result,andupdating the result to define the hidden state vector;andprocessing, by one or more prediction operations of the second component of the transformer model, the result to produce an updated result.The method of claim 10 further comprising, at the second NE:obtaining a configuration defining a respective target activation state for each of the cache of the second component and the filter of the second component.The method of claim 11 further comprising, at the second NE:performing, in accordance with the respective target activation state for the cache of the second component, one of:activating the cache of the second component to cause the cache to become active;anddeactivating the cache of the second component to cause the cache to become inactive.The method of any one of claims 11 and 12 further comprising, at the second NE:performing, in accordance with the respective target activation state for the filter of the second component, one of:activating the filter of the second component to cause the filter to become active;anddeactivating the filter of the second component to cause the filter to become inactive.The method of claim any one of claims 11 to 13 wherein obtaining the configuration includes:determining the configuration in accordance with at least one of:a respective state of the first NE indicating at least one of a respective availability of caching resources and a respective computational capacity, the respective availability of caching resources indicating a respective sufficiency for caching the hidden state vector at the first NE, the respective computational capacity indicating a respective sufficiency for processing the hidden state matrix at the first NE;a respective state of the second NE indicating at least one of a respective availability of caching resources and a respective computational capacity, the respective availability of caching resources indicating a respective sufficiency for caching the hidden state vector at the second NE, the respective computational capacity indicating a respective sufficiency for processing the hidden state matrix at the second NE;anda network state indicating a communication capacity of the communications network.The method of any one of claims 11 to 14 wherein:the second NE is connected to a network controller through the communications network;andobtaining the configuration includes:receiving, from the network controller, the configuration.The method of any one of claims 11 to 14 wherein:the method further comprises, at the second NE:receiving, through the communications network, a message identifying the result as being either the hidden state matrix or the hidden state vector;andobtaining the configuration includes:determining, in accordance with the message, the configuration.The method of any one of claims 11 to 14 wherein obtaining the configuration includes:negotiating, with the first NE, the configuration.The method of any one of claims 10 to 17 wherein the first set of actions further includes:storing, at the cache of the second component, the hidden state vector.The method of claim 10 wherein:executing the second set of actions when the result defines the hidden state matrix and when the filter of the second component is activated includes:executing the second set of actions when the result defines the hidden state matrix, when the filter of the second component is activated, and when a further cache of the second component is activated;andthe second set of actions further includes:processing, by a further prediction operation of the second component of the transformer model, the result to produce an intermediate result,constructing an intermediate hidden state matrix from the intermediate result and one or more previous intermediate hidden state vectors each stored at the further cache and corresponding to a respective previous generating round of prediction,andupdating the result to define the intermediate hidden state matrix.The method of any one of claims 10 to 18 wherein processing, by the one or more prediction operations of the second component of the transformer model, the result to produce the updated result includes:calculating, when the result defines the hidden state matrix, a key matrix, a value matrix, and a query matrix in accordance with the updated hidden state matrix and through at least one prediction operation of the one or more prediction operations.The method of any one of claims 10 to 18 wherein processing, by the one or more prediction operations of the second component of the transformer model, the result to produce the updated result includes:executing, when the result defines the hidden state vector, a third set of actions including:calculating, in accordance with the hidden state vector, a key vector, a value vector, and a query vector through at least one prediction operation of the one or more prediction operations,storing, at a further cache of the of the second component of the transformer model, the key vector, the value vector, and the query vector,andconstructing:a key matrix from the key vector and one or more previous key vectors each stored at the further cache and corresponding to a respective previous generating round of prediction,a value matrix from the value vector and one or more previous value vectors each stored at the further cache and corresponding to a respective previous generating round of prediction,anda query matrix from the query vector and one or more previous query vectors each stored at the further cache and corresponding to a respective previous generating round of prediction.The method of claim 19 wherein processing, by the further prediction operation of the second component of the transformer model, the result to produce the intermediate result includes:executing, when the result defines the hidden state vector, a third set of actions including:calculating, in accordance with the hidden state vector, a key vector, a value vector, and a query vector through at least one prediction operation of the one or more prediction operations,storing, at a further cache of the of the second component of the transformer model, the key vector, the value vector, and the query vector,andconstructing:a key matrix from the key vector and one or more previous key vectors each stored at the further cache and corresponding to a respective previous generating round of prediction,a value matrix from the value vector and one or more previous value vectors each stored at the further cache and corresponding to a respective previous generating round of prediction,anda query matrix from the query vector and one or more previous query vectors each stored at the further cache and corresponding to a respective previous generating round of prediction.The method of claim 19 further comprising, at the second NE:obtaining a configuration defining a respective target activation state for the further cache of the second component.The method of claim 23 further comprising, at the second NE:performing, in accordance with the respective target activation state for the further cache of the second component, one of:activating the further cache of the second component to cause the further cache to become active;anddeactivating the further cache of the second component to cause the further cache to become inactive.A method for supporting execution of a transformer model split into respective components at a first network entity (NE) and a second NE each connected to a network controller through a communications network, the method comprising, at the network controller:obtaining a status indication for the second NE indicating an availability of caching resources at the second NE, the availability of caching resources at the second NE indicating a sufficiency of the caching resources at the second NE for caching one or more hidden state vectors;generating, in accordance with the status indication for the second NE, a configuration for the respective component of the transformer model at the first NE, the configuration defining a respective target activation state for each of at least one of a cache and a filter of the respective component at the first NE;andsending, to the first NE, the configuration.The method of claim 25 wherein the status indication for the second NE further indicates a computational capacity at the second NE, the computational capacity at the second NE indicating a sufficiency for processing a hidden state matrix at the second NE.The method of claim 25 wherein obtaining the status indication for the second NE includes:receiving, from a network function, the status indication for the second NE.The method of claim 26 wherein:the method further comprises, at the network controller:obtaining a status indication for the first NE indicating an availability of caching resources at the first NE and a computational capacity at the first NE, the availability of caching resources at the first NE indicating a sufficiency of the caching resources at the first NE for caching the one or more hidden state vectors, the computational capacity at the first NE indicating a sufficiency for processing the hidden state matrix at the first NE;andgenerating, in accordance with the status indication for the second NE, the configuration for the respective component of the transformer model at the first NE includes:generating, in accordance with each of the status indications for the first NE and the second NE, the configuration for the respective component of the transformer model at the first NE.The method of claim 28 wherein obtaining the status indication for the first NE includes:receiving, from a network function, the status indication for the first NE.The method of claim 28 wherein:the method further comprises, at the network controller:obtaining a status indication for the communications network indicating a communication capacity, the communication capacity indicating a sufficiency of the communications network for transmitting the hidden state matrix from the first NE to the second NE;andgenerating, in accordance with the status indication for the second NE, the configuration for the respective component of the transformer model at the first NE includes:generating, in accordance with each of the status indications for the first NE, the second NE, and the communications network, the configuration for the respective component of the transformer model at the first NE.The method of claim 30, wherein obtaining the status indication for the communications network includes:receiving, from a network function, the status indication for the communications network.The method of claim 25, wherein generating, in accordance with the status indication for the second NE, the configuration for the respective component of the transformer model at the first NE includes:generating the configuration for the respective component of the transformer model at the first NE to define an expected output in agreement with an expected input defined by a further configuration for the respective component of the transformer model at the second NE.The method of claim 25, wherein generating, in accordance with the status indication for the second NE, the configuration for the respective component of the transformer model at the first NE includes:generating the configuration for the respective component of the transformer model at the first NE to define an expected input in agreement with an expected output defined by a further configuration for the respective component of the transformer model at the second NE.A network system comprising:a first network entity (NE) having a first component of a transformer model, the first component configured to generate, by one or more prediction operations for a generating round of prediction, a result depending from data input to the transformer model, the result defining either a hidden state vector or a hidden state matrix, the first component including at least one of a first filter and a first cache each being either active or inactive, the first filter configured to obtain, from the hidden state matrix, the hidden state vector when the first filter is active and when the result defines the hidden state matrix, the first cache configured to store the hidden state vector when the first cache is active and when the result defines the hidden state vector;anda second NE connected to the first NE and having a second component of the transformer model, the second component configured to receive the result from the first component of the transformer model at the first NE, the second component including at least one of a second filter and a second cache each being either active or inactive, the second filter configured to obtain, from the hidden state matrix, the hidden state vector when the second filter is active and when the result defines the hidden state matrix, the second cache configured to store the hidden state vector when the second cache is active and when the result defines the hidden state vector, the second component further configured to process, by one or more further prediction operations for the generating round of prediction, the result to produce an updated result.The network system of claim 34 wherein:the first component of the transformer model is further configured to:when the first filter is active, update the result to define the hidden state vector,andwhen the first cache is active, construct the hidden state matrix from the hidden state vector and one or more previous hidden state vectors each stored at the first cache and update the result to define the hidden state matrix;andthe second component of the transformer model is further configured to:when the second filter is active, update the result to define the hidden state vector,andwhen the second cache is active, construct the hidden state matrix from the hidden state vector and one or more previous hidden state vectors each stored at the second cache and update the result to define the hidden state matrix.The network system of any one of claims 34 and 35 wherein:the transformer model includes a plurality of blocks;the first component of the transformer model includes a first set of blocks of the plurality of blocks;andthe second component of the transformer model includes a second set of blocks of the plurality of blocks, wherein the second set of blocks is different from the first set of blocks.The network system of claim 36 wherein:the first set of blocks includes one or more decoder blocks;andthe second set of blocks includes one or more further decoder blocks.The network system of any one of claims 34 and 35 wherein:the transformer model includes a plurality of blocks, at least one block of the plurality of blocks including a plurality of sub-blocks;the first component of the transformer model includes at least one sub-block of the plurality of sub-blocks of the at least one block;andthe second component of the transformer model includes a different at least one sub-block of the plurality of sub-blocks of the at least one block.The network system of claim 38 wherein:the at least one block includes a decoder block having a self-attention sub-block and a cross-attention sub-block;the at least one sub-block includes the self-attention sub-block;andthe different at least one sub-block includes the cross-attention sub-block.The network system of claim 38 wherein:the at least one block includes a decoder block having a cross-attention sub-block and a feed-forward sub-block;the at least one sub-block includes the cross-attention sub-block;andthe different at least one sub-block includes the feed-forward sub-block.The network system of claim 38 wherein:the at least one block includes a decoder block having a self-attention sub-block and a feed-forward sub-block;the at least one sub-block includes the self-attention sub-block;andthe different at least one sub-block includes the feed-forward sub-block.The network system of any one of claims 34 to 41 wherein:the first NE further has a third component of the transformer model, the third component configured to receive the updated result from the second component of the transformer model at the second NE, the third component including at least one of a third filter and a third cache each being either active or inactive, the third filter configured to obtain, from the hidden state matrix, the hidden state vector when the third filter is active and when the result defines the hidden state matrix, the third cache configured to store the hidden state vector when the third cache is active and when the result defines the hidden state vector, the third component further configured to process, by one or more further prediction operations for the generating round of prediction, the updated result to produce a further updated result.The network system of claim 42 wherein:the third component of the transformer model is further configured to:when the third cache is active, construct the hidden state matrix from the hidden state vector and one or more previous hidden state vectors each stored at the third cache and update the result to define the hidden state matrix.The network system of claim 34 wherein:the first NE is a user equipment,andthe second NE is a server.The network system of any one of claims 34 to 44 whereinthe network system further comprises:a network controller configured to generate a configuration defining a respective target activation state for each of the at least one of the first cache and the first filter;andthe first component of the transformer model at the first NE is further configured to:receive, from the network controller, the configuration;andactivate, in accordance with the configuration, at least one of the first cache and the first filter.The network system of claim 45 wherein:the configuration further defines a respective target activation state for each the at least one of the second filter and the second cache;andthe second component of the transformer model at the second NE is further configured to:receive, from the network controller, the configuration;andactivate, in accordance with the configuration, at least one of the second filter and the second cache.The network system of claim 42 wherein:the network system further comprises:a network controller configured to generate a configuration defining a respective target activation state for each of the at least one of the third cache and the third filter;andthe third component of the transformer model at the first NE is further configured to:receive, from the network controller, the configuration;andactivate, in accordance with the configuration, at least one of the third filter and the third cache.The network system of claim 45 wherein:the network system further comprises:one or more network functions each configured to generate one or more respective status indications each indicating one of:a first availability of caching resources at the first NE,a first computational capacity at the first NE,a second availability of caching resources at the second NE,a second computation capacity at the second NE,anda communication capacity between the first NE and the second NE;andthe network controller is configured to receive each status indication from each network function and generate the configuration in accordance with at least one status indication.

Citation Information

Patent Citations

  • Coding method, decoding method and related device

    CN116647305A

  • Semantic Representations of Mathematical Expressions in a Continuous Vector Space and Generation of Different but Mathematicallly Equivalent Expressions and Applications Thereof

    US20240135148A1

  • Apparatus And Method For Data Augmentation

    US20240202462A1

  • Systems and methods for executing vertical federated learning

    WO2024087146A1