Machine learning programs and machine learning methods

The model generation device enhances inference accuracy in early exit models by training untrained classifiers first, followed by the entire model, addressing performance degradation issues and maintaining speedup benefits.

JP7878012B2Active Publication Date: 2026-06-23FUJITSU LTD

Patent Information

Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
FUJITSU LTD
Filing Date
2022-10-17
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Conventional transfer learning methods for machine learning models result in decreased inference accuracy due to untrained classifiers with random parameters, leading to performance degradation during early exit applications.

Method used

A method involving a model generation device that trains only the untrained heads (classifiers) of an early exit model using downstream tasks before training the entire model, utilizing a first fine-tuning processing unit to train the initial output layer and connected layers, followed by a second unit to fine-tune the entire model, thereby reducing adverse gradient effects on pre-trained layers.

Benefits of technology

Improves inference accuracy while maintaining speedup benefits of early exit models by preventing performance degradation, allowing for faster inference with maintained accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007878012000001
    Figure 0007878012000001
  • Figure 0007878012000002
    Figure 0007878012000002
  • Figure 0007878012000003
    Figure 0007878012000003
Patent Text Reader

Abstract

To improve inference accuracy of machine learning models.SOLUTION: For a machine learning model having a plurality of layers that are subjected to learning in advance, a first output layer formed in conformity with a downstream task and connected to the last layer of a plurality of layers, and a plurality of second output layers connected to respective outputs of layers other than the last layer among the plurality of layers and having the same configuration as the first output layer, after training only the first output layer and the second output layers of the machine learning model with the downstream task, the entire machine learning model including the first output layer and the second output layers is trained with the downstream task.SELECTED DRAWING: Figure 5
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a machine learning program and a machine learning method.

Background Art

[0002] In recent years, transfer learning using pre-trained models such as BERT (Bidirectional Encoder Representations from Transformers) has been realized.

[0003] In transfer learning, a part of a machine learning model trained (machine learning) using a pre-training task is changed according to a task (downstream task) that a user wants to perform. A machine learning model trained using a pre-training task may be referred to as a pre-trained model. For example, the output layer of the pre-trained model may be replaced with an output layer adapted to the downstream task. The downstream task may also be referred to as a downstream task.

[0004] In transfer learning, the pre-trained model in which a part such as the output layer is changed according to the downstream task in this way is retrained using the downstream task. Retraining the pre-trained model using the downstream task may be referred to as fine-tuning.

[0005] As a transfer learning method for a machine learning model, for example, in fine-tuning, a technique of training only a classifier included in a pre-trained model (see, for example, Patent Document 1 and Patent Document 2) and a technique of training the entire pre-trained model (see, for example, Patent Document 3) are known.

Prior Art Documents

Patent Documents

[0006]

Patent Document 1

[0007] In these conventional transfer learning methods, there is a need to improve the inference accuracy of machine learning models.

[0008] In one aspect, the present invention aims to improve the inference accuracy of machine learning models. [Means for solving the problem]

[0009] Therefore, this machine learning program causes a computer to perform the following processes for a machine learning model having multiple pre-trained layers, a first output layer formed to suit a downstream task and connected to the final layer of the multiple layers, and multiple second output layers connected to the outputs of each of the layers other than the final layer and having the same configuration as the first output layer: training only the first output layer and the second output layer of the machine learning model on the downstream task, and training the entire machine learning model, including the first output layer and the second output layer, on the downstream task. [Effects of the Invention]

[0010] According to one embodiment, the inference accuracy of a machine learning model can be improved. [Brief explanation of the drawing]

