IP Library Granted Patent US 12,475,328
Granted Patent B2
US 12,475,328 · App. 17/974,317 · Granted Nov 18, 2025

Method for training non-autoregressive translation model

Inventors: Xiyang Wang (Beijing, CN); Ruiqing Zhang (Beijing, CN); Zhongjun He (Beijing, CN); Zhi Li (Beijing, CN); Hua Wu (Beijing, CN)
Assignee: BEIJING BAIDU NETCOM SCIENCE TECHNOLOGY CO., LTD.
G06F40/47G06F40/44G06N3/0455G06N3/088
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,475,328
App. No.
17/974,317
Granted
Nov 18, 2025
Kind
B2
Abstract

A method for training a non-autoregressive translation (NAT) model includes: acquiring a source language text, a target language text corresponding to the source language text and a target length of the target language text; generating a target language prediction text and a prediction length by inputting the source language text into the NAT model, in which initialization parameters of the NAT model are determined based on parameters of a pre-trained translation model; and obtaining a target NAT model by training the NAT model based on the target language text, the target language prediction text, the target length and the prediction length.

Claims (51)

1 . A computer-implemented method for training a non-auto regressive translation (NAT) model, comprising:

acquiring a source language text, a target language text corresponding to the source language text and a target length of the target language text;

generating a target language prediction text and a prediction length by inputting the source language text into the NAT model, wherein initialization parameters of an encoder in the NAT model are determined based on parameters of an encoder in a pre-trained translation model, initialization parameters or a decoder in the NAT model are determined based on parameters of a decoder in the pre-trained translation model, training data of the pre-trained translation model includes a first hybrid text and a second hybrid text, the first hybrid text comprises a first source language text, a separator and a second target language text sequentially arranged, and the second hybrid text comprises a first target language text corresponding to the first source language text, the separator, and a second source language text corresponding to the second target language text sequentially arranged;

obtaining a target NAT model by training the NAT model based on the target language text, the target language prediction text, the target length and the prediction length;

performing machine translation on scarce languages using the target NAT model.

2 . The method of claim 1 , further comprising:

acquiring the first hybrid text, the second hybrid text, and a target length of the second hybrid text;

generating a hybrid prediction text and a prediction length of the first hybrid text, by inputting the first hybrid text into a translation model to be trained; and

obtaining the pre-trained translation model by training the translation model to be trained based on the second hybrid text, the hybrid prediction text, the target length of the second hybrid text and the prediction length of the first hybrid text.

3 . The method of claim 2 , wherein the translation model to be trained generates the hybrid prediction text and the prediction length of the first hybrid text by acts of:

generating hybrid encoded information by encoding the first hybrid text through an encoder in the translation model to be trained;

generating the prediction length of the first hybrid text based on the hybrid encoded information through a length predictor in the translation model to be trained;

generating a hybrid masked text based on the first hybrid text through the translation model to be trained; and

generating the hybrid prediction text by decoding the hybrid masked text based on the prediction length of the first hybrid text and the hybrid encoded information through a decoder in the translation model to be trained.

4 . The method of claim 3 , wherein generating the hybrid masked text based on the first hybrid text through the translation model to be trained comprises:

generating the hybrid masked text by performing mask operation randomly on words in the first hybrid text through the translation model to be trained.

5 . An electronic device, comprising:

at least one processor; and

a memory stored with instructions executable by the at least one processor;

wherein the at least one processor is configured to:

acquire a source language text, a target language text corresponding to the source language text and a target length of the target language text;

generate a target language prediction text and a prediction length by inputting the source language text into the NAT model, wherein initialization parameters of an encoder in the NAT model are determined based on parameters of an encoder in a pre-trained translation model, initialization parameters of a decoder in the NAT model are determined based on parameters of a decoder in the pre-trained translation model, training data of the pre-trained translation model includes a first hybrid text and a second hybrid text, the first hybrid text comprises a first source language text, a separator and a second target language text sequentially arranged, and the second hybrid text comprises a first target language text corresponding to the first source language text, the separator, and a second source language text corresponding to the second target language text sequentially arranged;

obtain a target NAT model by training the NAT model based on the target language text, the target language prediction text, the target length and the prediction length; and

perform machine translation on scarce languages using the target NAT model.

6 . The electronic device of claim 5 , further comprising:

acquiring the first hybrid text, the second hybrid text, and a target length of the second hybrid text;

generating a hybrid prediction text and a prediction length of the first hybrid text, by inputting the first hybrid text into a translation model to be trained; and

obtaining the pre-trained translation model by training the translation model to be trained based on the second hybrid text, the hybrid prediction text, the target length of the second hybrid text and the prediction length of the first hybrid text.

7 . The electronic device of claim 6 , wherein the at least one processor is further configured to:

generate hybrid encoded information by encoding the first hybrid text through an encoder in the translation model to be trained;

generate the prediction length of the first hybrid text based on the hybrid encoded information through a length predictor in the translation model to be trained;

