# US 2022/0292269 A1 · Method and apparatus for acquiring pre-trained model

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

- Number: US 2022/0292269 A1
- Document ID: US20220292269A1
- Status: Published application
- Kind: A1
- Application number: 17/502,108
- Filed: 2021-10-15
- Published: 2022-09-15
- Earliest claimed: 2021-03-15
- Assignees: Beijing Baidu Netcom Science Technology Co., Ltd.
- Applicants: Beijing Baidu Netcom Science Technology Co., Ltd.
- Inventors: Guocheng NIU; Wei LI; Can GAO; Xinyan XIAO; Hua WU
- Web page: https://patentgrep.com/patent/US20220292269A1

## CPC

- G06F 40/58: Use of machine translation, e.g. for multi-lingual retrieval, for server-side translation for client devices or for real-time translation
- G06N 3/08: Learning methods
- G06F 18/214: Generating training patterns; Bootstrap methods, e.g. bagging or boosting
- G06F 18/256: {of results relating to different input data, e.g. multimodal recognition}
- G06F 40/205: Parsing
- G06F 40/47: Machine-assisted translation, e.g. using translation memory
- G06N 3/045: Combinations of networks
- G06N 3/0895: Weakly supervised learning, e.g. semi-supervised or self-supervised learning
- G06N 3/09: Supervised learning
- G06V 10/803: {of input or preprocessed data}
- G06N 3/02: Neural networks
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING

## Abstract

The present disclosure discloses a method and apparatus for acquiring a pre-trained model, and relates to natural language processing and deep learning technologies in the field of artificial intelligence technologies. An implementation includes: acquiring training data, the training data including a single-modal language material and a multi-modal language material, and the multi-modal language material including a language material pair formed by a first-modal language material and a second-modal language material; and performing a multi-task training operation on a pre-trained model using the training data, the multi-task including at least one cross-modal contrastive learning task and at least one single-modal learning task; the pre-trained language model obtained in the present disclosure may learn from different forms of language materials, i.e., the single-modal language material and the multi-modal language material, such that the pre-trained language model may effectively process information in various modals.

## Claims

### Claim 1

A method for acquiring a pre-trained model, comprising:
acquiring training data, the training data comprising a single-modal language material and a multi-modal language material, and the multi-modal language material comprising a language material pair formed by a first-modal language material and a second-modal language material; and
performing a multi-task training operation on a pre-trained model using the training data, the multi-task comprising at least one cross-modal contrastive learning task and at least one single-modal learning task;
wherein the cross-modal contrastive learning task comprises: determining similarity between the first-modal language material and the second-modal language material in the multi-modal language material utilizing a vector representation of the first-modal language material and a vector representation of the second-modal language material in the multi-modal language material by the pre-trained model, with a training target of maximizing the similarity between the first-modal language material and the second-modal language material in a positive multi-modal language material and minimizing the similarity between the first-modal language material and the second-modal language material in a negative multi-modal language material; and
the single-modal learning task comprises: predicting a second part of content in the single-modal language material utilizing a vector representation of a first part of content in the single-modal language material by the pre-trained model, with a training target of minimizing a difference between the predicted second part of content and the second part of content in the single-modal language material.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the single-modal language material comprises an image and a text, and the multi-modal language material comprises an image-text pair.

### Claim 3 (depends on 1)

The method according to claim 1, further comprising:
performing at least one of rewriting extension and retrieval extension on the multi-modal language material in the training data, and adding the extended multi-modal language material into the training data.

### Claim 4 (depends on 3)

The method according to claim 3, wherein the rewriting extension comprises:
if the first-modal language material in the positive multi-modal language material is a text in a first language, translating the text in the first language into a text in a second language and then translating the text in the second language back to a text in the first language using a translation model, and constructing a new positive multi-modal language material by the text in the first language obtained after translation and the second-modal language material in the positive multi-modal language material; or
parsing the first-modal language material in the positive multi-modal language material into a scenario graph, randomly replacing at least one of an entity, an attribute and a relationship in the scenario graph, converting the scenario graph obtained after replacement back into the first-modal language material, and constructing a new negative multi-modal language material by the first-modal language material obtained after conversion and the second-modal language material in the positive multi-modal language material.

### Claim 5 (depends on 3)