[0011] [Figure 1] This figure shows the functional configuration of a model generation device as an example of an embodiment. [Figure 2] This block diagram shows the hardware configuration of a computer that implements the functions of a model generation device as an example of an embodiment. [Figure 3] This figure illustrates the backbone generated by the backbone generation unit of a model generation device as an example of an embodiment. [Figure 4] This figure illustrates an early exit model generated by the early exit model generation unit of a model generation device as an example of an embodiment. [Figure 5] This is a flowchart illustrating a model generation method using a model generation device as an example of an embodiment. [Figure 6] This is a flowchart illustrating the training method of a model to be trained by the first fine-tuning processing unit and the second fine-tuning processing unit of a model generation device as an example of an embodiment. [Figure 7] This figure shows the inference accuracy of a model trained using a model generation device as an example of an embodiment, compared to a model trained using a conventional method. [Figure 8] This figure shows the inference accuracy of a model trained using a model generation device as an example of an embodiment, compared to a model trained using a conventional method. [Figure 9] This flowchart shows the first modified example of the training method for the model under training using the first fine-tuning processing unit and the second fine-tuning processing unit. [Figure 10] This flowchart shows a second variation of the training method for the model under training using the first and second fine-tuning processing units. [Figure 11] This figure illustrates a pre-trained model with early exit strategies applied. [Modes for carrying out the invention]

[0012] Hereinafter, embodiments of the present machine learning program and machine learning method will be described with reference to the drawings. However, the embodiments shown below are merely examples, and there is no intention to exclude various modifications and applications of technologies not explicitly shown in the embodiments. That is, the present embodiments can be implemented with various modifications (such as combining the embodiments and each modification) without departing from the gist thereof. Also, each figure does not mean that it includes only the components shown in the figure, and can include other functions and the like.

[0013] (A) Related art As a method for realizing high-speed inference of a neural network, Early exit is known.

[0014] FIG. 11 is a diagram illustrating a pre-trained model to which Early exit is applied.

[0015] In FIG. 11, a basic model having a plurality (L in the example shown in FIG. 11) of layers (Encoder block) and a classifier (Teacher-Classifier) of the final layer is shown. This basic model may be referred to as a backbone. Also, a pre-trained model to which Early exit is applied may be referred to as an Early exit applied model.

[0016] Each of the plurality of layers in the backbone may be an encoder, and in the backbone, these plurality of layers may be repeatedly stacked. The plurality of layers in the backbone are each pre-trained using a pre-training task.

[0017] To the final layer of the backbone, a classifier configured according to a downstream task is connected instead of the classifier used in the pre-training. The classifier connected to this final layer has unlearned (for example, random) parameters before the start of training (initial state).

[0018] Furthermore, each output layer in the backbone is connected to a classifier (Student-Classifier) ​​with the same configuration as the classifier connected to the final layer. These classifiers connected to each output can be called branches.

[0019] In this type of early exit application model, the uncertainty of the inference data is calculated at the output of each classifier during inference. If the calculated uncertainty meets a predetermined threshold, the prediction of that classifier is taken as the final result, and the inference data is not passed to subsequent layers, thereby speeding up the inference process.

[0020] Furthermore, fine-tuning for models with early exit applied is performed in the same way as fine-tuning for pre-trained models without early exit applied. That is, during fine-tuning, training using downstream tasks is performed on both the backbone and branches simultaneously. This allows for simultaneous training of the pre-trained parts (each layer) of the backbone and the untrained classifiers (Teacher-Classifier and Student-Classifier).

[0021] However, the inference accuracy of a finely tuned early exit model is lower than that of a model without early exit.

[0022] This is likely because each classifier connected to the final layer of the backbone and each classifier in the branches have untrained, random parameters, and during fine tuning, the gradients backpropagated from these classifiers become larger, and these large gradients negatively affect the parameters of each layer.

[0023] In neural networks, high-precision inference of tasks is required, and it is undesirable for the model's inference accuracy to decrease in exchange for reduced training time through transfer learning.

[0024] Furthermore, while early exit is a technique that speeds up inference by outputting inference results at the shallower layers of the model, improving the inference accuracy at those shallower layers is necessary to achieve this. In other words, if the inference accuracy decreases, it becomes impossible to achieve the speedup of inference through early exit.

[0025] In this model generation device 1, fine tuning is performed on the early exit application model without causing any performance degradation.

[0026] (B) Embodiment Figure 1 shows the functional configuration of a model generation device 1 as an example of an embodiment.

