A pseudo-language family clustering method and device based on multi-language pre-trained large model
Through the pseudo-language family clustering method based on multi-language pre-trained large models, the problem of requiring additional knowledge or model modifications in low-resource language translation is solved, the translation quality and model generalization are improved, and the clustering process is simplified.
Patent Information
- Application Number
- CN202311653724.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-04
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2043-12-04
AI Technical Summary
Existing technologies require additional prior knowledge or modifications to the model architecture in low-resource language translation, resulting in training complexity and difficulty in reproducibility.
A pseudo-language family clustering method based on a large multi-lingual pre-trained model is used to achieve language pairing by establishing a shared language pool, calculating the Fisher information matrix, calculating the similarity of language pairs and sorting them, and selecting auxiliary language pairs that meet the boundary values. of clustering.
It improves the translation quality of low-resource language pairs under multi-language collaborative training, enhances the generalization of the model between different data sets, simplifies the clustering process of language pairs, and avoids modification of the model structure.
Smart Images

Figure CN117688176B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of machine translation, and in particular to a pseudo language family clustering method and device based on a multi-language pre-trained large model. Background Art
[0002] Neural machine translation (NMT) has become the dominant machine translation (MT) paradigm in academic research and commercial use. In recent years, studies have found that the NMT framework can naturally integrate multiple languages. As a result, research work on MT systems involving multiple languages has increased dramatically. Researchers refer to NMT systems that handle translations of more than one language pair as multilingual NMT (MNMT) systems. The ultimate goal of MNMT research is to develop a single model for translation between as many languages as possible by effectively utilizing available language resources. Although MNMT has brought promising improvements in translation quality, these models all rely on massively parallel corpora. Since such corpora only exist for a few language pairs, translation performance is far from expected in most low-resource languages. Related studies have shown that for low-resource language translation, by introducing additional auxiliary language pairs in the fine-tuning stage, multilingual co-training can outperform traditional fine-tuning methods in some cases. However, subsequent studies have further pointed out that co-training does not always bring positive results, and sometimes may even lead to a decline in translation quality, depending on the choice of co-language pairs.
[0003] In recent years, domestic and foreign research has shown that by fine-tuning the model using a language pair close to the target language, the translation quality of the target language pair can be improved without using the data of the target language pair, further illustrating the synergy between language pairs. However, not all language pairs can achieve the same effect through collaborative training. Therefore, the selection of collaborative language pairs has become a key step in improving the translation quality of MNMT in low-resource language pairs. Languages in a language family usually have a common geographical and linguistic background, so there are more similar meanings at the character or word level. From a linguistic point of view, these language pairs will have more identical or similar characters, grammar and other linguistic features. At present, academic research in this field is mainly divided into two directions: on the one hand, researchers usually integrate different prior knowledge, including language similarity, resource availability, language type and task-specific requirements; on the other hand, researchers try to apply language embedding, represent each language with an embedding vector, and cluster them in the embedding space, such as adding a language embedding (LanguageEmbedding) layer to the model, and after multi-language training, build an embedding vector for each language pair, and then build a language family through hierarchical clustering to improve the translation quality of the language pair, or embed an adapter (Adapter) structure in the model structure while keeping the pre-trained model parameters unchanged, and improve the translation quality by training the language family Adapter in downstream tasks.
[0004] Although these methods can improve the translation quality of language pairs, they also face certain difficulties in practical application. In particular, training new models or changing the structure of models will make these methods complicated, and these methods are also difficult to reproduce when the original structure and data of large language models are difficult to obtain. Summary of the invention
[0005] In order to solve the technical problems existing in the prior art that training a new model or changing the structure of the model will make these methods complicated, and it is difficult to reproduce when the original structure and data of the large language model are difficult to obtain, the embodiment of the present invention provides a pseudo language family clustering method and device based on a multi-language pre-trained large model. The technical solution is as follows:
[0006] On the one hand, a pseudo language family clustering method based on a multi-language pre-trained large model is provided, the method is implemented by a pseudo language family clustering device based on a multi-language pre-trained large model, and the method includes:
[0007] S1. Establish a shared language pool;
[0008] S2 calculates the Fisher information matrix of the language pairs in the shared language pool based on the multi-language pre-trained large model to obtain the representation results of the language pairs in the shared language pool;
[0009] S3, calculating the similarity between the language pairs according to the representation results to obtain a similarity value;
[0010] S4. According to the similarity values, the similarities between the language pairs are sorted, and the auxiliary language pairs that meet the preset boundary values are selected to complete the pseudo language family clustering based on the multi-language pre-trained large model.
[0011] Optionally, in step S1, establishing a shared language pool includes:
[0012] Get the TED dataset;
[0013] Extract multiple languages from the TED dataset, translate multiple languages into English as the basic dataset, and build a shared language pool.
[0014] Optionally, in step S2, based on the multi-language pre-trained large model, the Fisher information matrix of the language pairs in the shared language pool is calculated to obtain the representation results of the language pairs in the shared language pool, including:
[0015] Obtain the parallel corpus corresponding to the language pairs in the shared language pool, and equally divide the data in the parallel corpus into j small batch data sets;
[0016] Input the small batch data sets into the multi-language pre-trained large model in sequence, and output the Fisher information matrix of each small batch data set;
[0017] After one input round, the average Fisher information matrix of each mini-batch data set is calculated, and the average Fisher information matrix is used as an estimated value to obtain the Fisher information weight of each mini-batch data set;
[0018] According to the Fisher information weights, the distribution of corresponding language pairs in the shared language pool is characterized.
[0019] Optionally, in step S3, the similarity between the language pairs is calculated according to the characterization result to obtain a similarity value, including:
[0020] Obtain characterization results;
[0021] The mean square error method is used to calculate the distance between the target language pair and the auxiliary language pair. The closer the distance is, the higher the similarity is.
[0022] Optionally, in step S3, the similarity between the language pairs is calculated according to the characterization result to obtain a similarity value, including:
[0023] The Fisher information matrix is used to calculate the KL divergence from the auxiliary language to the target language to obtain the distance between the target language pair and the auxiliary language pair. The closer the distance is, the higher the similarity is.
[0024] Optionally, in step S3, the similarity between the language pairs is calculated according to the characterization result to obtain a similarity value, including:
[0025] The first K parameters are selected and assigned a value of 1, while the remaining parameters are assigned a value of 0 to create a Fisher information mask;
[0026] According to the number of parameters activated simultaneously and the number of parameters activated in the target direction, the distance between the target language pair and the auxiliary language pair is calculated. The closer the distance is, the higher the similarity is.
[0027] Optionally, in step S4, the similarities between the language pairs are sorted according to the similarity values, and the auxiliary language pairs that meet the boundary values are selected according to the preset boundary values, so as to complete the pseudo language family clustering based on the multi-language pre-trained large model, including:
[0028] Traverse and calculate the similarity between all language pairs;
[0029] Arrange in descending order according to the similarity between language pairs;
[0030] Preset an initial search radius and define a boundary range based on the initial search radius;
[0031] Integrate the closest language pairs within the borders into the list of auxiliary languages;
[0032] Update the search radius based on the similarity between the newly added language pair and the target language pair;
[0033] The search radius is updated repeatedly until no new language pairs are expanded, and the clustered pseudo-language families are obtained, completing the clustering of pseudo-language families based on the multi-language pre-trained large model.
[0034] On the other hand, a pseudo language family clustering device based on a multi-language pre-trained large model is provided, and the device is applied to a pseudo language family clustering method based on a multi-language pre-trained large model, and the device comprises:
[0035] Language pool module, used to establish a shared language pool;
[0036] A representation module is used to calculate the Fisher information matrix of the language pairs in the shared language pool based on the multi-language pre-trained large model to obtain the representation results of the language pairs in the shared language pool;
[0037] A similarity calculation module is used to calculate the similarity between the language pairs according to the representation results to obtain a similarity value;
[0038] The clustering module is used to sort the similarities between language pairs according to the similarity values, select auxiliary language pairs that meet the preset boundary values, and complete the pseudo-language family clustering based on the multi-language pre-trained large model.
[0039] On the other hand, a pseudo-language family clustering device based on a multi-language pre-trained large model is provided, and the pseudo-language family clustering device based on a multi-language pre-trained large model comprises: a processor; a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, any one of the pseudo-language family clustering methods based on the multi-language pre-trained large model is implemented.
[0040] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction is stored in the storage medium, and the at least one instruction is loaded and executed by a processor to implement any one of the above-mentioned pseudo-language family clustering methods based on a multi-language pre-trained large model.
[0041] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:
[0042] In view of the limitations of the prior art that require additional prior knowledge or require modification of the model architecture, the present invention provides a method for constructing a more effective language pair clustering method for multi-language collaborative training. The core goal is to use the ability of multi-language pre-training itself to characterize language pairs, more effectively select and cluster auxiliary languages and improve their generalization between different models and data sets, and ultimately improve the translation quality of low-resource language pairs under multi-language collaborative training. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0044] Figure 1 It is a flow chart of a pseudo language family clustering method based on a multi-language pre-trained large model provided by an embodiment of the present invention;
[0045] Figure 2 is a schematic diagram of a language pair (XX-en) provided in an embodiment of the present invention;
[0046] Figure 3 It is a schematic diagram of the distribution of the 40% Fisher information parameter in the model structure provided by an embodiment of the present invention;
[0047] Figure 4 It is a block diagram of a pseudo language family clustering device based on a multi-language pre-trained large model provided by an embodiment of the present invention;
[0048] Figure 5It is a structural schematic diagram of a pseudo language family clustering device based on a multi-language pre-trained large model provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0049] The technical solution of the present invention is described below in conjunction with the accompanying drawings.
[0050] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "example" in the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the word "example" is intended to present the concept in a specific way. In addition, in the embodiments of the present invention, the meaning expressed by "and / or" can be both, or it can be either of the two.
[0051] In the embodiments of the present invention, "image" and "picture" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, the meanings they intend to express are the same. "of", "corresponding, relevant" and "corresponding" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, the meanings they intend to express are the same.
[0052] In the embodiments of the present invention, sometimes a subscript such as W1 may be mistakenly written as a non-subscript such as W1. When the difference is not emphasized, the meanings to be expressed are consistent.
[0053] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0054] The embodiment of the present invention provides a pseudo language clustering method based on a multi-language pre-trained large model. The method can be implemented by a pseudo language clustering device based on a multi-language pre-trained large model. The pseudo language clustering device based on a multi-language pre-trained large model can be a terminal or a server. Figure 1 The flowchart of the pseudo language family clustering method based on the multi-language pre-trained large model is shown in the figure. The processing flow of the method may include the following steps:
[0055] S101, establish a shared language pool;
[0056] In a feasible implementation manner, in step S101, establishing a shared language pool includes:
[0057] Get the TED dataset;
[0058] Extract multiple languages from the TED dataset, translate multiple languages into English as the basic dataset, and build a shared language pool.
[0059] In a feasible implementation, for the study of language pair representation, it is first necessary to establish a shared language pool, which includes high-resource and low-resource language pairs and spans multiple language families. The present invention uses the TED dataset, and uses data from 17 languages to English (English, abbreviated as en) as the basic dataset of the present invention. These language pairs together constitute an optional shared language pool, which will be used as optional auxiliary languages for low-resource languages in subsequent selections. These languages span seven different language families: Balto-Slavic, Austronesian, Indo-Iranian, Turkic, Japonic, Korean and Germanic, such as Figure 2 shown.
[0060] S102 calculates the Fisher information matrix of the language pairs in the shared language pool based on the multi-language pre-trained large model to obtain representation results of the language pairs in the shared language pool;
[0061] In a feasible implementation, in step S102, based on the multi-language pre-trained large model, the Fisher information matrix of the language pairs in the shared language pool is calculated to obtain the representation results of the language pairs in the shared language pool, including:
[0062] Obtain the parallel corpus corresponding to the language pairs in the shared language pool, and equally divide the data in the parallel corpus into j small batch data sets;
[0063] Input the small batch data sets into the multi-language pre-trained large model in sequence, and output the Fisher information matrix of each small batch data set;
[0064] After one input round, the average Fisher information matrix of each mini-batch data set is calculated, and the average Fisher information matrix is used as an estimated value to obtain the Fisher information weight of each mini-batch data set;
[0065] According to the Fisher information weights, the distribution of corresponding language pairs in the shared language pool is characterized.
[0066] The present invention chooses to use FIM to calculate the parameters in the pre-trained model, and calculates the Fisher information weight of each parameter. The weight size indicates its importance, and the parameter with a large weight represents its sensitivity in a specific translation direction. Parameter calculation is used to evaluate and select those parameters that are sensitive to a specific translation direction, that is, parameters that require a large number of weight updates in the fine-tuning stage. It is an important indicator for evaluating the importance and potential value of specific parameters. In essence, it quantifies the variance of the first-order derivative of the logarithm of the likelihood function. By measuring the size of this metric, it can be inferred that it is necessary to fine-tune specific parameters in subsequent tasks. Its original calculation formula is as follows:
[0067]
[0068] Among them, X and Y represent the input and output of the model respectively; θ represents the parameters of the model; P represents the probability distribution of output Y when the input is X and the parameter is θ; T represents the matrix rank conversion; E represents the expectation. For the i-th parameter, using a diagonal matrix helps to estimate the Fisher information matrix:
[0069]
[0070] Although using diagonal matrices helps estimate FIM, obtaining accurate probability estimates is still a difficult task. In view of this, we adopt the following formula to approximate FIM:
[0071]
[0072] Here, D represents the entire data set, |D| represents the amount of data, and the entire data set is divided into j small batches of equal data volume and sequentially input into the model for training. The present invention inputs the parallel corpus corresponding to the language into the model and calculates the FIM of each small batch only in one round (epoch). During the model training process, we use formula (3) to accumulate FIM for each small batch, but do not perform back propagation. After an epoch is completed, we calculate the average FIM obtained for each small batch as the final estimate.
[0073] Furthermore, the present invention analyzes the distribution of high Fisher information parameters in the pre-trained model structure. In the study, the distribution of the high 40% parameters was observed as follows Figure 3 The pre-trained model is initially divided into five parts: encoder attention layer (E a ), encoder fully connected layer (encoder fully connected layer, referred to as E f ), decoder self-attention (Decoder self-attention, referred to as D a), decoder cross attention layer (decoder cross attention layer, referred to as D c ) and the decoder fully connected layer (decoder fully connected layer, referred to as D f ). More than 60% of the parameters are distributed in feed-forward networks (FFN for short). Therefore, the present invention selects the FFN layer to calculate the FIM and measure the similarity.
[0074] S103, calculating the similarity between the language pairs according to the representation results to obtain a similarity value;
[0075] In a feasible implementation, in step S103, the similarity between the language pairs is calculated according to the characterization result to obtain a similarity value, including:
[0076] Obtain characterization results;
[0077] The mean square error method is used to calculate the distance between the language pairs in the shared language pool and the target language pairs. The closer the distance is, the higher the similarity is.
[0078] In a feasible implementation, the mean square error (MSE) is calculated as follows: where t and a are the target language pair and the auxiliary language pair, respectively, and S (t,a) is the distance between t and a. The closer the distance, the higher the similarity. F is FIM. |F t | indicates the parameter quantity.
[0079]
[0080] In a feasible implementation, in step S103, the similarity between the language pairs is calculated according to the characterization result to obtain a similarity value, including:
[0081] The Fisher information matrix is used to calculate the KL divergence between the language pairs in the shared language pool and the target language pairs, and the distance between the language pairs in the shared language pool and the target language pairs is obtained. The closer the distance is, the higher the similarity is.
[0082] In one feasible implementation, KL divergence (Kullback-Leibler divergence, KL for short): FIM is directly used to calculate the KL divergence between the language pairs in the shared language pool and the target language pair, thereby more accurately representing the distance between the language pairs. The calculation formula is as follows, where the symbols are consistent with those described in MSE, and |·| represents the calculated absolute value.
[0083]
[0084] In a feasible implementation, in step S103, the similarity between the language pairs is calculated according to the characterization result to obtain a similarity value, including:
[0085] The first K parameters are selected and assigned a value of 1, while the remaining parameters are assigned a value of 0 to create a Fisher information mask;
[0086] According to the number of parameters activated simultaneously and the number of parameters activated in the target direction, the distance between the target language pair and the auxiliary language pair is calculated. The closer the distance is, the higher the similarity is.
[0087] In one feasible implementation, Overlap Similarity (Overlap for short): Different from the first two calculation methods, Overlap Similarity does not directly use FIM, but creates a Fisher information mask (M) by selecting the first K parameters and assigning them a value of 1, while the remaining parameters are assigned a value of 0. The calculation method is as follows, where Overlapping and Activate represent the number of parameters activated at the same time and the amount of parameters activated in the target direction.
[0088]
[0089] In the Overlap method, the present invention uses 40% as the default parameter of K by default, because it achieves the best translation effect.
[0090] S104, sorting the similarities between the language pairs according to the similarity values, selecting auxiliary language pairs that meet the boundary values according to the preset boundary values, and completing the pseudo language family clustering based on the multi-language pre-trained large model.
[0091] In a feasible implementation, in step S104, the similarities between the language pairs are sorted according to the similarity values, and the auxiliary language pairs that meet the boundary values are selected according to the preset boundary values, so as to complete the pseudo language family clustering based on the multi-language pre-trained large model, including:
[0092] Traverse and calculate the similarity between all language pairs;
[0093] Arrange in descending order according to the similarity between language pairs;
[0094] Preset an initial search radius and define a boundary range based on the initial search radius;
[0095] Integrate the closest language pairs within the borders into the list of auxiliary languages;
[0096] Update the search radius based on the similarity between the newly added language pair and the target language pair;
[0097] The search radius is updated repeatedly until no new language pairs are expanded, and the clustered pseudo-language families are obtained, completing the clustering of pseudo-language families based on the multi-language pre-trained large model.
[0098] In a feasible implementation, the present invention designs a simple algorithm to select auxiliary languages. First, we use the above-mentioned similarity measurement method to calculate the similarity of other language pairs with the target language pair, sort them according to the similarity between the language pairs, and then set an initial search radius. Within this pre-defined boundary, the closest language pairs are integrated into the auxiliary language list. Then, according to the similarity measurement between the most recently added language pair and the target language pair, the radius is adjusted. Repeat this process until no new language pairs are expanded. The present invention refers to such a clustered language family as a pseudo-language family. The algorithm for selecting auxiliary language pairs is as follows:
[0099] 1. Arrange the similarities in descending order (MSE and KL in ascending order, Overlap in descending order) and create a list L;
[0100] 2. Initialize Gap to |L[1]-L[0]| and add the first language to the auxiliary list;
[0101] 3. Iterate from i=2 to the end of L. In each loop we choose the language as follows:
[0102] a) If |L[i-1]-L[i]|<Gap, add the i-th language to the auxiliary list and update Gap=|L[i-1]-L[i]|;
[0103] b) If |L[i-1]-L[i]|<Gap, add the i-th language to the auxiliary list and update
[0104] c) If |L[i-1]-L[i]|>Gap, terminate the loop;
[0105] 4. The language pairs in the auxiliary list and the target pair form a pseudo-language family of the target language pair.
[0106] In a feasible implementation, in order to evaluate the method of the present invention, the following baseline is designed based on the m2m100_418M model:
[0107] 1. Pre-trained: Directly use the pre-trained model to translate the target language pair without any fine-tuning;
[0108] 2. FT (fine-tune): Fine-tune the base model using bilingual data of the target language pair;
[0109] 3. LF (langauge family): use Figure 2 Fine-tune the traditional language family divided in , use temperature sampling and set the temperature to 1.5;
[0110] 4.LF+FT: Based on the LF method, further fine-tuning is performed using the data of the target language pair.
[0111] For the training phase, the batch size was set to 4096; for the proposed method, the training data was upsampled to make them the same to ensure the same proportion of each language in each mini-batch, except for Hindi (hi), where the same sampling method as LF was used when the Overlap method was used. The Adam optimizer was used for optimization, with β1 = 0.98, β2 = 0.98 and ∈ = 10e -6 The learning rate is lr=3e -5 In the present invention, the BLEU (bilingual evaluation under study) value is used to evaluate the translation quality.
[0112] Table 1 Pseudo-language families under different method selections
[0113]
[0114] Table 2 BLEU scores for each low-resource language pair under different methods
[0115]
[0116] Table 1 shows the pseudo language families clustered by the method of the present invention for low-resource language pairs in a shared language pool, and Table 2 shows the test results of Persian (fa for short), Hindi (hi for short), Bengali (bn for short), Indonesian (id for short), and Malaysian (ms for short) to English on the TED dataset.
[0117] Models (1) to (4) represent the baselines in current commonly used fine-tuning, and models (5) to (7) represent our implementation of this method using different computational methods.
[0118] The present invention uses three metrics, MSE, KL and Overlap, to calculate the distance or similarity between language pairs, so as to cluster pseudo-language families and verify it on low-resource language pairs. The evaluation results show that all three calculation methods further improve the BLEU score and the final improvement effect is equivalent. Model (7) achieves the best improvement effect.
[0119] Figure 4 1 is a block diagram of a pseudo language clustering device based on a multi-language pre-trained large model according to an exemplary embodiment. The device is used in a pseudo language clustering method based on a multi-language pre-trained large model. Figure 4 The device includes a language pool module 410, a characterization module 420, a similarity calculation module 430, and a clustering module 440. For ease of explanation, Figure 4 Only the main components of the full process visualization device 400 are shown:
[0120] A language pool module 410, for establishing a shared language pool;
[0121] A representation module 420 is used to calculate the Fisher information matrix of the language pairs in the shared language pool based on the multi-language pre-trained large model to obtain the representation results of the language pairs in the shared language pool;
[0122] A similarity calculation module 430 is used to calculate the similarity between the language pairs according to the representation results to obtain a similarity value;
[0123] The clustering module 440 is used to sort the similarities between language pairs according to the similarity values, select auxiliary language pairs that meet the boundary values according to the preset boundary values, and complete the pseudo language family clustering based on the multi-language pre-trained large model.
[0124] Optionally, a language pool module 410 is used to obtain a TED dataset;
[0125] Extract multiple languages from the TED dataset, translate multiple languages into English as the basic dataset, and build a shared language pool.
[0126] Optionally, the representation module 420 is used to obtain a parallel corpus corresponding to the language pairs in the shared language pool, and equally divide the data in the parallel corpus into j small batch data sets;
[0127] Input the small batch data sets into the multi-language pre-trained large model in sequence, and output the Fisher information matrix of each small batch data set;
[0128] After one input round, the average Fisher information matrix of each mini-batch data set is calculated, and the average Fisher information matrix is used as an estimated value to obtain the Fisher information weight of each mini-batch data set;
[0129] According to the Fisher information weights, the distribution of corresponding language pairs in the shared language pool is characterized.
[0130] Optionally, a similarity calculation module 430 is used to obtain a characterization result;
[0131] The mean square error method is used to calculate the distance between the language pairs in the shared language pool and the target language pairs. The closer the distance is, the higher the similarity is.
[0132] Optionally, the similarity calculation module 430 is used to calculate the KL divergence between the language pairs in the shared language pool and the target language pair using the Fisher information matrix to obtain the distance between the language pairs in the shared language pool and the target language pair. The closer the distance is, the higher the similarity is.
[0133] Optionally, a similarity calculation module 430 is used to select the first K parameters and assign them a value of 1, and the remaining parameters are assigned a value of 0 to create a Fisher information mask;
[0134] According to the number of simultaneously activated parameters and the number of parameters activated in the target direction, the distance between the language pairs in the shared language pool and the target language pair is calculated. The closer the distance is, the higher the similarity is.
[0135] Optionally, a clustering module 440 is used to traverse and calculate similarities between all language pairs;
[0136] Arrange in descending order according to the similarity between language pairs;
[0137] Preset an initial search radius and define a boundary range based on the initial search radius;
[0138] Integrate the closest language pairs within the borders into the list of auxiliary languages;
[0139] Update the search radius based on the similarity between the newly added language pair and the target language pair;
[0140] The search radius is updated repeatedly until no new language pairs are expanded, and the clustered pseudo-language families are obtained, completing the clustering of pseudo-language families based on the multi-language pre-trained large model.
[0141] In view of the limitations of the prior art that require additional prior knowledge or require modification of the model architecture, the present invention provides a method for constructing a more effective language pair clustering method for multi-language collaborative training. The core goal is to use the ability of multi-language pre-training itself to characterize language pairs, more effectively select and cluster auxiliary languages and improve their generalization between different models and data sets, and ultimately improve the translation quality of low-resource language pairs under multi-language collaborative training.
[0142] Figure 5is a schematic diagram of the structure of a pseudo language clustering device based on a multi-language pre-trained large model provided by an embodiment of the present invention, such as Figure 5 As shown, the pseudo language clustering device based on the multi-language pre-trained large model may include the above Figure 4 The pseudo language clustering device based on multi-language pre-trained large model is shown. Optionally, the pseudo language clustering device based on multi-language pre-trained large model 510 may include a processor 2001.
[0143] Optionally, the pseudo language family clustering device 510 based on the multi-language pre-trained large model may further include a memory 2002 and a transceiver 2003 .
[0144] The processor 2001, the memory 2002 and the transceiver 2003 may be connected via a communication bus.
[0145] Combine the following Figure 5 The components of the pseudo language clustering device 510 based on the multi-language pre-trained large model are specifically introduced:
[0146] The processor 2001 is the control center of the pseudo language clustering device 510 based on the multi-language pre-trained large model, and can be a processor or a general term for multiple processing elements. For example, the processor 2001 is one or more central processing units (CPUs), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention, such as one or more microprocessors (digital signal processors, DSPs), or one or more field programmable gate arrays (FPGAs).
[0147] Optionally, the processor 2001 can perform various functions of the pseudo language family clustering device 510 based on the multi-language pre-trained large model by running or executing a software program stored in the memory 2002 and calling data stored in the memory 2002.
[0148] In a specific implementation, as an embodiment, the processor 2001 may include one or more CPUs, such as Figure 4 CPU0 and CPU1 are shown in FIG.
[0149] In a specific implementation, as an embodiment, the pseudo language family clustering device 510 based on the multi-language pre-trained large model may also include multiple processors, such as Figure 42001 and processor 2004 are shown in FIG. Each of these processors may be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). A processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0150] The memory 2002 is used to store the software program for executing the solution of the present invention, and the execution is controlled by the processor 2001. The specific implementation method can refer to the above method embodiment, which will not be repeated here.
[0151] Optionally, the memory 2002 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 2002 may be integrated with the processor 2001, or may exist independently, and may be connected to the processor 2001 through the interface circuit ( Figure 5 2001) is coupled to the processor 2001, which is not specifically limited in the embodiment of the present invention.
[0152] The transceiver 2003 is used to communicate with a network device or a terminal device.
[0153] Optionally, the transceiver 2003 may include a receiver and a transmitter ( Figure 5 The receiver is used to implement a receiving function, and the transmitter is used to implement a sending function.
[0154] Optionally, the transceiver 2003 may be integrated with the processor 2001, or may exist independently, and communicate with the processor 2001 through the interface circuit ( Figure 5 2001) is coupled to the processor 2001, which is not specifically limited in the embodiment of the present invention.
[0155] It should be noted that Figure 5 The structure of the pseudo-language family clustering device 510 based on the multi-language pre-trained large model shown in the figure does not constitute a limitation on the router. The actual knowledge structure recognition device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0156] In addition, the technical effects of the pseudo-language family clustering device 410 based on a multi-language pre-trained large model can refer to the technical effects of the pseudo-language family clustering method based on a multi-language pre-trained large model described in the above method embodiment, and will not be repeated here.
[0157] It should be understood that the processor 2001 in the embodiment of the present invention may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0158] It should also be understood that the memory in the embodiments of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).
[0159] The above embodiments can be implemented in whole or in part by software, hardware (such as circuits), firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.
[0160] It should be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding.
[0161] In the present invention, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0162] It should be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0163] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0164] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described equipment, devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0165] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0166] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0167] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0168] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0169] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A pseudo language family clustering method based on a multi-language pre-trained large model, characterized in that: The method comprises: S1. Establish a shared language pool; S2. Based on the multi-language pre-trained large model, the Fisher information matrix of the language pairs in the shared language pool is calculated to obtain the representation results of the language pairs in the shared language pool; In step S2, based on the multi-language pre-trained large model, the Fisher information matrix of the language pairs in the shared language pool is calculated to obtain the representation results of the language pairs in the shared language pool, including: Obtain a parallel corpus corresponding to the language pairs in the shared language pool, and equally divide the data in the parallel corpus into j small batch data sets; Inputting the small batch data sets into the multilingual pre-trained large model in sequence, and outputting the Fisher information matrix of each small batch data set; After one input round, the average Fisher information matrix of each mini-batch data set is calculated, and the average Fisher information matrix is used as an estimated value to obtain the Fisher information weight of each mini-batch data set; Characterizing the distribution of corresponding language pairs in the shared language pool according to the Fisher information weights; S3, calculating the similarity between the language pairs according to the representation result to obtain a similarity value; In step S3, the similarity between the language pairs is calculated according to the characterization result to obtain a similarity value, including: Obtain representation results; select target language pair; The mean square error method is used to calculate the distance between the language pairs in the shared language pool and the target language pair. The closer the distance is, the higher the similarity is. Or select a target language pair; The Fisher information matrix is used to calculate the KL divergence between the language pairs in the shared language pool and the target language pair, and the distance between the language pairs in the shared language pool is obtained. The closer the distance is, the higher the similarity is. Or select a target language pair; The first K parameters are selected and assigned a value of 1, while the remaining parameters are assigned a value of 0 to create a Fisher information mask; According to the number of parameters activated at the same time and the number of parameters activated in the target direction, the distance between the language pair in the shared language pool and the target language pair is calculated. The closer the distance is, the higher the similarity is. S4, sorting the similarities between the language pairs according to the similarity values, selecting auxiliary language pairs that meet the boundary values according to a preset boundary value, and completing pseudo language family clustering based on a multi-language pre-trained large model; In step S4, the similarities between the language pairs are sorted according to the similarity values, and the auxiliary language pairs that meet the preset boundary values are selected according to the preset boundary values, so as to complete the pseudo language family clustering based on the multi-language pre-trained large model, including: Traverse and calculate the similarity between all language pairs; Arrange in descending order according to the similarity between language pairs; Presetting an initial search radius, and defining a boundary range according to the initial search radius; The closest language pairs within the said boundaries are integrated into the list of auxiliary languages; Update the search radius based on the similarity between the newly added language pair and the target language pair; The search radius is updated repeatedly until no new language pairs are expanded, and the clustered pseudo-language families are obtained, completing the clustering of pseudo-language families based on the multi-language pre-trained large model.
2. The method according to claim 1, characterized in that In step S1, establishing a shared language pool includes: Get the TED dataset; A plurality of languages in the TED data set are extracted, and language pairs of the plurality of languages translated into English are used as basic data sets to establish a shared language pool.
3. A pseudo language clustering device based on a multi-language pre-trained large model, characterized in that: The device comprises: Language pool module, used to establish a shared language pool; A representation module, used to calculate the Fisher information matrix of the language pairs in the shared language pool based on the multi-language pre-trained large model, and obtain the representation results of the language pairs in the shared language pool; The representation module is used to obtain the parallel corpus corresponding to the language pairs in the shared language pool and equally divide the data in the parallel corpus into j small batch data sets; Input the small batch data sets into the multi-language pre-trained large model in sequence, and output the Fisher information matrix of each small batch data set; After one input round, the average Fisher information matrix of each mini-batch data set is calculated, and the average Fisher information matrix is used as an estimated value to obtain the Fisher information weight of each mini-batch data set; According to Fisher information weights, the distribution of corresponding language pairs in the shared language pool is characterized; A similarity calculation module, used to calculate the similarity between the language pairs according to the representation result to obtain a similarity value; A similarity calculation module is used to obtain representation results; select a target language pair; The mean square error method is used to calculate the distance between the language pairs in the shared language pool and the target language pair. The closer the distance is, the higher the similarity is. A similarity calculation module is used to select a target language pair; use the Fisher information matrix to calculate the KL divergence between the language pairs in the shared language pool and the target language pair, and obtain the distance between the language pairs in the shared language pool and the target language pair. The closer the distance is, the higher the similarity is; A similarity calculation module is used to select a target language pair; the first K parameters are selected and assigned a value of 1, while the remaining parameters are assigned a value of 0 to create a Fisher information mask; According to the number of parameters activated at the same time and the number of parameters activated in the target direction, the distance between the language pair in the shared language pool and the target language pair is calculated. The closer the distance is, the higher the similarity is. A clustering module, used to sort the similarities between the language pairs according to the similarity values, select auxiliary language pairs that meet the boundary values according to a preset boundary value, and complete pseudo language family clustering based on a multi-language pre-trained large model; Clustering module, used to traverse and calculate the similarity between all language pairs; Arrange in descending order according to the similarity between language pairs; Preset an initial search radius and define a boundary range based on the initial search radius; Integrate the closest language pairs within the borders into the list of auxiliary languages; Update the search radius based on the similarity between the newly added language pair and the target language pair; The search radius is updated repeatedly until no new language pairs are expanded, and the clustered pseudo-language families are obtained, completing the clustering of pseudo-language families based on the multi-language pre-trained large model.
4. A pseudo-language clustering device based on a multi-language pre-trained large model, characterized in that: The pseudo language family clustering device based on the multi-language pre-trained large model includes: processor; A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the method according to any one of claims 1 to 2 is implemented.
5. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program codes, which can be called by a processor to execute the method according to any one of claims 1 to 2.
