# US 2023/0145452 A1 · Method and apparatus for training a model

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2023/0145452 A1
- Document ID: US20230145452A1
- Status: Published application
- Kind: A1
- Application number: 18/047,783
- Filed: 2022-10-19
- Published: 2023-05-11
- Earliest claimed: 2021-11-09
- Applicants: Alibaba Cloud Computing (Beijing) Co., Ltd.
- Inventors: Junyang LIN; An YANG; Rui MEN; Chang ZHOU; Hongxia YANG; Jingren ZHOU
- Web page: https://patentgrep.com/patent/US20230145452A1

## CPC

- G06N 3/045: Combinations of networks
- G06N 3/08: Learning methods
- G06N 3/082: modifying the architecture, e.g. adding, deleting or silencing nodes or connections
- G06N 3/084: Backpropagation, e.g. using gradient descent
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

A method and an apparatus for model training are provided. The method for model training includes: training a first model to obtain a parameter set of the trained first model, in which first layers in the first model share the same weight parameters; copying the parameter set for multiple times as weight parameters of second layers of a second model; and training the second model to realize model convergence. The first model and the second model have the same computation graph, and the number of the second layers is equal to or greater than the number of the first layers.

## Claims

### Claim 1

A method for model training, comprising:
training a first model to obtain a parameter set of the trained first model, wherein a plurality of first layers in the first model share same weight parameters;
copying the parameter set for a plurality of times as weight parameters of a plurality of second layers of a second model; and
training the second model to realize model convergence,
wherein the first model and the second model have a same computation graph, and the number of the plurality of second layers is equal to or greater than the number of the plurality of first layers.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
before training the first model, designating the plurality of first layers to share the weight parameters in a model to be trained to obtain the first model; and
before copying the parameter set for the plurality of times, designating the plurality of first layers not to share the weight parameters in the first model to obtain the second model.

### Claim 3 (depends on 1)

The method of claim 1, further comprising:
after training the first model and before copying the parameter set for the plurality of times, determining whether an error between a result and an expected result of the first model satisfies a set condition; and
copying the parameter set for the plurality of times in response to the set condition being satisfied.

### Claim 4 (depends on 1)

The method of claim 1, wherein training the first model and training the second model are performed on a server comprising a central processing unit and a plurality of graphics processing units, and a CPU offload mode is adopted for training the second model.

### Claim 5 (depends on 1)

The method of claim 1, wherein the computation graph has a transformer or Bidirectional Encoder Representations from Transformers (BERT) structure.

### Claim 6

An apparatus for model training, comprising:
a first training unit configured to train a first model to obtain a parameter set of the trained first model, wherein a plurality of first layers in the first model share same weight parameters;
a parameter copying unit configured to copy the parameter set for a plurality of times as weight parameters of a plurality of second layers of a second model; and
a second training unit configured to train the second model to realize model convergence,
wherein the first model and the second model have a same computation graph, and the number of the plurality of second layers is equal to or greater than the number of the plurality of first layers.

### Claim 7 (depends on 6)

The apparatus of claim 6, further comprising:
a first configuration unit configured to designate the plurality of first layers to share the weight parameters in a model to-be-trained to obtain the first model; and
a second configuration unit configured to designate the plurality of first layers not to share the weight parameters in the first model to obtain the second model.

### Claim 8 (depends on 6)

The apparatus of claim 6, wherein the computation graph has a transformer or Bidirectional Encoder Representations from Transformers (BERT) structure.

### Claim 9 (depends on 6)

The apparatus of claim 6, wherein the apparatus is configured to determine whether an error between a result and an expected result of the first model satisfies a set condition, and the parameter copying unit is configured to copy the parameter set for the plurality of times in response to the set condition being satisfied.

### Claim 10 (depends on 6)

The apparatus of claim 6, further comprises a central processing unit and a plurality of graphics processing units, wherein the second training unit is configured to adopt a CPU offload mode to train the second model.

### Claim 11

A server, comprising:
one or more processors, and
a plurality of model acceleration units, wherein the one or more processors and the plurality of model acceleration units are configured to execute a set of instructions to cause the server to perform:
training a first model to obtain a parameter set of the trained first model, wherein a plurality of first layers in the first model share same weight parameters;
copying the parameter set for a plurality of times as weight parameters of a plurality of second layers of a second model; and
training the second model to realize model convergence,
wherein the first model and the second model have a same computation graph, and the number of the plurality of second layers is equal to or greater than the number of the plurality of first layers.

### Claim 12 (depends on 11)

The server of claim 11, wherein the one or more processors and the plurality of model acceleration units are configured to execute the set of instructions to further cause the server to perform:
before training the first model, designating the plurality of first layers to share the weight parameters in a model to be trained to obtain the first model; and
before copying the parameter set for the plurality of times, designating the plurality of first layers not to share the weight parameters in the first model to obtain the second model.

### Claim 13 (depends on 11)

The server of claim 11, wherein the one or more processors and the plurality of model acceleration units are configured to execute the set of instructions to further cause the server to perform:
after training the first model and before copying the parameter set for the plurality of times, determining whether an error between a result and an expected result of the first model satisfies a set condition; and
performing copying the parameter set for the plurality of times in response to the set condition being satisfied.

### Claim 14 (depends on 11)

The server of claim 11, wherein the one or more processors and the plurality of model acceleration units are configured to execute the set of instructions to further cause the server to adopt a CPU offload mode for training the second model.

### Claim 15 (depends on 11)

The server of claim 11, wherein the computation graph has a transformer or Bidirectional Encoder Representations from Transformers (BERT) structure.