[0027] This model generator 1 generates an early exit application model. Based on a basic model (backbone) created using transfer learning, this model generator 1 generates an early exit model. Furthermore, this model generator 1 performs fine-tuning on the generated early exit model. The basic model is a neural network.

[0028] (B-1) Hardware configuration example Figure 2 is a block diagram showing the hardware (HW) configuration of a computer 10 that implements the functions of a model generation device 1 as an example of an embodiment. If multiple computers are used as HW resources to implement the functions of the model generation device 1, each computer may have the HW configuration illustrated in Figure 2.

[0029] As shown in Figure 2, the computer 10 may, as an example of its hardware configuration, include a processor 10a, a graphics processing unit 10b, a memory 10c, a storage unit 10d, an IF (Interface) unit 10e, an IO (Input / Output) unit 10f, and a read unit 10g.

[0030] The processor 10a is an example of an arithmetic processing unit that performs various controls and calculations, and is a control unit that executes various processes. The processor 10a may be connected to each block in the computer 10 via a bus 10j so as to be able to communicate with each other. The processor 10a may be a multiprocessor that includes multiple processors, a multicore processor that has multiple processor cores, or a configuration that has multiple multicore processors.

[0031] Examples of processor 10a include integrated circuits (ICs) such as CPUs, MPUs, APUs, DSPs, ASICs, and FPGAs. Note that two or more combinations of these integrated circuits may be used as processor 10a. CPU stands for Central Processing Unit, MPU for Micro Processing Unit, APU for Accelerated Processing Unit, DSP for Digital Signal Processor, ASIC for Application Specific IC, and FPGA for Field-Programmable Gate Array.

[0032] The graphics processing unit 10b controls the screen display for output devices such as monitors, which are part of the I / O unit 10f. The graphics processing unit 10b may also be configured as an accelerator that performs machine learning processing and inference processing using machine learning models. Examples of graphics processing units 10b include various arithmetic processing units, such as integrated circuits (ICs) like GPUs (Graphics Processing Units), APUs, DSPs, ASICs, or FPGAs.

[0033] Memory 10c is an example of hardware that stores various data and program information. Examples of memory 10c include volatile memory such as DRAM (Dynamic Random Access Memory) and non-volatile memory such as PM (Persistent Memory), or both.

[0034] The storage unit 10d is an example of hardware that stores various data and program information. Examples of storage units 10d include magnetic disk devices such as HDDs (Hard Disk Drives), semiconductor drive devices such as SSDs (Solid State Drives), and various storage devices such as non-volatile memory. Examples of non-volatile memory include flash memory, SCM (Storage Class Memory), and ROM (Read Only Memory).

[0035] The memory unit 10d may store a program 10h (machine learning program) that implements all or part of the various functions of the computer 10.

[0036] For example, the processor 10a of the model generation device 1 can realize a model generation function for training a machine learning model by loading the program 10h stored in the memory 10c into the memory 10c and executing it.

[0037] The IF unit 10e is an example of a communication interface that controls the connection and communication between this computer 10 and other computers. For example, the IF unit 10e may include an adapter compliant with LAN (Local Area Network) such as Ethernet®, or optical communication such as FC (Fibre Channel). The adapter may support wireless, wired, or both communication methods.

[0038] For example, the model generation device 1 may be connected to other information processing devices (not shown) via the IF unit 10e and a network so as to be able to communicate with each other. The program 10h may be downloaded from the network to the computer 10 via the communication IF and stored in the storage unit 10d.

[0039] The I / O unit 10f may include one or both of an input device and / or an output device. Examples of input devices include a keyboard, mouse, and touch panel. Examples of output devices include a monitor, projector, and printer. The I / O unit 10f may also include a touch panel that integrates both an input device and an output device. The output device may be connected to the graphics processing unit 10b.

