ADAPTIVE TOKEN SAMPLING
Aspects of the present application relate to adaptive token sampling, where input tokens are scored and adaptively sampled to yield a set of significant tokens for subsequent processing by a machine learning (ML) model. In examples, the set of significant tokens is identified based on attention values for the input tokens, as may be generated by a transformer block (e.g., of a multimodal adapter or of the ML model). Thus, the adaptive token sampler itself need not be trained. As a result, the disclosed aspects omit tokens having reduced significance for a given input prompt to the ML model, while retaining tokens having comparatively greater significance. Thus, examples of the present disclosure may result in improved computational resource efficiency for a comparable level of model output quality.
Latest Microsoft Patents:
Resource utilization of a machine learning (ML) model may be due, at least in part, to a number of input tokens that are processed by the ML model, such that a greater number of input tokens results in higher computational resource utilization. Additionally, these and other issues may be most apparent for edge devices that perform ML processing, as such devices may have limited memory and/or processing resources, among other examples.
It is with respect to these and other general considerations that embodiments have been described. Also, although relatively specific problems have been discussed, it should be understood that the embodiments should not be limited to solving the specific problems identified in the background.
SUMMARYAspects of the present application relate to adaptive token sampling, where input tokens are scored and adaptively sampled to yield a set of significant tokens for subsequent processing by a machine learning (ML) model. In examples, the set of significant tokens is identified based on attention values for the input tokens, as may be generated by a transformer block (e.g., of a multimodal adapter or of the ML model). Thus, the adaptive token sampler itself need not be trained.
As a result, the disclosed aspects omit tokens having comparatively reduced significance for a given input prompt to the ML model, while retaining tokens having comparatively greater significance. Thus, examples of the present disclosure may result in improved computational resource efficiency (e.g., due to the reduced number of input tokens) for a comparable level of model output quality (e.g., since tokens that are comparatively more significant are retained over those having decreased significance, thereby providing higher-quality context for ML processing).
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
Non-limiting and non-exhaustive examples are described with reference to the following Figures.
In the following detailed description, references are made to the accompanying drawings that form a part hereof, and in which are shown by way of illustrations specific embodiments or examples. These aspects may be combined, other aspects may be utilized, and structural changes may be made without departing from the present disclosure. Embodiments may be practiced as methods, systems or devices. Accordingly, embodiments may take the form of a hardware implementation, an entirely software implementation, or an implementation combining software and hardware aspects. The following detailed description is therefore not to be taken in a limiting sense, and the scope of the present disclosure is defined by the appended claims and their equivalents.
In examples, a machine learning (ML) model processes a set of input tokens to generate model output accordingly. In examples, multimodal processing by the ML model is performed according to a subset of tokens that corresponds to a prompt (e.g., text input and/or natural language input) and a subset of tokens corresponding to one or more other input types (e.g., text input, audio input, image input, and/or video input). Thus, the multimodal tokens may provide additional context for the ML model when processing the prompt tokens.
However, processing a large number of input tokens may be computationally expensive (e.g., with respect to memory and/or processor utilization), which may limit the ability of certain computing devices to perform such processing. For instance, computing resources of an edge computing device may be more restrictive as compared to those of a server computing device, thereby restricting certain processing to the server computing device versus the edge computing device.
Additionally, certain tokens may be more relevant than other input tokens, such that merely truncating the number of input tokens to reduce computational resource utilization (e.g., thereby permitting processing by an edge computing device) may have a disproportionately negative impact on model output quality, as tokens of high relevance may be inadvertently omitted and/or tokens of low relevance may be inadvertently included, among other examples.
Accordingly, aspects of the present disclosure relate to adaptive token sampling, where input tokens are scored and adaptively sampled to yield a set of significant tokens for subsequent processing by an ML model. Thus, unlike other methods (e.g., which may rely on token merging or progressive token pruning within ML layers), aspects of the present disclosure adaptively score and sample significant tokens, such that the resulting number of significant tokens may vary depending on an input prompt and/or multimodal data, among other examples.
As a result, the disclosed aspects omit tokens having reduced or limited significance to the input prompt while retaining tokens having comparatively greater significance, thereby reducing computational resource utilization while also limiting model output quality degradation that may otherwise result from a reduction in the number of input tokens. Thus, examples of the present disclosure may result in improved computational resource efficiency for a given number of input tokens and/or level of model output quality.
In an example, an adaptive token sampler according to aspects described herein is part of a multimodal adapter that processes embeddings for a variety of input token modalities. Each modality may have one or more corresponding encoders with which a respective set of embeddings is generated accordingly. A transformer block for the multimodal adapter generates attention values for the input tokens, such that the adaptive token sampler identifies a predetermined number of significant tokens based on the attention values according to aspects described herein. The significant tokens may then be provided for subsequent processing by a large language model (LLM) to generate model output based on input prompt tokens and the identified significant tokens accordingly.
Since the adaptive token sampler identifies significant tokens according to corresponding attention values (e.g., from a transformer block), the adaptive token sampler itself need not be trained. Additionally, an ML model may be trained prior to inclusion of such an adaptive token sampler (e.g., such that the model may be fine-tuned after inclusion) and/or trained with the adaptive token sampler already included, among other examples. Further, while examples are described with respect to a multimodal adapter that includes an adaptive token sampler, it will be appreciated similar aspects may be included within an LLM itself (e.g., as an early block of the LLM, for example prior to a subsequent transformer block).
As an example, multimodal input may comprise an image having a foreground in which a car and bird are present, as well as a background. Thus, resulting features and corresponding tokens may relate to the car, the bird, and the image background, among other examples. In a traditional scenario, these tokens may be provided for processing by an ML model, even in instances where the prompt relates only to the bird. By contrast, aspects of the present disclosure may generate a subset of significant multimodal tokens based on significance to the prompt. Thus, in the present example, incidence of tokens relating to the car and the image background may be reduced or such tokens may be removed entirely, such that only significant multimodal tokens relating to the bird are retained for subsequent ML processing (e.g., up to a predetermined maximum number of tokens), thereby reducing computational resource utilization while also retaining model output quality.
In operation, adaptive token sampler 124 and machine learning model 126 may together form a machine learning package 122 that is distributed to computing devices 110 for ML processing according to aspects described herein. Additional example aspects of ML package 122 are discussed below with respect to
In embodiments, the network 130 may further be communicatively coupled to one or more data stores 132. It should be appreciated that the machine learning model may be on the server 120 and/or in the data store 132 prior to deployment. At or before runtime, one or more models 126 are deployed to one or more computing devices 110. For example, a computing device 110 may request a model to be deployed and/or the server 120 may proactively deploy a model 126 to one or more computing devices 110 (e.g., based on resources and capabilities of computing devices).
Server 120 is also illustrative of a server that may be used to distribute an adaptive token sampler 124 to the different computing devices 110. The adaptive token sampler is used in conjunction with machine learning model 126 (e.g., on the devices 110) to provide improved processing efficiency at computing devices 110 according to aspects described herein. In examples, adaptive token sampler 124 need not be trained or may be used to train and/or fine-tune machine learning model 126 (e.g., using training data 128) at server 120, among other examples. As will be apparent to those skilled in the art, training and/or fine-tuning may be performed at another system (not shown) and deployed to server 120 for further deployment to computing devices 110. As a further example, machine learning model 126 is trained by server 120 or another system, such that fine-tuning is performed at computing devices 110 using adaptive token sampler 124 (e.g., thereby exhibiting reduced computational resource utilization at computing devices 110).
As will be appreciated by those skilled in the art, the server 120 comprises processor 160, memory 162, and communication interface 164. As illustrated, the server 120 further comprises one or more applications 166 for executing one or more functions, such as training the machine learning model 126, fine-tuning the machine learning model 126, and/or deploying the machine learning model 126 and/or the adaptive token sampler 124 to computing device 110, among other examples.
In embodiments wherein the server 120 is configured to generate and train machine learning model 126, the server 120 is configured to determine appropriate weight values of the model to optimize the model's output. The weights of the model are parameters that determine the strength and direction of the influence between layers in the model. For example, in neural networks, the weights are associated with connections between neurons or nodes of the model.
The computing device 110 may be, but is not limited to, a computer, a notebook, a laptop, a mobile device, a smartphone, a tablet, a portable device, a wearable device, or any other suitable computing device that is capable of performing machine learning processing using ML package 122 according to aspects described herein. For example, the computing device 110 may be an edge device or a system-on-chip. As illustrated, the computing device 110 includes a processor 170, a memory 172 and a communication interface 174. As illustrated, the computing device 110 further comprises one or more applications 176 for executing one or more functions, which, for example, may perform machine learning processing using ML package 122.
The network 130 may include any kind of computing network including, without limitation, a wired or wireless local area network (LAN), a wired or wireless wide area network (WAN), and/or the Internet.
In operation, computing device 110 may perform on-device machine learning processing, including, but not limited to, processing text, audio, and/or image input, among other examples. Such processing may be as an alternative to or in addition to ML processing performed by server 120, which may thus result in reduced latency, increased privacy, and/or improved personalization (e.g., as a result of on-device fine-tuning), among other examples.
In examples, encoder 152 processes any of a variety of input modalities to generate features therefrom. According to aspects described herein, an input modality may have one or more corresponding encoders (e.g., audio encoder 210 and/or vision encoder 212 discussed below with respect to
As illustrated, optical character recognizer 208 processes image input 204 to generate corresponding text that is processed by tokenizer 214. It will be appreciated that, in other examples, tokens for input image 204 may be generated only by vision encoder 212 or, as another example, another input (e.g., audio input 202) may similarly be processed by multiple encoders according to aspects described herein. Returning to the present example, tokenizer 214 processes prompt input 206 and recognized text from optical character recognizer 208 for input image 204, such that the resulting tokens are processed by embedding model 220 to generate text embeddings 226 accordingly.
Image input 204 is further processed by vision encoder 212 to generate corresponding features, which are thus processed by vision projector 218 to generate image embeddings 224 accordingly. Similarly, audio input 202 is processed by audio encoder 210 to generate features that are then processed by audio projector 216 to generate audio embeddings 222 based thereon. Thus, audio input 202, image input 204, and prompt input 206 are example modalities for multimodal machine learning processing, where each input modality has a corresponding encoder (e.g., audio encoder 210, vision encoder 212, and tokenizer 214, respectively).
Transformer block 228 generates an attention tensor for each of audio embeddings 222, image embeddings 224, and text embeddings 226. As an example, the attention tensor comprises attention values for multimodality input tokens (e.g., audio input 202 and image input 204), as they relate to tokens of prompt input 206.
Accordingly, adaptive token sampler 230 processes audio embeddings 222, image embeddings 224, and text embeddings 226 based on the attention tensor that was generated by transformer block 228, thereby generating a set of significant tokens therefrom. Thus, rather than processing all of audio embeddings 222, image embeddings 224, and text embeddings 226 (e.g., which would be computationally expensive) or processing a truncated set of embeddings (e.g., which may be inadvertently over- or under-inclusive for significant tokens), adaptive token sampler 230 provides a subset of significant tokens that are processed by machine learning model 232 to generate model output accordingly. Additional example aspects of the processing performed by adaptive token sampler 230 are discussed below with respect to
In examples, transformer block 228 and adaptive token sampler 230 each form part of a multimodal adapter for an LLM (e.g., which may thus enable the LLM to process one or more different and/or additional types of input modalities). As another example, while transformer block 228 and adaptive token sampler 230 are illustrated as separate from machine learning model 230, it will be appreciated that, in other examples, such aspects are instead included as part of machine learning model 232.
The below function is provided as an example with which to generate a sampling metric Sk for a given token k based on corresponding attention values. Even so, it will be appreciated that any of a variety of other functions may be used to generate a sampling metric for a given token based on an attention tensor according to aspects described herein.
Thus, according to the present example, sampling metric Sk for a given token k is generated by summing the attention values Ai,k for token k corresponding to prompt tokens Q1, . . . , QF, which is thus normalized by dividing the sum by F (e.g., the number of prompt tokens). The resulting quotient is then multiplied by the norm of the attention value for the token, Vk, to yield the corresponding sampling metric accordingly.
Accordingly, based on sampling metrics 252 for each token, inverse transform sampling 254 is used to sample a subset of significant tokens therefrom. In the present example, a cumulative distribution function is formed using sampling metrics 252, from which K points are uniformly sampled along the y-axis. As inverse transform sampling is an example statistical sampling technique, a token may be sampled multiple times in some examples. Accordingly, unique sampled indices are used, thereby identifying K′ tokens (e.g., which is thus equal to or less than K, which is the upper bound of tokens that may be sampled).
As a result of sampling significant tokens, insignificant tokens 264 are thus omitted from attention tensor A (as illustrated by reference numeral 256) to form sampled attention tensor AS (as illustrated by reference numeral 258). Accordingly, the resulting tensor AS is multiplied by corresponding values 260 (e.g., as may have been generated by audio projector 216 and/or vision protector 218 in
While example an example sampling metric and corresponding sampling technique is described, it will be appreciated that any of a variety of additional and/or alternative metric and/or sampling techniques may be used in other examples.
As illustrated, method 300 begins at operation 302, where an attention tensor is generated for a set of input tokens. Aspects of operation 302 may be similar to those discussed above with respect to reference numerals 228, 230, and 252 in
Method 300 progresses to operation 304, where a sampling metric is generated for each multimodal input token based on the attention tensor from operation 302. In examples, the sampling metric reflects a significance for a given multimodal token with respect to the prompt tokens. An example function for generating a sampling metric was discussed above with respect to reference numeral 252 of
Flow progresses to operation 306, where multimodal tokens are sampled according to the generated sampling metrics to generate a sampled attention tensor (e.g., reference numeral 258). Example sampling techniques were discussed above with respect to reference numerals 254, 256, and 258 of
At operation 308, a set of output tokens is generated by multiplying the sampled attention tensor (e.g., reference numeral 258 in
Flow then moves from operation 308 to 310, where the resulting set of significant output tokens is further processed by a large language model. Thus, as noted above, rather than processing prompt tokens in conjunction with the full set of multimodal tokens (e.g., which may be computationally expensive), method 300 thus instead yields only a subset of multimodal tokens that are comparatively more significant (e.g., in relation to the prompt tokens), thereby reducing the number of tokens that are thus subsequently processed at operation 310. As illustrated, method 300 terminates at operation 310.
The language model 402 commences its operation with the receipt of input information, such as a passage of text. The prompt includes a series of linguistic tokens. In some examples, a “token” refers to a unit of text having any granularity, such as an individual word, a word fragment produced by byte pair encoding (BPE), a character n-gram, a word fragment identified by the WordPiece or SentencePiece algorithm, etc. To facilitate explanation, assume that each token corresponds to a complete word. The principles set forth herein, however, are not limited to the processing of text information; in other examples, the language model 402 operates on any of: audio information, image information, video information, sensor information, and so on, or any combination thereof.
Next, an embedding component (not shown) maps the sequence of tokens into respective token embeddings. For example, the embedding component produces one-hot vectors that describe the tokens, and then maps the one-hot vectors into the token embeddings using a machine-trained transformation. The embedding component then adds position information (and, in some cases, segment information) to the respective token embeddings to produce position-supplemented embedding vectors 406. The position information added to each token embedding describes the embedding vector's position in the sequence of token embeddings.
The first transformer block 404 operates on the position-supplemented embedding vectors 406. In some implementations, the first transformer block 404 includes, in order, an attention component 408, a first add-and-normalize component 410, a feed-forward neural network (FFN) component 412, and a second add-and-normalize component 414.
The attention component 408 determines how much emphasis should be placed on parts of input information when interpreting other parts of the input information. As an example, the attention component 408 performs attention analysis using the following equation:
Thus, in such an example, the attention component 408 produces query information Q by multiplying the position-supplemented embedding vectors 406 by a query weighting matrix WQ. Similarly, the attention component 408 produces key information K and value information V by multiplying the position-supplemented embedding vectors 406 by a key weighting matrix WK and a value weighting matrix WV, respectively. To execute the above equation, the attention component 408 takes the product of Q with the transpose of K, and then divides the product by a scaling factor √{square root over (d)}, to produce a scaled result. The symbol d represents the dimensionality of Q and K. The attention component 408 takes the Softmax (normalized exponential function) of the scaled result, and then multiplies the result of the Softmax operation by V, to produce attention output information. In some cases, the attention component 408 is said to perform masked attention insofar as the attention component 408 masks output token information that, at any given time, has not yet been determined.
Accordingly, adaptive token sampling may be performed using the resulting attention values, where a subset of significant tokens is identified for subsequent machine learning processing according to aspects described herein. In examples, such aspects may thus be performed by a transformer block of a multimodal adapter or as part of a large language model, among other examples. Such aspects may be similar to those discussed above with respect to transformer block 228 in
Note that
The add-and-normalize component 410 includes a residual connection that combines (e.g., sums) input information fed to the attention component 408 with the output information generated by the attention component 408. The add-and-normalize component 410 then normalizes the output information generated by the residual connection, e.g., by normalizing values in the output information based on the mean and standard deviation of those values, or by performing root-mean-squared normalization. The other add-and-normalize component 414 performs the same functions as the first-mentioned add-and-normalize component 410. The FFN component 412 transforms input information to output information using a feed-forward neural network having any number of layers.
The first transformer block 404 produces output information 418. A series of other transformer block (420, . . . , 422) perform the same functions as the first transformer block 404 and produce output results of the same shape (e.g., the same dimensions), each operating on output information produced by its immediately preceding transformer block. Each transformer block uses its own level-specific set of machine-trained weights. The final transformer block 422 in the language model 402 produces final output information 424.
In some implementations, a post-processing component 426 performs post-processing operations on the final output information 424. For example, the post-processing component 426 performs a machine-trained linear transformation on the final output information 424, and processes the results of this transformation using a Softmax component (not shown). The language model 402 uses the output of the post-processing component 426 to predict the next token in the input sequence of tokens. In some applications, the language model 402 performs this task using a greedy selection approach (e.g., by selecting the token having the highest probability), or by using the beam search algorithm (e.g., by traversing a tree that expresses a search space of candidate next tokens).
In some implementations, the language model 402 operates in an auto-regressive manner, as indicated by the loop 428. To operate in this way, the language model 402 appends a predicted token to the end of the sequence of input tokens, to provide an updated sequence of tokens. The predicted token leads to the production of a new position-supplemented vector 430. In a next pass, the language model 402 processes the updated sequence of position-supplemented vectors to generate a next predicted token. The language model 402 repeats the above process until it generates a specified stop token.
The above-described implementation of the language model 402 relies on a decoder-only architecture. Other implementations of the language model 402 use an encoder-decoder transformer-based architecture. Here, a transformer-based decoder receives encoder output information produced by a transformer-based encoder, together with decoder input information.
In other implementations, the post-processing component 426 represents a classification component that produces a classification result. In some implementations, the classification component is implemented by using a fully connected feed-forward neural network having one or more layers followed by a Softmax component. A BERT-based transformer model is an example of this configuration. While example machine learning models and corresponding structures are described, it will be appreciated that the disclosed aspects may be used in conjunction with any of a variety of other models and/or structures.
The system memory 504 may include an operating system 505 and one or more program modules 506 suitable for running software application 520, such as one or more components supported by the systems described herein. As examples, system memory 504 may include adaptive token sampler 524 and machine learning model 526. The operating system 505, for example, may be suitable for controlling the operation of the computing device 500.
Furthermore, embodiments of the disclosure may be practiced in conjunction with other operating systems and/or any other application program and is not limited to any particular application or system. This basic configuration is illustrated in
As stated above, a number of program modules and data files may be stored in the system memory 504. While executing on the processing unit 502, the program modules 506 (e.g., application 520) may perform processes including, but not limited to, the aspects, as described herein. Other program modules that may be used in accordance with aspects of the present disclosure may include electronic mail and contacts applications, word processing applications, spreadsheet applications, database applications, slide presentation applications, drawing or computer-aided application programs, etc.
Furthermore, embodiments of the disclosure may be practiced in an electrical circuit comprising discrete electronic elements, packaged or integrated electronic chips containing logic gates, a circuit utilizing a microprocessor, or on a single chip containing electronic elements or microprocessors. For example, embodiments of the disclosure may be practiced via a system-on-a-chip (SOC) where each or many of the components illustrated in
The computing device 500 may also have one or more input device(s) 512 such as a keyboard, a mouse, a pen, a sound or voice input device, a touch or swipe input device, etc. The output device(s) 514 such as a display, speakers, a printer, etc. may also be included. The aforementioned devices are examples and others may be used. The computing device 500 may include one or more communication connections 516 allowing communications with other computing devices 550. Examples of suitable communication connections 516 include, but are not limited to, radio frequency (RF) transmitter, receiver, and/or transceiver circuitry; universal serial bus (USB), parallel, and/or serial ports.
The term computer readable media as used herein may include computer storage media. Computer storage media may include volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information, such as computer readable instructions, data structures, or program modules. The system memory 504, the removable storage device 509, and the non-removable storage device 510 are all computer storage media examples (e.g., memory storage). Computer storage media may include RAM, ROM, electrically erasable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other article of manufacture which can be used to store information and which can be accessed by the computing device 500. Any such computer storage media may be part of the computing device 500. Computer storage media does not include a carrier wave or other propagated or modulated data signal.
Communication media may be embodied by computer readable instructions, data structures, program modules, or other data in a modulated data signal, such as a carrier wave or other transport mechanism, and includes any information delivery media. The term “modulated data signal” may describe a signal that has one or more characteristics set or changed in such a manner as to encode information in the signal. By way of example, and not limitation, communication media may include wired media such as a wired network or direct-wired connection, and wireless media such as acoustic, radio frequency (RF), infrared, and other wireless media.
In a basic configuration, such a mobile computing device is a handheld computer having both input elements and output elements. The system 600 typically includes a display 605 and one or more input buttons that allow the user to enter information into the system 600. The display 605 may also function as an input device (e.g., a touch screen display).
If included, an optional side input element allows further user input. For example, the side input element may be a rotary switch, a button, or any other type of manual input element. In alternative aspects, system 600 may incorporate more or less input elements. For example, the display 605 may not be a touch screen in some embodiments. In another example, an optional keypad 635 may also be included, which may be a physical keypad or a “soft” keypad generated on the touch screen display.
In various embodiments, the output elements include the display 605 for showing a graphical user interface (GUI), a visual indicator (e.g., a light emitting diode 620), and/or an audio transducer 625 (e.g., a speaker). In some aspects, a vibration transducer is included for providing the user with tactile feedback. In yet another aspect, input and/or output ports are included, such as an audio input (e.g., a microphone jack), an audio output (e.g., a headphone jack), and a video output (e.g., a HDMI port) for sending signals to or receiving signals from an external device.
One or more application programs 666 may be loaded into the memory 662 and run on or in association with the operating system 664. Examples of the application programs include phone dialer programs, e-mail programs, personal information management (PIM) programs, word processing programs, spreadsheet programs, Internet browser programs, messaging programs, and so forth. The system 600 also includes a non-volatile storage area 668 within the memory 662. The non-volatile storage area 668 may be used to store persistent information that should not be lost if the system 600 is powered down. The application programs 666 may use and store information in the non-volatile storage area 668, such as e-mail or other messages used by an e-mail application, and the like. A synchronization application (not shown) also resides on the system 600 and is programmed to interact with a corresponding synchronization application resident on a host computer to keep the information stored in the non-volatile storage area 668 synchronized with corresponding information stored at the host computer. As should be appreciated, other applications may be loaded into the memory 662 and run on the system 600 described herein.
The system 600 has a power supply 670, which may be implemented as one or more batteries. The power supply 670 might further include an external power source, such as an AC adapter or a powered docking cradle that supplements or recharges the batteries.
The system 600 may also include a radio interface layer 672 that performs the function of transmitting and receiving radio frequency communications. The radio interface layer 672 facilitates wireless connectivity between the system 600 and the “outside world,” via a communications carrier or service provider. Transmissions to and from the radio interface layer 672 are conducted under control of the operating system 664. In other words, communications received by the radio interface layer 672 may be disseminated to the application programs 666 via the operating system 664, and vice versa.
The visual indicator 620 may be used to provide visual notifications, and/or an audio interface 674 may be used for producing audible notifications via the audio transducer 625. In the illustrated embodiment, the visual indicator 620 is a light emitting diode (LED) and the audio transducer 625 is a speaker. These devices may be directly coupled to the power supply 670 so that when activated, they remain on for a duration dictated by the notification mechanism even though the processor 660 and other components might shut down for conserving battery power. The LED may be programmed to remain on indefinitely until the user takes action to indicate the powered-on status of the device. The audio interface 674 is used to provide audible signals to and receive audible signals from the user. For example, in addition to being coupled to the audio transducer 625, the audio interface 674 may also be coupled to a microphone to receive audible input, such as to facilitate a telephone conversation. In accordance with embodiments of the present disclosure, the microphone may also serve as an audio sensor to facilitate control of notifications, as will be described below. The system 600 may further include a video interface 676 that enables an operation of an on-board camera 630 to record still images, video stream, and the like.
It will be appreciated that system 600 may have additional features or functionality. For example, system 600 may also include additional data storage devices (removable and/or non-removable) such as, magnetic disks, optical disks, or tape. Such additional storage is illustrated in
Data/information generated or captured and stored via the system 600 may be stored locally, as described above, or the data may be stored on any number of storage media that may be accessed by the device via the radio interface layer 672 or via a wired connection between the system 600 and a separate computing device associated with the system 600, for example, a server computer in a distributed computing network, such as the Internet. As should be appreciated, such data/information may be accessed via the radio interface layer 672 or via a distributed computing network. Similarly, such data/information may be readily transferred between computing devices for storage and use according to any of a variety of data/information transfer and storage means, including electronic mail and collaborative data/information sharing systems.
It will be appreciated that the aspects and functionalities described herein may operate over distributed systems (e.g., cloud-based computing systems), where application functionality, memory, data storage and retrieval and various processing functions may be operated remotely from each other over a distributed computing network, such as the Internet or an intranet. User interfaces and information of various types may be displayed via on-board computing device displays or via remote display units associated with one or more computing devices. For example, user interfaces and information of various types may be displayed and interacted with on a wall surface onto which user interfaces and information of various types are projected. Interaction with the multitude of computing systems with which embodiments of the invention may be practiced include, keystroke entry, touch screen entry, voice or other audio entry, gesture entry where an associated computing device is equipped with detection (e.g., camera) functionality for capturing and interpreting user gestures for controlling the functionality of the computing device, and the like.
Aspects of the present disclosure, for example, are described above with reference to block diagrams and/or operational illustrations of methods, systems, and computer program products according to aspects of the disclosure. The functions/acts noted in the blocks may occur out of the order as shown in any flowchart. For example, two blocks shown in succession may in fact be executed substantially concurrently or the blocks may sometimes be executed in the reverse order, depending upon the functionality/acts involved.
The description and illustration of one or more aspects provided in this application are not intended to limit or restrict the scope of the disclosure as claimed in any way. The aspects, examples, and details provided in this application are considered sufficient to convey possession and enable others to make and use claimed aspects of the disclosure. The claimed disclosure should not be construed as being limited to any aspect, example, or detail provided in this application. Regardless of whether shown and described in combination or separately, the various features (both structural and methodological) are intended to be selectively included or omitted to produce an embodiment with a particular set of features. Having been provided with the description and illustration of the present application, one skilled in the art may envision variations, modifications, and alternate aspects falling within the spirit of the broader aspects of the general inventive concept embodied in this application that do not depart from the broader scope of the claimed disclosure.
Claims
1. A system comprising:
- at least one processor; and
- memory storing instructions that, when executed by the at least one processor, cause the system to perform a set of operations, the set of operations comprising: obtaining, for a set of multimodal input tokens, an attention tensor comprising an attention value for a multimodal input token of the set of input tokens in relation to a prompt token of a set of prompt tokens; generating, for each multimodal input token of the set of multimodal input tokens, a sampling metric based on a corresponding attention value for the multimodal input token from the attention tensor; sampling, based on the generated sampling metrics, a subset of multimodal input tokens from the set of multimodal input tokens; and processing, using a machine learning model, the subset of multimodal input tokens with the set of prompt tokens.
2. The system of claim 1, wherein the attention tensor is obtained from a transformer block of a multimodal adapter for the machine learning model.
3. The system of claim 1, wherein the attention tensor is obtained from a transformer block of the machine learning model.
4. The system of claim 1, wherein sampling the subset of multimodal input tokens comprises using inverse transform sampling to identify the subset of multimodal input tokens according to respective sampling metrics.
5. The system of claim 4, wherein the sampling further comprises omitting a duplicate instance of a sampled multimodal input token from the subset of multimodal input tokens.
6. The system of claim 1, wherein the set of multimodal input tokens comprises at least one token of an audio token or an image token and the set of prompt tokens comprises a text token.
7. The system of claim 6, wherein the at least one token is an image token, and the set of multimodal input tokens further comprises a text token for text generated using optical character recognition to process image data corresponding to the image token.
8. The system of claim 1, wherein the sampling is performed according to a predetermined maximum number of tokens, thereby generating the subset of multimodal input tokens having no more than the predetermined maximum number of tokens.
9. A method, comprising:
- obtaining, from a transformer block, an attention tensor for a set of multimodal tokens and a set of prompt tokens;
- generating, for each multimodal input token of the set of multimodal input tokens, a sampling metric based on a corresponding attention value from the attention tensor;
- processing the generated sampling metrics using inverse transform sampling to probabilistically sample a subset of multimodal input tokens from the set of multimodal input tokens according to a predetermined maximum number of tokens; and
- processing, using a machine learning model, the subset of multimodal input tokens with the set of prompt tokens.
10. The method of claim 9, wherein the transformer block is:
- a transformer block of a multimodal adapter for the machine learning model; or
- a transformer block of the machine learning model.
11. The method of claim 9, wherein the processing further comprises omitting a duplicate instance of a sampled multimodal input token from the subset of multimodal input tokens.
12. The method of claim 9, wherein the set of multimodal input tokens comprises at least one token of an audio token or an image token and the set of prompt tokens comprises a text token.
13. The method of claim 12, wherein the at least one token is an image token, and the set of multimodal input tokens further comprises a text token for text generated using optical character recognition to process image data corresponding to the image token.
14. A method, comprising:
- obtaining, for a set of multimodal input tokens, an attention tensor comprising an attention value for a multimodal input token of the set of input tokens in relation to a prompt token of a set of prompt tokens;
- generating, for each multimodal input token of the set of multimodal input tokens, a sampling metric based on a corresponding attention value for the multimodal input token from the attention tensor;
- sampling, based on the generated sampling metrics, a subset of multimodal input tokens from the set of multimodal input tokens; and
- processing, using a machine learning model, the subset of multimodal input tokens with the set of prompt tokens.
15. The method of claim 14, wherein the attention tensor is obtained from:
- a transformer block of a multimodal adapter for the machine learning model; or
- a transformer block of the machine learning model.
16. The method of claim 14, wherein sampling the subset of multimodal input tokens comprises using inverse transform sampling to identify the subset of multimodal input tokens according to respective sampling metrics.
17. The method of claim 16, wherein the sampling further comprises omitting a duplicate instance of a sampled multimodal input token from the subset of multimodal input tokens.
18. The method of claim 14, wherein the set of multimodal input tokens comprises at least one token of an audio token or an image token and the set of prompt tokens comprises a text token.
19. The method of claim 18, wherein the at least one token is an image token, and the set of multimodal input tokens further comprises a text token for text generated using optical character recognition to process image data corresponding to the image token.
20. The method of claim 14, wherein the sampling is performed according to a predetermined maximum number of tokens, thereby generating the subset of multimodal input tokens having no more than the predetermined maximum number of tokens.
Type: Application
Filed: May 23, 2025
Publication Date: Nov 26, 2026
Applicant: Microsoft Technology Licensing, LLC (Redmond, WA)
Inventors: Mohsen FAYYAZ (Berlin), Sunando SENGUPTA (Reading), Parth S. PATHAK (London), Liana MIKAELYAN (London)
Application Number: 19/217,771