Method for generating a language model and electronic device
The method generates a new language model by calculating parameter differences and changes between base, functional, and target models, effectively integrating domain-specific capabilities without retraining, thus overcoming performance loss and resource challenges.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-03-27
- Publication Date
- 2026-03-16
AI Technical Summary
Existing language models face challenges in maintaining desired performance during additional tuning due to catastrophic forgetting and the need for extensive training data and resources when further fine-tuning or continual learning is required, especially when transitioning between languages or domains.
A method for generating a new language model by calculating the difference between parameters of a base model and a functional model, and the rate of change in a target model, allowing for the creation of a new model without a training process, incorporating specified functions and domain-specific training data.
Enables efficient and convenient generation of language models that integrate domain-specific capabilities without the need for additional training, addressing issues of catastrophic forgetting and resource-intensive processes.
Smart Images

Figure 2026048032000001_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to a method for generating a language model and an electronic device.
Background Art
[0002] Recently, in the field of natural language processing technology, techniques have been developed to optimize the performance of a model by adding desired functions through supervised fine tuning (SFT) or reinforcement learning from human feedback (RLHF) using a large language model (LLM) as a base model to meet user needs. For example, when an LLM is trained in a specific language, due to problems where the specific language appears in fields that require generation in other languages, it may be necessary to perform additional training in the language to be used. As another example, when an LLM is trained with general knowledge, due to a lack of expertise in a specific area or the inability to match the data and requirements within a specific company, it may be necessary to perform tuning to match the expertise in the area to be used and the needs of the company.
[0003] Generally, a base model can be used when performing additional tuning to suit a specific purpose using LLM (Low-Level Modeling). However, when performing further fine-tuning or continual learning on a model to which a specified function has been added via SFT (Structure-Focused Technique) or RLHF (Reinforced-Low-Level Learning) or similar methods, it becomes difficult to obtain a model with the desired performance. For example, catastrophic forgetting can occur during the additional tuning process, where existing capabilities are forgotten. Furthermore, when a base model is further trained with training data from a specified domain, performing SFT or RLHF again to add specific capabilities requires a vast amount of training data and resources. Therefore, there is a need to develop a technology that generates a new model without a training process, using a functional model (a base model with a specified function added) and a target model (a base model further trained with training data from a specified domain). [Prior art documents] [Patent Documents]
[0004] [Patent Document 1] Korean Registered Patent Publication No. 10-2572828 [Overview of the Initiative] [Problems that the invention aims to solve]
[0005] This disclosure provides a method for generating a language model and an electronic device for solving the aforementioned problems. [Means for solving the problem]
[0006] This disclosure can be embodied in a variety of ways, including methods, apparatus (systems), and / or computer programs.
[0007] According to one embodiment of the present disclosure, a method for generating a language model, performed by at least one processor, may include the steps of: obtaining a base model pre-trained on a large corpus, a functional model to which a specified function has been added to the base model, and a target model to which the base model has been further trained on training data of a specified domain; calculating a first difference between a first parameter of the functional model and a second parameter of the base model corresponding to the first parameter; calculating the rate of change of a third parameter of the target model corresponding to the second parameter with respect to the second parameter; and generating a new model from the target model based on the first difference and rate of change.
[0008] This disclosure provides a computer program for executing a method for generating a language model according to one embodiment of this disclosure on a computer.
[0009] According to one embodiment of the present disclosure, the electronic device includes a memory and at least one processor connected to the memory and configured to execute at least one computer-readable program contained in the memory, the at least one program may include instructions for generating a new model from the target model based on the first difference between a first parameter of the functional model and a second parameter of the base model corresponding to the first parameter, calculating the rate of change of a third parameter of the target model corresponding to the second parameter with respect to the second parameter, and based on the first difference and rate of change, instructions for generating a new model from the target model. [Effects of the Invention]
[0010] According to some embodiments of this disclosure, a functional model is created by adding a specified function to a base model, and a target model is created by further training the base model with training data from a specified domain. By generating a new model without a training process, it is possible to support the generation of language models more conveniently and efficiently.
[0011] Furthermore, according to some embodiments of this disclosure, it is possible to generate a new model based on the difference between the corresponding parameters of the base model and the functional model, and the rate of change of the corresponding parameters of the base model and the target model, thereby supporting the generation of a language model that adds the capabilities of the functional model to the target model without a learning process.
[0012] The effects of this disclosure are not limited thereto, and other technical effects not mentioned herein should be clearly understood by a person with ordinary skill in the art to which this disclosure pertains ("ordinary art") from the claims. [Brief explanation of the drawing]
[0013] The embodiments of this disclosure will be described based on the following attached drawings. Here, similar reference numerals indicate similar elements, but are not limited thereto. [Figure 1] This figure illustrates an electronic device for generating a language model according to one embodiment of the present disclosure. [Figure 2] This diagram shows a schematic configuration in which an information processing system is linked to communicate with multiple user terminals, in relation to data processing according to one embodiment of the present disclosure. [Figure 3] This is a block diagram showing the internal configuration of a user terminal and information processing system according to one embodiment of the present disclosure. [Figure 4] This figure illustrates a method for calculating the difference between corresponding parameters of a base model and a functional model according to one embodiment of the present disclosure. [Figure 5] This figure illustrates a method for calculating the percentage change of corresponding parameters in a base model and a target model according to one embodiment of the present disclosure. [Figure 6] A diagram for explaining a method of applying a calculated conversion ratio to a calculated difference value according to an embodiment of the present disclosure. [Figure 7] A diagram for explaining a method of generating a new model using a value obtained by applying a calculated conversion ratio to a calculated difference value according to an embodiment of the present disclosure. [Figure 8] A diagram for explaining an activation function used when calculating a change ratio according to an embodiment of the present disclosure. [Figure 9] A diagram showing pseudo code used for generating a language model according to an embodiment of the present disclosure. [Figure 10] A diagram for explaining a method of generating a language model according to an embodiment of the present disclosure.
Mode for Carrying Out the Invention
[0014] <Summary of the Invention> According to one embodiment, the step of calculating the change ratio may include a step of calculating a second difference value between a third parameter and a second parameter, and a step of inputting the second difference value into an activation function to obtain a change ratio.
[0015] According to one embodiment, the activation function may include at least one of a sigmoid function or a ReLU (Rectified Linear Unit) function.
[0016] According to one embodiment, the method of generating a language model may further include a step of normalizing after obtaining the absolute value of the second difference value before inputting the second difference value into the activation function.
[0017] According to one embodiment, the step of generating a new model may include a step of generating a new model based on a value obtained by multiplying a value obtained by subtracting the change ratio from 1 and a first difference value and then adding the result to a third parameter.
[0018] According to one embodiment, the first difference value and change rate can be calculated separately for the corresponding layers of the base model, functional model, and target model.
[0019] According to one embodiment, the specified function may include at least one of the following: a response generation function for command words, a chat function, a search extension generation function, a context extension function, or a coding function.
[0020] According to one embodiment, the designated domain may include at least one of the following: a foreign language domain, a specialized knowledge domain, or a corporate domain.
[0021] According to one embodiment, calculating the rate of change may include calculating a second difference between the third parameter and the second parameter, and inputting the second difference into an activation function to obtain the rate of change.
[0022] According to one embodiment, at least one program may further include instructions for normalizing the second difference after calculating its absolute value, before inputting the second difference into the activation function.
[0023] According to one embodiment, generating a new model may include generating a new model based on a value obtained by subtracting the rate of change from 1, multiplying it by a first difference value, and then adding that value to a third parameter.
[0024] <Detailed description of the invention> The specific details for implementing this disclosure will be described below in detail based on the attached drawings. However, in the following explanation, specific descriptions of publicly known functions and configurations will be omitted if there is a risk of unnecessarily obscuring the gist of this disclosure.
[0025] In the attached drawings, identical or corresponding components are assigned the same reference numerals. Furthermore, in the following descriptions of embodiments, redundant descriptions of identical or corresponding components may be omitted. However, the omission of a description of a component should not be interpreted as meaning that such a component is not included in a particular embodiment.
[0026] The advantages and features of the embodiments disclosed, and the methods for achieving them, will become clear with reference to the embodiments described below, based on the accompanying drawings. However, this disclosure is not limited to the embodiments disclosed below and can be embodied in a variety of different forms. These embodiments are provided only to complete the disclosure and to enable those skilled in the art to accurately recognize the category of the invention.
[0027] This disclosure provides a brief explanation of the terminology used and a detailed description of the embodiments of the disclosure. The terminology used in this disclosure has been selected to the greatest extent possible from commonly used terms, taking into account the function of the disclosure; however, this may change due to the intent of engineers in the relevant field, case law, the emergence of new technologies, etc. In certain cases, the applicant may have arbitrarily selected terms; the meanings of these terms will be described in detail in the description of the invention. Therefore, the terminology used in this disclosure should be defined not merely as simple term names, but based on the meaning of the term and the overall content of this disclosure.
[0028] In this disclosure, unless explicitly specified in the context, a singular expression may include multiple expressions, and a plural expression may include a singular expression. Throughout the specification, where a part "includes" a component, this does not exclude other components, unless otherwise stated, and may further include other components.
[0029] Furthermore, the terms “module” or “part” as used in this specification refer to software or hardware components, and a “module” or “part” performs a certain role. However, the meaning of “module” or “part” is not limited to software or hardware. A “module” or “part” may be configured to reside on an addressable storage medium, or to regenerate one or more processors. Thus, as an example, a “module” or “part” may include components such as software components, object-oriented software components, class components, task components, as well as at least one of processes, functions, attributes, procedures, subroutines, segments of program code, drivers, firmware, microcode, circuits, data, databases, data structures, tables, arrays, or variables. Components and “modules” or “parts” may be combined with a smaller number of components and “modules” or “parts” to provide internal functionality, or further separated into additional components and “modules” or “parts”.
[0030] According to one embodiment of the present disclosure, a “module” or “part” may be embodied in a processor and memory. “Processor” should be broadly interpreted to include general-purpose processors, central processing units (CPUs), microprocessors, digital signal processors (DSPs), controllers, microcontrollers, state machines, and the like. In some environments, “processor” may also refer to application-specific semiconductors (ASICs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), and the like. “Processor” may also refer to combinations of processing devices, such as a combination of a DSP and a microprocessor, a combination of multiple microprocessors, a combination of one or more microprocessors coupled with a DSP core, or any other such combination. “Memory” should also be broadly interpreted to include any electronic component capable of storing electronic information. The term "memory" can also refer to various types of processor-readable media, such as RAM (Random Access Memory), ROM (Read Only Memory), NVRAM (Non-Volatile Random Access Memory), PROM (Programmable Read-Only Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory, magnetic or optical data storage devices, and registers. When a processor can read / receive information from or record information into memory, the memory is said to be in electronic communication with the processor. Memory integrated into a processor is in electronic communication with the processor.
[0031] Furthermore, terms such as 1st, 2nd, A, B, (a), (b), etc., used in the following examples are merely used to distinguish one component from another, and do not limit the essence, order, or procedure of that component.
[0032] Furthermore, in the following embodiments, if it is stated that one component is "connected," "joined," or "linked" to another component, it should be understood that these components can be directly connected or linked to each other, but that other components can also be "connected," "joined," or "linked" to each other.
[0033] Furthermore, the use of "comprises" or "comprising" in the following examples does not preclude the presence or addition of one or more different components, steps, operations, and / or elements mentioned.
[0034] Hereinafter, various embodiments of this disclosure will be described in detail based on the attached drawings.
[0035] Figure 1 is an illustrative diagram showing an electronic device 100 for generating a language model according to one embodiment of the present disclosure. Referring to Figure 1, the electronic device 100 can generate a new model 140 using a base model 110, a functional model 120, and a target model 130. For example, the electronic device 100 can generate a new model 140 without a learning process using a functional model 120, which is the base model 110 with a specified function added, and a target model 130, which is the base model 110 further trained with training data from a specified domain. In this case, the electronic device 100 can generate the new model 140 based on the difference between the corresponding parameters of the base model 110 and the functional model 120, and the rate of change of the corresponding parameters of the base model 110 and the target model 130.
[0036] Here, the base model 110 is a basic model that is not specialized for a particular task. It can be pre-trained using a large general dataset and then fine-tuned to suit a specific task or domain. For example, the base model 110 could refer to a language model pre-trained on a large corpus.
[0037] Furthermore, the functional model 120 can refer to a model in which a specified function has been added to the base model 110, and which has been equipped with the specified function by performing additional learning and alignment learning based on the base model 110. According to one embodiment, the specified function may include at least one of the following: a response generation function to command words (e.g., instruction following function), a chat function, a search extension generation function (e.g., RAG (retrieval augmented generation) function), a context extension function, or a coding function. Methods such as SFT and RLHF can be used to generate the functional model 120 by adding the specified function to the base model 110. SFT can use a dataset with labels for a given task as a method of fine-tuning the base model 110 to match a specific task through instructional learning. RLHF can use a method of improving the output of a model with human feedback as a method of improving the output of a model tuned by SFT, for example, by collecting feedback, which is evaluation data, on the output generated from the model tuned by SFT, learning a compensation model using the collected feedback, and optimizing the model's policy with the compensation model. In this process, reinforcement learning is used to adjust the model so that it produces an output that can be highly compensated.
[0038] Furthermore, the target model 130 can refer to a model obtained by further training the base model 110 with training data from a specified domain. Here, the domain refers to language, terminology, etc., associated with a specific subject or field, and can define the subject area to which the language model is trained and applied. For example, a language model specialized for a particular domain can have the ability to understand and appropriately process the vocabulary, grammar, style, context, etc., that are mainly used in that domain. According to one embodiment, the specified domain may include at least one foreign language domain, a specialized knowledge domain, or a corporate domain.
[0039] The electronic device 100 for generating such language models may include memory and at least one processor. However, the configuration of the electronic device 100 is not limited thereto. According to various embodiments, the electronic device 100 may further include at least one different component in addition to the components described above. For example, the electronic device 100 may further include a communication circuit (or communication module) for communication with an external electronic device.
[0040] The processor can be connected to memory and configured to execute at least one computer-readable program contained in memory. For example, the processor can execute software (or a program) to control at least one different component (e.g., hardware or software component) of an electronic device 100 connected to the processor, and perform a variety of data processing or calculations. According to one embodiment, as at least part of the data processing or calculation, the processor can load instructions or data received from different components (e.g., a communication circuit) into volatile memory, process the instructions or data stored in volatile memory, and store the resulting data in non-volatile memory.
[0041] The memory can store a variety of data used by at least one component of the electronic device 100 (e.g., a processor). The data may include, for example, software (or programs) and input or output data for associated instructions. The memory may include volatile or non-volatile memory.
[0042] The processor may execute at least one program that includes instructions related to the generation of a language model. The following description of the processor's functions is for illustrative purposes only. Essentially, the processor's function should be understood as executing instructions contained within at least one program stored in memory.
[0043] The processor can obtain a base model 110 pre-trained on a large-capacity corpus, a functional model 120 in which specified functions are added to the base model 110, and a target model 130 in which the base model 110 is further trained on training data from a specified domain.
[0044] Furthermore, the processor can calculate the difference between each corresponding parameter of the base model 110 and the functional model 120. For example, the processor can calculate the difference between the parameter of the functional model 120 (hereinafter referred to as the first parameter) and the parameter of the base model 110 corresponding to the first parameter (hereinafter referred to as the second parameter) (hereinafter referred to as the first difference).
[0045] Furthermore, the processor can calculate the rate of change of each corresponding parameter in the base model 110 and the target model 130. For example, the processor can calculate the rate of change of the parameter of the target model 130 corresponding to the second parameter of the base model 110 (hereinafter referred to as the third parameter) with respect to the second parameter of the base model 110. According to one embodiment, the processor can calculate the difference between the third parameter of the target model 130 and the second parameter of the base model 110 (hereinafter referred to as the second difference), input the second difference into an activation function, and obtain the rate of change. Here, the activation function can include at least one of a sigmoid function or a ReLU (Rectified Linear Unit) function. According to one embodiment, the processor can normalize the second difference after obtaining its absolute value before inputting it into the activation function. For example, the processor can adjust the input value of the activation function so that it is a real value between 0 and 1.
[0046] Furthermore, the processor can generate a new model 140 from the target model 130 based on the first difference value and the change ratio. For example, the processor can generate the new model 140 by adding a value obtained by combining the first difference value and the change ratio to the target model 130. According to one embodiment, the processor can generate the new model 140 based on a value obtained by subtracting the change ratio from 1, multiplying it by the first difference value, and then adding this value to the third parameter of the target model 130.
[0047] According to one embodiment, the first difference value and change rate can be calculated separately for the corresponding layers of the base model 110, the functional model 120, and the target model 130. Here, the layers, as structural components of the model, can perform a series of transformations on the input data to sequentially extract high-dimensional features or learn complex representations. In this case, each layer can perform a specific operation, and the layer group can be stacked hierarchically to give the model the ability to learn and predict. The layers may include an input layer that receives input data from the outside, an output layer that outputs output data corresponding to the input data, and at least one hidden layer located between the input layer and the output layer that receives data from the input layer, extracts characteristics, and transmits them to the output layer.
[0048] In the above explanation, the parameters of a model (e.g., base model 110, functional model 120, or target model 130) are numerical values that indicate the structure and learned knowledge of the model, and can include the information and rules necessary for the model to process input data and produce appropriate outputs. The number and values of these parameters directly affect the performance and complexity of the model and can be an indicator of the size and capacity of the model. Model parameters can include, for example, weights and / or biases. Weights are values that indicate the strength of the connections between each node of the model, and can indicate the importance of the input data when it is passed to the next layer. Thus, one weight is assigned to each connection (connection between nodes). Bias, on the other hand, is a value that indicates the degree to which the model is activated without input data, and can help the model better represent specific features of the data. Thus, one bias is assigned to each node.
[0049] Figure 2 is a schematic diagram showing a configuration in which an information processing system 230 is connected to communicate with a plurality of user terminals 210_1, 210_2, and 210_3 in relation to data processing according to one embodiment of the present disclosure. The information processing system 230 may include systems(e) capable of providing data processing services (e.g., language model generation infrastructure services). In one embodiment, the information processing system 230 may include one or more server devices and / or databases capable of storing, providing, and executing computer-executable programs (e.g., downloadable applications) and data related to the data processing services, or one or more distributed computing devices and / or distributed databases for a cloud computing service infrastructure. For example, the information processing system 230 may include a separate system (e.g., a server) for the data processing services.
[0050] The data processing services provided by the information processing system 230 can be delivered to users via data processing applications, web browser applications, etc., installed on each of the multiple user terminals 210_1, 210_2, and 210_3.
[0051] Multiple user terminals 210_1, 210_2, and 210_3 can communicate with the information processing system 230 via the network 220. The network 220 can be configured to enable communication between the multiple user terminals 210_1, 210_2, and 210_3 and the information processing system 230. Depending on the installation environment, the network 220 may consist of a wired network such as Ethernet (registered trademark), PLC (Power Line Communication), telephone line communication equipment, and RS-serial communication, a mobile communication network, a wireless network such as WLAN (Wireless LAN), Wi-Fi (registered trademark), Bluetooth (registered trademark), and ZigBee, or a combination thereof. The communication method is not limited and includes not only communication methods that utilize communication networks that can include the network 220 (e.g., mobile communication networks, wired internet, wireless internet, broadcasting networks, satellite networks, etc.), but also short-range wireless communication between user terminals 210_1, 210_2, and 210_3.
[0052] For example, multiple user terminals 210_1, 210_2, and 210_3 can send data processing requests, user requests for data processing, and related command words to the information processing system 230 via the network 220, which the information processing system 230 can then receive.
[0053] In Figure 2, a mobile phone terminal 210_1, a tablet terminal 210_2, and a PC terminal 210_3 are shown as examples of user terminals, but are not limited to these. User terminals 210_1, 210_2, and 210_3 can be any computing device capable of wired and / or wireless communication, and on which data processing applications can be installed and run. For example, user terminals can include smartphones, mobile phones, navigation systems, desktop computers, laptop computers, digital broadcasting terminals, PDAs (Personal Digital Assistants), PMPs (Portable Multimedia Players), tablet PCs, game consoles, wearable devices, IoT (Internet of Things) devices, VR (Virtual Reality) devices, and AR (Augmented Reality) devices. Furthermore, while Figure 2 shows three user terminals 210_1, 210_2, and 210_3 communicating with the information processing system 230 via the network 220, the system is not limited to this configuration, and a different number of user terminals can be configured to communicate with the information processing system 230 via the network 220.
[0054] Figure 3 is a block diagram showing the internal configuration of a user terminal 210 and an information processing system 230 according to one embodiment of the present disclosure. The user terminal 210 can refer to any computing device capable of executing data processing applications and capable of wired / wireless communication, and can include, for example, the mobile phone terminal 210_1, tablet terminal 210_2, and PC terminal 210_3 shown in Figure 2. As shown in the figure, the user terminal 210 can include a memory 312, a processor 314, a communication module 316, and an input / output interface 318. Similarly, the information processing system 230 can include a memory 332, a processor 334, a communication module 336, and an input / output interface 338. As shown in Figure 3, the user terminal 210 and the information processing system 230 can be configured to communicate information and / or data via the network 220 using their respective communication modules 316 and 336. The input / output device 320 can also be configured to input information and / or data to the user terminal 210 or output information and / or data generated from the user terminal 210 via the input / output interface 318.
[0055] The memories 312 and 332 may include any non-temporary computer-readable recording medium. According to one embodiment, the memories 312 and 332 may include permanent mass storage devices such as ROM (read-only memory), disk drives, SSDs (solid-state drives), and flash memory. In other examples, permanent mass storage devices such as ROM, SSDs, flash memory, and disk drives may be included in the user terminal 210 or information processing system 230 as separate permanent storage devices distinct from the memory. The memories 312 and 332 may also store an operating system and at least one program code (for example, code for an application associated with a data processing service).
[0056] Such software components can be loaded from a computer-readable recording medium separate from the memories 312 and 332. Such a separate computer-readable recording medium may include a recording medium that can be directly connected to such a user terminal 210 and information processing system 230, and may include computer-readable recording media such as floppy disks, disks, tapes, DVD / CD-ROM drives, and memory cards. As another example, software components, etc., can be loaded into the memories 312 and 332 via communication modules 316 and 336, rather than via a computer-readable recording medium. For example, at least one program can be loaded into the memories 312 and 332 based on a computer program (e.g., an application related to a data processing service) that is installed by a file provided via the network 220 by a developer or a file distribution system that distributes application installation files.
[0057] Processors 314, 334 can be configured to process computer program instructions by performing basic arithmetic, logic, and input / output operations. Instructions may be provided to processors 314, 334 by memory 312, 332 or by communication modules 316, 336. For example, processors 314, 334 can be configured to execute instructions received by program code stored in a recording device such as memory 312, 332.
[0058] Communication modules 316 and 336 can provide configurations and functions for the user terminal 210 and the information processing system 230 to communicate with each other via the network 220, and can also provide configurations and functions for the user terminal 210 and / or the information processing system 230 to communicate with other user terminals or other systems (e.g., a separate cloud system). For example, requests and data (e.g., data processing requests or data) generated by program code stored in a recording device such as memory 312 by the processor 314 of the user terminal 210 can be transmitted to the information processing system 230 via the network 220 under the control of the communication module 316. Conversely, control signals and commands provided under the control of the processor 334 of the information processing system 230 can be received by the user terminal 210 via the communication module 336 and the network 220 through the communication module 316 of the user terminal 210.
[0059] The input / output interface 318 may be a means for interface with the input / output device 320. For example, the input device may include devices such as a camera including an audio sensor and / or image sensor, a keyboard, a microphone, or a mouse, and the output device may include devices such as a display, a speaker, or a haptic feedback device. In another example, the input / output interface 318 may be a means for interface with a device that integrates a configuration or function for performing input and output in one, such as a touchscreen. In Figure 3, the input / output device 320 is shown not to be included in the user terminal 210, but is not limited to this, and can be configured together with the user terminal 210. Furthermore, the input / output interface 338 of the information processing system 230 may be connected to the information processing system 230, or may be a means for interface with input and output devices (not shown) that the information processing system 230 may include. In Figure 3, the input / output interfaces 318 and 338 are shown as elements configured separately from the processors 314 and 334. However, the system is not limited to this configuration, and the input / output interfaces 318 and 338 can also be configured to be included within the processors 314 and 334.
[0060] The user terminal 210 and the information processing system 230 may include more components than those shown in Figure 3. However, it is not necessary to explicitly show most of the conventional components. According to one embodiment, the user terminal 210 can be implemented to include at least a portion of the input / output device 320 described above. The user terminal 210 may also further include other components such as a transceiver, a GPS (Global Positioning system) module, a camera, various sensors, and a database. For example, if the user terminal 210 is a smartphone, it may include components that are generally found in smartphones, and the user terminal 210 can be implemented to further include a variety of components such as an accelerometer, a gyroscope, a microphone module, a camera module, various physical buttons, buttons using a touch panel, input / output ports, and a vibrator for vibration.
[0061] According to one embodiment, the processor 314 of the user terminal 210 can be configured to run a data processing application or a web browser application that provides data processing services. In this case, program code associated with the application can be loaded into the memory 312 of the user terminal 210. When the application is running, the processor 314 of the user terminal 210 can receive information and / or data provided by the input / output device 320 via the input / output interface 318, or receive information and / or data from the information processing system 230 via the communication module 316, process the received information and / or data, and store it in the memory 312. In addition, such information and / or data can be provided to the information processing system 230 via the communication module 316.
[0062] When a data processing application is running, the processor 314 can receive audio data, text, images, video, etc., input or selected by input devices such as a touchscreen, keyboard, camera including audio sensors and / or image sensors, and microphone, which are connected to the input / output interface 318. The received audio data, text, images, and / or video can be stored in the memory 312 or provided to the information processing system 230 via the communication module 316 and the network 220. In one embodiment, the processor 314 can receive user input input from an input device and provide data / requests corresponding to the received user input to the information processing system 230 via the network 220 and the communication module 316.
[0063] The processor 314 of the user terminal 210 can transfer and output information and / or data to the input / output device 320 via the input / output interface 318. For example, the processor 314 of the user terminal 210 can output processed information and / or data via the input / output device 320, such as a display-capable device (e.g., a touchscreen or display) or an audio-capable device (e.g., a speaker).
[0064] The processor 334 of the information processing system 230 can be configured to manage, process, and / or store information and / or data received from multiple user terminals 210 and / or multiple external systems. The information and / or data processed by the processor 334 can be provided to the user terminals 210 via the communication module 336 and the network 220.
[0065] Figure 4 illustrates a method for calculating the difference between corresponding parameters of a base model 410 and a functional model 420 according to one embodiment of the present disclosure; Figure 5 illustrates a method for calculating the rate of change of corresponding parameters of a base model 410 and a target model 430 according to one embodiment of the present disclosure; Figure 6 illustrates a method for applying a calculated conversion ratio to the calculated difference according to one embodiment of the present disclosure; and Figure 7 illustrates a method for generating a new model 440 using the values obtained by applying a calculated conversion ratio to the calculated difference according to one embodiment of the present disclosure. Referring to Figures 4 to 7, the processor of an electronic device for generating a language model (e.g., electronic device 100 in Figure 1) can generate a new model 440 (e.g., new model 140 in Figure 1) without a training process, using a functional model 420 (e.g., functional model 120 in Figure 1) which has a specified function added to the base model 410 (e.g., base model 110 in Figure 1), and a target model 430 (e.g., target model 130 in Figure 1) which has been further trained on training data of a specified domain from the base model 410. At this time, the processor can generate the new model 440 based on the difference in each corresponding parameter of the base model 410 and the functional model 420, and the rate of change of each corresponding parameter of the base model 410 and the target model 430. In the following description, the parameter sets of a model (e.g., base model 410, functional model 420, target model 430, or new model 440) can be represented in matrix form, and groups of elements at the same position in the matrix can represent the corresponding parameters of the model group, and the calculation results based on the corresponding parameter groups can also be represented in matrix form, including elements stored at the positions corresponding to those parameter groups.
[0066] The processor can calculate the difference 402 (hereinafter referred to as the first difference) between the parameters 422 and 424 of the functional model 420 (hereinafter referred to as the first parameters) and the parameters of the base model 410 corresponding to the first parameters 422 and 424 (hereinafter referred to as the second parameters). For example, as shown in Figure 4, if the 7th, 9th, 15th, 19th, and 21st elements 422 of the functional model 420 and the remaining elements of the corresponding base model 410 excluding the 7th, 9th, 15th, 19th, and 21st elements are identical to each other, then the first difference 402, expressed as a matrix, can also have 0 for the remaining elements excluding the 7th, 9th, 15th, 19th, and 21st elements. Such a first difference 402 can be calculated by the following formula, Equation 1.
[0067]
number
[0068] JPEG2026048032000003.jpg26166
[0069] Furthermore, the processor can calculate the change ratio 404 of the parameters 432 and 434 of the target model 430 (hereinafter referred to as the third parameter) corresponding to the second parameter of the base model 410 with respect to the second parameter of the base model 410. According to one embodiment, the processor can calculate the difference between the third parameters 432 and 434 of the target model 430 and the second parameter of the base model 410 (hereinafter referred to as the second difference), input the second difference to the activation function 510, and obtain the change ratio 404. Here, the activation function 510 can include at least one of a sigmoid function or a LeLU function. According to one embodiment, the processor can normalize the second difference after obtaining its absolute value before inputting it to the activation function 510. For example, the processor can adjust the input value of the activation function 510 so that it is a real value between 0 and 1. For example, as shown in Figure 5, if the 6th, 9th, 14th, 17th, 21st, and 25th elements of the target model 430 are identical to the remaining elements of the corresponding base model 410 excluding the 6th, 9th, 14th, 17th, 21st, and 25th elements, then the second difference value, expressed as a matrix, can also have 0 for the remaining elements excluding the 6th, 9th, 14th, 17th, 21st, and 25th elements. Furthermore, when the absolute value of the second difference value is input to the activation function 510 after the normalization process, depending on the characteristics of the activation function 510, if the difference value is not large (e.g., the 17th element), the corresponding element (e.g., the 17th element) in the output change ratio 404 can also have 0. On the other hand, for elements whose difference value is above a certain threshold (e.g., the 6th, 9th, 14th, 21st, and 25th elements), the output change ratio 404 for those elements (e.g., the 6th, 9th, 524, 14th, 21st, 522, and 25th elements) can have a value other than 0. Such a change ratio 404 can be calculated using the following formula 2.
[0070]
number
[0071] JPEG2026048032000005.jpg39167
[0072] Furthermore, before inputting the second difference value into the activation function 510, if the activation function 510 is a sigmoid function, then the following equations 3 and 4 can be used in the process of normalizing after finding the absolute value of the second difference value.
[0073]
number
[0074]
number
[0075] JPEG2026048032000008.jpg69167
[0076] Equations 3 and 4 are for calculating the rate of change based on the difference between the target model 430 and the base model 410. In this case, in order to adjust the calculated rate of change to a real value between 0 and 1, the processor can also transform the values used as input to the activation function 510 so that they are also between 0 and 1. In this case, as shown in equation 3, the processor can find the absolute value of each element in the matrix of parameter differences between the target model 430 and the base model 410, and apply this to the min-max normalization algorithm as shown in equation 4.
[0077] Furthermore, the processor can generate a new model 440 from the target model 430 based on the first difference value 402 and the change ratio 404. For example, the processor can generate a new model 440 by adding a value obtained by combining the first difference value 402 and the change ratio 404 to the target model 430. In one embodiment, the processor can generate a new model 440 by adding a value 408 obtained by subtracting the change ratio 404 from 1 and multiplying that value by the first difference value 402 to the third parameters 432 and 434 of the target model 430. For example, as shown in Figure 6, among the set of elements of the change ratio 404 represented by a matrix, if an element is not zero (e.g., the 6th element, the 9th element 524, the 14th element, the 21st element 522, and the 25th element), then the matrix elements with a value of 406 obtained by subtracting 1 from that value (e.g., the 6th element, the 9th element 624, the 14th element, the 21st element 622, and the 25th element) can have a value other than 1. This means that when the matrix elements with a value of 406 obtained by subtracting the change ratio 404 from 1 (e.g., the 6th element, the 9th element 624, the 14th element, the 21st element 622, and the 25th element) have a value other than 1, it can affect the value 408 obtained by multiplying the value 406 obtained by subtracting the change ratio 404 from 1 by the first difference value 402. For example, as shown in Figure 6, even if the 7th, 9th, 15th, 19th, and 21st elements of the matrix element group of the first difference value 402 have non-zero values, the 7th, 15th, and 19th elements of the matrix element group of value 406 (1 minus the change ratio 404) have a value of 1, so the first difference value 402 is applied as is. The 9th element 624 has a value of 0, so the first difference value 402 is not applied. The 21st element 622 has a value between 0 and 1, so a certain portion of the first difference value 402 is applied. In other words, when a new model 440 is generated by adding a value 408, obtained by multiplying a value 406 (1 minus the change rate 404) by a first difference value 402, to the third parameters 432 and 434 of the target model 430, the parameters 442 and 444 of the new model 440 may differ from those of the target model 430 in that the value 408 (1 minus the change rate 404) multiplied by a first difference value 402 is not zero.For example, as shown in Figure 7, when the 7th, 15th, 19th, and 21st elements of the matrix elements 408 obtained by multiplying 406 (1 obtained by subtracting the change ratio 404 from 1) by the first difference value 402 have non-zero values, the 7th, 15th, 19th, and 21st elements 442 of the parameters 442 and 444 of the new model 440 may differ from those of the target model 430. This means that at least some of the corresponding parameters of the functional model 420 are applied to the target model 430. Such a new model 440 can be calculated by the following formula 5.
[0078]
number
[0079] JPEG2026048032000010.jpg40168
[0080] Figure 8 is a diagram illustrating the activation function used when calculating the change rate according to one embodiment of the present disclosure. Referring to Figure 8, the processor of an electronic device for generating a language model (e.g., electronic device 100 in Figure 1) can generate a new model (e.g., new model 140 in Figure 1) without a learning process, using a functional model (e.g., functional model 120 in Figure 1) in which a specified function has been added to a base model (e.g., base model 110 in Figure 1), and a target model (e.g., target model 130 in Figure 1) in which the base model has been further trained with training data of a specified domain. At this time, the processor can generate the new model based on the difference between each corresponding parameter of the base model and the functional model, and the change rate of each corresponding parameter of the base model and the target model.
[0081] In one embodiment, the processor can calculate the difference between the parameters of the target model and the corresponding parameters of the base model, input the calculated difference into the activation function 810, and obtain the rate of change. In this process, the processor can normalize the calculated difference after determining its absolute value before inputting it into the activation function 810. For example, the processor can adjust the input value (x) of the activation function 810 so that it is a real value between 0 and 1. In one embodiment, the processor can use an activation function 820 in which the parameters of the activation function 810 have been changed. For example, if the activation function 810 is a sigmoid function, the processor can use an activation function 820 in which the input value x is replaced with (12x-6). Here, the parameters 12 and 6 can make the input value x a real value between 0 and 1.
[0082] Figure 9 shows pseudocode used to generate a language model according to one embodiment of the present disclosure. The pseudocode shown in Figure 9 can represent pseudocode corresponding to the equations Equation 1, Equation 2 (Equation 3, Equation 4), and Equation 5 mentioned above. For example, the first pseudocode 910 corresponds to Equation 1 and may include code for calculating the difference between the parameters of a functional model (e.g., functional model 120 in Figure 1) and the corresponding parameters of a base model (e.g., base model 110 in Figure 1). The second pseudocode 920 corresponds to Equations 2, 3, and 4 and may include code for calculating the rate of change of the parameters of a target model (e.g., target model 130 in Figure 1) with respect to the parameters of a base model. Furthermore, the third pseudocode 930 corresponds to equation 5 and may include code for generating a new model (e.g., the new model 140 in Figure 1) from the target model based on the difference calculated by equation 1, and the rate of change calculated by equations 2, 3, and 4.
[0083] Figure 10 is a diagram illustrating a method for generating a language model according to one embodiment of the present disclosure. Referring to Figure 10, the processor of an electronic device for generating a language model (e.g., electronic device 100 in Figure 1) can acquire a base model (e.g., base model 110 in Figure 1), a functional model (e.g., functional model 120 in Figure 1), and a target model (e.g., target model 130 in Figure 1) in step S1010. For example, the processor can acquire a base model pre-trained on a large-capacity corpus, a functional model in which a specified function is added to the base model, and a target model in which the base model is further trained with training data of a specified domain. According to one embodiment, the specified function may include at least one of the following: a response generation function for command words, a chat function, a search extension generation function, a context extension function, or a coding function. According to one embodiment, the specified domain may include at least one of the following: at least one foreign language domain, a specialized knowledge domain, or a corporate domain.
[0084] In step S1020, the processor can calculate the difference between the first parameter of the functional model and the second parameter of the base model. For example, the processor can calculate the difference between each corresponding parameter of the base model and the functional model.
[0085] In step S1030, the processor can calculate the ratio of change of the third parameter of the target model with respect to the second parameter. For example, the processor can calculate the ratio of change of each corresponding parameter in the base model and the target model. In one embodiment, the processor can calculate the difference between the third parameter of the target model and the second parameter of the base model, and input the calculated difference into an activation function to obtain the ratio of change. Here, the activation function can include at least one of a sigmoid function or a LeLU function. In one embodiment, the processor can normalize the calculated difference after obtaining its absolute value before inputting it into the activation function. For example, the processor can adjust the input value of the activation function so that it is a real value between 0 and 1.
[0086] In step S1040, the processor can generate a new model (e.g., new model 140 in Figure 1) from the target model based on the difference and the rate of change. For example, the processor can generate a new model by adding to the target model a value obtained by combining the difference between the first parameter of the functional model and the second parameter of the base model, and the rate of change of the third parameter of the target model relative to the second parameter of the base model. In one embodiment, the processor can generate a new model based on a value obtained by subtracting the rate of change of the third parameter of the target model relative to the second parameter of the base model from 1, multiplying this by the difference between the first parameter of the functional model and the second parameter of the base model, and then adding this value to the third parameter of the target model.
[0087] According to one embodiment, the difference between the first parameter of the functional model and the second parameter of the base model, and the ratio of change of the third parameter of the target model relative to the second parameter of the base model, can be calculated for each corresponding layer of the base model, functional model, and target model. Here, the layers may include an input layer that receives input data from an external source, an output layer that outputs output data corresponding to the input data, and at least one hidden layer located between the input layer and the output layer that receives data from the input layer, extracts characteristics, and transmits them to the output layer. Furthermore, the parameters of the model (e.g., base model, functional model, or target model) may include at least one of weights or biases.
[0088] The flowchart and explanation described above are merely examples and may be implemented differently in some embodiments. For example, in some embodiments, the order of the steps may be changed, some steps may be repeated, some steps may be omitted, or some steps may be added.
[0089] The methods described above may be provided as computer programs stored on a computer-readable recording medium for execution on a computer. The medium may be used to continuously store computer-executable programs or to temporarily store them for execution or download. The medium may also be a variety of recording or storage means in the form of a single or multiple hardware combination, and is not limited to a medium directly connected to a computer system, but may be distributed on a network. Examples of mediums include magnetic media such as hard disks, floppy disks, and magnetic tapes, optical recording media such as CD-ROMs and DVDs, magneto-optical mediums such as floptical disks, and ROMs, RAMs, flash memories, etc., configured to store program instructions. Other examples of mediums include recording or storage media managed by app stores that distribute applications and other sites and servers that supply or distribute various software.
[0090] The methods, operations, or techniques described herein can be implemented by a variety of means. For example, such techniques can be implemented in hardware, firmware, software, or a combination thereof. A person of ordinary skill would understand that the various exemplary logic blocks, modules, circuits, and algorithmic steps described herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate these mutual substitutability between hardware and software, various exemplary components, blocks, modules, circuits, and steps have been generally described in terms of their functional aspects. Whether such functions are implemented as hardware or software depends on the design requirements attached to the specific application and the overall system. A person of ordinary skill may implement the functions described in a variety of ways for each specific application, but such implementations should not be construed as deviations from the scope of this disclosure.
[0091] In hardware implementation, the processing units used to perform the technique may be one or more ASICs, DSPs, digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, electronic devices, other electronic units designed to perform the functions described herein, computers, or combinations thereof.
[0092] Accordingly, the diverse exemplary logic blocks, modules, and circuits described herein may also be embodied or performed by any combination of general-purpose processors, DSPs, ASICs, FPGAs or other programmable logic devices, discrete gate and transistor logic, discrete hardware components, or any combination designed to perform the functions described herein. A general-purpose processor may be a microprocessor, but alternatively, a processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be embodied by a combination of computing devices, such as a DSP and a microprocessor, multiple microprocessors, one or more microprocessors associated with a DSP core, or any other combination of configurations.
[0093] In the embodiment of firmware and / or software, the technique can be embodied as instructions stored on a computer-readable medium such as RAM (random access memory), ROM (read-only memory), NVRAM (non-volatile random access memory), PROM (programmable read-only memory), EPROM (erasable programmable read-only memory), EEPROM (electrically erasable programmable read-only memory), flash memory, CD (compact disc), or magnetic or optical data storage devices. The instructions are executable by one or more processors, which can perform specific modes of the functions described herein.
[0094] When embodied as software, the techniques may be stored on or transferred via computer-readable media as one or more instructions or codes. Computer-readable media include any media that facilitates the transfer of computer programs from one location to another, and include both computer storage media and communication media. Storage media can be any available media accessible by a computer. As an unrestricted example, such computer-readable media may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other media accessible by a computer that can be used to transfer or store desired program code in the form of instructions or data structures. Furthermore, any connection may appropriately be referred to as computer-readable media.
[0095] For example, if software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, lead wire, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, then coaxial cable, fiber optic cable, lead wire, digital subscriber line, or wireless technologies such as infrared, radio, and microwave are included within the definition of a medium. The terms "disk" and "disc" used in this application include CDs, laserdiscs, optical discs, DVDs (digital versatile discs), floppy disks, and Blu-ray discs, where a disk typically reproduces data magnetically, while a disc reproduces data optically using a laser. The aforementioned combinations, etc., must also be included within the scope of computer-readable media, etc.
[0096] Software modules may reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disks, portable disks, CD-ROMs, or any other known form of storage medium. An exemplary storage medium may be linked to the processor so that the processor reads information from or writes information to the storage medium. Alternatively, the storage medium may be integrated into the processor. The processor and storage medium may reside within an ASIC. The ASIC may reside within a user terminal. Alternatively, the processor and storage medium may exist as separate components within the user terminal.
[0097] While the embodiments described above utilize aspects of the currently disclosed subject matter in one or more standalone computer systems, the disclosure can be embodied in any computing environment, such as networks or distributed computing environments, without limitation. Furthermore, aspects of the subject matter in the disclosure can be embodied in multiple processing chips or devices, and storage can be similarly affected across multiple devices. Such devices may include PCs, network servers, and portable devices.
[0098] While this disclosure has been described in part by some embodiments, various modifications and alterations are possible without departing from the disclosure as understood by a person of the ordinary skill in the art to which the invention of this disclosure pertains. Such modifications and alterations should be understood to fall within the scope of the claims appended to this specification. [Explanation of Symbols]
[0099] 100 Electronic equipment 110 Base Model 120 Function Models 130 Target Models 140 New Models
Claims
1. In a method for generating a language model, which is performed by at least one processor, The steps include obtaining a base model pre-trained on a large-capacity corpus, a functional model in which a specified function is added to the base model, and a target model in which the base model is further trained on training data of a specified domain. A step of calculating a first difference between a first parameter of the functional model and a second parameter of the base model corresponding to the first parameter, A step of calculating the rate of change of the third parameter of the target model corresponding to the second parameter with respect to the second parameter, A method for generating a language model, comprising the step of generating a new model from the target model based on the first difference value and the rate of change.
2. The step of calculating the aforementioned change rate is: A step of calculating a second difference between the third parameter and the second parameter, A method for generating a language model according to claim 1, comprising the step of inputting the second difference value into an activation function to obtain the change ratio.
3. The method for generating a language model according to claim 2, wherein the activation function includes at least one of a sigmoid function or a ReLU (Rectified Linear Unit) function.
4. A method for generating a language model according to claim 2, further comprising the step of normalizing the absolute value of the second difference before inputting the second difference into the activation function.
5. The method for generating a language model according to claim 4, wherein the step of generating the new model includes the step of generating the new model based on a value obtained by multiplying the value obtained by subtracting the rate of change from 1 by the first difference value and then adding the result to the third parameter.
6. The method for generating a language model according to claim 1, wherein the first difference value and the change ratio are calculated separately for the corresponding layers of the base model, the functional model, and the target model.
7. The method for generating a language model according to claim 1, wherein the specified function includes at least one of a response generation function for command words, a chat function, a search extension generation function, a context extension function, or a coding function.
8. The method for generating a language model according to claim 1, wherein the designated domain includes at least one of the following: a language domain of another country, a specialized knowledge domain, or a corporate domain.
9. A computer-readable computer program for performing the method according to any one of claims 1 to 8 on a computer.
10. In electronic devices, Memory and The memory is connected to at least one processor configured to execute at least one computer-readable program contained in the memory, The aforementioned at least one program, Obtain a base model pre-trained on a large corpus, a functional model with specified functions added to the base model, and a target model obtained by further training the base model with training data from a specified domain. A first difference value is calculated between the first parameter of the functional model and the second parameter of the base model corresponding to the first parameter. The ratio of change of the third parameter of the target model corresponding to the second parameter is calculated with respect to the second parameter. An electronic device including instructions for generating a new model from the target model based on the first difference and the rate of change.
11. Calculating the aforementioned change ratio is Calculate the second difference between the third parameter and the second parameter, The electronic device according to claim 10, comprising inputting the second difference value into an activation function to obtain the change ratio.
12. The electronic device according to claim 11, wherein the activation function includes at least one of a sigmoid function or a ReLU function.
13. The electronic device according to claim 11, wherein the at least one program further includes instructions for normalizing the second difference after obtaining the absolute value of the second difference, before inputting the second difference to the activation function.
14. The electronic device according to claim 13, wherein generating the new model includes generating the new model based on a value obtained by multiplying the value obtained by subtracting the rate of change from 1 by the first difference value and then adding the result to the third parameter.
15. The electronic device according to claim 10, wherein the first difference value and the change ratio are calculated separately for the corresponding layers of the base model, the functional model, and the target model.
Citation Information
Patent Citations
Learning method and learning system for neural network
JP2005100011A
Model generation device, model generation method, and program
JP7251613B2
Method for obtaining neural network model and electronic apparatus for performing the same
KR102572828B1