[0040] The reading unit 10g is an example of a reader that reads data and program information recorded on the recording medium 10i. The reading unit 10g may include a connection terminal or device to which the recording medium 10i can be connected or inserted. Examples of the reading unit 10g include an adapter compliant with USB (Universal Serial Bus), a drive device for accessing a recording disk, and a card reader for accessing flash memory such as an SD card. The recording medium 10i may store a program 10h, and the reading unit 10g may read the program 10h from the recording medium 10i and store it in the storage unit 10d.

[0041] Examples of recording media 10i include non-temporary computer-readable recording media such as magnetic / optical discs and flash memory. Examples of magnetic / optical discs include flexible discs, CDs (Compact Discs), DVDs (Digital Versatile Discs), Blu-ray discs, and HVDs (Holographic Versatile Discs). Examples of flash memory include semiconductor memory such as USB memory and SD cards.

[0042] The hardware configuration of computer 10 described above is illustrative. Therefore, the addition or deletion of hardware within computer 10 (for example, adding or deleting arbitrary blocks), division, integration in any combination, or addition or deletion of buses may be performed as appropriate.

[0043] (B-2) Example of Functional Configuration As shown in Figure 1, the model generation device 1 may, for example, include functions as a pre-trained model acquisition unit 2, a backbone generation unit 3, an early exit model generation unit 4, a first fine-tuning processing unit 5, and a second fine-tuning processing unit 6. These functions may be implemented by the hardware of the computer 10 (see Figure 2).

[0044] The pre-trained model acquisition unit 2 acquires a pre-trained model. The pre-trained model acquisition unit 2 may generate (acquire) a pre-trained model by training a machine learning model using a pre-training task. Alternatively, the pre-trained model acquisition unit 2 may acquire a pre-trained model generated (prepared) by another information processing device via a network or the like.

[0045] The pre-trained model may be a neural network model. The pre-trained model may have multiple layers (encoder blocks) and a final layer classifier (teacher-classifier).

[0046] The pre-trained model acquisition unit 2 stores the acquired pre-trained model information in a predetermined memory area of ​​the storage unit 10d.

[0047] The backbone generation unit 3 generates a backbone (basic model) tailored to the downstream task based on the pre-trained model acquired (generated) by the pre-trained model acquisition unit 2.

[0048] The backbone generation unit 3 generates a backbone by replacing the output layer (e.g., a classifier) ​​connected to the final layer of a pre-trained model configured for a pre-training task with a new output layer (second output layer: new classifier) ​​formed for a downstream task.

[0049] The new output layer (new classifier) ​​in this backbone may have, for example, random parameters as its initial state.

[0050] The backbone generation unit 3 stores the generated backbone information in a predetermined storage area of ​​the storage unit 10d.

[0051] Figure 3 is a diagram illustrating the backbone generated by the backbone generation unit 3 of the model generation device 1 as an example of an embodiment.

[0052] In Figure 3, code A indicates the pre-trained model 100 acquired (generated) by the pre-trained model acquisition unit 2, and code B indicates the backbone 101 generated by the backbone generation unit 3 based on the pre-trained model 100 shown in code A.

[0053] The pre-trained model 100, shown as code A, has three layers of encoders E1 to E3 and a classifier C1 connected to the last layer of these three layers, encoder E3. The classifier C1 corresponds to the output layer. The pre-trained model 100 may be, for example, a model pre-trained on a large dataset.

[0054] The backbone generation unit 3 generates the backbone 101 by replacing the classifier C1 of the pre-trained model 100 with a classifier C2 configured to suit the downstream task. Classifier C2 corresponds to the first output layer.

[0055] The backbone generation unit 3 replaces the classifier C1 (output layer) connected to encoder E3, which is the final layer among the encoders E1 to E3, with classifier C2 (first output layer) formed to suit the downstream task, in a pre-trained model 100 which has multiple pre-trained layers, namely encoders E1 to E3.

[0056] The Early Exit Model Generation Unit 4 generates an Early Exit model by connecting a classifier (Student-Classifier: Second Output Layer) with the same configuration as the classifier (First Output Layer) connected to the final layer of the backbone to the outputs of multiple layers (intermediate layers) provided in the backbone generated by the Backbone Generation Unit 3.