The method according to claim 3, wherein the retrieval extension comprises:
retrieving the first-modal language material of the positive multi-modal language material in a first-modal corpus, and constructing a new positive multi-modal language material using the retrieved language material and the second-modal language material in the positive multi-modal language material.

### Claim 6 (depends on 3)

The method according to claim 3, wherein in the cross-modal contrastive learning task, the similarity between the first-modal language material and the second-modal language material in the multi-modal language material obtained by the retrieval extension is determined by: calculating similarity between a vector representation of the first-modal language material obtained by the pre-trained model and a vector representation of the second-modal language material obtained by the pre-trained model; and
the similarity between the first-modal language material and the second-modal language material in the multi-modal language material obtained by the rewriting extension is determined by: stitching the first-modal language material and the second-modal language material, and mapping a vector representation of the stitched language material obtained by the pre-trained model into a similarity value.

### Claim 7 (depends on 1)

The method according to claim 1, wherein the single-modal learning task further comprises:
predicting a second part of content in the first-modal language material utilizing a vector representation of a first part of content in the first-modal language material and the vector representation of the second-modal language material in the multi-modal language material by the pre-trained model, with a training target of minimizing a difference between the predicted second part of content and the second part of content in the first-modal language material.

### Claim 8 (depends on 1)

The method according to claim 1, wherein parameters of the pre-trained model are updated using a constructed total loss function when the multi-task training operation is performed; and
the total loss function is obtained by a sum of the loss function of the at least one cross-modal contrastive learning task and the loss function of the at least one single-modal learning task.

### Claim 9 (depends on 4)

The method according to claim 4, wherein in the cross-modal contrastive learning task, the similarity between the first-modal language material and the second-modal language material in the multi-modal language material obtained by the retrieval extension is determined by: calculating similarity between a vector representation of the first-modal language material obtained by the pre-trained model and a vector representation of the second-modal language material obtained by the pre-trained model; and
the similarity between the first-modal language material and the second-modal language material in the multi-modal language material obtained by the rewriting extension is determined by: stitching the first-modal language material and the second-modal language material, and mapping a vector representation of the stitched language material obtained by the pre-trained model into a similarity value.

### Claim 10 (depends on 5)

The method according to claim 5, wherein in the cross-modal contrastive learning task, the similarity between the first-modal language material and the second-modal language material in the multi-modal language material obtained by the retrieval extension is determined by: calculating similarity between a vector representation of the first-modal language material obtained by the pre-trained model and a vector representation of the second-modal language material obtained by the pre-trained model; and
the similarity between the first-modal language material and the second-modal language material in the multi-modal language material obtained by the rewriting extension is determined by: stitching the first-modal language material and the second-modal language material, and mapping a vector representation of the stitched language material obtained by the pre-trained model into a similarity value.

### Claim 11

An electronic device, comprising:
at least one processor; and
a memory communicatively connected with the at least one processor;
wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform a method for acquiring a pre-trained model, wherein the method comprises:
acquiring training data, the training data comprising a single-modal language material and a multi-modal language material, and the multi-modal language material comprising a language material pair formed by a first-modal language material and a second-modal language material; and
performing a multi-task training operation on a pre-trained model using the training data, the multi-task comprising at least one cross-modal contrastive learning task and at least one single-modal learning task;
wherein the cross-modal contrastive learning task comprises: determining similarity between the first-modal language material and the second-modal language material in the multi-modal language material utilizing a vector representation of the first-modal language material and a vector representation of the second-modal language material in the multi-modal language material by the pre-trained model, with a training target of maximizing the similarity between the first-modal language material and the second-modal language material in a positive multi-modal language material and minimizing the similarity between the first-modal language material and the second-modal language material in a negative multi-modal language material; and
the single-modal learning task comprises: predicting a second part of content in the single-modal language material utilizing a vector representation of a first part of content in the single-modal language material by the pre-trained model, with a training target of minimizing a difference between the predicted second part of content and the second part of content in the single-modal language material.

### Claim 12 (depends on 11)

The electronic device according to claim 11, wherein the single-modal language material comprises an image and a text, and the multi-modal language material comprises an image-text pair.

### Claim 13 (depends on 11)

The electronic device according to claim 11, further comprising:
performing at least one of rewriting extension and retrieval extension on the multi-modal language material in the training data, and adding the extended multi-modal language material into the training data.

