Method for adapting artificial intelligence model to combined tasks, and electronic device for performing same
By combining and calibrating single-task adapters with correction parameters, the method addresses the inefficiency of LLMs in adapting to specific tasks, achieving efficient and flexible task performance with reduced resource usage.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- SAMSUNG ELECTRONICS CO LTD
- Filing Date
- 2025-12-11
- Publication Date
- 2026-07-02
AI Technical Summary
Existing large language models (LLMs) require significant computing resources and memory for training and fine-tuning to perform multiple tasks, making them inefficient for adapting to specific downstream tasks.
The method involves combining and calibrating multiple single-task adapters using correction parameters to form a joint-expert adapter, which is then merged with a base model to perform a combination task, reducing the need for extensive retraining and resource consumption.
This approach allows for efficient adaptation of LLMs to perform multiple tasks with reduced computational and storage requirements, enhancing efficiency and flexibility in task performance.
Smart Images

Figure KR2025021400_02072026_PF_FP_ABST
Abstract
Description
Method for adapting an artificial intelligence model to combinatorial tasks and an electronic device for performing the same
[0001] The present disclosure relates to adapting an artificial intelligence model, and more specifically, to a method for adapting an artificial intelligence model to a combination task and an electronic device for performing the same.
[0002] The field of Natural Language Processing (NLP) is growing rapidly alongside the recent advancements in Artificial Intelligence (AI) technology. In particular, Large Language Models (LLMs) are garnering attention as technologies become capable of performing text generation, translation, summarization, and question-answering at a level comparable to that of humans. Language models enable natural interaction with humans and provide tangible value across various industries, including healthcare, finance, and education. For instance, LLMs can analyze user requests and dynamically call appropriate functions or connect with external systems to process tasks. Consequently, LLMs can contribute to enhancing efficiency and user experience in various services, such as virtual assistants and smart home control.
[0003] A method according to one aspect of the present disclosure may include: obtaining user input from a user; identifying a first task and a second task in response to the user input; combining a first adapter corresponding to the first task and a second adapter corresponding to the second task to create a combined adapter; correcting the combined adapter using one or more correction parameters; generating an output corresponding to the user input based on the corrected combined adapter; and providing the generated output to the user.
[0004] An electronic device according to one aspect of the present disclosure may include: a memory for storing instructions; and at least one processor operably coupled to the memory and comprising a processing circuit. By the instructions being executed by the at least one processor alone or in cooperation, the electronic device may: obtain user input from a user; identify a first task and a second task in response to the user input; combine a first adapter corresponding to the first task and a second adapter corresponding to the second task to create a combined adapter; correct the combined adapter using one or more correction parameters; generate an output corresponding to the user input based on the corrected combined adapter; and provide the generated output to the user.
[0005] A computer-readable recording medium according to one aspect of the present disclosure may record a program for performing any combination of one or more operations of the present disclosure on a computer.
[0006] FIG. 1 illustrates operations performed by an electronic device according to one or more embodiments of the present disclosure.
[0007] FIG. 2 illustrates a block diagram of a system according to one embodiment of the present disclosure.
[0008] FIG. 3 illustrates an inference model executed by an electronic device according to one embodiment of the present disclosure.
[0009] FIG. 4 illustrates a set of adapters associated with an inference model executed by an electronic device according to one embodiment of the present disclosure.
[0010] FIG. 5 illustrates a flowchart of a method performed by an electronic device according to one embodiment of the present disclosure.
[0011] FIG. 6 illustrates operations performed by an electronic device according to one embodiment of the present disclosure.
[0012] FIG. 7 illustrates combining adapters to form a combined adapter and correcting a combined model according to one embodiment of the present disclosure.
[0013] FIG. 8 illustrates combining adapters to form a combined adapter and correcting a combined model according to one embodiment of the present disclosure.
[0014] FIG. 9 illustrates combining adapters to form a combined adapter and correcting a combined model according to one embodiment of the present disclosure.
[0015] FIG. 10a illustrates correction parameters according to one embodiment of the present disclosure.
[0016] FIG. 10b illustrates correction parameters according to one embodiment of the present disclosure.
[0017] FIG. 11 illustrates a flowchart of a method for training correction parameters by a server according to one embodiment of the present disclosure.
[0018] FIG. 12 illustrates a flowchart of a method performed by an electronic device according to one embodiment of the present disclosure.
[0019] The terms used in the embodiments of this specification have been selected to be as widely used as possible, taking into account the functions of the present disclosure; however, these terms may vary depending on the intent of those skilled in the art, case law, the emergence of new technologies, etc. Additionally, in specific cases, terms have been arbitrarily selected by the applicant, and in such cases, their meanings will be described in detail in the description section of the relevant embodiments. Therefore, terms used in this specification should be defined not merely by their names, but based on their meanings and the overall content of the present disclosure.
[0020] The terms used in this disclosure are used merely to describe specific embodiments and are not intended to limit the scope of this disclosure. A singular expression may include a plural expression unless the context clearly indicates otherwise. Terms used herein, including technical or scientific terms, may have the same meaning as generally understood by those skilled in the art described in this disclosure. Terms used in this disclosure that are defined in a general dictionary may be interpreted as having the same or similar meaning as they have in the context of the relevant technology, and are not to be interpreted in an ideal or overly formal sense unless explicitly defined in this disclosure. In some cases, even terms defined in this disclosure are not to be interpreted to exclude the embodiments of this disclosure.
[0021] In the disclosure described below, a hardware-based approach is described by one or more examples. However, since the disclosure includes techniques using both hardware and software, the disclosure does not exclude a software-based approach.
[0022] Throughout this disclosure, when a part is described as "comprising" a certain component, this means that, unless specifically stated otherwise, it does not exclude other components but may include additional components. Furthermore, terms such as "part" and "module" as used in this specification refer to a unit that processes at least one function or operation, and may be implemented in hardware or software, or as a combination of hardware and software.
[0023] As used in this disclosure, the expression “configured to” may be replaced, depending on the context, with, for example, “suitable for,” “having the capacity to,” “designed to,” “adapted to,” “made to,” or “capable of.” The term “configured to” may not necessarily mean only “specifically designed to” in hardware. Instead, in some situations, the expression “system configured to” may mean that the system is “capable of” in conjunction with other devices or components. For example, the phrase “processor configured to perform A, B, and C” may mean a dedicated processor for performing the said operations (e.g., an embedded processor) or a generic-purpose processor capable of performing said operations by executing one or more software programs stored in memory.
[0024] In the present disclosure, when one component is referred to as being "connected" or "connected" to another component, it should be understood that the one component may be directly connected to or directly connected to the other component, but unless specifically stated otherwise, it may also be connected or connected through another component in between.
[0025] In the present disclosure, expressions of "greater than" or "less than" may be used to determine whether a specific condition is satisfied or fulfilled; however, this is merely for the purpose of expressing an example and does not exclude descriptions of "greater than" or "less than." Conditions described as "greater than" may be replaced with "greater than," conditions described as "less than" may be replaced with "less than," and conditions described as "greater than and less than" may be replaced with "greater than and less than."
[0026] It should be understood that the blocks in each flowchart and combinations of flowcharts can be executed by one or more computer programs containing computer-executable instructions. One or more computer programs may be stored all in a single memory or may be partitioned and stored in multiple different memories.
[0027] All functions or operations described in this document may be processed by a single processor or a combination of processors. A single processor or a combination of processors is a circuitry that performs processing and may include circuitry such as an Application Processor (AP), Communication Processor (CP), Graphics Processing Unit (GPU), Neural Processing Unit (NPU), Microprocessor Unit (MPU), System on Chip (SoC), Integrated Circuit (IC), etc.
[0028] One or more processors according to the present disclosure may include at least one of a CPU, GPU, APU (Accelerated Processing Unit), MIC (Many Integrated Core), DSP (Digital Signal Processor), or NPU. One or more processors may be implemented in the form of an integrated system-on-chip (SoC) including one or more electronic components. Each of the one or more processors may be implemented as separate hardware (H / W).
[0029] When a method according to one embodiment of the present disclosure includes a plurality of operations, the plurality of operations may be performed by a single processor or by a plurality of processors. For example, when a first operation, a second operation, and a third operation are performed by a method according to one embodiment, the first operation, the second operation, and the third operation may all be performed by a first processor, or the first operation and the second operation may be performed by a first processor (e.g., a general-purpose processor) and the third operation may be performed by a second processor (e.g., an artificial intelligence dedicated processor). However, the present disclosure is not limited thereto.
[0030] One or more processors according to the present disclosure may be implemented as a single core processor or as a multicore processor.
[0031] In the case where a method according to one embodiment of the present disclosure includes a plurality of operations, the plurality of operations may be performed by a single core or by a plurality of cores included in one or more processors.
[0032] Functions related to Artificial Intelligence (AI) according to the present disclosure are operated through a processor and memory. The processor may be composed of one or more processors. In this case, the one or more processors may be general-purpose processors such as CPUs, APs, DSPs, etc., graphics-dedicated processors such as GPUs, VPUs (Vision Processing Units), or AI-dedicated processors such as NPUs. The one or more processors control the processing of input data according to predefined operation rules or AI models stored in memory. Alternatively, if the one or more processors are AI-dedicated processors, the AI-dedicated processors may be designed with a hardware structure specialized for processing a specific AI model.
[0033] The predefined rules of operation or artificial intelligence models are characterized by being created through learning. Here, being created through learning means that a predefined rules of operation or artificial intelligence models configured to perform desired characteristics (or objectives) are created by a basic artificial intelligence model being trained using multiple learning data by a learning algorithm. Such learning may be performed on the device itself where the artificial intelligence according to the present disclosure is executed, or it may be performed through a separate server and / or system. Examples of learning algorithms include supervised learning, unsupervised learning, semi-supervised learning, or reinforcement learning, but are not limited to the examples described above.
[0034] An artificial intelligence model may be composed of multiple neural network layers. Each of the multiple neural network layers has multiple weight values and performs neural network operations through operations between the results of previous layers and the multiple weights. The multiple weights possessed by the multiple neural network layers can be optimized based on the learning results of the artificial intelligence model. For example, the multiple weights may be updated so that the loss value or cost value obtained from the artificial intelligence model during the learning process is reduced or minimized. Artificial neural networks may include deep neural networks (DNNs), such as Convolutional Neural Networks (CNNs), Deep Neural Networks (DNNs), Recurrent Neural Networks (RNNs), Restricted Boltzmann Machines (RBMs), Deep Belief Networks (DBNs), Bidirectional Recurrent Deep Neural Networks (BRDNNs), or Deep Q-Networks, but are not limited to the examples mentioned above.
[0035] In one embodiment of the present disclosure, a 'Language Model (LM)' may refer to an artificial intelligence model designed for natural language processing (NLP), such as language understanding or language generation. For example, an LM may be understood as an artificial intelligence model trained to generate output in the form of natural language in response to input data. An LM may be an artificial intelligence model trained to generate and output a natural language description of input data using natural language processing techniques.
[0036] A Large Language Model (LLM) can be a natural language processing model or LM trained on a large dataset. LLMs can be used to perform various tasks such as sentence prediction, translation, summarization, and question answering. While LLMs possess excellent performance as they are trained using large-scale computational resources and time, they may require significant computing resources and memory for training.
[0037] In the present disclosure, in one or more examples, the term "pre-trained model" may refer to a model that has been pre-learned general knowledge or patterns using a large dataset. A pre-trained model may be understood as a model that can be used universally across various tasks by being trained using a large dataset. A pre-trained model may also be referred to as a "base model" or a "foundation model." In one or more examples, a pre-trained model may be pre-loaded onto an electronic device. In one or more examples, a pre-trained model may be downloaded onto an electronic device via a connection to a server that stores the pre-trained model. In one or more examples, a pre-trained model may be updated or fine-tuned based on how the pre-trained model is used by a specific user.
[0038] In this disclosure, 'task' may refer to a specific goal or mission designed and trained to be performed by a model. A model's task may be understood as a problem to be solved by generating an expected output from a given input. Tasks may represent different specialized domains (e.g., mathematical or biological question answering), different downstream tasks (e.g., summarization, translation, etc.), or different points of convergence for optimization (e.g., different runs of LLM training experiments).
[0039] In the present disclosure, "fine-tuning" may refer to the process of further training a pre-trained model to suit a specific task. More precise performance can be achieved by fine-tuning the model's weights using a new dataset. Through fine-tuning, high performance can be achieved using significantly fewer resources and time than training a model targeting a specific task from the beginning.
[0040] In this disclosure, 'downstream task' may refer to a specific task or application in which a pre-trained model is fine-tuned to achieve a specific purpose. Downstream tasks may correspond to the goal of adapting and optimizing the general capabilities of a pre-trained model to solve specific scenarios or tasks. For example, downstream tasks for an LLM may include specific and specialized roles assigned to the LLM, such as text summarization or translation.
[0041] In the present disclosure, 'learnable' parameters may mean parameters that are updatable, changeable, or variant during learning. In the present disclosure, 'frozen' parameters may mean parameters that are fixed or invariant.
[0042] In one or more examples, the Parameter-Efficient Fine-Tuning (PEFT) technique can be used to efficiently utilize LLM. The PEFT technique allows the model to be adapted to specific downstream tasks with relatively few resources by training only a small number of parameters to fine-tune the model. For example, by training only a few parameters while freezing all or some of the pre-trained parameters, PEFT enables rapid fine-tuning for various downstream tasks. Through the PEFT technique, necessary parts can be fine-tuned while maintaining the main structure of the pre-trained model.
[0043] A base model pre-trained using general training data can be fine-tuned or adapted to perform a specific task. For example, all parameters of the pre-trained model can be retrained (or updated) to target a specific task. However, as the number of parameters in the pre-trained model increases radically, updating all parameters may require significant computational resources, long training times, and a large amount of memory. Accordingly, instead of retraining the entire pre-trained model, tuning only some of the parameters of the pre-trained model or training additional layer(s) (e.g., adapter modules) for the target task may be considered.
[0044] In one embodiment, for efficient fine-tuning of a pre-trained base model, the weight matrices of the pre-trained model are fixed, and only one or more additional low-rank weight matrices are trained for a target task. The one or more low-rank weight matrices may have a lower rank than the weight matrices of the pre-trained neural network model. The parameters of the pre-trained neural network model are frozen, and only the parameters of the low-rank matrices are trained to target a specific task (or a specific domain).
[0045] To support multiple tasks with a single model, merging two or more models may be considered. Model merging can enable the use of a model for tasks that have not been trained on, without retraining or fine-tuning. The resulting model from model merging can perform multiple tasks using one or more single sets of weights. The resulting model can be expected to perform multiple tasks for a given input.
[0046] In one embodiment of the present disclosure, a plurality of single-task adapters may be reconfigured to perform a combination task comprising a plurality of tasks. The plurality of adapters may be single-task combined and corrected to form a joint-expert adapter. Accordingly, instead of performing multiple inferences using a plurality of adapters for each of the plurality of tasks, outputs for a plurality of tasks of a given input may be generated in a single inference. Additionally, instead of storing new adapters for each of the possible combination tasks, relatively small correction parameters may be used for adapter reconfiguration. Accordingly, the storage space required to store the model is reduced, and computation speed may be improved.
[0047] FIG. 1 illustrates operations performed by an electronic device (100) according to one embodiment of the present disclosure.
[0048] Referring to FIG. 1, an electronic device (100) may receive user input. The electronic device (100) may perform operations (102, 106, 108, 110, 112). By performing operations (102, 106, 108, 110, 112), the electronic device (100) may generate an output corresponding to the user input. However, the present disclosure is not limited thereto, and operations (102, 106, 108, 110, 112) may be performed individually by any electronic device or collectively by a plurality of electronic devices. The electronic device (100) may omit any of the operations illustrated in FIG. 1 and / or additionally perform operations not illustrated in FIG. 1. In one embodiment, the order of at least some of the operations (102, 106, 108, 110, 112) may be changed.
[0049] In operation (102), the electronic device (100) can identify a compositional task indicated by user input. In one embodiment of the present disclosure, a "compositional task" may refer to a set of multiple tasks. In one or more examples, a "compositional task" may be based on user input in the form of natural language. For example, user input may be a task such as "calculate how far to drive from point A to point B and estimate the amount of fuel to drive from point A to point B." The electronic device (100) can analyze the user input and identify (or determine) a task to achieve the goal indicated by the user input. The electronic device (100) can identify whether the identified task is a compositional task. In response to identifying that the identified task is a combination of multiple tasks supported by the electronic device (100), the electronic device (100) can identify that the identified task is a compositional task.
[0050] In one embodiment of the present disclosure, user input may include a request for a specific task. An electronic device (100) may identify a request for a specific task included in the user input. To perform a request included in the user input, the electronic device (100) may decompose the specific task into one or more downstream tasks. For example, the electronic device (100) may analyze the user input to identify the goal of the user input. The electronic device (100) may identify a task to be performed to achieve the goal of the user input. In one embodiment of the present disclosure, user input may include an input prompt.
[0051] In one embodiment of the present disclosure, user input may include a request for a specific task and target data to which the task is to be applied. For example, target data may include any combination of various forms such as text data, image data, video data, or audio data. User input may be obtained from a user of the electronic device (100), an application, software, or computer program running on the electronic device (100), an external electronic device of the electronic device (100), or any combination thereof. The request for a specific task and target data may be obtained from a single entity. For example, the electronic device (100) may receive a selection for a specific task and target data from a user (e.g., receiving a text and a Spanish translation request for said text from a user). The request for a specific task and target data may also be obtained from different entities. For example, the electronic device (100) may receive target data from an application running on the electronic device (100) and may receive a specific task request for the target data from a user (e.g., receiving a Spanish summary request from a user for English text provided by the application).
[0052] In one embodiment of the present disclosure, the electronic device (100) can identify whether a task directed by user input is a combination task comprising a plurality of downstream tasks. Based on identifying that a task directed by user input is a combination task, the electronic device (100) can trigger a reconfiguration of the adapters.
[0053] In operation (106), the electronic device (100) can combine adapters (104) corresponding to each task included in the combination task identified through operation (102). For example, based on the combination task identified in operation (102) being a combination of 'Task 1' and 'Task 2', the electronic device (100) can combine 'Adapter 1' corresponding to 'Task 1' and 'Adapter 2' corresponding to 'Task 2'. In one embodiment of the present disclosure, the electronic device (100) can store pretrained adapters for each of the tasks supported by the electronic device (100). The electronic device (100) can load an adapter corresponding to each task included in the identified combination task from among the stored adapters.
[0054] In operation (106), the electronic device (100) may merge the adapters (104) using at least one of various methods. In one embodiment of the present disclosure, the electronic device (100) may obtain a combined adapter of the adapters by performing linear merging of the adapters (104). For example, the weights of the combined adapter may be obtained by calculating a weighted average of the weights of the adapters. In one embodiment of the present disclosure, the electronic device (100) may calculate the weighted average by applying the same weights to the adapters or by applying weights defined for each adapter (e.g., predefined or predetermined).
[0055] In operation (108), the electronic device (100) can calibrate the combination adapter of the adapters. The electronic device (100) can calibrate the combination adapter using one or more calibration parameters. Through operation (108), the combination adapter can be calibrated to be specific to the combination task identified in operation (102). In one embodiment of the present disclosure, the electronic device (100) can add one or more calibration parameters to the combination adapter. One or more calibration parameters may be referred to as additional parameters.
[0056] In one embodiment of the present disclosure, one or more correction parameters may be learnable parameters. For example, correction parameters may be learned by combining single-task adapters, correcting using the correction parameters, and updating using training data. The training of the correction parameters will be described in detail later with reference to FIG. 11.
[0057] In one embodiment of the present disclosure, one or more correction parameters may be row vectors or column vectors. By performing element-wise addition of one or more correction parameters to one or more weight matrices of the combination adapter, the electronic device (100) may correct the combination adapter. For example, the electronic device (100) may perform element-by-column addition on a matrix of one or more correction parameters and one weight matrix of the combination adapter.
[0058] In one embodiment of the present disclosure, one or more correction parameters may constitute one or more correction matrices. For example, a first correction matrix may include a first set of one or more correction parameters, and a second correction matrix may include a second set of one or more correction parameters. By performing the addition of the correction matrices and the weight matrices of the combination adapter, the electronic device (100) can correct the combination adapter. The number of correction matrices may be equal to the number of weight matrices of the adapter.
[0059] Through operations (106, 108), multiple single-task adapters can be reconstructed into multi-task adapters. The electronic device (100) can combine and calibrate multiple single-task adapters to obtain a joint-expert adapter for a combined task. The reconstructed adapter can be used during inference.
[0060] In operation (110), the electronic device (100) can merge the calibrated coupling adapter with the base model. The base model may correspond to a pre-trained AI model or a neural network model. The base model may also be referred to as a foundation model. By merging the calibrated coupling adapter with the base model, the electronic device (100) can obtain an inference model specialized for the combination task identified in operation (102).
[0061] In one embodiment of the present disclosure, an electronic device (100) may store one or more adapters that support various individual downstream tasks (e.g., translation, summarization, etc.) together with a base model. By applying one or more adapters to the base model, the electronic device (100) may fine-tune the base model for a specific task (or tasks). For example, to generate an output corresponding to a user input, the electronic device (100) may load one or more adapters corresponding to each of one or more tasks indicated by the user input. The electronic device (100) may obtain an inference model by adding the loaded one or more adapters to the base model. The inference model may correspond to the base model updated based on the one or more adapters. Accordingly, the adapters may be used to generate a fine-tuned model configured so that the pre-trained base model handles one or more tasks indicated by the user input.
[0062] In operation (112), the electronic device (100) can perform inference using the inference model obtained in operation (112). By inputting user input into the inference model, the electronic device (100) can infer an output corresponding to the user input. Based on the user input, the inference model can generate an output. The electronic device (100) can provide the output generated from the inference model to the user.
[0063] In one embodiment of the present disclosure, an electronic device (100) may combine a plurality of adapters to perform a combination task. The electronic device (100) may calibrate the combination adapter of the adapters. For example, the electronic device (100) may identify a plurality of downstream tasks for performing a combination task. The electronic device (100) may acquire a plurality of adapters, each corresponding to a respective of the plurality of downstream tasks. The electronic device (100) may combine the acquired plurality of adapters. The electronic device (100) may calibrate the combination adapter to be specialized for a given combination task by a relatively small number of calibration parameters. The number of calibration parameters may be negligible compared to using a new adapter specialized for the combination task. For example, the number of calibration parameters may be relatively small or insignificant compared to the total number of parameters of the plurality of adapters specialized for any combination of downstream tasks supported by the electronic device (100). For example, assuming that the parameters of a typical adapter are about 30 million (e.g., an adapter with a capacity of 50 MB), the number of correction parameters can be 20,000 to 160,000 (e.g., a set of correction parameters with a capacity of 0.05 to 0.3 MB), and thus the capacity of the correction parameters can be negligible. Accordingly, the electronic device (100) can support various combination tasks with less storage space.
[0064] FIG. 2 illustrates a block diagram of a system (20) according to one embodiment of the present disclosure.
[0065] Referring to FIG. 2, the system (20) may include a server (200) and an electronic device (100). The server (200) may include at least one processor (202), memory (204), a communication interface (206), and a storage device (208). FIG. 2 illustrates only essential components for explaining the function and / or operation of the server (200), and the components included in the server (200) are not limited to those illustrated in FIG. 2. The configuration of the server (200) illustrated in FIG. 2 is merely an example, and the configuration illustrated in FIG. 2 does not limit examples of the server (200) performing one or more embodiments of the present disclosure. In one or more embodiments, one or more of the components of the server (200) illustrated in FIG. 2 may be deleted or modified, or components not illustrated in FIG. 2 may be added to the server (200). In one embodiment, some or all of at least one processor (202), memory (204), communication interface (206), and storage device (208) may be implemented in the form of a single chip.
[0066] At least one processor (202) may be configured to control a series of processes to enable the server (200) to operate according to the embodiments described below, and may be composed of one or more processors. One or more processors included in the at least one processor (202) may be circuitry such as a System on Chip (SoC) or an Integrated Circuit (IC). One or more processors included in the at least one processor (202) may be a general-purpose processor such as a Central Processing Unit (CPU), Micro Processor Unit (MPU), Application Processor (AP), Digital Signal Processor (DSP), a graphics-dedicated processor such as a Graphic Processing Unit (GPU) or Vision Processing Unit (VPU), an artificial intelligence-dedicated processor such as a Neural Processing Unit (NPU), or a communication-dedicated processor such as a Communication Processor (CP). If one or more processors included in the at least one processor (202) are artificial intelligence-dedicated processors, the artificial intelligence-dedicated processor may be designed with a hardware structure specialized for processing a specific artificial intelligence model.
[0067] At least one processor (202) can control the overall operations of the server (200). In one or more examples, at least one processor (202) can control the server (200) to perform at least some of the operations according to the embodiment described below. For example, at least one processor (202) can transmit and receive signals through a communication interface (206). At least one processor (202) can write data to memory (204) and read data written to memory (204). For example, at least one processor (202) can process data according to a predefined operation rule or artificial intelligence model by executing one or more instructions of a program stored in memory (204). Thus, at least one processor (202) can perform the operations described in subsequent embodiments. The operations described in this disclosure as being performed by the server (200) or the components (202, 204, 206, 208) included in the server (200) may be understood as being performed by at least one processor (202) unless otherwise specified. At least one processor (202) may access data stored in the storage device (208). At least one processor (202) may load data stored in the storage device (208) into memory (204).
[0068] At least one processor (202) may include various processing circuits and / or multiple processors. In one embodiment of the present disclosure, the 'processor' may include at least one processor and, in one or more examples, may include various processing circuits. One or more processors may be configured to perform the various functions described in the present disclosure in a distributed manner, individually and / or collectively. As used herein, the 'processor', 'at least one processor', and 'one or more processors' may be configured to perform various functions. However, these terms may, without limitation, cover situations where one processor performs some of the functions and other processor(s) perform other parts of the functions, and situations where a single processor can perform all functions. Additionally, at least one processor may include a combination of processors performing various functions of the disclosed functions in a distributed manner. At least one processor may execute program instructions individually or in cooperation to achieve or perform various functions.
[0069] The memory (204) may store instructions, data structures, and / or program code that can be read by at least one processor (202). The memory (204) may store a program or at least one instruction for performing operations according to the embodiments described below. The memory (204) may provide stored data to at least one processor (202) upon the request of at least one processor (202). For example, the memory (204) may store data such as a basic program, an application program, and configuration information for the operation of the server (200). In one embodiment, the memory (204) may store instructions that can cause the server (200) to perform at least some of the operations of the server (200) described below by being executed by at least one processor (202) alone or in cooperation. For example, at least one processor (202) can perform at least some of the operations of the server (200) described in the present disclosure by executing one or more instructions or codes stored in memory (204).
[0070] The memory (204) may include a flash memory type, a hard disk type, a multimedia card micro type, and a card type of memory, and may include a non-volatile memory including at least one of a ROM (Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), PROM (Programmable Read-Only Memory), magnetic memory, a magnetic disk, and an optical disk, and / or a volatile memory such as a DRAM (Dynamic Random Access Memory) or SRAM (Static Random Access Memory).
[0071] The communication interface (206) may be a component for transmitting and receiving signals (control commands and data, etc.) to and from an external device via wired or wireless means. The communication interface (206) may be implemented to include a communication chipset that supports various communication protocols. The communication interface (206) may receive signals from the outside and provide them to at least one processor (202). The communication interface (206) may transmit signals output from at least one processor (202) to the outside. The server (200) may communicate with external devices (e.g., electronic device (100)) through the communication interface (206).
[0072] The storage device (208) may store data associated with the operation of the server (200). The storage device (208) may store instructions, program codes, and / or software for the operations of the server (200). The storage device (208) may store data to be processed by at least one processor (202) and / or the processing results of at least one processor (202). In one embodiment of the present disclosure, the storage device (208) may store data to be distributed to the electronic device (100). For example, the storage device (208) may store at least one of one or more weight matrices included in an AI model to be executed by the electronic device (100), one or more weight matrices to be applied to the AI model, one or more weight matrices of one or more adapters to fine-tune the AI model, or one or more parameters used to fine-tune the AI model. The storage device (208) may include one or more storage media. The storage device (208) may include at least one of non-volatile memory or volatile memory. At least one processor (202) can load data stored in a storage device (208) into memory (204) and process the data loaded into memory (204).
[0073] The electronic device (100) may include at least one processor (212), memory (214), communication interface (216), storage device (218), and user interface (220). Only essential components for describing the function and / or operation of the electronic device (100) are illustrated in FIG. 2, and the components included in the electronic device (100) are not limited to those illustrated in FIG. 2. The configuration of the electronic device (100) illustrated in FIG. 2 is merely an example, and the configuration illustrated in FIG. 2 does not limit examples of the electronic device (100) performing one or more embodiments of the present disclosure. In one or more embodiments, one or more of the components of the electronic device (100) illustrated in FIG. 2 may be deleted or changed, or components not illustrated in FIG. 2 may be added to the electronic device (100). In one embodiment, some or all of at least one processor (212), memory (214), communication interface (216), storage device (218), and user interface (220) may be implemented in the form of a single chip.
[0074] At least one processor (212) may be configured to control a series of processes to enable the electronic device (100) to operate according to the embodiments described below, and may be composed of one or more processors. One or more processors included in the at least one processor (212) may be circuit devices such as SoCs or ICs. One or more processors included in the at least one processor (212) may be general-purpose processors such as CPUs, MPUs, APs, DSPs, etc., graphics-dedicated processors such as GPUs and VPUs, artificial intelligence-dedicated processors such as NPUs, or communication-dedicated processors such as CPs. If one or more processors included in the at least one processor (212) are artificial intelligence-dedicated processors, said artificial intelligence-dedicated processors may be designed with a hardware structure specialized for processing a specific artificial intelligence model.
[0075] At least one processor (212) can control the overall operations of the electronic device (100). In one or more examples, at least one processor (212) can control the electronic device (100) to perform at least some of the operations according to the embodiment described below. For example, at least one processor (212) can transmit and receive signals through a communication interface (216). At least one processor (212) can write data to memory (214) and read data written to memory (214). For example, at least one processor (212) can process data according to a predefined operation rule or artificial intelligence model by executing one or more instructions of a program stored in memory (214). Thus, at least one processor (212) can perform the operations described in subsequent embodiments. The operations described in this disclosure as being performed by the electronic device (100) or the components (212, 214, 216, 218, 220) included in the electronic device (100) may be understood to be performed by at least one processor (212) unless otherwise specified. At least one processor (212) may access data stored in the storage device (218). At least one processor (212) may load data stored in the storage device (218) into memory (214).
[0076] At least one processor (212) may include various processing circuits and / or multiple processors. In one embodiment of the present disclosure, the 'processor' may include at least one processor and, in one or more examples, may include various processing circuits. One or more processors may be configured to perform the various functions described in the present disclosure in a distributed manner, alone and / or in cooperation. As used herein, the 'processor', 'at least one processor', and 'one or more processors' may be configured to perform various functions. However, these terms may, without limitation, cover situations where one processor performs some of the functions and other processor(s) perform other parts of the functions, and situations where a single processor can perform all functions. Additionally, at least one processor may include a combination of processors performing various functions of the disclosed functions in a distributed manner. At least one processor may execute program instructions alone or in cooperation to achieve or perform various functions.
[0077] The memory (214) may store instructions, data structures, and / or program code that can be read by at least one processor (212). The memory (214) may store a program or at least one instruction for performing operations according to the embodiments described below. The memory (214) may provide stored data to at least one processor (212) upon the request of at least one processor (212). For example, the memory (214) may store data such as a base program, application program, and configuration information for the operation of the electronic device (100). In one embodiment, the memory (214) may store instructions that, when executed alone or in cooperation by at least one processor (212), cause the electronic device (100) to perform at least some of the operations of the electronic device (100) described below. For example, at least one processor (212) can perform at least some of the operations of the electronic device (100) described in the present disclosure by executing one or more instructions or codes stored in memory (214).
[0078] The memory (214) may include at least one of a flash memory type, a hard disk type, a multimedia card micro type, or a card type of memory (or storage medium). The memory (214) may include a non-volatile memory including at least one of a ROM, EEPROM, PROM, magnetic memory, a magnetic disk, or an optical disk, and / or a volatile memory such as a DRAM or SRAM.
[0079] The communication interface (216) may be a component for transmitting and receiving signals (control commands and data, etc.) to and from an external device via wired or wireless means. The communication interface (216) may be implemented to include a communication chipset that supports various communication protocols. The communication interface (216) may receive signals from the outside and provide them to at least one processor (212). The communication interface (216) may transmit signals output from at least one processor (212) to the outside. The electronic device (100) may communicate with external devices (e.g., a server (200)) through the communication interface (216).
[0080] The storage device (218) may store data associated with the operation of the electronic device (100). The storage device (218) may store instructions, program codes, and / or software for the operations of the electronic device (100). The storage device (218) may store data to be processed by at least one processor (212) and / or the processing results of at least one processor (212). In one embodiment of the present disclosure, the storage device (218) may store data distributed from the server (200) to the electronic device (100). For example, the storage device (218) may store at least one of one or more weights included in an AI model to be executed by the electronic device (100), one or more weight matrices to be applied to the AI model, one or more weight matrices of one or more adapters to fine-tune the AI model, or one or more parameters used to fine-tune the AI model.
[0081] The storage device (218) may include one or more storage media. The storage device (218) may include at least one of non-volatile memory or volatile memory. At least one processor (212) may load data stored in the storage device (218) into memory (214) and process the data loaded onto memory (214).
[0082] The user interface (220) may include an input interface and / or an output interface for interacting with a user of the electronic device (100). For example, the user interface (220) may include an input interface for receiving at least one of various inputs, such as a command, a request, information, or data, from a user of the electronic device (100). The input interface may include various input devices, such as a touch screen, a keyboard, and / or a microphone. The user interface (220) may include an output interface for providing the user with the result of an operation according to the user's command or the state of the electronic device (1000). The output interface may include various output devices, such as a display device and / or a speaker. In one embodiment of the present disclosure, the electronic device (100) may obtain user input from a user through the user interface (220). The electronic device (100) may perform a task directed by the user input. The electronic device (100) can provide the result of performing a task (e.g., a response to a question included in user input, data edited according to a request in user input, etc.) to the user through a user interface (220).
[0083] In one embodiment of the present disclosure, an electronic device (100) may communicate with a server (200) based on various wired or wireless communication protocols. The electronic device (100) may receive from the server (200) one or more instructions, program codes, and / or data structures to be executed (or driven) on the electronic device (100). For example, the server (200) may distribute to the electronic device (100) at least one of a base model to be executed on the electronic device (100), one or more adapters for fine-tuning the base model for a corresponding downstream task, one or more parameters used to combine the adapters, or one or more correction parameters for correcting (or adjusting, correcting) the combination of the adapters. The parameters or data distributed from the server (200) may be stored in a storage device (218). Parameters or data distributed from the server (200) are loaded into memory (214) by at least one processor (212) and can be processed, computed, and / or executed by at least one processor (212).
[0084] In one embodiment of the present disclosure, the server (200) may create a new adapter to be distributed to the electronic device (100). The server (200) may update existing adapters and / or existing parameters (e.g., weights used for weighted averages, or at least some of existing correction parameters). The server (200) may distribute the newly created adapter, the updated adapter, and / or the updated parameters to the electronic device (100). The electronic device (100) may store the newly created adapter, the updated adapter, and / or the updated parameters received from the server (200) in a storage device (218).
[0085] In one embodiment of the present disclosure, an electronic device (100) may request a server (200) to perform at least some of the operations for generating an output for a user input. For example, the electronic device (100) may request the server (200) to perform at least some of the operations (102, 106, 108, 110, 112) of FIG. 1. The electronic device (100) may receive result(s) of the requested operation(s) from the server (200). Based on the received result(s), the electronic device (100) may provide an output for the user input.
[0086] FIG. 3 illustrates an inference model (300) executed by an electronic device (100) according to one embodiment of the present disclosure.
[0087] Referring to FIG. 3, an electronic device (100) can execute an inference model (300) to generate an output corresponding to a user input. The electronic device (100) can input user input to the inference model (300). The inference model (300) can infer an output based on the user input. The inference model (300) can be implemented as an AI-based model.
[0088] The inference model (300) can be implemented based on the base model (302) and the combination adapter (304). For example, the inference model (300) can be obtained by merging the base model (302) and the combination adapter (304) or by applying the combination adapter (304) to the base model (302). The combination adapter (304) can correspond to the combination of multiple adapters. For example, the combination adapter (304) can refer to the combination of the first adapter (306) and the second adapter (308).
[0089] To perform a task directed by user input, the electronic device (100) can identify a task to achieve the goal of the user input. The electronic device (100) can identify the goal of the user input by analyzing the user input. The electronic device (100) can identify a task to be performed to achieve the goal of the user input. The electronic device (100) can identify whether the identified task is a combination of multiple downstream tasks (e.g., whether the identified task is a combination task). For example, the electronic device (100) can identify that the identified task is a combination of a first task (or primary task) and a second task (or secondary task). Accordingly, to perform the identified task, the electronic device (100) can combine a first adapter (306) specialized for the first task and a second adapter (308) specialized for the second task. By combining the first adapter (306) and the second adapter (308), the electronic device (100) can obtain a combined adapter (304) for performing an identified combination task.
[0090] To perform an identified task, the electronic device (100) may apply a combination adapter (304) to a base model (302). For example, the electronic device (100) may merge (or add) the combination adapter (304) with the base model (302) to obtain an inference model (300). Accordingly, the base model (302) may be fine-tuned to be specialized for an identified combination task (e.g., a combination of a first task and a second task). For example, the inference model (300) may correspond to the base model (302) that has been fine-tuned to be specialized for a combination task of a first task and a second task.
[0091] In one embodiment of the present disclosure, an adapter specialized for a specific task may include one or more low-rank weight matrices. The weight matrices of the adapter may be of lower dimension than the weight matrices of the base model (302). For example, while the weight matrices of the base model (302) may be of a size of 1 billion to 3 billion parameters, the size of the adapter may be relatively small, such as 20 to 100 [MB]. Instead of retraining the base model (302) entirely, the electronic device (100) may use one or more adapters to fine-tune the base model (302) to perform the desired tasks.
[0092] In one embodiment of the present disclosure, one adapter comprises two factored weight matrices , It may include (here, rank Each weight matrix can be obtained by training the adapter for a specific task. The adapter's weight matrices are the weight matrices of the base model. It can be added to. During the adapter's learning, It is frozen and does not receive gradient updates, and It can include learnable parameters. Input Output for To obtain , the forward pass can be modified as shown in Equation 1.
[0093]
[0094] In one embodiment of the present disclosure, the first task The first adapter (306) specialized for is weight matrices , It may include. Second task The second adapter (308) specialized for is weight matrices , It may include. The electronic device (100) combines the first adapter (306) and the second adapter (308), and correction parameters Using [the method], the merged combination adapter (304) can be calibrated, and the calibrated combination adapter (304) and the base model (302) can be merged. First task and 2nd task Combination task including and combination and correction functions Regarding this, the forward propagation of the inference model (300) may be equal to Equation 2 ( can correspond to the number of adapters to be merged):
[0095]
[0096] In one embodiment of the present disclosure, correction parameters is a combination task It can be trained using associated data and cross-entropy loss. Correction parameters The learning of will be described in detail later.
[0097] In one embodiment of the present disclosure, instead of performing inference using only the first adapter (306) and inference using only the second adapter (308), the electronic device (100) may perform inference using an inference model (300) obtained by merging a combined adapter (304) that combines the first adapter (306) and the second adapter (308) and a base model (302). Accordingly, the inference speed of the electronic device (100) may be improved.
[0098] In one embodiment of the present disclosure, the first adapter (306) and the second adapter (308) may be merged using any one of various model merging methods. For example, the first adapter (306) and the second adapter (308) may be merged using any one of various model merging methods such as linear merging, concatenation, TIES (TRIM, ELECT SIGN & MERGE), DARE (Drop and Rescale) merging, Slerp (Spherical Linear Interpolation) merging, LoRaHub, DAM (Differentiable adaptive merging), ZipLoRA merging, etc. The combination and calibration of the adapters will be described in detail later.
[0099] FIG. 4 illustrates a set of adapters (400) associated with an inference model (300) executed by an electronic device (100) according to one embodiment of the present disclosure.
[0100] Referring to FIG. 4, the electronic device (100) can input user input to the inference model (300). Based on the user input, the inference model (300) can generate an output corresponding to the user input. The inference model (300) may include a base model (302) and a combination adapter of a plurality of adapters added to an adapter placeholder (410). The plurality of adapters to be added to the adapter placeholder (410) may be obtained from a set of adapters (400).
[0101] To generate an output corresponding to user input, the electronic device (100) can identify a combination task directed by user input. The electronic device (100) can identify multiple tasks included in the combination task. The electronic device (100) can obtain adapters for the multiple tasks identified from user input from a set of adapters (400). The electronic device (100) can combine the obtained adapters to obtain a combination adapter. The electronic device (100) can calibrate the combination adapter and apply the calibrated combination adapter to an adapter placeholder (410). The electronic device (100) can obtain an inference model (300) by merging the calibrated combination adapter and the base model (302). By merging the calibrated combination adapter and the base model (302), the electronic device (100) can fine-tune the AI model for a given combination task.
[0102] A set of adapters (400) may include one or more adapters each specialized for one or more downstream tasks supported by the electronic device (100). For example, in the embodiment illustrated in FIG. 4, the set of adapters (400) may include an adapter (402) learned for summarizing English text, an adapter (404) learned for generating English responses, an adapter (406) learned for English-Spanish translation, and an adapter (406) learned for English-French translation. Each adapter may be learned to be specialized for a corresponding task. The electronic device (100) may select an adapter from the set of adapters (400) that corresponds to the task to be performed. As understood by a person skilled in the art, the embodiments are not limited to such a set of adapters and may include any suitable adapter known to a person skilled in the art.
[0103] In one embodiment of the present disclosure, a set of adapters (400) may be stored in an electronic device (100). The electronic device (100) may select adapters corresponding to tasks identified from user input from among the set of adapters (400) and combine the selected adapters to form a combined adapter. The electronic device (100) may apply the combined adapter to an adapter placeholder (410) to merge the combined adapter with the base model (302) and thereby obtain an inference model (300).
[0104] FIG. 5 illustrates a flowchart of a method (500) performed by an electronic device (100) according to one embodiment of the present disclosure.
[0105] Referring to FIG. 5, the method (500) may include operations (502, 504, 506, 508, 510, 512, 514). The method (500) may be performed by an electronic device (100). However, the present disclosure is not limited thereto, and the operations (502, 504, 506, 508, 510, 512, 514) may be performed by any electronic device alone or in cooperation by a plurality of electronic devices. A method (500) according to one embodiment of the present disclosure is not limited to that shown in FIG. 5, and any one of the operations shown in FIG. 5 may be omitted, or additional operations not shown in FIG. 5 may be included. In one embodiment, the order of at least some of the operations (502, 504, 506, 508, 510, 512, 514) may be changed.
[0106] In operation (502), the electronic device (100) can analyze user input. Based on the analysis of user input, the electronic device (100) can identify a task directed by user input. For example, the electronic device (100) can identify the goal of user input. It can identify a task to achieve the goal of user input. The electronic device (100) can identify a task to perform to achieve the goal of user input.
[0107] In operation (504), the electronic device (100) can identify whether the task directed by user input is a combination task. For example, the electronic device (100) can identify whether multiple tasks supported by the electronic device (100) must be performed or a single task must be performed in order to perform the task directed by user input. Based on identifying that multiple tasks must be performed in order to perform the task directed by user input, the electronic device (100) can identify that the task directed by user input is a combination task. Based on identifying that single tasks must be performed in order to perform the task directed by user input, the electronic device (100) can identify that the task directed by user input is not a combination task.
[0108] Based on identifying that the task directed by user input is not a combination task, the electronic device (100) can perform an operation (506). In the operation (506), the electronic device (100) can merge a base model (e.g., the base model (302) of FIG. 3) and an adapter corresponding to the directed task. For example, the electronic device (100) can acquire an adapter corresponding to the task directed by user input. The electronic device (100) can select an adapter corresponding to the task directed by user input from a set of adapters (400) and load the selected adapter. The electronic device (100) can apply the acquired adapter to the base model (302). The electronic device (100) can acquire a weight matrix of an inference model for the task directed by user input based on one or more weight matrices of the acquired adapter and the weight matrix of the base model. In one embodiment of the present disclosure, the weight matrix of the inference model for a task indicated by user input may correspond to the sum of one or more weight matrices of the acquired adapter and the weight matrix of the base model.
[0109] Based on identifying that a task directed by user input is a combination task, the electronic device (100) can perform an operation (508). In the operation (508), the electronic device (100) can determine multiple tasks included in the combination task. For example, the electronic device (100) can break down a task directed by user input into multiple tasks.
[0110] In operation (510), the electronic device (100) may combine multiple adapters using one or more correction parameters. For example, the electronic device (100) may obtain a combined adapter by merging the adapters for each task included in the combination task. The electronic device (100) may load the adapters for the multiple tasks determined in operation (508) from an internal storage device. The electronic device (100) may receive one or more of the adapters for the multiple tasks determined in operation (508) from an external electronic device. The electronic device (100) may combine the obtained multiple adapters.
[0111] In one embodiment of the present disclosure, by calculating the weighted average of the weight matrices of a plurality of adapters, the electronic device (100) can obtain one or more weight matrices of a combined adapter. The electronic device (100) can correct the combined adapter using one or more correction parameters. In one embodiment of the present disclosure, the electronic device (100) can adjust one or more weights of the combined adapter using one or more correction parameters.
[0112] In operation (512), the electronic device (100) can merge the base model and the corrected combination adapter. The electronic device (100) can apply the corrected combination adapter to the base model. The electronic device (100) can obtain a weight matrix of an inference model for a combination task based on one or more weight matrices of the corrected combination adapter and the weight matrix of the base model. In one embodiment of the present disclosure, the weight matrix of the inference model for a combination task may correspond to the sum of one or more weight matrices of the corrected combination adapter and the weight matrix of the base model.
[0113] In operation (514), the electronic device (100) can obtain an output based on the merged model and user input. The electronic device (100) can obtain an output corresponding to the user input by using the weight matrix of the inference model obtained in operation (512) or the weight matrix of the inference model obtained in operation (508). The electronic device (100) can provide the output obtained in operation (514) in response to the user input.
[0114] FIG. 6 illustrates operations performed by an electronic device (100) according to one embodiment of the present disclosure.
[0115] Referring to FIG. 6, the electronic device (100) may perform operations (602, 606, 608, 610, 612). However, the present disclosure is not limited thereto, and the operations (602, 606, 608, 610, 612) may be performed by any electronic device alone or in cooperation with a plurality of electronic devices. The electronic device (100) may omit any of the operations illustrated in FIG. 6 and / or additionally perform operations not illustrated in FIG. 6. In one embodiment, the order of at least some of the operations (602, 606, 608, 610, 612) may be changed.
[0116] The electronic device (100) may receive user input including English input text and a request for a Spanish summary of the English input text. In operation (602), the electronic device (100) may identify a combination task directed by the user input. The electronic device (100) may analyze the user input and identify (or determine) a task to achieve a goal directed by the user input. The electronic device (100) may identify whether the identified task is a combination task. In response to identifying that the identified task is a combination of multiple tasks supported by the electronic device (100), the electronic device (100) may identify that the identified task is a combination task. The electronic device (100) may determine the multiple tasks included in the combination task. In one or more examples, the user input may be identified as a combination task by inputting the user input into an LLM or learning model trained to identify multiple tasks included in the user input and to identify the types of tasks within the user input. For example, an electronic device (100) can identify one or more tasks corresponding to a user input by inputting the user input into an LLM trained to identify a combination of one or more tasks to achieve the goal of the user input.
[0117] For example, the electronic device (100) can identify from user input that the goal of the user input is to generate a Spanish summary for English input text. The electronic device (100) can identify that the task to be performed to achieve the goal of the user input is a combination of summarizing the input text and translating the summary into Spanish. Accordingly, the electronic device (100) can identify that the identified task is a combination task consisting of a combination of summarizing the input text and translating the summary into Spanish. The electronic device (100) can determine the tasks to be performed as summarizing the input text and translating the summary into Spanish.
[0118] In operation (606), the electronic device (100) may combine adapters (604) corresponding to tasks included in the combination task identified through operation (602). For example, the electronic device (100) may combine a summary adapter corresponding to a summary of input text and a translation adapter corresponding to a Spanish translation. In one embodiment of the present disclosure, the electronic device (100) may load the summary adapter and the translation adapter from the storage device among the stored adapters. In one embodiment of the present disclosure, the electronic device (100) may form a combined adapter by performing a linear merging of the summary adapter and the translation adapter. For example, the weights of the combined adapter may be obtained by calculating a weighted average of the weights of the summary adapter and the translation adapter. In one embodiment of the present disclosure, the electronic device (100) may calculate the weighted average by applying the same weight to the adapters or by applying a weight defined for each adapter (e.g., a predefined or predetermined weight).
[0119] In operation (608), the electronic device (100) can calibrate the coupling adapter. The electronic device (100) can calibrate the coupling adapter using one or more calibration parameters. Through operation (608), the coupling adapter can be calibrated to be specialized for the combination task identified in operation (602), e.g., summarizing English text and translating Spanish. In one embodiment of the present disclosure, the electronic device (100) can add one or more calibration parameters to the coupling adapter.
[0120] In operation (610), the electronic device (100) can merge the corrected combination adapter with a pre-trained base language model. To generate an output corresponding to data in the form of a given text, the electronic device (100) can select the language model as the base model. By merging the corrected combination adapter with the pre-trained base language model, the electronic device (100) can obtain an inference model specialized for summarizing English text and translating it into Spanish.
[0121] In operation (612), the electronic device (100) can perform inference using an inference model. The electronic device (100) can use an inference model specialized for summarizing English text and translating Spanish, which is obtained in operation (610). By inputting a given English input text into the inference model, the electronic device (100) can obtain a Spanish summary for the given English input text. For example, based on the given English input text, the inference model can generate a Spanish summary for the given English input text. The electronic device (100) can provide the Spanish summary generated from the inference model.
[0122] In the embodiment illustrated in FIG. 6, instead of performing first inference using a summary adapter and a base language model and second inference using a translation adapter and a base language model, respectively, the electronic device (100) may perform one inference using a combined adapter and a base language model that combines the summary adapter and the translation adapter. Accordingly, the amount of computation performed by the electronic device (100) is reduced, and the response speed to user input can be improved.
[0123] FIG. 7 illustrates combining adapters to form a combined adapter and correcting a combined model according to one embodiment of the present disclosure.
[0124] Referring to FIG. 7, the first task The first adapter (702) specialized for is weight matrices , It may include. Second task The second adapter (704) specialized for is weight matrices , It may include correction parameters (706) can be shared across all layers. For example, correction parameters (706) can be shared among the layers of the base model into which the coupling adapter is inserted.
[0125] The first adapter (702) and the second adapter (704) can be combined using linear merging. For example, the weight matrices of the combined adapter formed by merging the first adapter (702) and the second adapter (704). , It can be obtained through mathematical formula 3.
[0126]
[0127] In mathematical formula 3, the weight matrix of the first adapter (702) and the weight matrix of the second adapter (704) It can be linearly merged using the same weight (e.g., 0.5). Weight matrices of the combined adapter , are correction parameters It can be corrected using (706). For the combined adapter matrix, column-wise It can be applied as in mathematical formula 4.
[0128]
[0129] In mathematical equation 4, operation It can represent element-by-column addition. Learnable biases It can be trained in advance. Biases It can be trained after being initialized to 0. For example, correction parameters The vector (or set) of (706) is a matrix Correction parameters can be added to each column. (706) can be formed as column vectors and weight matrices , , , It can have a relatively small size compared to. Therefore, the electronic device (100) can store correction parameters with less storage space.
[0130] FIG. 8 illustrates combining adapters to form a combined adapter and correcting a combined model according to one embodiment of the present disclosure. Referring to FIG. 8, a first task The first adapter (802) specialized for is weight matrices , It may include. Second task The second adapter (804) specialized for is weight matrices , It may include correction parameters (806) can be shared across all layers. For example, correction parameters (806) can be shared among the layers of the base model into which the coupling adapter is inserted.
[0131] The first adapter (802) and the second adapter (804) can be combined using linear merging. A weighted average can be calculated for the first adapter (802) and the second adapter (804) using different learnable weights. For example, the weight matrices of the combined adapter formed by merging the first adapter (802) and the second adapter (804). , It can be obtained through mathematical formula 5.
[0132]
[0133] In mathematical formula 5, the weight matrix of the first adapter (802) and the weight matrix of the second adapter (804) It can be linearly merged using different weights. can be a learnable parameter. are correction parameters It can be optimized with the learning of (806). One weight for each component that exists, or for all layers It can be shared. For example, the first task and 2nd task Combination task that is a combination of Used for This can also be applied to other combinatorial tasks. In one or more examples, weights per combinatorial task can be learned. Weights applied to each combination task It may differ. Used for combining adapters for a specific layer of the base model. It can also be used for other layers. In one or more examples, weights per layer of the base model can be learned.
[0134] Weight matrices of the combined adapter obtained through Equation 5 , are correction parameters It can be corrected using (806). For example, the weight matrices of the combined adapter , It can be corrected based on mathematical formula 4, or corrected as in the embodiment of FIG. 8 described later.
[0135] FIG. 9 illustrates combining adapters to form a combined adapter and correcting a combined model according to one embodiment of the present disclosure.
[0136] Referring to FIG. 9, the first task The first adapter (902) specialized for is weight matrices , It may include. Second task The second adapter (904) specialized for is weight matrices , It may include. The correction matrix (906) consists of two low-rank matrices , It may include (here, rank The correction matrix (906) can be shared across all layers. For example, the correction matrix (906) can be shared among the layers of the base model into which the combined adapter is inserted.
[0137] The first adapter (902) and the second adapter (904) can be combined using linear merging. For example, the weight matrices of the combined adapter formed by merging the first adapter (902) and the second adapter (904). , It can be obtained based on Equation 3. In one or more examples, the weight matrices of the combined adapter , It may also be obtained based on Equation 5. The correction matrix (906) may be added to the top of the reconstructed combined adapter, which may result in a full matrix update such as Equation 6:
[0138]
[0139] The correction matrix (906) consists of two low-rank matrices , It can be implemented by multiplying. In contrast to the combined adapter, the correction matrix (906) can be shared across all layers of the base model. Unlike correction parameters implemented as column bias vectors or row bias vectors, the correction matrix (906) can include more parameters. Accordingly, the correction effect can be improved.
[0140] FIG. 10a illustrates correction parameters according to one embodiment of the present disclosure.
[0141] Referring to FIG. 10a, one or more correction parameters can be learned for each combination task. For example, the first combination task Correction parameters for This can be learned. 2 Combination task Correction parameters for This can be learned. Third combination task Correction parameters for This can be learned. 4. Combination task Correction parameters for This can be learned. By optimizing the correction parameters separately for each combination task, the performance of the correction of the combination adapter for each combination task can be improved.
[0142] For example, to generate a response to user input, the electronic device (100) has a first combination task including a first task and a second task from the user input. It can identify. The electronic device (100) can load a first adapter for a first task and a second adapter for a second task. First combined task Correction parameters for Based on, the electronic device (100) performs a first combination task from the first adapter and the second adapter. The coupling adapter for can be reconfigured. The electronic device (100) is a first combination task Merging the combination adapter and base model for the first combination task An inference model for can be obtained. For example, the electronic device (100) loads one or more weight matrices of a base model stored in a storage device (218), and at least one of the loaded weight matrices and a first combination task One or more weight matrices of the combination adapter for can be merged. First combination task Using a reasoning model for, the electronic device (100) can generate a response to a given user input.
[0143] Next, the electronic device (100) may receive new additional user input. To generate an additional response to the additional user input, the electronic device (100) generates a second combined task including a third task and a fourth task from the additional user input. It can identify. The electronic device (100) can load a third adapter for a third task and a fourth adapter for a fourth task. Second combination task Correction parameters for Based on, the electronic device (100) performs a second combination task from the third adapter and the fourth adapter. The coupling adapter for can be reconfigured. The electronic device (100) is a second combination task Merging the combination adapter and base model for the second combination task You can obtain an inference model for .
[0144] For example, the electronic device (100) reloads one or more weight matrices of a base model stored in a storage device (218), and at least one of the loaded weight matrices and a second combination task At least one of the weight matrices of one or more combination adapters for can be merged. In one or more examples, the electronic device (100) is a first combination task First combinatorial task in the inference model for Subtract the weight matrices corresponding to the combination adapter for, and the second combination task At least one of the weight matrices of the combination adapter for can be added. Second combination task Using a reasoning model for, the electronic device (100) can generate a response to a given user input.
[0145] FIG. 10b illustrates correction parameters according to one embodiment of the present disclosure.
[0146] Referring to FIG. 10b, correction parameters can be shared among combination tasks. For example, the first combination task , 2nd combination task , 3rd combination task , and the 4th combination task Correction parameters for This can be learned. Correction parameters By sharing it among all combination tasks, correction parameters Small storage space may be used for storing.
[0147] For example, to generate a response to user input, the electronic device (100) has a first combination task including a first task and a second task from the user input. It can identify. The electronic device (100) can load a first adapter for a first task and a second adapter for a second task. Correction parameters Based on, the electronic device (100) performs a first combination task from the first adapter and the second adapter. The coupling adapter for can be reconfigured. The electronic device (100) is a first combination task By using a reconfigured combination adapter for, a response to user input can be generated.
[0148] Next, the electronic device (100) may receive new additional user input. To generate an additional response to the additional user input, the electronic device (100) generates a second combined task including a third task and a fourth task from the additional user input. It can identify. The electronic device (100) can load a third adapter for a third task and a fourth adapter for a fourth task. First combination task Correction parameters used for Based on, the electronic device (100) performs a second combination task from the third adapter and the fourth adapter. By using a combination adapter for, additional responses to additional user input can be generated.
[0149] FIG. 11 illustrates a flowchart of a method (1100) for training correction parameters by a server (200) according to one embodiment of the present disclosure.
[0150] Referring to FIG. 11, the method (1100) may include operations (1102, 1104, 1106, 1108, 1110, 1112). The method (1100) may be performed by a server (200). However, the present disclosure is not limited thereto, and the operations (1102, 1104, 1106, 1108, 1110, 1112) may be performed by any electronic device alone or in cooperation by a plurality of electronic devices. A method (1100) according to one embodiment of the present disclosure is not limited to that shown in FIG. 11, any one of the operations shown in FIG. 11 may be omitted, and may further include operations not shown in FIG. 11. In one embodiment, the order of at least some of the operations (1102, 1104, 1106, 1108, 1110, 1112) may be changed.
[0151] In one embodiment of the present disclosure, the method (1100) may be performed using given training steps T, a learning rate, a base model (e.g., a base AI model or a foundation model), single-task adapters, and training examples (or training data) from a combination task. The method (1100) may be performed prior to deploying the base model to an electronic device (100).
[0152] In operation (1102), the server (200) has correction parameters and step t can be initialized. For example, the server (200) can initialize the correction parameters and step t can be initialized to 0. In operation (1104), the server (200) can identify whether the current step t is the same as a given training step T. Based on whether the current step t is the same as a given training step T, the server (200) corrects the parameters Training can be terminated. Based on the fact that the current stage t is not the same as the given training stage T, the server (200) can perform operation (1106).
[0153] In operation (1106), the server (200) has correction parameters The combination adapter can be calibrated using [the following]. For example, the server (200) combines single-task adapters for a specific combination task to obtain a combination adapter, and calibrates the combination adapter using [the following] parameters. It can be calibrated using [this]. Accordingly, single-task adapters can be transformed into calibrated combined adapters. In operation (1108), the server (200) can merge the calibrated combined adapter with the base model. Accordingly, a merged model adapted to a specific combined task can be obtained.
[0154] In operation (1110), the server (200) can obtain predictions by inputting one or more training samples into the merged model. For example, the server (200) can sample one or more examples from training data associated with a combination task. Each example may include input training data and output training data corresponding to the result of performing the combination task on the input training data. The server (200) can input the obtained examples (or training samples) into the merged model. The merged model can generate predictions in response to the training examples or training samples.
[0155] In operation (1112), the server (200) corrects parameters through back-propagation It can be updated. For example, during backpropagation, the weight matrices of the base model and the combined adapter are frozen, and the correction parameters Only can be updated. In one embodiment of the present disclosure, the loss function may be based on cross-entropy loss. The server (200) may increment the training step t by 1 and then perform operation (1104) again.
[0156] In one embodiment of the present disclosure, the base model may be a language model (or a large-scale language model). Accordingly, the model formed by merging the base model and the combined adapter can generate next-token predictions for input data (e.g., text data) of given training examples. A loss function can be calculated by comparing the next-token predictions with the output data (e.g., text data) of the given training examples. Based on the loss function, correction parameters It can be updated through this backpropagation.
[0157] In one embodiment of the present disclosure, correction parameters for a plurality of combination tasks This can be updated. After the server (200) performs the method (1100) for the first combination task, it may perform the method (1100) for the second combination task at least partially. For example, for the second combination task, in operation (1102), the server (200) corrects the parameters can be initialized only the training step t without initializing . For the second combination task, in operation (1106), the server (200) corrects the parameters Adapters for multiple tasks included in the second combination task can be combined and corrected using [this]. For the second combination task, in operation (1108), the server (200) can merge the corrected combination adapter with the base model. For the second combination task, in operation (1110), the server (200) can obtain a prediction by inputting one or more training samples associated with the second combination task into the merged model. For the second combination task, in operation (1112), the server (200) corrects the parameters through backpropagation It can be updated. Accordingly, the correction parameters These multiple combination tasks can be updated.
[0158] In one embodiment of the present disclosure, the method (1100) may be performed for at least some of all possible combinations of downstream tasks supported by the electronic device (100). For example, three downstream tasks by the electronic device (100) , , Based on this support, the server (200) tasks , Combination task composed of a combination of , tasks , Combination task composed of a combination of , and tasks , , Combination task composed of a combination of The method (1100) can be performed on at least a portion of. Accordingly, the correction parameters Multiple combination tasks to be performed by this electronic device (100) can be updated.
[0159] In one embodiment of the present disclosure, a plurality of combination tasks inside Regarding, a set of multiple correction parameters inside It can be learned independently. For example, the first combinatorial task Correction parameters for This can be learned. 2 Combination task Correction parameters for This can be learned. Third combination task Correction parameters for This can be learned. 4. Combination task Correction parameters for This can be learned.
[0160] In one embodiment of the present disclosure, correction parameters Training and calibration parameters of Fine-tuning on-device based on this can be performed based on the algorithms listed in Table 1.
[0161]
[0162] In one embodiment of the present disclosure, weights used for merging single-task adapters while performing the method (1100). They can be learned together. For example, in operation (1102), the server (200) has weights can be additionally initialized to 0.5. In operation (1106), the server (200) can combine the adapters based on Equation 5. In operation (1112), the server (200) through backpropagation, the weight You can further update it.
[0163] FIG. 12 illustrates a flowchart of a method (1200) performed by an electronic device (100) according to one embodiment of the present disclosure.
[0164] Referring to FIG. 12, the method (1200) may include operations (1202, 1204, 1206, 1208, 1210, 1212, 1214). The method (1200) may be performed by an electronic device (100). However, the present disclosure is not limited thereto, and the operations (1202, 1204, 1206, 1208, 1210, 1212, 1214) may be performed by any electronic device alone or in cooperation by a plurality of electronic devices. A method (1200) according to one embodiment of the present disclosure is not limited to that shown in FIG. 12, any one of the operations shown in FIG. 12 may be omitted, and may further include operations not shown in FIG. 12. In one embodiment, the order of at least some of the operations (1202, 1204, 1206, 1208, 1210, 1212, 1214) may be changed.
[0165] In operation (1202), the electronic device (100) can obtain user input from the user. In operation (1204), the electronic device (100) can identify a first task and a second task in response to the obtained user input. In operation (1206), the electronic device (100) can obtain a first adapter corresponding to the first task and a second adapter corresponding to the second task. In operation (1206), the electronic device (100) can combine the first adapter and the second adapter to form a combined adapter. In operation (1208), the electronic device (100) can correct the combined adapter using one or more correction parameters. In operation (1210), the electronic device (100) can generate an output corresponding to the user input based on the corrected combined adapter. In operation (1212), the electronic device (100) can provide the generated output to the user.
[0166] In one or more examples, to identify the first task and the second task, the electronic device (100) can identify the goal of the user input. The electronic device (100) can identify the task for achieving the goal of the user input. The electronic device (100) can identify a plurality of tasks including the first task and the second task included in the identified task.
[0167] In one or more examples, to combine the first adapter and the second adapter, the electronic device (100) may calculate a weighted average of the weight matrix of the first adapter and the weight matrix of the second adapter. Based on the calculated weighted average, the electronic device (100) may obtain a combined adapter. In one embodiment of the present disclosure, to calculate the weighted average, the weight matrix of the first adapter and the weight matrix of the second adapter may be weighted with the same weight. In one embodiment of the present disclosure, to calculate the weighted average, the weight matrix of the first adapter and the weight matrix of the second adapter may be weighted with a weight defined for each adapter.
[0168] In one or more examples, to calibrate a coupling adapter using one or more correction parameters, the electronic device (100) may add a set of column-wise parameters including one or more correction parameters and one or more weights of a weight matrix of the coupling adapter. In one or more examples, to calibrate a coupling adapter using one or more correction parameters, the electronic device (100) may add a pair of a first correction matrix including a first set of one or more correction parameters and a second correction matrix including a second set of one or more correction parameters, and a pair of a first weight matrix and a second weight matrix of the coupling adapter.
[0169] In one or more examples, to generate an output corresponding to a user input based on a corrected combined adapter, the electronic device (100) may obtain a pre-trained base model. The electronic device (100) may obtain an inference model by merging one or more weight matrices of the corrected combined adapter and the weight matrix of the base model. The electronic device (100) may obtain an output by inputting a user input into the inference model. In one or more examples, the rank of one or more weight matrices of the first adapter and one or more weight matrices of the second adapter may be lower than the rank of the weight matrix of the base model.
[0170] In one or more examples, the electronic device (100) may obtain additional user input from a user. The electronic device (100) may identify a third task and a fourth task corresponding to the additional user input. The electronic device (100) may obtain a third adapter corresponding to the third task and a fourth adapter corresponding to the fourth task. The electronic device (100) may combine the third adapter and the fourth adapter to form an additional combined adapter. The electronic device (100) may calibrate the additional combined adapter using one or more calibration parameters. Based on the calibrated additional combined adapter, the electronic device (100) may generate an additional output corresponding to the additional user input. The electronic device (100) may provide the additional output to the user.
[0171] In one or more examples, the electronic device (100) may obtain additional user input from a user. The electronic device (100) may identify a third task and a fourth task corresponding to the additional user input. The electronic device (100) may obtain a third adapter corresponding to the third task and a fourth adapter corresponding to the fourth task. The electronic device (100) may combine the third adapter and the fourth adapter to form an additional combined adapter. The electronic device (100) may calibrate the additional combined adapter using one or more additional calibration parameters corresponding to the combination of the third task and the fourth task. Based on the calibrated additional combined adapter, the electronic device (100) may generate an additional output corresponding to the additional user input. The electronic device (100) may provide the additional output to the user.
[0172] A device-readable storage medium may be provided in the form of a non-transitory storage medium. Here, 'non-transitory storage medium' simply means that it is a tangible device and does not contain a signal (e.g., electromagnetic waves), and the term does not distinguish between cases where data is stored semi-permanently and cases where it is stored temporarily. For example, a 'non-transitory storage medium' may include a buffer in which data is stored temporarily.
[0173] According to one embodiment, the method according to the various embodiments disclosed herein may be provided by being included in a computer program product. The computer program product may be traded between a seller and a buyer as a product. The computer program product may be distributed in the form of a device-readable storage medium (e.g., compact disc read-only memory (CD-ROM)), or distributed online (e.g., download or upload) through an application store or directly between two user devices (e.g., smartphones). In the case of online distribution, at least a portion of the computer program product (e.g., downloadable app) may be temporarily stored or temporarily created on a device-readable storage medium, such as the memory of a manufacturer's server, an application store's server, or a relay server.
[0174] A method according to one aspect of the present disclosure comprises: obtaining user input from a user; identifying a first task and a second task based on the user input; combining a first adapter corresponding to the first task and a second adapter corresponding to the second task to create a combined adapter; correcting the combined adapter using one or more correction parameters; generating an output corresponding to the user input based on the corrected combined adapter; and providing the generated output to the user.
[0175] According to one aspect of the present disclosure, the step of identifying the first task and the second task comprises: identifying a goal of the user input; identifying a task for achieving the goal of the user input; and identifying a plurality of tasks including the first task and the second task included in the identified task.
[0176] According to one aspect of the present disclosure, the step of combining the first adapter and the second adapter comprises: calculating a weighted average of the weight matrix of the first adapter and the weight matrix of the second adapter.
[0177] According to one aspect of the present disclosure, in order to calculate the weighted average, the weight matrix of the first adapter and the weight matrix of the second adapter are weighted with (i) the same weight or (ii) a first set of weights for the first adapter and a second set of weights for the second adapter.
[0178] According to one aspect of the present disclosure, the step of correcting the coupling adapter using the one or more correction parameters comprises: adding a set of column-wise parameters including the one or more correction parameters and one or more weights of the weight matrix of the coupling adapter.
[0179] According to one aspect of the present disclosure, the step of correcting the coupling adapter using the one or more correction parameters comprises: adding a pair of a first correction matrix comprising a first set of the one or more correction parameters and a second correction matrix comprising a second set of the one or more correction parameters, and a pair of a first weight matrix and a second weight matrix of the coupling adapter.
[0180] According to one aspect of the present disclosure, the step of generating the output corresponding to the user input based on the corrected combination adapter comprises: obtaining a pre-trained base model; obtaining an inference model by merging one or more weight matrices of the corrected combination adapter and the weight matrix of the pre-trained base model; and obtaining the output by inputting the user input into the inference model.
[0181] According to one aspect of the present disclosure, the first rank of one or more weight matrices of the first adapter and the second rank of one or more weight matrices of the second adapter are lower than the third rank of the weight matrix of the pre-trained base model.
[0182] According to one aspect of the present disclosure, the method further comprises the steps of: obtaining additional user input from the user; identifying a third task and a fourth task corresponding to the additional user input; combining a third adapter corresponding to the third task and a fourth adapter corresponding to the fourth task to generate an additional combined adapter; correcting the additional combined adapter using one or more correction parameters; generating an additional output corresponding to the additional user input based on the corrected additional combined adapter; and providing the additional output to the user.
[0183] According to one aspect of the present disclosure, the method further comprises the steps of: obtaining additional user input from the user; identifying a third task and a fourth task corresponding to the additional user input; combining a third adapter corresponding to the third task and a fourth adapter corresponding to the fourth task to generate an additional combined adapter; correcting the additional combined adapter using one or more additional correction parameters corresponding to the combination of the third task and the fourth task; generating an additional output corresponding to the additional user input based on the corrected additional combined adapter; and providing the additional output to the user.
[0184] According to one aspect of the present disclosure, a non-transient computer-readable recording medium has stored instructions that, when executed by a computer, enable the computer to perform a method comprising: identifying a first task and a second task based on the user input; combining a first adapter corresponding to the first task and a second adapter corresponding to the second task to create a combined adapter; correcting the combined adapter using one or more correction parameters; generating an output corresponding to the user input based on the corrected combined adapter; and providing the generated output to the user.
[0185] According to one aspect of the present disclosure, an electronic device comprises: a memory for storing instructions; and at least one processor operably coupled to the memory and including a processing circuit, wherein the instructions are executed by the at least one processor alone or in cooperation, so that the electronic device: obtains user input from a user; identifies a first task and a second task based on the user input; combines a first adapter corresponding to the first task and a second adapter corresponding to the second task to generate a combined adapter; corrects the combined adapter using one or more correction parameters; generates an output corresponding to the user input based on the corrected combined adapter; and provides the generated output to the user.
[0186] According to one aspect of the present disclosure, by executing the instructions alone or in cooperation by the at least one processor, the electronic device further: identifies a goal of the user input; identifies a task for achieving the goal of the user input; and identifies a plurality of tasks including the first task and the second task included in the identified task.
[0187] According to one aspect of the present disclosure, the electronic device further calculates the weighted average of the weight matrix of the first adapter and the weight matrix of the second adapter by executing the instructions alone or in combination by the at least one processor.
[0188] According to one aspect of the present disclosure, in order to calculate the weighted average, the weight matrix of the first adapter and the weight matrix of the second adapter are weighted with (i) the same weight or (ii) a first set of weights for the first adapter and a second set of weights for the second adapter.
[0189] According to one aspect of the present disclosure, by executing the instructions alone or in combination by the at least one processor, the electronic device further adds a set of column-wise parameters including the one or more correction parameters and one or more weights of the weight matrix of the combined adapter.
[0190] According to one aspect of the present disclosure, by executing the instructions alone or in combination by the at least one processor, the electronic device further: a pair of a first correction matrix comprising a first set of the one or more correction parameters and a second correction matrix comprising a second set of the one or more correction parameters, and a pair of a first weight matrix and a second weight matrix of the combination adapter.
[0191] According to one aspect of the present disclosure, the electronic device further comprises: obtaining a pre-trained base model by executing the instructions alone or in combination by the at least one processor; obtaining an inference model by merging one or more weight matrices of the corrected combined adapter and the weight matrix of the base model; and obtaining the output by inputting the user input to the inference model.
[0192] According to one aspect of the present disclosure, the electronic device further obtains additional user input from the user by the execution of the instructions alone or in combination by the at least one processor; identifies a third task and a fourth task corresponding to the additional user input; combines a third adapter corresponding to the third task and a fourth adapter corresponding to the fourth task to create an additional combined adapter; corrects the additional combined adapter using one or more correction parameters; generates an additional output corresponding to the additional user input based on the corrected additional combined adapter; and provides the additional output to the user.
[0193] According to one aspect of the present disclosure, the electronic device further obtains additional user input from the user by the execution of the instructions alone or in combination by the at least one processor (212); identifies a third task and a fourth task corresponding to the additional user input; combines a third adapter corresponding to the third task and a fourth adapter corresponding to the fourth task to create an additional combined adapter; corrects the additional combined adapter using one or more additional correction parameters corresponding to the combination of the third task and the fourth task; generates an additional output corresponding to the additional user input based on the corrected additional combined adapter; and provides the additional output to the user.
[0194] Although the embodiments have been described above with reference to limited examples and drawings, those skilled in the art can make various changes and modifications from the description above. For example, appropriate results can be achieved even if the described techniques are performed in a different order than described, and / or components such as the described computer system or module are combined or assembled in a form different from described, or replaced or substituted by other components or equivalents.
Claims
1. A step of obtaining user input from the user (1202); A step (1204) of identifying a first task and a second task based on the above user input; A step (1206) of combining a first adapter corresponding to the first task and a second adapter corresponding to the second task to create a combined adapter; A step (1208) of calibrating the coupling adapter using one or more calibration parameters; Based on the above-mentioned corrected coupling adapter, a step (1210) of generating an output corresponding to the user input; and A method comprising the step (1212) of providing the generated output to the user.
2. In Paragraph 1, The step of identifying the first task and the second task is: A step of identifying the goal of the above user input; A step of identifying a task to achieve the goal of the above user input; and A method comprising the step of identifying a plurality of tasks including the first task and the second task, which are included in the identified task.
3. In either Paragraph 1 or Paragraph 2, The step of combining the first adapter and the second adapter is: A method comprising the step of calculating the weighted average of the weight matrix of the first adapter and the weight matrix of the second adapter.
4. In Paragraph 3, A method for calculating the above weighted average, wherein the weight matrix of the first adapter and the weight matrix of the second adapter are weighted (i) with equal weights or (ii) with a first set of weights for the first adapter and a second set of weights for the second adapter.
5. In any one of paragraphs 1 through 4, The step of calibrating the coupling adapter using the above one or more correction parameters is: A method comprising the step of adding one or more weights of a set of column-wise parameters including one or more correction parameters and a weight matrix of the combined adapter.
6. In any one of paragraphs 1 through 4, The step of calibrating the coupling adapter using the above one or more correction parameters is: A method comprising the step of adding a pair of a first correction matrix comprising a first set of one or more correction parameters and a second correction matrix comprising a second set of one or more correction parameters, and a pair of a first weight matrix and a second weight matrix of the combined adapter.
7. In any one of paragraphs 1 through 6, Based on the above-mentioned corrected coupling adapter, the step of generating the output corresponding to the user input is: Step of acquiring a pre-trained base model; A step of obtaining an inference model by merging one or more weight matrices of the corrected combined adapter and the weight matrix of the pre-trained base model; and A method comprising the step of obtaining the output by inputting the user input into the inference model.
8. In Paragraph 7, A method in which the first rank of one or more weight matrices of the first adapter and the second rank of one or more weight matrices of the second adapter are lower than the third rank of the weight matrix of the pre-trained base model.
9. In any one of paragraphs 1 through 8, A step of obtaining additional user input from the above user; A step of identifying a third task and a fourth task corresponding to the additional user input above; A step of creating an additional combined adapter by combining a third adapter corresponding to the third task and a fourth adapter corresponding to the fourth task; A step of calibrating the additional coupling adapter using the above one or more correction parameters; Based on the above-mentioned corrected additional coupling adapter, a step of generating an additional output corresponding to the additional user input; and A method further comprising the step of providing the above additional output to the user.
10. In any one of paragraphs 1 through 8, A step of obtaining additional user input from the above user; A step of identifying a third task and a fourth task corresponding to the additional user input above; A step of creating an additional combined adapter by combining a third adapter corresponding to the third task and a fourth adapter corresponding to the fourth task; A step of correcting the additional coupling adapter using one or more additional correction parameters corresponding to a combination of the third task and the fourth task; Based on the above-mentioned corrected additional coupling adapter, a step of generating an additional output corresponding to the additional user input; and A method further comprising the step of providing the above additional output to the user.
11. A computer-readable recording medium having a program recorded thereon for performing the method of any one of paragraphs 1 through 10 on a computer.
12. In the electronic device (100): Memory for storing instructions (214); and It includes at least one processor (212) that is operably coupled to the memory (214) and includes a processing circuit, and By executing the above instructions alone or in cooperation by the at least one processor (212), the electronic device (100) is: Obtain user input from the user; Based on the above user input, identify the first task and the second task; To create a combined adapter, a first adapter corresponding to the first task and a second adapter corresponding to the second task are combined; Calibrate the coupling adapter using one or more calibration parameters; Based on the above-mentioned corrected coupling adapter, generate an output corresponding to the user input; and An electronic device that provides the above-generated output to the user.
13. In Paragraph 12, By executing the above instructions alone or in cooperation by the at least one processor (212), the electronic device additionally: Identify the goal of the above user input; Identifying tasks to achieve the goal of the above user input; and An electronic device for identifying a plurality of tasks including the first task and the second task, which are included in the identified task.
14. In either Paragraph 12 or Paragraph 13, The electronic device, wherein the above instructions are executed by the at least one processor (212) either alone or in combination, thereby further calculating the weighted average of the weight matrix of the first adapter and the weight matrix of the second adapter.
15. In any one of paragraphs 12 through 14, The electronic device, wherein the above instructions are executed by the at least one processor (212) either alone or in combination, further adds a set of column-wise parameters including the one or more correction parameters and one or more weights of the weight matrix of the combined adapter.