[0057] Each classifier (first output layer, second output layer) in an early exit model can be called a "head." Each classifier (head) in an early exit model is a layer (untrained layer) with untrained (e.g., random) weights.

[0058] The early exit model generation unit 4 stores the generated early exit model information in a predetermined storage area of ​​the storage unit 10d.

[0059] Figure 4 is a diagram illustrating an early exit model generated by the early exit model generation unit 4 of the model generation device 1, as an example of an embodiment.

[0060] In Figure 4, code A indicates the backbone 101 generated by the backbone generation unit 3, and code B indicates the early exit model 102 generated by the early exit model generation unit 4 based on the backbone 101 shown in code A.

[0061] The early exit model generation unit 4 connects a classifier C2', which has the same configuration as classifier C2, to the outputs of encoders E1 and E2, which are among the three layers of encoders E1 to E3 provided in the backbone 101 indicated by symbol A, and which are not connected to classifier C2. In this way, the early exit model generation unit 4 generates an early exit model 102 based on the backbone 101.

[0062] The early exit model generation unit 4 generates the early exit model 102 (machine learning model) by connecting a classifier C2' (second output layer), which has the same configuration as classifier C1 (first output layer), to the output of each of the layers (E1 to E2) of the backbone 101, excluding the final layer (encoder E1 to E3).

[0063] The first fine-tuning processing unit 5 trains (fine-tunes) each classifier included in the early exit model generated by the early exit model generation unit 4 using downstream tasks.

[0064] In other words, the first fine-tuning processing unit 5 trains only the classifier (first output layer) C2 and the classifier (second output layer) C2' included in the early exit model using downstream tasks. The first fine-tuning processing unit 5 trains only the untrained heads in the early exit model using downstream tasks.

[0065] The training of each head by the first fine-tuning processing unit 5 may be performed using known methods. The first fine-tuning processing unit 5 trains each head by repeatedly performing, for example, forward propagation, loss function calculation, backpropagation, and weight update in this order until the termination condition is met.

[0066] In the forward propagation stage, training data (downstream task) is input to the head (classifier), and the calculation results are output from the head's output layer.

[0067] Furthermore, in calculating the loss function, the calculation results from the output layer of the head are used to calculate the loss function. In backpropagation, the calculated loss function is used to calculate the gradient of each layer from the output layer to the input layer of the head. In updating the weights, the calculated gradients are used to update the weight values ​​of each layer.

[0068] The termination condition may be, for example, that a series of operations including forward propagation, calculation of the loss function, backpropagation, and weight updating are performed a number of times set by the user.

[0069] The first fine-tuning processing unit 5 performs training (fine-tuning) of each classifier included in the early exit model using downstream tasks, prior to the training of the entire early exit model using downstream tasks performed by the second fine-tuning processing unit 6, which will be described later.

[0070] The second fine-tuning processing unit 6 trains (fine-tunes) all the classifiers trained by the first fine-tuning processing unit 5 and each pre-trained intermediate layer included in the early exit model generated by the early exit model generation unit 4 using downstream tasks.

[0071] In other words, the second fine-tuning processing unit 6 trains the entire early exit model, which includes all the classifiers trained by the first fine-tuning processing unit 5, using downstream tasks.

[0072] The training of the entire early exit model by the second fine-tuning processing unit 6 may be carried out in the same manner as the training of each classifier by the first fine-tuning processing unit 5. That is, the second fine-tuning processing unit 6 may perform the following processes on the entire early exit model, for example, forward propagation, loss function calculation, backpropagation, and weight update, in this order, repeatedly until the termination condition is met.

[0073] (B-3) Operation A model generation method using the model generation device 1, as an example of the embodiment configured as described above, will be explained according to the flowchart (steps A1 to A5) shown in Figure 5.

[0074] In step A1, the pre-trained model acquisition unit 2 generates (acquires) a pre-trained model by, for example, training a machine learning model using a pre-training task.