### Claim 14 (depends on 13)

The electronic device according to claim 13, wherein the rewriting extension comprises:
if the first-modal language material in the positive multi-modal language material is a text in a first language, translating the text in the first language into a text in a second language and then translate the text in the second language back to a text in the first language using a translation model, and constructing a new positive multi-modal language material by the text in the first language obtained after translation and the second-modal language material in the positive multi-modal language material; or
parsing the first-modal language material in the positive multi-modal language material into a scenario graph, randomly replace at least one of an entity, an attribute and a relationship in the scenario graph, converting the scenario graph obtained after replacement back into the first-modal language material, and constructing a new negative multi-modal language material by the first-modal language material obtained after conversion and the second-modal language material in the positive multi-modal language material.

### Claim 15 (depends on 13)

The electronic device according to claim 13, wherein the retrieval extension comprises:
retrieving the first-modal language material of the positive multi-modal language material in a first-modal corpus, and constructing a new positive multi-modal language material using the retrieved language material and the second-modal language material in the positive multi-modal language material.

### Claim 16 (depends on 13)

The electronic device according to claim 13, wherein in the cross-modal contrastive learning task, the similarity between the first-modal language material and the second-modal language material in the multi-modal language material obtained by the retrieval extension is determined by: calculating similarity between a vector representation of the first-modal language material obtained by the pre-trained model and a vector representation of the second-modal language material obtained by the pre-trained model; and determines the similarity between the first-modal language material and the second-modal language material in the multi-modal language material obtained by the rewriting extension by: stitching the first-modal language material and the second-modal language material, and mapping a vector representation of the stitched language material obtained by the pre-trained model into a similarity value.

### Claim 17 (depends on 11)

The electronic device according to claim 11, wherein the single-modal learning task further comprises: predicting a second part of content in the first-modal language material utilizing a vector representation of a first part of content in the first-modal language material and the vector representation of the second-modal language material in the multi-modal language material by the pre-trained model, with a training target of minimizing a difference between the predicted second part of content and the second part of content in the first-modal language material.

### Claim 18 (depends on 11)

The electronic device according to claim 11, wherein parameters of the pre-trained model are updated using a constructed total loss function when the multi-task training operation is performed; and
the total loss function is obtained by a sum of the loss function of the at least one cross-modal contrastive learning task and the loss function of the at least one single-modal learning task.

### Claim 19 (depends on 14)

The electronic device according to claim 14, wherein in the cross-modal contrastive learning task, the similarity between the first-modal language material and the second-modal language material in the multi-modal language material obtained by the retrieval extension is determined by: calculating similarity between a vector representation of the first-modal language material obtained by the pre-trained model and a vector representation of the second-modal language material obtained by the pre-trained model; and determines the similarity between the first-modal language material and the second-modal language material in the multi-modal language material obtained by the rewriting extension by: stitching the first-modal language material and the second-modal language material, and mapping a vector representation of the stitched language material obtained by the pre-trained model into a similarity value.

### Claim 20

A non-transitory computer readable storage medium with computer instructions stored thereon, wherein the computer instructions are used for causing a computer to perform a method for acquiring a pre-trained model, wherein the method comprises:
acquiring training data, the training data comprising a single-modal language material and a multi-modal language material, and the multi-modal language material comprising a language material pair formed by a first-modal language material and a second-modal language material; and
performing a multi-task training operation on a pre-trained model using the training data, the multi-task comprising at least one cross-modal contrastive learning task and at least one single-modal learning task;
wherein the cross-modal contrastive learning task comprises: determining similarity between the first-modal language material and the second-modal language material in the multi-modal language material utilizing a vector representation of the first-modal language material and a vector representation of the second-modal language material in the multi-modal language material by the pre-trained model, with a training target of maximizing the similarity between the first-modal language material and the second-modal language material in a positive multi-modal language material and minimizing the similarity between the first-modal language material and the second-modal language material in a negative multi-modal language material; and
the single-modal learning task comprises: predicting a second part of content in the single-modal language material utilizing a vector representation of a first part of content in the single-modal language material by the pre-trained model, with a training target of minimizing a difference between the predicted second part of content and the second part of content in the single-modal language material.