generate a hybrid masked text based on the first hybrid text through the translation model to be trained; and

generate the hybrid prediction text by decoding the hybrid masked text based on the prediction length of the first hybrid text and the hybrid encoded information through a decoder in the translation model to be trained.

8 . The electronic device of claim 7 , wherein the at least one processor is further configured to:

generate the hybrid masked text by performing mask operation randomly on words in the first hybrid text through the translation model to be trained.

9 . A non-transitory computer-readable storage medium stored with computer instructions, wherein, when the computer instructions cause a computer to perform a method for training a non-autoregressive translation (NAT) model, the method comprising:

acquiring a source language text, a target language text corresponding to the source language text and a target length of the target language text;

generating a target language prediction text and a prediction length by inputting the source language text into the NAT model, wherein initialization parameters of an encoder in the NAT model are determined based on parameters of an encoder in a pre-trained translation model, initialization parameters of a decoder in the NAT model are determined based on parameters of a decoder in the pre-trained translation model, training data of the pre-trained translation model includes a first hybrid text and a second hybrid text, the first hybrid text comprises a fast source language text, a separator and a second target language text sequentially arranged, and the second hybrid text comprises a first target language text corresponding to the first source language text, the separator, and a second source language text corresponding to the second target language text sequentially arranged;

obtaining a target NAT model by training the NAT model based on the target language text, the target language prediction text, the target length and the prediction length; and

performing machine translation on scarce languages using the target NAT model.

10 . The storage medium of claim 9 , wherein the method further comprises:

acquiring the first hybrid text, the second hybrid text, and a target length of the second hybrid text;

generating a hybrid prediction text and a prediction length of the first hybrid text, by inputting the first hybrid text into a translation model to be trained; and

obtaining the pre-trained translation model by training the translation model to be trained based on the second hybrid text, the hybrid prediction text, the target length of the second hybrid text and the prediction length of the first hybrid text.

11 . The storage medium of claim 10 , wherein the translation model to be trained generates the hybrid prediction text and the prediction length of the first hybrid text by acts of:

generating hybrid encoded information by encoding the first hybrid text through an encoder in the translation model to be trained;

generating the prediction length of the first hybrid text based on the hybrid encoded information through a length predictor in the translation model to be trained;

generating a hybrid masked text based t hybrid text through the translation model to be trained; and

generating the hybrid prediction text by decoding the hybrid masked text based on the prediction length of the first hybrid text and the hybrid encoded information through a decoder in the translation model to be trained.

12 . The storage medium of claim 11 , wherein generating the hybrid masked text based on the first hybrid text through the translation model to be trained comprises:

generating the hybrid masked text by performing mask operation randomly on words in the first hybrid text through the translation model to be trained.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 26, 2022
From: WANG, XIYANG; ZHANG, RUIQING; HE, ZHONGJUN; LI, ZHI; WU, HUA
To: BEIJING BAIDU NETCOM SCIENCE TECHNOLOGY CO., LTD.
Reel/Frame 061549/0956 →
Priority Claims (1)
CN 202111353568.8 · Nov 16, 2021 · national
Continuity (1)
Related Publication 20230051373A1 · Feb 16, 2023
References Cited (19)
US 20230051373A1 · Wang · 2023 [cited by examiner]
CN 111368560A · 2020 [cited by examiner]
CN 113168560A · 2020 [cited by applicant]
CN 111581988A · 2020 [cited by examiner]
CN 112257471A · 2021 [cited by examiner]
CN 112417901A · 2021 [cited by examiner]
CN 113204979A · 2021 [cited by examiner]
CN 113378584A · 2021 [cited by examiner]
CN 113657125A · 2021 [cited by examiner]
CN 114091482A · 2022 [cited by examiner]
CN 114186569A · 2022 [cited by examiner]
CN 110457713B · 2023 [cited by examiner]
CN 113378584B · 2023 [cited by examiner]
Search Report for European Application No. 22203878.8, dated Mar. 22, 2023, 10 pages. [cited by applicant]
Kasai, Jungo et al., “Deep Encoder, Shallow Decoder: Reevaluating Non-Autoregressive Machine Translation”; May 7, 2021; ICLR 2021; 16 Pages. [cited by applicant]
Gu, Jiatao et al., “Non-Autoregressive Neural Machine Translation”; Mar. 9, 2018; ICLR 2018; 13 pages. [cited by applicant]
Wang, Yiren et al., “Non-Autoregressive Machine Translation with Auxiliary Regularization”; Feb. 22, 2019; ICLR 2019; 8 pages. [cited by applicant]
Kasai, Jungo et al. “Non-autoregressive Machine Translation with Disentangled Context Transformer”; Jun. 30, 2020; ICLR 2020; 12 pages. [cited by applicant]
Office Action for Japanese Patent Application No. 2022-179428, dated Jan. 16, 2024, 3 pages. [cited by applicant]