[0075] In step A2, the backbone generation unit 3 generates a backbone by replacing the final layer (classifier) ​​of a pre-trained model configured for the pre-training task with a final layer (classifier) ​​configured for the downstream task.

[0076] In step A3, the early exit model generation unit 4 generates an early exit model by connecting a classifier with the same configuration as the classifier connected to the final layer of the backbone to the output of each intermediate layer provided in the backbone generated by the backbone generation unit 3.

[0077] In step A4, the first fine-tuning processing unit 5 trains only the untrained heads (classifiers) of the early exit model using downstream tasks.

[0078] In step A5, the second fine-tuning processing unit 6 trains all the classifiers trained by the first fine-tuning processing unit 5 and each of the pre-trained intermediate layers included in the early exit model generated by the early exit model generation unit 4, all at once using a downstream task. In other words, the second fine-tuning processing unit 6 fine-tunes the entire early exit model simultaneously. After that, the process terminates.

[0079] Next, the training method of the model to be trained by the first fine-tuning processing unit 5 and the second fine-tuning processing unit 6 of the model generation device 1, as an example of an embodiment, will be explained according to the flowchart (steps B1 to B5) shown in Figure 6.

[0080] The training target model for the first fine-tuning processing unit 5 is the untrained head (classifier) ​​of the early exit model, while the training target model for the second fine-tuning processing unit 6 is the entire early exit model.

[0081] In step B1, the first fine-tuning processing unit 5 or the second fine-tuning processing unit 6 inputs training data (downstream task) into the model (classifier) ​​and performs forward propagation to output the calculation results from the output layer.

[0082] In step B2, the first fine-tuning processing unit 5 or the second fine-tuning processing unit 6 calculates the loss function using the calculation results from the output layer.

[0083] In step B3, the first fine-tuning processing unit 5 or the second fine-tuning processing unit 6 performs backpropagation, which calculates the gradient of each layer from the output layer to the input layer using the calculated loss function.

[0084] In step B4, the first fine-tuning processing unit 5 or the second fine-tuning processing unit 6 updates the weight values ​​of each layer using the calculated gradient.

[0085] In step B5, the first fine-tuning processing unit 5 or the second fine-tuning processing unit 6 checks whether the processes in steps B1 to B4 have been performed the number of training cycles set by the user. In other words, the first fine-tuning processing unit 5 or the second fine-tuning processing unit 6 checks whether the termination condition has been met.

[0086] If, upon verification, steps B1 to B4 have not been performed the number of training sessions set by the user (see NO route in step B5), the termination condition is not met, and the process returns to step B1.

[0087] On the other hand, if steps B1 to B4 are performed the number of training sessions set by the user (see the YES route in step B5), the termination condition is met and the process ends.

[0088] (B-4) Effect Thus, according to the model generation device 1 as an example of an embodiment, first, the first fine-tuning processing unit 5 trains only the untrained heads (classifiers) of the early exit model using a downstream task. Then, the second fine-tuning processing unit 6 simultaneously fine-tunes the entire early exit model.

[0089] As a result, when the second fine-tuning processing unit 6 fine-tunes the entire model for early exit, all classifiers in the backbone are already trained by the first fine-tuning processing unit 5.

[0090] Therefore, during the fine-tuning of the entire early exit model by the second fine-tuning processing unit 6, the gradients backpropagated from each classifier are reduced, preventing the backpropagated gradients from adversely affecting the parameters of each layer of the backbone. This prevents a decrease in the accuracy of the fine-tuned early exit model. As a result, inference using the fine-tuned early exit model can be accelerated.

[0091] Figures 7 and 8 show the inference accuracy of a model trained by the model generation device 1, which is an example of an embodiment, compared to a model trained by a conventional method.

[0092] Figures 7 and 8 show a comparison of the inference accuracy of each layer when using the GLUE task, comparing the model generated by the model generation device 1 with an early exit model trained using the method described in the related technologies above (referred to as the conventional method in Figures 7 and 8) and a model without early exit. Figures 7 and 8 also show examples of fine tuning performed using the QQP, SST-2, QNLI, and MNLI tasks within the GLUE task. GLUE is an abbreviation for General Language Understanding Evaluation.

