Electronic device and control method therefor
The electronic device dynamically adjusts neural network model size and complexity based on task difficulty and resource availability, addressing LLM resource constraints and improving efficiency in on-device environments.
Patent Information
- Application Number
- PCT/KR2026/004931
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2025-11-19
- Filing Date
- 2026-03-27
- Publication Date
- 2026-11-26
AI Technical Summary
Large Language Models (LLMs) require significant computational resources and are difficult to execute in on-device environments with limited memory and power, and conventional methods for balancing processing efficiency and response quality are inflexible.
An electronic device dynamically determines the size of a neural network model based on task difficulty and resource availability, adjusting the model's complexity to fit the device's capabilities, and uses a sub-model to identify optimal layers for generating responses.
This approach allows efficient and flexible handling of diverse user tasks while optimizing resource usage, enhancing performance in constrained environments.
Smart Images

Figure KR2026004931_26112026_PF_FP_ABST
Abstract
Description
Electronic device and control method thereof
[0001] The present disclosure relates to an electronic device and a method for controlling the same.
[0002] Large Language Models (LLMs) are trained on vast amounts of data to possess the ability to understand and generate natural language, and are utilized in various language-based tasks such as question answering, translation, and summarization. Due to their general-purpose nature, LLMs offer the advantage of being able to handle diverse tasks with a single model structure.
[0003] However, since LLM generally requires a very large number of parameters and high computational resources, it has the disadvantage that it is difficult to execute LLM directly in an on-device environment where memory and computational power are limited.
[0004] Conventional technology has used a method of generating a response by evaluating the complexity of user input and selecting different expert modules or pre-prepared lightweight modules based on that level. In other words, the approach aimed to balance processing efficiency and response quality by assigning modules with low computational loads to simple tasks and more sophisticated modules to complex tasks. However, this method consumes significant resources as multiple modules are prepared in advance and reside in memory. Furthermore, the module selection process is fixed or limited, which restricts the ability to flexibly respond to diverse user needs.
[0005] An electronic device according to the present disclosure comprises a memory in which at least one instruction is stored and a processor operatively coupled to the memory, wherein when the at least one instruction is executed collectively or individually by the processor, the electronic device may, when a user input is acquired, acquire information regarding a task corresponding to the user input, determine the size of a neural network model for generating a response to the user input based on at least one of the information regarding the task or the resource information of the electronic device, and input the user input to a neural network model of the determined size to generate a response to the user input.
[0006] When the above at least one instruction is executed collectively or individually by the processor, the electronic device may acquire at least one keyword from the user input and, based on information about a plurality of previously stored tasks, acquire information about the type of task corresponding to the at least one keyword and difficulty information indicating the difficulty level of the type of task.
[0007] When the above at least one instruction is executed collectively or individually by the processor, the electronic device determines the size of the neural network model based on difficulty information of the task corresponding to the user input, and the size of the neural network model may increase as the difficulty level of the task indicated by the difficulty information increases, and the size of the neural network model may decrease as the difficulty level of the task indicated by the difficulty information decreases.
[0008] The resource information of the electronic device includes at least one of memory information, heat information, and battery information of the electronic device, and when the at least one instruction is executed collectively or individually by the processor, if the electronic device is identified as a first usage environment based on the resource information of the electronic device, the size of the neural network model is determined as a first size, and if the electronic device is identified as a second usage environment based on the resource information of the electronic device, the size of the neural network model is determined as a second size smaller than the first size, the first usage environment is an environment having a first level of available resources required for the operation of the electronic device, and the second usage environment is an environment having a second level of available resources required for the operation of the electronic device, and the first level of available resources may be larger than the second level of available resources.
[0009] Meanwhile, when the above at least one instruction is executed collectively or individually by the processor, the electronic device may identify layers among a plurality of layers included in the neural network model for generating a response to the user input based on the determined size.
[0010] When the above at least one instruction is executed collectively or individually by the processor, the electronic device may obtain information about tokens including the number and index of tokens for identifying the plurality of layers based on information about the user input and the task, obtain one or more confidence values for the plurality of layers included in the neural network model based on the information about the tokens, and identify the layers among the plurality of layers for generating a response to the user input based on the one or more confidence values for the plurality of layers.
[0011] Meanwhile, when the above at least one instruction is executed collectively or individually by the processor, the electronic device inputs the user input to a sub-model to obtain one or more confidence values for a plurality of layers included in the neural network model, and identifies the layers among the plurality of layers to generate a response to the user input based on the one or more confidence values for the plurality of layers, and the sub-model may be trained to output confidence values for a plurality of layers included in the neural network model in response to the reception of the user input based on information about a plurality of previously stored tasks and resource information of the electronic device.
[0012] The above sub-model includes an embedding layer included in the neural network model, one or more transformer layers, and one or more output layers that output one or more confidence values for the plurality of layers, and the one or more output layers may be independent of the neural network model.
[0013] Meanwhile, the above sub-model is trained independently of the above neural network model, and the above sub-model may include an embedding layer, one or more transformer layers, and one or more layers that output one or more confidence values for the plurality of layers.
[0014] When the above at least one instruction is executed collectively or individually by the processor, the electronic device may obtain a performance indicator for a neural network model of the determined size based on the generated response and update the size of the neural network model based on the performance indicator.
[0015] A control method for an electronic device according to the present disclosure may include, when a user input is obtained, a step of obtaining information about a task corresponding to the user input; a step of determining the size of a neural network model for generating a response to the user input based on at least one of the information about the task or the resource information of the electronic device; and a step of inputting the user input into a neural network model of the determined size to generate a response to the user input.
[0016] The step of obtaining information about a task corresponding to the above user input may include the step of obtaining at least one keyword from the above user input and the step of obtaining information about the type of task corresponding to the at least one keyword and difficulty information indicating the difficulty level of the type of task based on information about a plurality of previously stored tasks.
[0017] The step of determining the size of the neural network model includes the step of determining the size of the neural network model based on difficulty information of a task corresponding to the user input, wherein the size of the neural network model increases as the difficulty level of the task indicated by the difficulty information increases, and the size of the neural network model decreases as the difficulty level of the task indicated by the difficulty information decreases.
[0018] The resource information of the electronic device comprises at least one of memory information, heat information, and battery information of the electronic device, and the step of determining the size of the neural network model further comprises the step of determining the size of the neural network model to a first size when the electronic device is identified as a first usage environment based on the resource information of the electronic device, and the step of determining the size of the neural network model to a second size smaller than the first size when the electronic device is identified as a second usage environment based on the resource information of the electronic device, wherein the first usage environment is an environment having a first level of available resources required for the operation of the electronic device, and the second usage environment is an environment having a second level of available resources required for the operation of the electronic device, and the first level of available resources may be greater than the second level of available resources.
[0019] Meanwhile, the step of inputting the user input into the neural network model of the determined size to generate a response to the user input may include the step of identifying layers among a plurality of layers included in the neural network model to generate a response to the user input based on the determined size.
[0020] The step of identifying layers for generating a response to the above user input may include: obtaining information about tokens including the number and index of tokens for identifying the plurality of layers based on information about the above user input and the task; obtaining confidence values for the plurality of layers included in the neural network model based on the information about the tokens; and identifying layers among the plurality of layers for generating a response to the above user input based on resource information of the electronic device and confidence values for the plurality of layers.
[0021] Meanwhile, the step of identifying layers for generating a response to the user input includes the step of inputting the user input into a sub-model to obtain confidence values for a plurality of layers included in the neural network model, and the step of identifying layers among the plurality of layers for generating a response to the user input based on the confidence values for the plurality of layers, wherein the sub-model may be trained to output confidence values for a plurality of layers included in the neural network model when the user input is input, based on information regarding a plurality of previously stored tasks and resource information of the electronic device.
[0022] The above sub-model includes an embedding layer included in the neural network model, one or more transformer layers, and one or more layers that output confidence values for the plurality of layers, and the one or more layers may be independent of the neural network model.
[0023] Meanwhile, the above sub-model is trained independently of the above neural network model, and the above sub-model may include an embedding layer, one or more transformer layers, and one or more layers that output confidence values for the plurality of layers.
[0024] The above control method may further include the step of obtaining a performance indicator for a neural network model of the determined size based on the generated response and the step of updating the size of the neural network model based on the performance indicator.
[0025] FIG. 1 is a block diagram briefly illustrating the configuration of an electronic device according to at least one embodiment of the present disclosure.
[0026] FIG. 2 is a block diagram showing a plurality of modules for generating a response through a neural network model of a size determined according to user input according to at least one embodiment of the present disclosure.
[0027] FIG. 3 is a flowchart for explaining the operation of an electronic device according to at least one embodiment of the present disclosure.
[0028] FIG. 4 is a drawing for explaining information about a plurality of tasks according to at least one embodiment of the present disclosure.
[0029] FIG. 5 is a drawing showing examples of various usage environments according to resource information of an electronic device according to at least one embodiment of the present disclosure.
[0030] FIG. 6 is a drawing for illustrating a method for identifying a layer to generate a response based on the size of a determined model according to at least one embodiment of the present disclosure.
[0031] FIG. 7 is a drawing for explaining a method for identifying an optimal number of layers when an electronic device is in a first usage environment based on resource information according to at least one embodiment of the present disclosure.
[0032] FIG. 8 is a diagram illustrating a method for identifying an optimal number of layers when an electronic device is in a second usage environment based on resource information according to at least one embodiment of the present disclosure.
[0033] FIG. 9 is a diagram illustrating a path according to the selection or omission of a plurality of layers of a neural network model according to at least one embodiment of the present disclosure.
[0034] FIG. 10 is a diagram illustrating a path with the maximum reliability value among a plurality of paths according to at least one embodiment of the present disclosure.
[0035] FIG. 11 is a drawing for explaining a method of obtaining a path with the maximum reliability value among a plurality of paths according to at least one embodiment of the present disclosure.
[0036] FIG. 12 is a diagram illustrating the learning process of a sub-model in which some layers are shared with a neural network model according to at least one embodiment of the present disclosure.
[0037] FIG. 13 is a diagram illustrating the inference process of a sub-model in which some layers are shared with a neural network model according to at least one embodiment of the present disclosure.
[0038] FIG. 14 is a diagram illustrating the learning process of a neural network model and an independent sub-model according to at least one embodiment of the present disclosure.
[0039] FIG. 15 is a diagram illustrating the inference process of a sub-model independent of a neural network model according to at least one embodiment of the present disclosure.
[0040] FIG. 16 is a flowchart illustrating a method for controlling an electronic device according to at least one embodiment of the present disclosure.
[0041] The terms used in the embodiments of this disclosure have been selected to be as widely used and general as possible, taking into account their functions within this 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 relevant explanatory section of this disclosure. Therefore, terms used in this disclosure should be defined not merely by their names, but based on their meanings and the overall content of this disclosure.
[0042] In this specification, expressions such as “have,” “may have,” “include,” or “may include” indicate the presence of such features (e.g., numerical values, functions, operations, or components such as parts) and do not exclude the presence of additional features.
[0043] The expression "at least one of A or / and B" should be understood as representing either "A" or "B" or "A and B".
[0044] Expressions such as "first," "second," "first," or "second" used in this specification may modify various components regardless of order and / or importance, and are used only to distinguish one component from another and do not limit said components.
[0045] Where it is stated that a component (e.g., Component 1) is "(operatively or communicatively) coupled with / to" or "connected to" another component (e.g., Component 2), it should be understood that the component may be directly connected to the other component or connected through the other component (e.g., Component 3).
[0046] The singular expression includes the plural expression unless the context otherwise indicates. In this application, terms such as "comprising" or "consisting of" are intended to specify the existence of the features, numbers, steps, actions, components, parts, or combinations thereof described in the specification, and should be understood as not precluding the existence or addition of one or more other features, numbers, steps, actions, components, parts, or combinations thereof.
[0047] In the present disclosure, a "module" or "part" performs at least one function or operation and may be implemented in hardware or software, or a combination of hardware and software. Additionally, a plurality of "modules" or a plurality of "parts" may be integrated into at least one module and implemented by at least one processor (not shown), except for a "module" or "part" that needs to be implemented in specific hardware.
[0048] In this specification, the term "user" may refer to a person using the electronic device (100). Alternatively, the term "user" may refer to a device (e.g., an artificial intelligence electronic device) using the electronic device (100).
[0049] An embodiment of the present disclosure will be described in more detail below with reference to the attached drawings.
[0050] FIG. 1 is a block diagram briefly illustrating the configuration of an electronic device (100) according to at least one embodiment of the present disclosure.
[0051] As illustrated in FIG. 1, the electronic device (100) according to the present disclosure may include a memory (110), an operation interface (120), a processor (130), a communication interface (140), and a display (150). However, the configurations illustrated in FIG. 1 are merely exemplary, and as would be understood by a person skilled in the art, new configurations may be added or some configurations may be omitted in addition to the configurations illustrated in FIG. 1.
[0052] At least one instruction regarding an electronic device (100) may be stored in the memory (110). Additionally, an operating system (O / S) for operating the electronic device (100) may be stored in the memory (110). In one or more embodiments, various software programs or applications for operating the electronic device (100) according to various embodiments of the present disclosure may be stored in the memory (110). In one or more embodiments, the memory (110) may be implemented as a volatile memory such as S-RAM (Static Random Access Memory) or D-RAM (Dynamic Random Access Memory), a non-volatile memory such as Flash Memory, ROM (Read Only Memory), EPROM (Erasable Programmable Read Only Memory), or EEPROM (Electrically Erasable Programmable Read Only Memory), a hard disk drive (HDD), or a solid-state drive (SSD).
[0053] In one or more embodiments, various software modules for operating an electronic device (100) according to various embodiments of the present disclosure may be stored in the memory (110), and a processor (130) may control the operation of the electronic device (100) by executing the various software modules stored in the memory (110). That is, the memory (110) is accessed by the processor (130), and reading / writing / modifying / deleting / updating of data by the processor (130) may be performed.
[0054] In one or more embodiments of the present disclosure, a plurality of modules (e.g., 210 to 260 shown in FIG. 2) for generating a response through a neural network model of a size determined by user input (e.g., generative AI model, multimodal model, etc.) may be stored in the memory (110). In particular, when a plurality of modules for generating a response through a neural network model of a size determined by user input are executed, the electronic device (100) may load data for various modules stored in non-volatile memory to perform various operations into volatile memory. Here, loading means the operation of bringing data stored in non-volatile memory into volatile memory and storing it so that the processor (130) can access it. As would be understood by a person skilled in the art, a module may mean a processor that executes one or more instructions to implement the function of the module, a circuit configured to perform the function of the module, or a combination thereof.
[0055] Additionally, a neural network model can be stored in memory (110).
[0056] Additionally, information regarding multiple tasks and resource information of the electronic device (100) may be stored in the memory (110). Additionally, user input, information regarding the task corresponding to the user input, and a response to the user input may be stored in the memory (110). Additionally, reliability values for multiple layers, reliability values for a selected layer, or reliability values for multiple paths may be stored in the memory (110). Additionally, update information regarding the size of the updated model may be stored in the memory (110).
[0057] In one or more embodiments, the neural network model may include at least one artificial neural network, and the artificial neural network may be composed of multiple layers. Each of the multiple neural network layers has multiple weight values and performs neural network operations through operations between the results of operations of the previous layer and the multiple weights. The multiple weights of the multiple neural network layers may be optimized based on the learning results of the neural network model. For example, the multiple weights may be updated so that the loss value or cost value obtained from the neural network model during the learning process is reduced or minimized. Here, the weight of each layer may be referred to as the parameter of each layer.
[0058] In this case, the neural network model may include at least one of various types of neural network models, such as, for example, a Transformer Network, an Encoder, a Decoder, an Auto Encoder, or a combination thereof, and the artificial neural network in this disclosure is not limited to the examples described above.
[0059] As would be understood by a person skilled in the art, various information necessary within the scope of achieving the purpose of the present disclosure may be stored in the memory (110), and the information stored in the memory (110) may be updated as it is received from an external device or input by a user.
[0060] The operation interface (120) may include various types of input devices. For example, the operation interface (120) may receive user input using a physical button implemented with multiple keys or a touch method. Alternatively, the electronic device (100) may receive user input using voice recognition.
[0061] In one or more embodiments, the electronic device (100) can obtain user input or subsequent input through the operation interface (120).
[0062] The processor (130) can control the overall operations of the electronic device (100). For example, the processor (130) can cause other components of the electronic device (100) to perform various operations by executing instructions stored in memory (110). For example, the processor (130) can control the operation of the electronic device (100) by being operatively connected to memory (110). Additionally, the processor (130) can control the operation of the electronic device (100) according to the present disclosure by executing one or more instructions stored in memory (110). The processor (130) may be composed of one or more processors.
[0063] The processor (130) may be implemented as one or more integrated circuit (or circuitry) chips and may perform various data processing operations. The processor (130) may include at least one electrical circuit and may process instructions (or programs, data, etc.) stored in memory (110) individually or collectively. The processor (130) may include a processor assembly comprising one or more processing circuits. The processor (130) may include any processing circuit that is operative to control the performance and operations of one or more components (e.g., memory (110)) of the electronic device (100). For example, the processor (130) (e.g., application processor (AP)) may be implemented as a system on chip (SoC) (e.g., a single chip or chipset). For example, the processor (130) may be implemented with a plurality of cores (or at least one core circuit), a plurality of chips, or a plurality of chipsets. For example, the processor (130) may include one or more processing circuits. For example, the processor (130) may include one or more processing circuits configured to perform the various functions of the present disclosure individually and / or collectively.
[0064] The processor (130) may include one or more of a CPU (Central Processing Unit), GPU (Graphics Processing Unit), APU (Accelerated Processing Unit), MIC (Many Integrated Core), DSP (Digital Signal Processor), NPU (Neural Processing Unit), hardware accelerator, or machine learning accelerator. The processor (130) may control one or any combination of other components of the electronic device (100) and may perform operations or data processing related to communication. The processor (130) may execute one or more programs or instructions stored in the memory (110) of the electronic device (100). For example, the processor (130) may perform a method according to one or more embodiments of the present disclosure by executing one or more instructions stored in the memory (110).
[0065] 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. That is, 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., a processor for artificial intelligence).
[0066] For example, the operation of obtaining information about a task corresponding to a user input of the present disclosure and the operation of determining the size of a neural network model for generating a response to the user input may be performed by a first processor, and the operation of generating a response to the user input using a neural network model of the determined size may be performed by a second processor. In embodiments of the present disclosure, the processor (130) may mean a system-on-chip (SoC) in which one or more processors and other electronic components are integrated, a single-core processor, a multi-core processor, or a core included in a single-core processor or a multi-core processor, wherein the core may be implemented as a CPU, GPU, APU, MIC, DSP, NPU, hardware accelerator or machine learning accelerator, etc., but the embodiments of the present disclosure are not limited thereto.
[0067] In particular, the processor (130) obtains information about a task corresponding to the user input by executing at least one instruction, determines the size of a neural network model for generating a response to the user input based on at least one of the information about the task or the resource information of the electronic device, and generates a response to the user input using a neural network model of the determined size.
[0068] In one or more embodiments, the processor (130) can obtain at least one keyword from user input by executing at least one instruction, and obtain information about the type of task corresponding to at least one keyword and difficulty information about the type of task based on information about a plurality of previously stored tasks.
[0069] In one or more embodiments, the processor (130) can determine the size of the neural network model based on the difficulty information of the task corresponding to the user input by executing at least one instruction. In this case, the size of the neural network model may increase as the difficulty of the task increases, and the size of the neural network model may decrease as the difficulty of the task decreases.
[0070] In one or more embodiments, the processor (130) executes at least one instruction so that if the electronic device is identified as a first usage environment based on the resource information of the electronic device, the size of the neural network model is determined to be a first size, and if the electronic device is identified as a second usage environment based on the resource information of the electronic device, the size of the neural network model is determined to be a second size smaller than the first size. At this time, the resource information of the electronic device may include at least one of the memory information, heat information, and battery information of the electronic device. Additionally, the first usage environment may be an environment in which the resources required for the operation of the electronic device are sufficient compared to the second usage environment.
[0071] In one or more embodiments, the processor (130) can identify layers for generating a response to a user input among a plurality of layers included in a neural network model based on a determined size by executing at least one instruction.
[0072] In one or more embodiments, the processor (130) can obtain information about tokens including the number and index of tokens for identifying multiple layers based on information about user input and task by executing at least one instruction, obtain confidence values for multiple layers included in a neural network model based on information about tokens, and identify layers among multiple layers for generating a response to user input based on confidence values for multiple layers.
[0073] In one or more embodiments, the processor (130) can input a user input into a sub-model by executing at least one instruction to obtain confidence values for a plurality of layers included in a neural network model, and identify layers among the plurality of layers to generate a response to the user input based on the confidence values for the plurality of layers. At this time, the sub-model may be trained to output confidence values for a plurality of layers included in the neural network model when a user input is input, based on information about a plurality of tasks stored in advance and resource information of an electronic device.
[0074] In one or more embodiments, the processor (130) can obtain a performance indicator for a neural network model of a size determined based on a generated response by executing at least one instruction, and update the size of the neural network model based on the performance indicator.
[0075] The communication interface (140) includes a circuit and can perform communication with an external device. Specifically, the processor (130) can receive various data or information from an external device connected through the communication interface (140) and can also transmit various data or information to the external device.
[0076] The communication interface (140) may include at least one of a Wi-Fi module, a Bluetooth module, and a wireless communication module. Specifically, the Wi-Fi module and the Bluetooth module can each perform communication in a Wi-Fi manner and a Bluetooth manner. When using a Wi-Fi module or a Bluetooth module, various connection information such as SSID can be transmitted and received first, and then various information can be transmitted and received after establishing a communication connection using this information. Additionally, the wireless communication module can perform communication according to various communication standards such as IEEE, ZigBee, 3G (3rd Generation), 3GPP (3rd Generation Partnership Project), LTE (Long Term Evolution), 5G (5th Generation), etc.
[0077] In one or more embodiments, the electronic device (100) can transmit and receive data by communicating with an external device through a communication interface (140).
[0078] In one or more embodiments, the electronic device (100) may receive user input from an external device through a communication interface (140). In another example, the electronic device (100) may transmit a response to the user input to an external device through the communication interface (140).
[0079] In one or more embodiments, the electronic device (100) can receive information about a plurality of tasks from an external device or an external server through a communication interface (140).
[0080] The display (150) is configured to display an image signal under the control of the processor (130). The display (150) can be implemented as an LCD (Liquid Crystal Display Panel), OLED (Organic Light Emitting Diodes), etc., and the display (150) can also be implemented as a flexible display, a transparent display, etc. depending on the case. However, the display (150) according to the present disclosure is not limited to a specific type. Although FIG. 1 is illustrated as if the electronic device (100) directly embeds the display (150), this can be interpreted to include not only cases where the display (150) is actually mounted on the electronic device (100) (e.g., TV, kiosk, smartphone, laptop PC, tablet PC, etc.), but also cases where it is connected to a separately provided display device (e.g., monitor, TV, beam projector, electronic whiteboard, etc.) via various wired or wireless communication methods (e.g., set-top box, PC, server, etc.).
[0081] In one or more embodiments, the display (150) may display user input.
[0082] In one or more embodiments, the display (150) may display a screen corresponding to a response to user input obtained through a neural network model.
[0083] In one or more embodiments, the display (150) may display a UI requesting feedback on the response.
[0084] FIG. 2 is a block diagram showing a plurality of modules for generating a response through a neural network model of a size determined according to user input according to at least one embodiment of the present disclosure. As shown in FIG. 2, the electronic device (100) may include a user input acquisition module (210), a task identification module (220), a token determination module (230), an execution plan module (240), a response generation module (250), and a performance evaluation module (260). Here, the plurality of modules (210 to 260) may be implemented in a software form or in a form combining software and hardware. In one or more embodiments, depending on the implementation example of the electronic device (100), at least some of the plurality of modules (210 to 260) may be included in another device.
[0085] The user input acquisition module (210) can acquire user input. The user input acquisition module (210) can acquire user input through various methods. In one or more embodiments, the user input acquisition module (210) can receive a signal corresponding to user input from an external device through a communication interface (140). In one or more embodiments, the user input acquisition module (210) can acquire audio or the user's voice through a microphone. In one or more embodiments, the user input acquisition module (210) can acquire user input through an operation interface (120).
[0086] User input obtained through the user input acquisition module (210) can be input into the task identification module (220) and the token determination module (230).
[0087] The task identification module (220) can obtain information about a task corresponding to a user input. The task identification module (220) can obtain at least one keyword included in the user input. The task identification module (220) can identify a task corresponding to at least one keyword based on information about a plurality of previously stored tasks.
[0088] The task identification module (220) can obtain information about the identified task. The task identification module (220) can obtain information about the type and difficulty of the identified task based on information about a plurality of previously stored tasks.
[0089] Information about the task obtained from the task identification module (220) can be input into the token determination module (230) and the execution plan module (240).
[0090] The token determination module (230) can obtain information about tokens including the number and index of tokens for identifying the plurality of layers based on information about user input and tasks. The information about tokens may represent information about candidate tokens that can represent user input.
[0091] Specifically, the token determination module (230) can obtain multiple tokens corresponding to the user input by performing tokenization on the user input. Subsequently, the token determination module (230) can obtain the number of tokens for identifying a layer based on the total number of tokens corresponding to the user input and the difficulty information of the task. In addition, the token determination module (230) can obtain a token index based on the number of tokens for identifying a layer and the total number of tokens corresponding to the user input.
[0092] The token determination module (230) can input information about the acquired token into the execution plan module (240).
[0093] The execution plan module (240) can determine the size of a neural network model for generating a response to a user input based on at least one of information about a task or resource information of an electronic device (100).
[0094] In this case, the size of the neural network model can represent the number of parameters included in the neural network model. For example, if the size of the neural network model is 3B, the number of parameters included in the neural network model could be 3 billion. That is, the size of the model for generating a response to user input can represent the number of parameters required to generate a response to user input.
[0095] Meanwhile, the size of the model for generating the response may be determined as a single value (e.g., 2.0B) or as a certain range (e.g., 1.5B to 2.0B).
[0096] The size of the model can correspond to the number of layers included in the model. Since each layer included in the model contains a certain number of parameters, the total number of parameters may increase as the number of layers increases. For example, if the size of the model is 3B, the number of layers included in the model may be 30.
[0097] Therefore, determining the size of the model can mean determining the number of layers required to generate a response based on user input.
[0098] In one or more embodiments, the execution plan module (240) can determine the size of the neural network model based on information about the task corresponding to the user input. The execution plan module (240) can increase the size of the model as the difficulty of the task increases, and decrease the size of the model as the difficulty of the task decreases.
[0099] In one or more embodiments, the execution plan module (240) may determine the size of the neural network model based on resource information of the electronic device (100). In this case, the resource information of the electronic device (100) may represent information regarding the state of resources available for the electronic device (100) to perform an operation.
[0100] In one or more embodiments, the execution plan module (240) may identify a usage environment based on resource information of the electronic device (100) and determine the size of the model according to the identified usage environment. If the execution plan module (240) identifies a first usage environment, it may determine the size of the model to a first size, and if the electronic device (100) identifies a second usage environment, it may determine the size of the model to a second size that is smaller than the first size. Here, the first usage environment may be an environment where there are sufficient resources required for the operation of the electronic device (100), and the second usage environment may be an environment where resources are insufficient. For example, the number of resources required in the first environment may be greater than the number of resources required in the second environment.
[0101] In one or more embodiments, the execution plan module (240) can determine the size of a neural network model for generating a response to a user input based on information about the task and resource information of the electronic device (100).
[0102] The execution plan module (240) can identify (or select) a layer to generate a response among a plurality of layers of a neural network model based on a determined size. The execution plan module (240) can identify a layer to generate a response among a plurality of layers of a neural network model within a determined model size range.
[0103] The execution plan module (240) can identify a layer among a plurality of layers to generate a response to user input based on confidence values for a plurality of layers. At this time, the confidence value may represent a value indicating the prediction accuracy for the plurality of layers. The execution plan module (240) can obtain (or calculate) confidence values for a plurality of layers based on information about tokens obtained from the token determination module (230).
[0104] In one or more embodiments, the execution plan module (240) can identify a layer among a plurality of layers to generate a response to user input based on confidence values for a plurality of layers.
[0105] In one or more embodiments, the execution plan module (240) can obtain a confidence value for a randomly selected layer among a plurality of layers included in a neural network model and identify the layer based on the obtained confidence value.
[0106] In one or more embodiments, the execution plan module (240) can identify an optimal number of layers within a range of the number of layers corresponding to the size of the model based on resource information of the electronic device (100).
[0107] In one or more embodiments, the execution plan module (240) can identify the path with the maximum reliability value among a plurality of paths corresponding to whether each of the plurality of layers is selected. In this case, the path may represent a combination of layers determined by the selection or omission (i.e., not selected) of each of the plurality of layers.
[0108] In one or more embodiments, the execution plan module (240) inputs a user input into a sub-model to obtain confidence values for multiple layers included in a neural network model, and can identify a layer among the multiple layers to generate a response to the user input based on the confidence values for the multiple layers. At this time, the sub-model may be a model trained to output confidence values for multiple layers included in a neural network model when a user input is input.
[0109] The response generation module (250) can generate a response to user input using a neural network model of a determined size. The response generation module (250) can generate a response to user input using a layer identified based on the determined size. The response generation module (250) can provide the generated response to the user.
[0110] The performance evaluation module (270) can obtain performance indicators for a neural network model of a determined size based on the response. At this time, the performance indicators may represent indicators that evaluate the performance of the neural network model of a determined size.
[0111] In one or more embodiments, the performance evaluation module (270) may obtain performance indicators based on subsequent input from the user. In this case, the subsequent input from the user may represent input received again from the user after the response has been provided to the user.
[0112] In one or more embodiments, the performance evaluation module (270) can obtain a performance indicator by comparing the output of a neural network model including a plurality of layers for the generated response and user input.
[0113] Based on the performance indicators obtained from the performance evaluation module (270), the execution plan module (240) can update the size of the model.
[0114] In one or more embodiments, the execution plan module (240) may increase the size of the model if the performance indicator is below a threshold value. The execution plan module (240) may store update information regarding the size of the updated model in memory (110). The update information is information about the updated model and may include information about the size of the updated model.
[0115] The execution plan module (240) can identify a layer to generate a response among a plurality of layers included in the neural network model based on the size of the updated model. For example, if the neural network includes N layers, the execution plan module (240) can identify a set k of some layers to generate a response, where k < N.
[0116] Meanwhile, the detailed operation of the electronic device (100) including the aforementioned plurality of modules (210 to 260) will be explained through FIG. 3.
[0117] FIG. 3 is a flowchart for explaining the operation of an electronic device (100) according to at least one embodiment of the present disclosure.
[0118] In the following embodiments, each operation may be performed sequentially, but is not necessarily performed sequentially. For example, the order of each operation may be changed, and at least two operations may be performed in parallel. For example, one operation may be started before another operation is completed.
[0119] According to one or more embodiments, operations S310 to S370 may be understood to be performed in at least one processor (e.g., processor (130) of FIG. 1) of a device (e.g., device (100) of FIG. 1).
[0120] The electronic device (100) can acquire user input (S310).
[0121] In one or more embodiments, user input may represent input for initiating interaction with a neural network model (e.g., a generative AI model, etc.). User input may be text input or voice input containing one or more texts and / or one or more sentences. Natural language text may include various information that the neural network model can use to generate a response to a user inquiry or to control the electronic device (100), such as context, intent, task, and constraints. Meanwhile, user input may be referred to by various expressions representing the same or similar concepts. User input may be replaced with expressions such as "input," "prompt," "input phrase," "user command," "directive," "starting sentence," "task query," "trigger sentence," "message," etc., but is not limited to the examples described above.
[0122] In one or more embodiments, user input may include natural language text. However, this is merely one embodiment, and user input may include one or more of text, voice, image, video, or audio.
[0123] The electronic device (100) can obtain user input through various methods. In one or more embodiments, the electronic device (100) can receive a signal corresponding to user input from an external device through a communication interface (140). In one or more embodiments, the electronic device (100) can obtain audio or the user's voice through a microphone. In one or more embodiments, the electronic device (100) can obtain user input through an operation interface (120) (e.g., a touch interface).
[0124] The electronic device (100) can obtain information about a task corresponding to user input (S320).
[0125] In this case, a task may represent a functional processing unit that a neural network model can perform based on user input. The neural network model can perform various tasks based on the intent included in the user input. For example, a task may include Intent Detection, Classification, Named Entity Recognition (NER), Information Extraction, Summarization, Function Mapping, Natural Language Generation (NLG), Dialog Response, Style Transfer, Question Answering (QA), Multi-turn Context, Reasoning, Multi-modal Understanding, etc. However, it is not limited to the examples described above and may include various types of tasks. Alternatively, a task may be replaced by a Function, Service, or Module.
[0126] In one or more embodiments, the electronic device (100) can obtain at least one keyword from user input.
[0127] In this case, keywords may represent one or more words or phrases that indicate the user's intent or context included in the user input. Keywords may include keywords corresponding to actions, keywords corresponding to objects, and keywords corresponding to conditions / contexts. Keywords corresponding to actions may represent keywords indicating an action or purpose that the user intends to perform. Keywords corresponding to objects may represent keywords designating the target of an action or information to be processed. Keywords corresponding to conditions / contexts may represent keywords describing conditions or contexts added to an action or object. Alternatively, keywords may be replaced with expressions such as Core Term, Feature Term, or Key Entity, and are not limited to the examples described above.
[0128] In one or more embodiments, the electronic device (100) may preprocess user input. In this case, the preprocessing process may include normalization, morphological analysis, part-of-speech tagging, stopword removal, etc. In this case, normalization may represent a process of converting user input into a consistent form by standardizing uppercase and lowercase letters within a sentence, cleaning up spaces and special characters, and converting character encoding. Morphological analysis may represent a process of breaking down words into morpheme units, or performing stem extraction and lemma extraction. Part-of-speech tagging may represent a process of assigning part-of-speech information to words for subsequent semantic unit analysis. Stopword removal may represent a process of removing elements that do not contribute to semantic analysis, such as particles, conjunctions, and articles.
[0129] Afterward, the electronic device (100) can identify one or more words having a semantic unit from the preprocessed user input and obtain a word among the identified one or more words that reflects the user's intention or context as a keyword.
[0130] For example, if the user input is “Identify the intent to launch the app in all future chat conversations and recommend a group of function candidates,” the electronic device (100) can obtain the keywords “future,” “all,” “chat conversation,” “intention to launch the app,” “identify,” “group of function candidates,” and “recommend.”
[0131] The electronic device (100) can identify a task corresponding to at least one keyword among a plurality of tasks that a neural network model can perform.
[0132] In one or more embodiments, the electronic device (100) can obtain an embedding vector corresponding to at least one keyword and a plurality of embedding vectors corresponding to a plurality of tasks that a neural network model can perform. The electronic device (100) can obtain a similarity score between the embedding vector corresponding to at least one keyword and the plurality of embedding vectors corresponding to a plurality of tasks.
[0133] Subsequently, the electronic device (100) can identify a task corresponding to at least one keyword based on a similarity score. The electronic device (100) can identify a task of an embedding vector whose similarity score is greater than or equal to a preset value among a plurality of embedding vectors corresponding to a plurality of tasks as a task corresponding to at least one keyword.
[0134] Meanwhile, although the above-described embodiment describes the electronic device (100) identifying one task based on at least one keyword, this is merely one example, and the electronic device (100) can identify multiple tasks corresponding to user input based on at least one keyword. For example, if the user input is “Identify the intent to launch the app during conversation in all future chats and recommend a group of function candidates,” the electronic device (100) can identify “intent detection” as the first task and “function mapping” as the second task.
[0135] The method of identifying a task corresponding to at least one keyword is not limited to the embodiments described above, and tasks can be identified in various ways.
[0136] Afterwards, the electronic device (100) can obtain information about the type of identified task and information about the difficulty level based on information about a plurality of previously stored tasks.
[0137] At this time, the information regarding multiple tasks stored in advance may represent information regarding multiple tasks defined as being executable by a neural network model. The information regarding multiple tasks may include information about the types of tasks executable by the neural network model, difficulty information regarding the types of tasks, and information about the size of the model required to perform the tasks. Referring to FIG. 4, an example of information regarding multiple tasks can be seen.
[0138] Meanwhile, as would be understood by a person skilled in the art, the information regarding the plurality of tasks shown in FIG. 4 is merely one embodiment, and only at least some of the information regarding the tasks shown in FIG. 4 may be stored. For example, among the information regarding the plurality of tasks, information regarding the type and difficulty of the tasks may be stored.
[0139] Information regarding the types of tasks may include various types of tasks that a neural network model can perform. As described above, the types of tasks may include intent detection, classification, etc. However, they are not limited to these and may include various types.
[0140] The difficulty of the task type may indicate the degree of complexity of the operation that the electronic device (100) must perform according to the task type. The difficulty of the task may vary depending on the task type, the amount of data to be processed, or the required level of accuracy.
[0141] The difficulty level of a task type can be divided into multiple levels, such as “high,” “medium,” and “low.” For example, in Fig. 4, the difficulty level of Intent Detection, Classification, and Named Entity Recognition (NER) may be “low.” Additionally, the difficulty level of Information Extraction, Summarization, Function Mapping, Natural Language Generation (NLG), Dialog Response, and Style Transfer may be “medium.” Furthermore, the difficulty level of Question Answering (QA), Multi-turn Context, Reasoning, and Multi-modal Understanding may be “high.”
[0142] However, it is not necessarily limited to this, and the difficulty of task types can be further subdivided. Additionally, the difficulty of task types can be expressed numerically.
[0143] Information regarding the model size can indicate the size of the neural network model required to perform a task, depending on the type of task. The number of parameters required to perform a task may vary depending on the type of task.
[0144] Information about multiple tasks may be stored in memory (110), but is not limited thereto, and information about multiple tasks may be stored on an external server.
[0145] Referring to FIG. 3, the electronic device (100) can determine the size of a neural network model for generating a response to user input (S330).
[0146] In this case, the response to the user input can represent the output generated by inputting the user input into a neural network model. Alternatively, the response can be replaced with output, output response, response data, inference result, predicted value, or returned message.
[0147] In one or more embodiments, the electronic device (100) can determine the size of a neural network model for generating a response to a user input based on at least one of information about a task or resource information of the electronic device (100).
[0148] In one or more embodiments, the electronic device (100) can determine the size of a neural network model based on information about a task corresponding to a user input. In particular, the electronic device (100) can determine the size of a neural network model based on difficulty information of a task corresponding to a user input.
[0149] The difficulty information of a task may represent information indicating the computational difficulty according to the type of task. In one example, the difficulty information of a task (e.g., difficulty level) may be expressed by dividing it into multiple stages, such as “high,” “medium,” and “low.” However, this is merely one example, and the difficulty information may be expressed in more detailed stages.
[0150] In one or more embodiments, the electronic device (100) may increase the size of the model as the difficulty of the task increases, and decrease the size of the model as the difficulty of the task decreases. The electronic device (100) may determine the size of the model to a first size (e.g., 2.5 to 3.5B) if the difficulty of the task corresponding to the user input is “high,” determine the size of the model to a second size (e.g., 1.2 to 2.0B) smaller than the first size if the difficulty of the task is “medium,” and determine the size of the model to a third size (e.g., 0.3 to 0.7B) smaller than the second size if the difficulty of the task is “low.”
[0151] For example, in the case of “Intent Detection” with a difficulty level of “low,” the electronic device (100) can determine the size of the model to be 0.3 to 0.7B, and in the case of “Reasoning” with a difficulty level of “high,” the size of the model can be determined to be 2.5 to 3.5B.
[0152] That is, when the difficulty of the task is high (e.g., processing a large data set or performing a high-precision operation), the electronic device (100) can generate a response to user input using a large-sized model to perform the task smoothly, and when the difficulty of the task is low (e.g., processing a small data set or performing a relatively simple operation), it can generate a response to user input using a small-sized model to reduce the use of computational resources.
[0153] In one or more embodiments, when a plurality of tasks corresponding to user input are identified, the electronic device (100) may determine the size of the model based on difficulty information for a task with a higher difficulty among the plurality of tasks. For example, if the task corresponding to user input includes a first task and a second task, and the difficulty of the first task is “low” and the difficulty of the second task is “high,” the electronic device (100) may determine the size of the model based on difficulty information for the second task. In this regard, for efficiency, the same model may be used to process the first task and the second task.
[0154] This is because a large-sized model corresponding to a high-difficulty task can smoothly perform a low-difficulty task, but a small-sized model corresponding to a low-difficulty task cannot perform a high-difficulty task. In one or more examples, multiple tasks may be divided into a first subset and a second subset, a first model of size 1 may be used to process the tasks of the first subset, and a second model of size 2 different from the first may be used to process the tasks of the second subset.
[0155] In one or more embodiments, the electronic device (100) can determine the size of the neural network model based on resource information of the electronic device (100).
[0156] At this time, the resource information of the electronic device (100) may represent information regarding the state of a resource available for the electronic device (100) to perform an operation. The resource information of the electronic device (100) may include at least one of memory information, heat information, or battery information of the electronic device (100).
[0157] In this case, the memory information may represent information about the state of memory resources. The memory information may include information about total memory capacity, usage, and available memory.
[0158] The heat information may represent information about the temperature generated in the internal configuration of the electronic device (100). The heat information may include information about the temperature of the processor or battery of the electronic device (100).
[0159] Battery information may indicate information regarding the status of the battery. Battery information may include information regarding the remaining charge, charging status, battery life, etc.
[0160] The electronic device (100) can identify a usage environment based on resource information of the electronic device (100) and determine the size of a model according to the identified usage environment. If the electronic device (100) is identified as a first usage environment (e.g., optimal environment), the size of the model can be determined as a first size, and if the electronic device (100) is identified as a second usage environment (e.g., general environment), the size of the model can be determined as a second size smaller than the first size. Here, the first usage environment may be an environment where there are sufficient resources required for the operation of the electronic device (100), and the second usage environment may be an environment where resources are insufficient.
[0161] That is, the electronic device (100) may determine the size of the model to a first size when there is a first usage environment where there are sufficient resources required for operation, and determine the size of the model to a second size that is smaller than the first size when there is a second usage environment where resources are relatively insufficient. In one or more examples, the resources available for the first usage environment may be larger than the resources required for the second usage environment.
[0162] In one or more embodiments, the electronic device (100) may determine the size of the model as a first size if the memory capacity (e.g., RAM capacity) is greater than or equal to a threshold value (e.g., 10GB), and determine the size of the model as a second size smaller than the first size if the memory capacity is less than the threshold value.
[0163] In one or more embodiments, the electronic device (100) can determine the size of the model as a first size if the heat generation value (e.g., NPU temperature) is greater than or equal to a threshold value (e.g., 41°C or higher), and determine the size of the model as a second size smaller than the first size if the heat generation value is less than the threshold value.
[0164] In one or more embodiments, the electronic device (100) may determine the size of the model as a first size if the remaining battery level is greater than or equal to a threshold value (e.g., 50%), and determine the size of the model as a second size smaller than the first size if the remaining battery level is less than the threshold value.
[0165] Meanwhile, an embodiment in which the size of a model is determined based on one of memory information, heat information, or battery information has been described above, but is not necessarily limited thereto. The electronic device (100) may determine the size of a model based on a combination of memory information, heat information, or battery information.
[0166] Meanwhile, the first and second usage environments described above are merely examples, and depending on the resource information of the electronic device (100), the usage environment can be divided into two or more different types, and the size of the model can be determined accordingly.
[0167] Referring to FIG. 5, examples of various usage environments (e.g., device scenarios, 510) according to resource information (520) of an electronic device (100) can be seen. For example, in FIG. 5, when the usage environment of the electronic device (100) is in an “optimal state (RAM state 10~12GB, NPU temperature 40°C or lower, battery 50% or higher)”, the model size for performing “Intent Detection” can be determined to be 0.7B and the model size for performing “Function Mapping” can be determined to be 2.0B. On the other hand, when the usage environment of the electronic device (100) is in a “normal state (RAM state 8~10GB, NPU temperature 41~42°C, battery 30% or higher)”, the model size for performing “Intent Detection” can be determined to be 0.7B and the model size for performing “Function Mapping” can be determined to be 1.5B to 2.0B.
[0168] In one or more embodiments, the electronic device (100) can determine the size of a neural network model for generating a response to a user input based on information about a task and resource information of the electronic device (100).
[0169] In one or more embodiments, the electronic device (100) may determine the size of a neural network model as a first size based on task difficulty information and determine the size of the model within the first size range based on resource information. At this time, the electronic device (100) may determine the size of the model as a second size based on resource information if the electronic device (100) is in a first usage environment, and determine the size of the model as a third size smaller than the second size if the electronic device (100) is in a second usage environment. At this time, both the second size and the third size may be smaller than the first size.
[0170] Meanwhile, the above-described embodiment is one embodiment, and the electronic device (100) may determine the size of the model as a first size based on resource information and determine the size of the model within the first size based on task difficulty information.
[0171] Referring to FIG. 3, the electronic device (100) can identify a layer for generating a response among a plurality of layers of a neural network model based on the size of a determined model (S340).
[0172] At this time, the size of the determined model may correspond to a certain range. In addition, the size of the model may correspond to the number of layers having a certain range. For example, if the task is “Function Mapping”, the size of the model may be determined to be 1.2B to 2.0B, which may correspond to 12 to 20 layers.
[0173] The electronic device (100) can identify a layer for generating a response among a plurality of layers of a neural network model within a determined model size range.
[0174] At this time, the layer for generating the response may include one or more layers.
[0175] In one or more embodiments, the electronic device (100) may obtain information about tokens, including the number and index of tokens for identifying layers based on information about user input and tasks. Based on the information about tokens, the electronic device (100) may obtain confidence values for a plurality of layers included in a neural network model, and based on the confidence values for the plurality of layers, identify a layer among the plurality of layers for generating a response to user input.
[0176] In this case, the information regarding the token may represent information regarding a token for identifying a layer. A token for identifying a layer may represent one or more tokens capable of representing a user input among multiple tokens corresponding to the user input, and may alternatively be referred to as a candidate token. That is, the information regarding the token may include information regarding the number and index of candidate tokens representing the user input.
[0177] A detailed method for an electronic device (100) to identify a layer based on information about a token will be described later through FIGS. 6 to 11.
[0178] In one or more embodiments, the electronic device (100) inputs a user input into a sub-model to obtain confidence values for a plurality of layers included in a neural network model, and can identify a layer among the plurality of layers to generate a response to the user input based on the confidence values for the plurality of layers.
[0179] At this time, the sub-model may be a model trained to output confidence values for multiple layers included in the neural network model when user input is input, based on information about multiple tasks stored in advance and resource information of the electronic device.
[0180] Meanwhile, the sub-model may share some of the multiple layers included in the neural network model, or it may exist independently of the neural network model.
[0181] A specific method for the electronic device (100) to identify a layer using a sub-model will be described later through FIGS. 12 to 15.
[0182] Meanwhile, the electronic device (100) can store information regarding reliability values for multiple layers in memory (110). Subsequently, when the model size is updated based on performance indicators, the electronic device (100) can re-identify the layers based on the reliability values for multiple layers.
[0183] The electronic device (100) can generate a response to user input (S350).
[0184] The electronic device (100) can generate a response to a user input by using an identified layer among a plurality of layers included in a neural network model. The electronic device (100) can generate a response to a user input by sequentially inputting the user input into the identified layers. That is, the electronic device (100) can generate a response to a user input by inputting the user input into the first layer (i.e., the first layer) among the identified layers and transmitting the output of each identified layer as the input to the next identified layer.
[0185] For example, in a neural network model including layers 1 through 5, if layers 1, 3, and 4 are identified as layers for generating a response, the electronic device (100) can input a user input to layer 1 and transmit the output of layer 1 as the input to layer 3. Subsequently, the electronic device (100) can generate a response to the user input by transmitting the output of layer 3 as the input to layer 4.
[0186] Through the method described above, the electronic device (100) can generate a response to user input using a neural network model of a determined size.
[0187] Afterwards, the electronic device (100) can provide the generated response to the user.
[0188] In one or more embodiments, the electronic device (100) may display the generated response through the display (150). The electronic device (100) may display a UI corresponding to the generated response through the display (150).
[0189] In one or more embodiments, the electronic device (100) can output voice audio corresponding to the generated response through a speaker. Specifically, the electronic device (100) can obtain voice audio by converting the generated response into Text-to-Speech (TTS) and output the obtained voice audio through a speaker.
[0190] In one or more embodiments, the electronic device (100) may transmit the generated response to an external device. The response may be provided to a user through the external device.
[0191] The electronic device (100) can obtain performance indicators for a neural network model of a size determined based on the response (S360).
[0192] In this context, performance metrics can represent indicators that evaluate the performance of a neural network model of a determined size. Performance metrics can be obtained by considering the quality of the response, the output speed of the response, and the resources consumed to output the response. Alternatively, performance metrics may be referred to as quality metrics, Quality of Service, or Key Performance Indicators (KPIs).
[0193] Performance metrics may include various indicators such as response accuracy, relevance, precision, and user satisfaction scores. In this context, accuracy may represent an indicator of how closely the generated response matches the user's intent or correct answer data. Relevance may represent an indicator that quantifies the semantic similarity between the user input and the response. Precision may represent an indicator that assesses the degree to which the response is semantically appropriate and minimizes unnecessary information. User satisfaction may represent an indicator of the user's satisfaction with the generated response and may be evaluated based on explicit or implicit reactions provided by the user after the response is delivered (e.g., positive / negative ratings, star ratings, follow-up inquiries, etc.). Meanwhile, performance metrics are not limited to the examples described above and may include a variety of other performance metrics.
[0194] In one or more embodiments, the electronic device (100) may obtain a subsequent input from a user and obtain a performance indicator based on the subsequent input from the user. In this case, the subsequent input from the user may represent an input received again from the user after a response has been provided to the user.
[0195] The electronic device (100) can display a UI requesting feedback on the response through a display (150) and obtain subsequent input from the user. However, it is not limited to this, and subsequent input from the user can be obtained immediately after providing the response without a separate feedback request.
[0196] Subsequent user input may include user feedback regarding the provided response. In this case, user feedback may represent the user's reaction or evaluation to the response. User feedback regarding the provided response may include positive feedback (e.g., an evaluation stating "it was helpful," or using the response as is) or negative feedback (e.g., indicating that the response is inappropriate or repeatedly entering the same question). User feedback is not limited to the examples described above and may include cases where the user enters a direct evaluation (e.g., satisfaction surveys, star ratings, likes / dislikes, etc.) or presents a new follow-up question.
[0197] The electronic device (100) can increase the performance indicator if the user's feedback included in the user's subsequent input is positive, and decrease the performance indicator if the user's feedback is negative.
[0198] However, it is not limited to the examples described above, and performance indicators can be obtained based on the user's subsequent input in various ways.
[0199] In one or more embodiments, the electronic device (100) can obtain a performance indicator by comparing the output of a neural network model including multiple layers for a generated response and a user input. The electronic device (100) can calculate the similarity between an embedding vector corresponding to the generated response and an embedding vector corresponding to the output of a neural network model including multiple layers, and obtain a performance indicator based on the calculated similarity. At this time, the similarity can be calculated through various methods such as cosine similarity, Euclidean distance, and Kullback-Leibler divergence.
[0200] The electronic device (100) can update the size of the model based on performance indicators (S370).
[0201] In one or more embodiments, the electronic device (100) can increase the size of the model if the performance indicator is below a threshold value. That is, if the performance of the response generated through the model of a determined size does not meet the criteria, a more accurate response can be generated by using a model of a larger size than the determined size.
[0202] Conversely, the electronic device (100) can reduce the size of the model if the performance indicator is above a threshold value. That is, if the performance of the generated response satisfies the criteria, the response can be generated while efficiently utilizing the resources of the electronic device (100) through a model smaller than the predetermined size.
[0203] In one or more embodiments, when the size is determined according to the usage environment of the electronic device (100), the electronic device (100) can update the size of the model based on performance indicators. For example, when the electronic device (100) has sufficient resources in a first usage environment, the size of the model is determined, and if the performance indicator of the response generated through the model of the determined size is above a threshold value, the size of the previously determined model can be reduced. Conversely, when the electronic device (100) has insufficient resources in a second usage environment, the size of the model is determined, and if the performance indicator of the response generated through the model of the determined size is below a threshold value, the size of the previously determined model can be increased.
[0204] Accordingly, the electronic device (100) can dynamically adjust the size of the model according to performance indicators and usage environment, thereby enabling the generation of a response with sufficient performance while efficiently using resources when new user input is acquired later.
[0205] The electronic device (100) can store update information regarding the size of the updated model in memory (110). The update information is information about the updated model and may include information regarding the size of the updated model. The update information may include information about the task corresponding to the user input, resource information, the size of the predetermined model, evaluation indicators for the generated response, and information regarding the size of the updated model accordingly. When a new user input is obtained, the electronic device (100) can determine the size of the model based on the update information.
[0206] Subsequently, the electronic device (100) can identify a layer for generating a response among a plurality of layers included in the neural network model based on the size of the updated model (S340). The electronic device (100) may also generate a new response to user input using the identified layer.
[0207] Below, a specific method for identifying layers will be explained through FIGS. 6 to FIGS. 15.
[0208] FIGS. 6 to 11 are drawings for explaining a method of identifying a layer based on information about a token according to one or more embodiments.
[0209] In one or more embodiments, the electronic device (100) obtains confidence values for a plurality of layers included in a neural network model based on information about a token, and can identify a layer among the plurality of layers to generate a response to a user input based on the confidence values for the plurality of layers.
[0210] At this time, the confidence value may represent a value indicating the prediction accuracy for multiple layers. The electronic device (100) can obtain confidence values for multiple layers by performing forwarding on multiple layers of a neural network model. At this time, forwarding may represent a process of obtaining the output of each layer by performing tokenization on input data and propagating the obtained multiple tokens in the forward direction to the neural network model. At this time, the electronic device (100) can obtain confidence values using the output of each layer.
[0211] At this time, tokenization may represent the process of dividing input data corresponding to user input into tokens, which are the smallest units that can be processed by a neural network model. A token may represent the smallest unit into which input data is divided so that it can be processed by a neural network model. The electronic device (100) may perform tokenization in various ways depending on the type of input data, and detailed methods will be described later.
[0212] Meanwhile, identifying a layer by the confidence value obtained by directly inputting multiple tokens corresponding to user input into a neural network model may be inefficient. Therefore, the electronic device (100) can obtain a confidence value using candidate tokens that can represent user input and identify a layer through this.
[0213] In other words, a candidate token is one or more tokens capable of representing a user input among multiple tokens corresponding to the user input, and can be used to identify the layer responsible for generating a response among multiple layers of a neural network model. Candidate tokens may also be referred to as representative tokens, substitute tokens, etc.
[0214] Below, we will explain how to acquire candidate tokens.
[0215] The electronic device (100) can perform tokenization on user input to obtain multiple tokens corresponding to user input.
[0216] The electronic device (100) can obtain multiple tokens by performing tokenization in various ways depending on the type of input data corresponding to user input. In one or more embodiments, when the input data is text, the electronic device (100) can obtain multiple tokens by dividing the text into preset units (e.g., subword units, character units, byte units). In one or more embodiments, when the input data is an image, the electronic device (100) can obtain multiple image tokens by dividing the image into multiple patches or extracting a feature map from the image and converting the multiple patches or feature maps into vectors. In one or more embodiments, when the input data is a video, the electronic device (100) can obtain multiple video tokens by dividing the video into multiple frames and then converting the multiple patches or feature maps obtained for each frame into vectors. In one or more embodiments, when the input data is audio, the electronic device (100) may convert the audio signal into the time-frequency domain and extract feature vectors such as spectrograms or Mel-Frequency Cepstral Coefficients (MFCC) to obtain multiple audio tokens. In one or more embodiments, when the input data is user voice, the electronic device (100) may convert the user voice into text (Speech-to-Text) and then perform tokenization on the converted text to obtain multiple text tokens. Meanwhile, when the input data is data combining two or more of text, image, video, audio, or voice, the electronic device (100) may perform tokenization for each of them in the manner described above.
[0217] Subsequently, the electronic device (100) can obtain a candidate token among a plurality of tokens corresponding to user input. At this time, information regarding the candidate token may include the number of tokens and an index for identifying a layer. Hereinafter, information regarding the candidate token may be referred to as information regarding the token.
[0218] In one or more embodiments, the electronic device (100) can obtain a number of tokens for identifying multiple layers based on user input and information about a task. Specifically, the electronic device (100) can obtain a number of tokens for identifying layers through the following mathematical formula 1 based on the total number of tokens corresponding to the user input and information about the difficulty of the task.
[0219]
[0220] Here, m represents the number of tokens for identifying layers, kc represents a coefficient corresponding to the task difficulty information, and n represents the total number of tokens corresponding to user input.
[0221] At this time, k c is a coefficient corresponding to the task difficulty information, and can represent a higher value as the task difficulty increases. In other words, the higher the task difficulty, the more tokens can be selected. In one or more examples, k c The value of can be classified as a difficulty level. For example, k between 0 and k1 c The value can be classified as “low,” k1~k2 can be classified as “medium,” and k2~k3 can be classified as “high.” Here, k1, k2, and k3 are integers, and k3 > k2 > k1.
[0222] Afterwards, the electronic device (100) can obtain a token index through the following mathematical formula 2 based on the number of tokens for identifying layers and the total number of tokens corresponding to user input.
[0223]
[0224] At this time, S represents the set of selected token indices, n represents the total number of tokens corresponding to user input, m represents the number of tokens for identifying layers, and k represents the sequence number for evenly distributing tokens.
[0225] Subsequently, the electronic device (100) can obtain confidence values for multiple layers included in a neural network model based on information about the token. The electronic device (100) can obtain a candidate token corresponding to a token index among multiple tokens corresponding to user input.
[0226] Afterwards, the electronic device (100) can perform forwarding to the neural network model based on the candidate token to obtain a confidence value for the layer included in the neural network model.
[0227] In one or more embodiments, the electronic device (100) can obtain confidence values for a plurality of layers included in a neural network model. In one or more embodiments, the electronic device (100) can obtain confidence values for some of the layers among the plurality of layers included in a neural network model.
[0228] The electronic device (100) can identify a layer for generating a response to user input among a plurality of layers included in a neural network model based on the acquired confidence value.
[0229] Meanwhile, since normal operation is impossible when the resource usage of the electronic device (100) exceeds the maximum available limit, the electronic device (100) must identify the layer by considering the resource usage. At this time, the resource usage may represent the resource usage consumed by the electronic device (100) according to the identification of the layer.
[0230] The electronic device (100) can identify a layer for generating a response within the resource usage limit of the electronic device (100). For example, the resource usage limit may be a condition where RAM usage is below a threshold (e.g., 2.3GB) and power usage is below a threshold (e.g., 8W). However, it is not limited to this, and the resource usage limit may be set differently depending on the performance of the electronic device (100).
[0231] In various embodiments to be described below regarding a method for identifying a layer, the electronic device (100) can identify a layer for generating a response within resource usage limits.
[0232] In one or more embodiments, the electronic device (100) can obtain a confidence value for a randomly selected layer among a plurality of layers included in a neural network model.
[0233] At this time, the electronic device (100) may arbitrarily select a layer within the range of the number of layers corresponding to the size of the model determined in step S330. For example, if the size of the model is determined to be 1.2B to 2.0B in step S330, a layer may be selected within the range of 12 to 20 corresponding layers.
[0234] The electronic device (100) can generate a response to user input using an arbitrarily selected layer when the acquired reliability value is greater than or equal to a threshold value (e.g., 95%).
[0235] On the other hand, if the obtained reliability value is less than a threshold value, the electronic device (100) can obtain a reliability value by selecting any layer among a plurality of layers again. At this time, the electronic device (100) can obtain a reliability value by arbitrarily selecting more than the number of layers previously selected. That is, if the reliability value for the first number of layers previously selected is less than a threshold value, the electronic device (100) can obtain a reliability value by arbitrarily selecting the first number or a second number of layers greater than the first number.
[0236] In this way, the electronic device (100) can identify a layer for generating a response based on whether the acquired reliability value is greater than or equal to a threshold value.
[0237] Referring to FIG. 6, N layers (e.g., 12) can be randomly selected for a neural network model containing 38 layers. The electronic device (100) can obtain a confidence value for the N randomly selected layers. At this time, if the obtained confidence value is greater than or equal to a threshold value, the electronic device (100) can generate a response to a user input using the N randomly selected layers.
[0238] In one or more embodiments, the electronic device (100) may store information and reliability values for a plurality of selected layers in memory (110) when the reliability value corresponding to a plurality of randomly selected layers is greater than or equal to a threshold value. Subsequently, the electronic device (100) may generate a response to a user input using a plurality of layers corresponding to the highest reliability value. In one or more examples, when the number of layers having reliability values exceeding the threshold is greater than N, N layers having the highest reliability value may be selected.
[0239] In one or more embodiments, the electronic device (100) can identify an optimal number of layers within a range of the number of layers corresponding to the size of the model based on resource information of the electronic device (100).
[0240] If the electronic device (100) is identified as having sufficient resources in a first usage environment based on resource information, it can obtain a reliability value for the layer selected as the maximum number within the range of the number of layers corresponding to the size of the determined model.
[0241] Subsequently, if the acquired reliability value is greater than or equal to a threshold value (e.g., 95%), the electronic device (100) can acquire a reliability value for a first number of layers that is less than the maximum number. If the reliability value for the first number of layers is greater than or equal to a threshold value (e.g., 95%), the electronic device (100) can acquire a reliability value for a second number of layers that is less than the first number. That is, the electronic device (100) can acquire a reliability value for selected layers while gradually decreasing the number of selected layers from the maximum number.
[0242] The electronic device (100) can identify the minimum number of layers where the acquired reliability value is above a threshold value as the optimal number of layers. That is, the electronic device (100) can identify the last number of layers where the acquired reliability value is maintained above a threshold value as the optimal number of layers. The electronic device (100) can generate a response to user input using the optimal number of layers. That is, if resources are sufficient, the optimal layer configuration can be derived by starting with a model with a large number of layers and gradually reducing them.
[0243] Referring to FIG. 7, in the case of “Function Mapping,” the number of layers corresponding to the size of the determined model may be 12 to 20. At this time, if the electronic device (100) is identified as the first usage environment, the electronic device (100) can arbitrarily select a maximum of 20 layers to obtain a reliability value. If the reliability value for the 20 layers is greater than or equal to a threshold value, the electronic device (100) can obtain a reliability value for 19 layers. Additionally, if the reliability value for the 19 layers is greater than or equal to a threshold value, the electronic device (100) can obtain a reliability value for 18 layers. In this way, the electronic device (100) can obtain a reliability value for the selected layers while reducing the number of selected layers. If the reliability value is greater than or equal to the threshold when the number of layers is 15, and the reliability value for 14 layers is less than or equal to the threshold, the electronic device (100) can identify the 15 layers as the optimal number of layers and generate a response using the 15 layers.
[0244] Conversely, if the electronic device (100) is identified as having a second usage environment where the resources of the electronic device (100) are insufficient based on resource information, a reliability value for the minimum number of layers selected within the range of the number of layers corresponding to the size of the determined model can be obtained.
[0245] Subsequently, if the acquired reliability value is less than a threshold value (e.g., 95%), the electronic device (100) can acquire reliability values for a third number of layers greater than the minimum number. If the reliability value for the third number of layers is less than a threshold value (e.g., 95%), the electronic device (100) can acquire reliability values for a fourth number of layers greater than the third number. That is, the electronic device (100) can acquire reliability values for selected layers while gradually increasing the number of selected layers from the minimum number.
[0246] The electronic device (100) can identify the minimum number of layers at which the acquired reliability value exceeds a threshold value as the optimal number of layers. That is, the electronic device (100) can identify the number of layers at which the acquired reliability value first exceeds a threshold value as the optimal number of layers. The electronic device (100) can generate a response to user input using the optimal number of layers. That is, in the event of resource scarcity, the optimal layer configuration can be derived by starting with a model with a small number of layers and gradually expanding.
[0247] Referring to FIG. 8, the number of layers corresponding to the size of the determined model, as in FIG. 7, may be 12 to 20. At this time, if the electronic device (100) is identified as being in a second usage environment, the electronic device (100) may arbitrarily select a minimum of 12 layers to obtain a reliability value. If the reliability value for the 12 layers is less than a threshold value, the electronic device (100) may obtain a reliability value for 13 layers. Additionally, if the reliability value for the 13 layers is less than a threshold value, the electronic device (100) may obtain a reliability value for 14 layers. In this way, the electronic device (100) may obtain a reliability value for the selected layers while increasing the number of selected layers. If, when the number of layers is 15, a reliability value greater than or equal to the threshold is obtained for the first time, the electronic device (100) identifies the 15 layers as the optimal number of layers and can generate a response using the 15 layers.
[0248] Meanwhile, if the size of the model is updated based on performance indicators for the generated response, the electronic device (100) can identify an optimal number of layers within the range of the number of layers corresponding to the size of the updated model.
[0249] However, in the case of the method described above, there is a problem in that the electronic device (100) cannot guarantee the search for all layer combinations. That is, since the electronic device (100) generates a response using the layer of the combination when the confidence value for any layer combination is greater than or equal to a threshold value, it may not be able to identify combinations of layers with higher confidence values.
[0250] In one or more embodiments, the electronic device (100) can identify a path with the maximum reliability value among a plurality of paths corresponding to whether each of a plurality of layers is selected. At this time, the path may represent a combination of layers determined by the selection or omission (i.e., not selected) of each of the plurality of layers. For example, in the case of a neural network model including three layers, there may be a first path (first layer selected, second layer omitted, and third layer omitted), a second path (first layer selected, second layer omitted, and third layer selected), etc.
[0251] Referring to FIG. 9, the selection or omission of multiple layers of a neural network model is indicated. In FIG. 9, solid lines indicate layers that are selected (910, 921, 931, 941, 951), and dotted lines indicate layers that are omitted (922, 932, 942, 952).
[0252] Referring to FIG. 10, the path with the maximum reliability value among multiple paths is illustrated. In FIG. 10, the first layer (910) and the second layer (921) are selected, the third layer (932) and the fourth layer (942) are omitted, and finally, the last layer (951) is selected.
[0253] Below, a detailed method for an electronic device (100) to obtain a reliability value corresponding to each of a plurality of paths is described.
[0254] The electronic device (100) can obtain reliability values for whether each layer is selected sequentially, starting from the first layer (i.e., the first layer).
[0255] The electronic device (100) can obtain a reliability value for the selection of the first layer.
[0256] The electronic device (100) can obtain a reliability value corresponding to whether a layer after the first layer is selected. That is, the electronic device (100) can obtain a reliability value corresponding to whether the nth layer (n-th layer) after the first layer is selected.
[0257] When the n-th layer is omitted, the electronic device (100) can obtain a reliability value corresponding to the omission of the n-th layer. At this time, the reliability value corresponding to the omission of the n-th layer may be a reliability value for the path up to the n-1-th layer (i.e., the layer immediately preceding the n-th layer). That is, the reliability value corresponding to the omission of the n-th layer may represent a reliability value for one or more selected layers from the first layer to the n-1-th layer.
[0258] For example, the path up to the third layer may be a path where only the first and second layers are selected, and the reliability value of the path may be 0.4. Subsequently, if the fourth layer is omitted, the reliability value corresponding to the omission of the fourth layer may be 0.4, which is the reliability value for the path up to the third layer.
[0259] When the nth layer is selected, the electronic device (100) can obtain a reliability value corresponding to the selection of the nth layer. At this time, the reliability value corresponding to the selection of the nth layer may be a reliability value for the path to the selected nth layer. That is, the reliability value corresponding to the selection of the nth layer may represent a reliability value for one or more selected layers among the first layer to the n-1st layer and the selected nth layer.
[0260] For example, the path up to the third layer may be a path where only the first and second layers are selected, and the reliability value of the path may be 0.4. In this case, if the fourth layer is selected, the reliability value corresponding to the selection of the fourth layer may be the reliability value for the first layer, the second layer, and the fourth layer.
[0261] Meanwhile, the electronic device (100) may not obtain a reliability value corresponding to whether the nth layer is selected when the number of layers selected up to the nth layer exceeds the number of layers corresponding to the size of the model. This is to select layers within the determined size range of the model.
[0262] Additionally, the electronic device (100) may not acquire a reliability value corresponding to the selection of the nth layer if the resource usage corresponding to the selection of the nth layer exceeds the resource usage limit.
[0263] At this time, the resource usage corresponding to the selection of the nth layer may represent the resource usage consumed when obtaining a reliability value for one or more layers selected up to the nth layer when the nth layer is selected. As described above, the electronic device (100) can identify layers within the resource usage limit of the electronic device (100).
[0264] Additionally, if the resource usage corresponding to the selection of the nth layer exceeds a threshold value, the electronic device (100) may not acquire a reliability value corresponding to whether to select a layer after the nth layer. Since additional layer selection is meaningless for paths that do not satisfy resource constraints, the electronic device (100) may stop searching for subsequent layers. Through this, the optimal path can be efficiently identified without searching all paths.
[0265] Through the method described above, the electronic device (100) can obtain a reliability value corresponding to each of a plurality of paths that satisfy the number of layers corresponding to the size of the determined model and the resource usage limit.
[0266] Meanwhile, the electronic device (100) can store the reliability value obtained for each of the multiple paths in the memory (110).
[0267] Subsequently, the electronic device (100) can identify the path with the maximum reliability value among the reliability values corresponding to each of the multiple paths. The electronic device (100) can identify the multiple layers included in the identified path as multiple layers for generating a response. Subsequently, the electronic device (100) can generate a response to a user input using the multiple layers included in the identified path.
[0268] Figure 11 illustrates multiple paths depending on the selection or omission of each layer when there are three layers.
[0269] In this case, the number inside the parentheses (e.g., (1,1,2)) may represent the current state (k, r, p). The variable k may represent the number of layers selected so far, r may represent RAM usage, and p may represent power usage. Meanwhile, r may be an integer representing RAM usage in units of a preset value (e.g., 30MB), and p may be an integer representing power usage in units of a preset value (e.g., 0.2W).
[0270] For example, (1, 1, 2) can indicate that 1 layer has been selected so far, RAM usage is 1W, and power usage is 2W.
[0271] Meanwhile, the number of layers corresponding to the size of the model determined in Fig. 11 is 1 to 2, the threshold for RAM usage is 2GB, and the threshold for power usage may be 5W.
[0272] Referring to FIG. 11, the reliability values obtained for each of the multiple paths according to the selection of the first layer to the third layer are shown.
[0273] At this time, it can be confirmed that the path with the current state of (3, 3, 7) has exceeded the threshold for the number of layers corresponding to the size of the determined model, the threshold for RAM usage, and the threshold for power usage. Even if there are layers after the third layer, the electronic device (100) may not obtain a reliability value regarding whether to select a layer after the path.
[0274] In FIG. 11, the path with the maximum confidence value is the path with a confidence value of 0.85 (current state: (2, 2, 5)). The path is a path in which the first layer and the second layer are selected, and the third layer is omitted. The electronic device (100) can generate a response to user input using the first layer and the second layer of the neural network model.
[0275] Meanwhile, if the performance indicator for the response is below a threshold value, the electronic device (100) can identify a path corresponding to the next highest reliability value among multiple paths. Subsequently, the electronic device (100) can generate a new response to the user input using multiple layers included in the identified path.
[0276] Alternatively, if the size of the model is updated based on performance indicators for the generated response, the electronic device (100) can identify the path with the maximum reliability value among multiple paths within a range of the number of layers corresponding to the size of the updated model. Subsequently, the electronic device (100) can generate a new response to user input using multiple layers included in the identified path.
[0277] FIGS. 12 to 15 are drawings for explaining a method of identifying layers using a sub-model according to one or more embodiments.
[0278] In one or more embodiments, the electronic device (100) can obtain confidence values for a plurality of layers using a learned sub-model. In this case, the confidence values for the plurality of layers may include confidence values for each of the plurality of layers.
[0279] The electronic device (100) inputs user input into a sub-model to obtain confidence values for multiple layers included in a neural network model, and can identify a layer among the multiple layers to generate a response to the user input based on the confidence values for the multiple layers.
[0280] In this case, the sub-model may be a model trained to output confidence values for multiple layers included in the neural network model when user input is input.
[0281] Meanwhile, the sub-model can be trained using information on multiple previously stored tasks and resource information of the electronic device (100) as training data. Below, the method of training the sub-model will be explained.
[0282] In one or more embodiments, the electronic device (100) may input a user input into a neural network model comprising a plurality of layers to obtain a first output. Additionally, the electronic device (100) may input the user input into a plurality of layers multiplied by a confidence value, which is the output of a sub-model, as a weight to obtain a second output. The sub-model outputs a confidence value for each of the plurality of layers of the neural network model, and the output confidence value may be multiplied by each layer. The electronic device (100) may input the user input into a plurality of layers multiplied by a confidence value to obtain a second output.
[0283] The electronic device (100) can obtain a loss function based on the difference between the first output and the second output, and update the parameters of the sub-model based on the loss function.
[0284] In this case, the loss function may represent a function that numerically indicates the difference between the output value produced by the model and the target value (ground truth). The output value produced by the model may be a second output obtained using multiple layers multiplied by confidence values output from sub-models. Additionally, the target value may be a first output obtained using multiple layers of the neural network model. The loss function may provide an optimization criterion to minimize the difference between the output value and the target value during the model's training process.
[0285] The electronic device (100) can update the parameters of the sub-model based on a loss function so that the second output becomes closer to the first output. Through this process, the electronic device (100) can train the sub-model.
[0286] However, the electronic device (100) can train the sub-model in various ways and is not necessarily limited to the embodiments described above.
[0287] Subsequently, the electronic device (100) can obtain confidence values for multiple layers using a learned sub-model and generate a response to user input using one or more identified layers based on the confidence values for multiple layers.
[0288] The electronic device (100) can obtain a confidence value for each of a plurality of layers using a learned sub-model. The electronic device (100) can store the obtained confidence values for the plurality of layers in memory (110).
[0289] The electronic device (100) can identify a layer corresponding to a higher preset number of reliability values among multiple layers. At this time, the preset number may represent the number of layers corresponding to a determined size.
[0290] Alternatively, the electronic device (100) can identify a layer having a reliability value greater than or equal to a threshold value among a plurality of layers. In this case, the threshold value may be a value that serves as a criterion for identifying a number of layers corresponding to the size of a determined model. That is, the electronic device (100) can identify a number of layers corresponding to the size determined by identifying layers whose reliability value is greater than or equal to the threshold value.
[0291] Afterwards, the electronic device (100) can obtain a response to user input using the identified layer.
[0292] Meanwhile, if the performance indicator for the response is below a threshold value, the electronic device (100) can additionally identify a next-priority layer. At this time, the next-priority layer may represent a layer with a higher reliability value than the upper preset number of layers among a plurality of layers.
[0293] The electronic device (100) can obtain a new response by using a higher preset number of layers and an added next-rank layer.
[0294] Alternatively, if the size of the model is updated based on performance indicators for the generated response, the electronic device (100) can identify a pre-set number of upper layers corresponding to the size of the updated model. That is, the electronic device (100) can identify a pre-set number of upper layers corresponding to the size of the updated model among the reliability values output from the sub-model. Subsequently, the electronic device (100) can generate a new response to the user input using a plurality of layers included in the identified path.
[0295] Meanwhile, the sub-model may include an embedding layer, one or more transformer layers, and a layer that outputs confidence values for multiple layers.
[0296] In this case, the embedding layer may represent a layer that converts user input into one or more embedding vectors.
[0297] One or more transformer layers can represent layers that output new embedding vectors by identifying the correlation between embedding vectors received from the previous layer (i.e., self-attention).
[0298] A layer that outputs confidence values for multiple layers may represent a layer that outputs confidence values for multiple layers included in a neural network model based on an embedding vector received from a transformer layer. Meanwhile, the layer that outputs confidence values may include one or more layers.
[0299] In one or more embodiments, some of the layers of the sub-model may consist of at least one layer among a plurality of layers included in the neural network model. That is, some layers of the sub-model may be shared with layers of the neural network model.
[0300] In one or more embodiments, the embedding layer of the sub-model may be an embedding layer of the neural network model, and one or more transformer layers of the sub-model may be initial transformer layers of the neural network model. On the other hand, a layer that outputs confidence values for multiple layers may be configured and exist independently of the neural network model.
[0301] In this case, the electronic device (100) can train only the layer that outputs confidence values for multiple layers. Specifically, the electronic device (100) can update the parameters of the layer that outputs confidence values for multiple layers so that the second output obtained by inputting the user input into multiple layers multiplied by the confidence values output from the sub-model based on the loss function described above becomes close to the first output obtained by inputting the user input into the neural network model.
[0302] Referring to FIG. 12, the training process of a sub-model in which some layers are shared with a neural network model is illustrated. In FIG. 12, the sub-model may share the embedding layer (1220) and initial transformer layer (1231, 1232) of the neural network model and include a separate layer (1250).
[0303] During the learning process of the sub-model, the electronic device (100) can input a user input (1210) into a neural network model including multiple layers to obtain a first output (y in FIG. 12). Additionally, the electronic device (100) can multiply a confidence value (1260) for each of the multiple layers output from a separate layer (1250) by a weight to the multiple layers (1231, 1232, 1233, 1234) of the neural network model. Subsequently, the electronic device (100) inputs the user input (1210) into the multiple layers to which the confidence value is multiplied by a weight to obtain a second output (y in FIG. 12). You can obtain ).
[0304] Subsequently, the electronic device (100) has a loss function (of FIG. 12) based on the difference between the first output and the second output. ) can be obtained, and a separate layer (1250) can be trained based on the loss function.
[0305] Referring to Fig. 13, an inference process for inferring confidence values for multiple layers using a sub-model is illustrated.
[0306] The electronic device (100) can input user input (1310) into a sub-model including an embedding layer (1320), an initial transformer layer (1331, 1332), and a separate layer (1350) to obtain a reliability value (1360) for each of the multiple layers.
[0307] The electronic device (100) can identify layers (1331, 1333) that are greater than or equal to a preset value among the reliability values (1360) for multiple layers. Alternatively, the electronic device (100) can identify a preset number of layers (1331, 1333) corresponding to a higher reliability value among the reliability values (1360) for multiple layers.
[0308] Subsequently, the electronic device (100) can obtain a response to the user input (1310) using the identified layers (1331, 1333). The electronic device (100) can obtain a response to the user input (1310) using the embedding layer (1320), the identified layers (1331, 1333), and the output layer (1340) based on the user input (1310).
[0309] Since parts of the sub-model are embedded in the neural network model, performance can be improved by selecting appropriate layers using minimal memory.
[0310] In one or more embodiments, the sub-model exists independently of the neural network model and can be trained independently. In other words, multiple layers of the sub-model may exist separately from multiple layers of the neural network model.
[0311] In this case, the electronic device (100) can train the entire sub-model. The method of training the sub-model is omitted as described above.
[0312] Referring to FIG. 14, the learning process of a sub-model (1450) existing independently of a neural network model is illustrated. In FIG. 14, the sub-model (1450) may include an embedding layer (1451), one or more transformer layers (1452), and a layer (1453) that outputs a confidence value.
[0313] During the learning process of the sub-model (1450), the electronic device (100) can input a user input (1410) into a neural network model including multiple layers to obtain a first output (y in FIG. 14). Additionally, the electronic device (100) can multiply the confidence value (1460) output from the sub-model (1450) based on the user input (1410) by a weight to multiple layers (1431, 1432, 1433, 1434) of the neural network model. Subsequently, the electronic device (100) inputs the user input (1410) into multiple layers to which the confidence value is multiplied by a weight to obtain a second output (y in FIG. 14). You can obtain ).
[0314] Subsequently, the electronic device (100) has a loss function (of FIG. 14) based on the difference between the first output and the second output. ) can be obtained, and a sub-model (1450) can be trained based on the loss function.
[0315] Referring to FIG. 15, an inference process for inferring confidence values for multiple layers using a sub-model (1550) is illustrated.
[0316] The electronic device (100) can input user input (1510) into the sub-model (1550) to obtain reliability values (1560) for multiple layers.
[0317] The electronic device (100) can identify layers (1531, 1533) that are greater than or equal to a preset value among the reliability values (1560) for multiple layers. Alternatively, the electronic device (100) can identify a preset number of layers (1531, 1533) corresponding to a higher reliability value among the reliability values (1560) for multiple layers.
[0318] Subsequently, the electronic device (100) can obtain a response to the user input (1510) using the identified layers (1531, 1533). The electronic device (100) can obtain a response to the user input (1510) using the embedding layer (1520), the identified layers (1531, 1533), and the output layer (1540) based on the user input (1510).
[0319] It exists separately from the neural network model of the sub-model, so while it may require additional memory, it allows for the selection of the optimal layer with enhanced performance.
[0320] FIG. 16 is a flowchart illustrating a control method of an electronic device (100) according to at least one embodiment of the present disclosure.
[0321] When user input is obtained, the electronic device (100) can obtain information about a task corresponding to the user input (S1610).
[0322] In one or more embodiments of the present disclosure, the electronic device (100) may obtain at least one keyword from user input and, based on information about a plurality of previously stored tasks, obtain information about the type of task corresponding to at least one keyword and difficulty information about the type of task.
[0323] The electronic device (100) can determine the size of a neural network model for generating a response to a user input based on at least one of information about a task or information about the resources of the electronic device (S1620).
[0324] In one or more embodiments of the present disclosure, the electronic device (100) may determine the size of a neural network model based on difficulty information of a task corresponding to a user input. In this case, the size of the neural network model may increase as the difficulty of the task increases, and the size of the neural network model may decrease as the difficulty of the task decreases.
[0325] In one or more embodiments of the present disclosure, if the electronic device (100) is identified as a first usage environment based on the resource information of the electronic device, the size of the neural network model may be determined as a first size, and if the electronic device is identified as a second usage environment based on the resource information of the electronic device, the size of the neural network model may be determined as a second size smaller than the first size. At this time, the resource information of the electronic device may include at least one of the memory information of the electronic device, the heat information of the electronic device, and battery information. Additionally, the first usage environment may be an environment in which the resources required for the operation of the electronic device are sufficient compared to the second usage environment.
[0326] The electronic device (100) can generate a response to user input using a neural network model of a determined size (S1630).
[0327] In one or more embodiments of the present disclosure, the electronic device (100) can identify layers for generating a response to a user input among a plurality of layers included in a neural network model based on a determined size.
[0328] In one or more embodiments of the present disclosure, the electronic device (100) obtains information about tokens including the number and index of tokens for identifying a plurality of layers based on information about user input and a task, obtains confidence values for a plurality of layers included in a neural network model based on information about tokens, and can identify layers among a plurality of layers for generating a response to user input based on resource information of the electronic device and confidence values for a plurality of layers.
[0329] In one or more embodiments of the present disclosure, the electronic device (100) inputs a user input into a sub-model to obtain confidence values for a plurality of layers included in a neural network model, and can identify layers among the plurality of layers to generate a response to the user input based on the confidence values for the plurality of layers. At this time, the sub-model may be trained to output confidence values for a plurality of layers included in the neural network model when a user input is input, based on information about a plurality of tasks stored in advance and resource information of the electronic device.
[0330] In one or more embodiments of the present disclosure, the sub-model may include an embedding layer included in the neural network model, one or more transformer layers, and one or more layers that output confidence values for the plurality of layers. In this case, the one or more layers that output confidence values for the plurality of layers may be independent of the neural network model.
[0331] In one or more embodiments of the present disclosure, the sub-model is trained independently of the neural network model, and the sub-model may include an embedding layer, one or more transformer layers, and one or more layers that output confidence values for a plurality of layers.
[0332] In one or more embodiments of the present disclosure, the electronic device (100) may obtain a performance indicator for a generated response and update the size of a neural network model based on the performance indicator.
[0333] A detailed description of the operation of the electronic device (100) has been described above and will be omitted.
[0334] The various embodiments described above may be implemented individually, but are not necessarily limited thereto, and may be implemented together in combination with at least one other embodiment, either partially or wholly.
[0335] The methods according to the various embodiments of the present disclosure described above can be implemented by software upgrade or hardware upgrade alone for an existing electronic device (100).
[0336] Meanwhile, according to a specific example of the present disclosure, the control method according to the various embodiments described above may be implemented as software comprising instructions stored on a non-transitory machine-readable storage media that can be read by various machines (e.g., computers), such as an electronic device (100).
[0337] Specifically, a program for performing a control method comprising the steps of receiving user setting information corresponding to each user of a plurality of external devices from a plurality of external devices, inputting into at least one artificial intelligence model based on content information and user setting information provided by an electronic device to obtain a plurality of output audio corresponding to the user setting information, and transmitting the obtained plurality of output audio to each of the plurality of external devices may be provided in a state stored on a non-transient computer-readable recording medium.
[0338] When stored software or instructions are executed by the processor (130), the processor (130) may perform operations according to the various embodiments described above, either directly or by using other components. Instructions may include code generated or executed by a compiler or an interpreter. Here, 'non-transient' merely indicates that the storage medium does not contain a signal and is tangible, and does not distinguish whether data is stored semi-permanently or temporarily in the storage medium.
[0339] Additionally, according to one or more embodiments of the present disclosure, the method according to the various embodiments described above may be provided as 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 online through an online store as well as the non-transient readable recording medium described above. In the case of online distribution, at least a portion of the computer program product may be temporarily stored or temporarily created in a storage medium such as the memory (110) of a manufacturer's server, an application store's server, or a relay server.
[0340] Additionally, each component (e.g., module or program) according to the various embodiments described above may be composed of a single or multiple entities, and some of the aforementioned sub-components may be omitted, or other sub-components may be further included in the various embodiments. Generally or additionally, some components (e.g., module or program) may be integrated into a single entity to perform the functions performed by each of the respective components prior to integration in the same or similar manner. The operations performed by the module, program, or other components according to the various embodiments may be executed sequentially, in parallel, iteratively, or heuristically, or at least some operations may be executed in a different order, omitted, or other operations added.
[0341] Although preferred embodiments of the present disclosure have been illustrated and described above, the present disclosure is not limited to the specific embodiments described above. It is understood that various modifications can be made by those skilled in the art without departing from the essence of the present disclosure as claimed in the claims, and such modifications should not be understood individually from the technical spirit or perspective of the present disclosure.
Claims
1. In an electronic device, Memory in which at least one instruction is stored; and A processor operatively coupled with the above memory; comprising, When the above at least one instruction is executed collectively or individually by the processor, the electronic device, When user input is obtained, information regarding the task corresponding to the user input is obtained, and Determining the size of a neural network model for generating a response to the user input based on at least one of information about the above task or resource information of the above electronic device, and An electronic device that inputs the user input into a neural network model of the above-determined size to generate a response to the user input.
2. In Paragraph 1, When the above at least one instruction is executed collectively or individually by the processor, the electronic device, Obtaining at least one keyword from the above user input, and An electronic device that obtains information about the type of task corresponding to at least one keyword and difficulty information indicating the difficulty level of the type of task based on information about a plurality of previously stored tasks.
3. In Paragraph 2, When the above at least one instruction is executed collectively or individually by the processor, the electronic device, The size of the neural network model is determined based on the difficulty information of the task corresponding to the above user input, and An electronic device in which the size of the neural network model increases as the difficulty level of the task indicated by the difficulty information increases, and the size of the neural network model decreases as the difficulty level of the task indicated by the difficulty information decreases.
4. In Paragraph 1, The resource information of the above electronic device is, The electronic device includes at least one of memory information, heat information, and battery information, and When the above at least one instruction is executed collectively or individually by the processor, the electronic device, If the electronic device is identified as a first usage environment based on the resource information of the electronic device, the size of the neural network model is determined as a first size, and If the electronic device is identified as a second usage environment based on the resource information of the electronic device, the size of the neural network model is determined to be a second size smaller than the first size. The first usage environment is an environment having a first level of available resources required for the operation of the electronic device, and the second usage environment is an environment having a second level of available resources required for the operation of the electronic device, wherein the first level of available resources is greater than the second level of available resources, an electronic device.
5. In Paragraph 1, When the above at least one instruction is executed collectively or individually by the processor, the electronic device, An electronic device that identifies layers for generating a response to the user input among a plurality of layers included in the neural network model based on the size determined above.
6. In Paragraph 5, When the above at least one instruction is executed collectively or individually by the processor, the electronic device, Based on the information regarding the above user input and the above task, information about a token including the number and index of tokens for identifying the above layers is obtained, and Based on information regarding the above token, one or more confidence values for a plurality of layers included in the neural network model are obtained, and An electronic device that identifies the layers among the plurality of layers for generating a response to the user input based on one or more confidence values for the plurality of layers.
7. In Paragraph 5, When the above at least one instruction is executed collectively or individually by the processor, the electronic device, The above user input is input into a sub-model to obtain one or more confidence values for a plurality of layers included in the neural network model, and Based on one or more confidence values for the plurality of layers, the layers among the plurality of layers for generating a response to the user input are identified, and The above sub-model is, An electronic device trained to output confidence values for a plurality of layers included in the neural network model in response to the reception of user input, based on information about a plurality of previously stored tasks and resource information of the electronic device.
8. In Paragraph 7, The above sub-model is, The embedding layer and one or more transformer layers included in the above neural network model and It includes one or more output layers that output one or more reliability values for the plurality of layers mentioned above, and The above one or more output layers are electronic devices independent of the neural network model.
9. In Paragraph 7, The above sub-model is trained independently of the above neural network model, and The above submodel is an electronic device comprising an embedding layer, one or more transformer layers, and one or more layers that output one or more reliability values for the plurality of layers.
10. In Paragraph 1, When the above at least one instruction is executed collectively or individually by the processor, the electronic device, Based on the above-mentioned generated response, performance indicators for a neural network model of the above-mentioned determined size are obtained, and An electronic device that updates the size of the neural network model based on the above performance indicators.
11. In a method for controlling an electronic device, When user input is obtained, a step of obtaining information about a task corresponding to the user input; A step of determining the size of a neural network model for generating a response to the user input based on at least one of information about the task or resource information of the electronic device; and A control method comprising the step of inputting the user input into a neural network model of the determined size to generate a response to the user input.
12. In Paragraph 11, The step of obtaining information about a task corresponding to the above user input is, A step of obtaining at least one keyword from the above user input; and A control method comprising the step of obtaining information on the type of task corresponding to at least one keyword and difficulty information indicating the difficulty level of the type of task, based on information on a plurality of previously stored tasks.
13. In Paragraph 12, The step of determining the size of the above neural network model is, The method includes the step of determining the size of the neural network model based on difficulty information of the task corresponding to the user input; A control method in which the size of the neural network model increases as the difficulty level of the task indicated by the difficulty information increases, and the size of the neural network model decreases as the difficulty level of the task indicated by the difficulty information decreases.
14. In Paragraph 11, The resource information of the above electronic device is, The electronic device includes at least one of memory information, heat information, and battery information, and The step of determining the size of the above neural network model is, If the electronic device is identified as a first usage environment based on resource information of the electronic device, the step of determining the size of the neural network model as a first size; and If the electronic device is identified as a second usage environment based on resource information of the electronic device, the method further includes the step of determining the size of the neural network model to a second size smaller than the first size. A control method wherein the first usage environment is an environment having a first level of available resources required for the operation of the electronic device, and the second usage environment is an environment having a second level of available resources required for the operation of the electronic device, and the first level of available resources is greater than the second level of available resources.
15. In Paragraph 11, The step of inputting the user input into a neural network model of the determined size to generate a response to the user input is: A control method further comprising the step of identifying layers for generating a response to the user input among a plurality of layers included in the neural network model based on the size determined above.