[0093] Figure 7 shows a graph illustrating the relationship between the inference accuracy and the average exit layer for the BERT-based GLUE task development set. Layer 1 represents the layer closest to the input, and Layer 12 represents the final layer.

[0094] It can be seen that the inference accuracy of models trained with this model generator 1 is improved regardless of whether the task used is QQP, SST-2, QNLI, or MNLI.

[0095] Figure 8 shows a comparison of the rate of acceleration of inference for each of the QQP, SST-2, QNLI, and MNLI tasks shown in Figure 7, using the model generated by this model generation device 1, an early exit applied model trained using the methods described in the related technologies above, and a model without early exit.

[0096] In Figure 8, the acceleration rate of the model generated (trained) by the model generation device 1 was measured by adjusting the uncertainty threshold so that the inference accuracy was equivalent to that without early exit.

[0097] Furthermore, in Figure 8, for the QQP, SST-2, QNLI, and MNLI tasks with early exit (trained using this model generator), the upper row of values ​​(% values) represents accuracy, and the lower row of values ​​represents the rate of inference acceleration.

[0098] As shown in Figures 7 and 8, it can be seen that the model trained by this model generation device 1 can achieve faster inference with the same inference accuracy as without early exit.

[0099] (C) Others Furthermore, the disclosed technology is not limited to the embodiments described above, and can be implemented in various modified forms without departing from the spirit of this embodiment.

[0100] For example, in the embodiment described above, the termination condition for training each head by the first fine-tuning processing unit 5 or the second fine-tuning processing unit 6 is reaching the number of training sessions set by the user, but it is not limited to this.

[0101] For example, the termination condition for training each head by the first fine-tuning processing unit 5 or the second fine-tuning processing unit 6 may be that the inference accuracy of the model reaches an accuracy set by the user.

[0102] Figure 9 is a flowchart (steps B1 to B5') showing the first modified example of the training method for the model to be trained by the first fine-tuning processing unit 5 and the second fine-tuning processing unit 6.

[0103] Note that in the diagram, processes denoted with the same symbols as those described above represent the same processes, so their explanations will be omitted.

[0104] In step B5', the first fine-tuning processing unit 5 or the second fine-tuning processing unit 6 checks whether the inference accuracy of the model after the weight update has reached the accuracy (threshold) set by the user.

[0105] If, upon verification, the inference accuracy of the model after the weight update does not reach the accuracy (threshold) set by the user (see NO route in step B5'), the termination condition is not met, and the process returns to step B1.

[0106] On the other hand, if the inference accuracy of the model after the weight update reaches the accuracy (threshold) set by the user (see the YES route in step B5'), the termination condition is met and the process is terminated.

[0107] Furthermore, the termination condition for training each head by the first fine-tuning processing unit 5 or the second fine-tuning processing unit 6 may be that the inference accuracy of the model has deteriorated compared to the previous training session.

[0108] Figure 10 is a flowchart (steps B1-B5″, B6) showing a second modified example of the training method for the model to be trained by the first fine-tuning processing unit 5 and the second fine-tuning processing unit 6.

[0109] Note that in the diagram, processes denoted with the same symbols as those described above represent the same processes, so their explanations will be omitted.

[0110] In step B5″, the first fine-tuning processing unit 5 or the second fine-tuning processing unit 6 checks whether the inference accuracy of the model after the weight update has deteriorated compared to the inference accuracy in the previous training, i.e., the inference accuracy of the model after the previous weight update.

[0111] If the verification results show that the inference accuracy of the model after the weight update is the same as or better than the inference accuracy in the previous training (see NO route in step B5), the termination condition is not met, and the process returns to step B1.

[0112] On the other hand, if the inference accuracy of the model after the weight update is worse than the inference accuracy in the previous training (see the YES route in step B5"), it can be determined that the termination condition has been met.

[0113] In step B6, the first fine-tuning processing unit 5 or the second fine-tuning processing unit 6 updates the weights updated in step B4 using the values ​​of the weights before the update (the weights updated in the previous training). After that, the process terminates.

[0114] Furthermore, while the above-described embodiment shows an example where the output layer of the machine learning model is a classifier, the model is not limited to this.

[0115] Furthermore, the above disclosure makes it possible for those skilled in the art to implement and manufacture this embodiment.

[0116] (D) Note The following additional information is disclosed regarding the embodiments described above.

[0117] (Note 1) For a machine learning model having multiple pre-trained layers, a first output layer formed to suit a downstream task and connected to the final layer of the multiple layers, and multiple second output layers connected to the outputs of each of the layers other than the final layer and having the same configuration as the first output layer, The first output layer and the second output layer of the machine learning model are trained on the downstream task. The entire machine learning model, including the first output layer and the second output layer, is trained on the downstream task. A machine learning program characterized by having a computer perform the processing.

[0118] (Note 2) For a pre-trained model having the multiple layers that have been pre-trained, the output layer connected to the final layer among the multiple layers is replaced with the first output layer formed to suit the downstream task. The machine learning model is generated by connecting a second output layer, having the same configuration as the first output layer, to the output of each of the layers other than the final layer among the plurality of layers. The machine learning program described in Appendix 1, characterized in that it causes the computer to perform the processing.

[0119] (Note 3) For a machine learning model having multiple pre-trained layers, a first output layer formed to suit a downstream task and connected to the final layer of the multiple layers, and multiple second output layers connected to the outputs of each of the layers other than the final layer and having the same configuration as the first output layer, The first output layer and the second output layer of the machine learning model are trained on the downstream task. The entire machine learning model, including the first output layer and the second output layer, is trained on the downstream task. A machine learning method characterized by having a computer perform the processing.

[0120] (Note 4) For a pre-trained model having the multiple layers that have been pre-trained, the output layer connected to the final layer among the multiple layers is replaced with the first output layer formed to suit the downstream task. The machine learning model is generated by connecting a second output layer, having the same configuration as the first output layer, to the output of each of the layers other than the final layer among the plurality of layers. The machine learning method according to Appendix 3, characterized in that the processing is performed by the computer. [Explanation of symbols]

[0121] 1 Model Generator 2. Pre-trained model acquisition unit 3. Backbone generation unit 4. Model generation unit for early exits 5. First Fine Tuning Processing Unit 6. Second Fine Tuning Processing Unit 10 Computers 10a processor 10b Graphics Processing Unit 10c memory 10d storage section 10e IF section 10f IO section 10g reading unit 10-hour program 10i recording media 10j bus 100 pre-trained models 101 Backbone 102 Early Exit Model E1~E3 Encoder C1,C2,C2′ classifier

Claims

1. For a machine learning model having multiple pre-trained layers, a first output layer formed to suit a downstream task and connected to the final layer of the multiple layers, and multiple second output layers connected to the outputs of each of the layers other than the final layer and having the same configuration as the first output layer, The first output layer and the second output layer of the machine learning model are trained on the downstream task. The entire machine learning model, including the first output layer and the second output layer, is trained on the downstream task. A machine learning program characterized by having a computer perform the processing.

2. For a pre-trained model having the multiple layers that have been pre-trained, the output layer connected to the final layer among the multiple layers is replaced with the first output layer formed to suit the downstream task. The machine learning model is generated by connecting a second output layer, having the same configuration as the first output layer, to the output of each of the layers other than the final layer among the plurality of layers. The machine learning program according to claim 1, characterized in that it causes the computer to perform the processing.

3. For a machine learning model having multiple pre-trained layers, a first output layer formed to suit a downstream task and connected to the final layer of the multiple layers, and multiple second output layers connected to the outputs of each of the layers other than the final layer and having the same configuration as the first output layer, The first output layer and the second output layer of the machine learning model are trained on the downstream task. The entire machine learning model, including the first output layer and the second output layer, is trained on the downstream task. A machine learning method characterized by having a computer perform the processing.