Method of operating a cross-lingual machine reading comprehension task and natural language processing system
By using attention mechanisms and gradient decoupling knowledge sharing techniques in cross-language machine reading comprehension tasks, the problem of insufficient cross-language transferability is solved, and more efficient cross-language understanding capabilities are achieved.
Patent Information
- Application Number
- CN202310620516.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-29
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2043-05-29
AI Technical Summary
In cross-language machine reading comprehension tasks, existing technologies struggle to effectively utilize translation data and address language and cultural differences between different languages, resulting in insufficient cross-language transferability of models in low-resource languages.
An attention mechanism is used to transfer answer fragments from the source language to the answer output space of the target language. The cross-attention blocks are improved through gradient decoupling and knowledge sharing techniques. Semantic alignment is performed by combining multi-granularity learning and teacher guidance to improve the cross-language transferability of the model.
By sharing, teaching, and coordinating, the knowledge-sharing technique of gradient decoupling is used to transfer language representations. Output calibration and semantic alignment are used to significantly improve the model's cross-linguistic transfer capability in low-resource languages, resulting in higher performance.
Smart Images

Figure CN116894438B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of deep learning, and more particularly to an operational method and natural language processing system for cross-language machine reading comprehension tasks. Background Technology
[0002] In recent years, with the development of research related to training language models, significant progress has been made in the research of downstream tasks of Natural Language Processing (NLP), including machine reading comprehension. Machine reading comprehension (MRC) is a type of NLP task, which refers to the task of extracting the answer to the question from the text content given a text and a question.
[0003] Pre-trained language models often require a large amount of training data to generalize to downstream tasks. However, in cross-lingual settings, training data is typically only available for the high-resource language, while training data for the low-resource target language is lacking. In cross-lingual language understanding, machine translation is frequently used to enhance the model's cross-lingual transferability, for example, translating training data from the source language to the target language, or from the target language to the source language, to aid reasoning. However, in cross-lingual machine reading comprehension, due to the varying positions of answer segments in different languages, it is difficult to use machine translation to provide deep assistance in enhancing cross-lingual transferability.
[0004] Therefore, a solution is needed to improve cross-language transferability in cross-language machine reading comprehension tasks. Summary of the Invention
[0005] One technical problem this disclosure aims to solve is to provide an operational method and natural language processing system for cross-language machine reading comprehension tasks. Embodiments of this invention utilize an attention mechanism to cleverly transfer answer fragments from the source language to the answer output space of the target language; and improve cross-attention blocks through gradient decoupling knowledge sharing technology. Furthermore, cross-language transferability is enhanced by allowing the model to learn semantic alignment from multiple granularities and calibrating the model output under the guidance of an instructor.
[0006] According to a first aspect of this disclosure, a method for performing a cross-language machine reading comprehension task is provided, comprising: acquiring target language training data corresponding to source language training data; constructing a training parallel language pair including source language training data and target language training data; feeding the training parallel language pair into a bi-column model constructed based on a pre-trained language model, and training the cross-language machine reading comprehension task using a backpropagation algorithm, wherein the bi-column model includes a source column using source language training data as input and a target column using target language training data as input, wherein the bi-column model calibrates the answer segments output by the target column by finding answer segments semantically similar to the source language output answers of the source column from the context information given by the target column.
[0007] Optionally, the bi-column model calibrates the answer fragments output by the target column by finding answer fragments semantically similar to the source language output answers from the context information given by the target column. This includes: using the hidden state of the target language training data obtained from the target column as a query; using the hidden state of the source language training data obtained from the source column as a key; and using the source language output answers from the source column as values. Based on a multi-head attention mechanism, the output distribution of the transfer is obtained using the above query, key, and value as the answer fragments semantically similar to the answer.
[0008] Optionally, using the hidden representation of the target language training data obtained from the target column as a query includes: subtracting the average representation of the target language from the hidden state of the last layer of the target column and projecting the result back to a standard normal distribution to obtain the regularized hidden state of the target column as the query, and using the hidden representation of the source language training data obtained from the source column as a key includes: subtracting the average representation of the source language from the hidden state of the last layer of the source column and projecting the result back to a standard normal distribution to obtain the regularized hidden state of the source column as the key.
[0009] Optionally, training the parallel language pairs by feeding them into a bi-column model constructed based on a pre-trained language model and using the backpropagation algorithm for training a cross-language machine reading comprehension task includes: constructing a first loss function based on the identified semantically similar answer segments to narrow the distance between semantically identical but linguistically different tags; and training the cross-language machine reading comprehension task using the backpropagation algorithm based on the first loss function.
[0010] Optionally, the dual-column model calibrates the answer fragments output by the target column by finding answer fragments semantically similar to the source language output answers from the context information given by the target column, including using a weighted average of the semantically similar answer fragments and the answer fragments output by the target column as the output of the dual-column model.
[0011] Optionally, in the intermediate layer of the dual-column model, feature fusion is performed between the hidden states of the target column's intermediate layer and the hidden states of the source column's intermediate layer based on a cross-attention mechanism, and the fused features are then incorporated into the source column. Optionally, the feature fusion is performed only in one intermediate layer of the dual-column model; and gradients associated with feature fusion are prevented from backpropagating to the source column.
[0012] Optionally, training the parallel language pairs by feeding them into a bi-column model constructed based on a pre-trained language model and using a backpropagation algorithm for training a cross-language machine reading comprehension task includes: constructing a second loss function that aligns source tags in the source language training data with target tags in the target language training data at the tag level; and training the cross-language machine reading comprehension task using a backpropagation algorithm based on the second loss function.
[0013] Optionally, training the parallel language pairs by feeding them into a bi-column model constructed based on a pre-trained language model and using the backpropagation algorithm for training a cross-language machine reading comprehension task includes: constructing a third loss function based on contrastive learning that aligns the source sentence representation in the source language training data with the target sentence representation in the target language training data at the sentence level; and training the cross-language machine reading comprehension task using the backpropagation algorithm based on the third loss.
[0014] Optionally, feeding the training parallel language pairs into a bi-column model constructed based on a pre-trained language model and using the backpropagation algorithm to train a cross-language machine reading comprehension task includes: constructing a fourth loss function to characterize the loss of the cross-language machine reading comprehension task; and training the cross-language machine reading comprehension task based on the fourth loss using the backpropagation algorithm.
[0015] According to a second aspect of this disclosure, a natural language processing system is provided, comprising: a storage node for storing a trained bi-column model acquired as described in the first aspect; and an interaction node for loading the trained bi-column model, acquiring input data of a target language and source language translation data based on the input data as inference parallel language pairs as model input, and using the acquired model output as an inference result for a cross-language machine reading comprehension task.
[0016] According to a third aspect of this disclosure, a computing device is provided, comprising: a processor; and a memory having executable code stored thereon, which, when executed by the processor, causes the processor to perform the method described in the first aspect above.
[0017] According to a fourth aspect of this disclosure, a computer program product is provided, including executable code that, when executed by a processor of an electronic device, causes the processor to perform the method described in the first aspect above.
[0018] According to a fifth aspect of this disclosure, a non-transitory machine-readable storage medium is provided, on which executable code is stored, which, when executed by a processor of an electronic device, causes the processor to perform the method described in the first aspect above.
[0019] Therefore, the proposed method for cross-lingual machine reading comprehension tasks addresses the challenges of effectively utilizing translation data and linguistic and cultural differences in cross-lingual MRC. Through sharing, teaching, and coordination, this invention utilizes gradient-decoupled knowledge-sharing techniques to transfer language representations and further enhances the model's cross-lingual transfer capabilities using output calibration and semantic alignment. Experimental results on three datasets demonstrate that our method achieves state-of-the-art performance compared to strong baselines. Attached Figure Description
[0020] The above and other objects, features and advantages of this disclosure will become more apparent from the more detailed description of exemplary embodiments thereof taken in conjunction with the accompanying drawings, wherein like reference numerals generally denote like parts.
[0021] Figure 1 Examples of machine translation-assisted cross-language natural language reasoning and machine reading comprehension tasks are shown.
[0022] Figure 2 A schematic flowchart illustrating an operational method for a cross-language machine reading comprehension task according to an embodiment of the present invention is shown.
[0023] Figure 3 An example of the structure of the double-column model of the present invention is shown.
[0024] Figure 4 The sentence representation is shown with and without regularization of the t-SNE distribution.
[0025] Figure 5 An example of a two-column model with a regularization layer added is shown.
[0026] Figure 6 An example of the construction and operation of a double-column model according to an embodiment of the present invention is shown.
[0027] Figure 7 A heatmap of attention distribution with and without marker-level alignment is shown.
[0028] Figure 8 A schematic diagram of the composition of a natural language processing system according to an embodiment of the present invention is shown.
[0029] Figure 9 A schematic diagram of a computing device is shown, which can be used to implement the above-described cross-language machine reading comprehension task according to an embodiment of the present invention. Detailed Implementation
[0030] Hereinafter, preferred embodiments of the present disclosure will be described in more detail with reference to the accompanying drawings. Although the preferred embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.
[0031] In recent years, with the development of research related to training language models, significant progress has also been made in research on natural language processing (NLP) downstream tasks including machine reading comprehension. Pre-trained language models often require a large amount of training data for downstream task generalization, while in a cross-language setting, usually only training data for high-resource languages is available, and there is a lack of training data for low-resource target languages. In cross-language language understanding, machine translation is often used to enhance the cross-language transferability of the model, for example, translating training data from a source language to a target language, or from a target language to a source language to aid inference. However, in cross-language machine reading comprehension, due to changes in the position of answer fragments in different languages, it is difficult to provide in-depth assistance through machine translation to enhance cross-language transferability.
[0032] Figure 1 An example of execution of a cross-language natural language inference task and a machine reading comprehension task assisted by machine translation is shown. Figure 1 The upper part shows an example of a natural language inference (NLI) task, which is used to determine whether there is a contradiction between two given sentences. Here, English can be regarded as a high-resource language, and Chinese can be regarded as a (relatively) low-resource language. In the English description, the two sentences "I do not know why." and "I am pretty sure why." give contradictory descriptions of each other, so in the inference of this task, the model should give a judgment result of "contradiction" (for example, more appropriately, give a judgment result of "Contradiction"). In the Chinese description, the Chinese translations of the two sentences "我不知道为什么。" and "我很确定是为什么。" can be directly used to determine that they give contradictory descriptions of each other, so in the inference of this task, the model should give a judgment result of "contradiction". That is, in the task of Figure 1 , machine translation is used to enhance the cross-language transferability of the model.
[0033] Figure 1 The lower part shows an example of a cross-language machine reading comprehension task. The machine reading comprehension task refers to a task in which a piece of text content and a question are given, and the answer to the question needs to be extracted from the text content. In Figure 1In the example, the given English text is "Combs rose from poverty in his native Clay County…", and the question is "Where is Combs from?". The answer is obviously "Clay County". However, since machine reading comprehension tasks require the answer to be annotated with the answer span (i.e., the start and end positions of the corresponding content), in the example above, the correct output of the model should start with 38 and end with 48. That is, the answer span starts at the 38th character after the beginning of the text (i.e., the position of "C" in "Clay") and ends at the 48th character (i.e., the position of "y" in "County"). However, when using machine translation to obtain the Chinese text and question, the answer is obviously "Clay County", and the correct input of the model should start with 5 and end with 7, that is, the answer span is "Combs was born in…". Clay County The underlined part in “From a poor background [...]” indicates the protected content starting from the 5th character after the beginning of the text and ending at the 7th character.
[0034] As shown above, English and Chinese have different sentence structures, word orders, and morphological features, making it impossible to directly use the model output for English text to calibrate the model output for Chinese text. One of the most significant challenges in cross-lingual MRC is the lack of annotated datasets for low-resource languages. Most current MRC datasets are in English. However, due to linguistic and cultural differences, different languages exhibit different sentence structures, word orders, and morphological features. For example, languages such as Japanese, Chinese, Hindi, and Arabic have different writing systems and more complex grammatical systems than English, making it difficult for MRC models to directly utilize machine translation and presenting challenges in understanding text.
[0035] To address this issue, this invention proposes a novel operational method for cross-language MRC. Specifically, this invention utilizes an attention mechanism to cleverly transfer answer fragments from the source language to the answer output space of the target language. Furthermore, a gradient decoupling knowledge-sharing technique is proposed to improve cross-attention blocks. Further, cross-language transferability is enhanced by allowing the model to learn semantic alignment from multiple granularities and calibrating the model output under the guidance of an instructor.
[0036] Figure 2 A schematic flowchart illustrating an operational method for a cross-language machine reading comprehension task according to an embodiment of the present invention is shown. Figure 2 The operation method shown can first be viewed as a training method for cross-language machine reading comprehension tasks.
[0037] In step S210, target language training data corresponding to the source language training data is obtained. Here, the source language training data can be translated into target language training data via an external translation model. Here, "external" translation model refers to a model used for translation that is not a bi-column model used to perform cross-language machine reading comprehension tasks.
[0038] In step S220, a parallel language pair for training is constructed, comprising source language training data and target language training data. Here, it is assumed that only source language training data is available, and the target language training data is obtained through translation using a translation model. The source language training data and the translated target language training data can be used as a parallel language pair for training, serving as input and for subsequent model training.
[0039] Therefore, in step S230, the training parallel language pairs are fed into a bi-column model constructed based on a pre-trained language model, and the backpropagation algorithm is used to train the cross-language machine reading comprehension task. Here, the model used for cross-language machine reading comprehension tasks in this invention is constructed based on a pre-trained language model. Since it is necessary to process parallel language pairs from both the source and target languages simultaneously, the model has a bi-column structure, and specifically may include a source column using source language training data as input and a target column using target language training data as input. In one embodiment, the source column and target column may have similar structures, for example, each may include... L A transformer layer.
[0040] To achieve accurate output of answer fragments in the target language, the dual-column model of this invention can calibrate the output answer by finding answer fragments semantically similar to the source language output answer from the target language context. Specifically, the dual-column model can calibrate the answer fragments output by the target column by finding answer fragments semantically similar to the source language output answer of the source column from the context information given by the target column.
[0041] For ease of understanding, Figure 3 An example structure of the double-column model of the present invention is shown. For example... Figure 3 As shown, the two-column model includes a source column on the left and a target column on the right. Each of the source and target columns includes... L There are several transformer layers. The transformer layer has a relatively fixed structure (see, for example, see...). Figure 6The left side of the image is used for feature extraction, and an attention mechanism is employed. Attention is an algorithm used in deep learning that allows the model to focus on the parts of the input data relevant to the current task, while ignoring parts irrelevant to the task. This mechanism can improve the performance and efficiency of the model, especially when processing long sequences of data. In deep learning, attention mechanisms are typically implemented through a special layer called an "attention layer." This layer calculates the importance of each input and uses these importance levels as weights to weight the inputs, thus allowing the model to focus more on the important parts. It can be considered that each transformer layer includes an attention layer.
[0042] Additionally, it can be noted that, in addition to the source column on the left and the target column on the right, the dual-column model of the present invention also includes an additional attention teacher module for guiding the hidden representation of the target column from the last hidden layer representation of the source column and the output of the source column. To this end, in one embodiment, the dual-column model calibrates the answer fragments output by the target column by finding answer fragments semantically similar to the source language output answer of the source column from the context information given by the target column. This includes: using the hidden state of the target language training data obtained by the target column as a query (i.e., Q in the attention mechanism); using the hidden state of the source language training data obtained by the source column as a key (i.e., K in the attention mechanism); and using the source language output answer of the source column as a value (i.e., V in the attention mechanism), based on a multi-head attention mechanism, using the above query, key, and value, to obtain the output distribution of the transfer (e.g., the output distribution of the transfer in the following application example). The answer fragments that are semantically similar to the answer can be used as the output of the dual-column model. In one embodiment, the weighted average of the semantically similar answer fragments and the answer fragments output by the target column can be used as the output of the dual-column model. For example, the output distribution of the transfer function output by the attention teacher module can be used in the application example. With the target column output distribution The average value is used as the output of the dual-column model.
[0043] In one embodiment, the attention teacher module can be trained by constructing a first loss function. Then, training the parallel language pair into a bi-column model constructed based on a pre-trained language model and performing a cross-language machine reading comprehension task using backpropagation may include: constructing a first loss based on semantically similar answer segments identified (e.g., corresponding to the teacher-guided loss in the application example). The first loss is used to narrow the distance between semantically similar but linguistically different tags; and the backpropagation algorithm is used to train the cross-language machine reading comprehension task based on the first loss.
[0044] Because a language may contain a large number of phenomena such as function words, the average representation of the language is prominent. In other words, sentence representations from different languages tend to cluster together. To further improve the model's task inference accuracy, the hidden state of the last layer can be regularized before being used as K and Q in attention guidance. Therefore, in one embodiment, the hidden state used to obtain the output distribution for transfer can be regularized to remove the influence of the average language representation. Figure 4 The figure shows the t-SNE distribution of sentence representations before and after regularization. The figure shows that the regularized sentence representations no longer cluster language-wise. Therefore, using the hidden representation of the target language training data obtained from the target column as a query can include: subtracting the average representation of the target language from the hidden state of the last layer of the target column and projecting the result back onto a standard normal distribution to obtain the regularized hidden state of the target column as the query. Correspondingly, using the hidden representation of the source language training data obtained from the source column as a key can include: subtracting the average representation of the source language from the hidden state of the last layer of the source column and projecting the result back onto a standard normal distribution to obtain the regularized hidden state of the source column as the key. The above regularization operation can, for example, correspond to the application example below, from the last layer hidden state... After regularization . Figure 5 This example illustrates a bicolumn model with a regularization layer added. The hidden state after regularization is shown. Attention operations actually performed in the attention teacher module.
[0045] In one embodiment, a cross-attention mechanism can be used to fuse the features of the two columns. Cross-attention is a technique in deep learning used for efficient information transfer between multiple feature maps. In cross-attention, each feature map calculates its similarity to other feature maps, and these similarities are used for weighted feature aggregation. In this invention, an intermediate layer in the two-column model can be selected, such as the l-th layer in L transformer layers, where l is any value other than 1 and L. In this intermediate layer, feature fusion is performed between the hidden states of the target column intermediate layer and the hidden states of the source column intermediate layer based on the cross-attention mechanism, and the fused features are incorporated into the source column. Specifically, to avoid performance loss in the source language due to feature fusion, gradients related to feature fusion can be prevented from backpropagating to the source column (e.g., using the following...). (Function). Furthermore, due to the differences between different languages, to avoid the adverse effects of over-fusion, the feature fusion is performed only in one intermediate layer of the dual-column model. In other words, the feature fusion based on the cross-attention mechanism is performed only once in one of the L transformer layers. Thus, this invention enhances the understanding of the target language by using parallel language pairs as model input to extract knowledge from the source language, while avoiding the degradation of the source language representation.
[0046] Furthermore, semantic alignment can enhance knowledge transfer in the model. To improve attention, in one embodiment, token-level alignment can be performed. In this case, training parallel language pairs by feeding them into a bi-column model constructed based on a pre-trained language model and using backpropagation to train a cross-language machine reading comprehension task includes: constructing a second loss function that achieves token-level alignment between source tokens in the source language training data and target tokens in the target language training data (e.g., corresponding to the token-level alignment loss in the application example). ); and training the cross-language machine reading comprehension task using the backpropagation algorithm based on the second loss.
[0047] Alternatively, a common method of learning alignment, namely sentence-level alignment, can be used. In this case, a third loss function (e.g., the sentence-level alignment loss corresponding to the application example) is constructed based on contrastive learning to achieve sentence-level alignment between the source sentence representations in the source language training data and the target sentence representations in the target language training data. The second and third loss functions can be used simultaneously, for example, by weighted summing the second and third loss functions as a multi-granularity semantic alignment loss function. The training of the cross-language machine reading comprehension task is performed using the backpropagation algorithm based on the third loss. In one embodiment, the second and third loss functions can also be used simultaneously, for example, by weighted summing the second and third loss functions as a multi-granularity semantic alignment loss function.
[0048] Alternatively, the loss function of the MRC task itself can be utilized. In this case, training the parallel language pairs by feeding them into a bi-column model constructed based on a pre-trained language model and using backpropagation to train a cross-language machine reading comprehension task includes: constructing a fourth loss function to characterize the loss of the cross-language machine reading comprehension task (e.g., corresponding to the MRC loss in the application example). ); and training the cross-language machine reading comprehension task using the backpropagation algorithm based on the fourth loss.
[0049] It should be understood that the various embodiments described above are preferred solutions that enable the dual-column model of the present invention to better perform cross-language machine reading comprehension tasks, and the above preferred features can be used together to form preferred application examples. The following will combine... Figure 6A preferred application example of the present invention will be described. However, as can be seen from the accompanying ablation experiments, while these preferred features are all effective in improving the level of model inference results, they are not essential.
[0050] Application examples Figure 6 An example of the construction and operation of a double-column model according to an embodiment of the present invention is shown.
[0051] First, the task is defined using a conformance.
[0052] Given context and the problem MRC tasks are derived from context. Extracting subsequences as a problem The correct answer. Represent the input sequence as... ,in This is the sequence length. You can use... and This represents the probability distribution of the start and end positions of the answer. For simplicity, the two can be concatenated together to form... Similarly, This represents a one-hot golden label sequence. For cross-language scenarios, only annotated training data from the source language is available. and raw test data from the target language Available. and This represents the source language and the target language. Machine translation can be used to obtain training data for the target language. Test data for the source language In addition, using Indicates the sequence in the layer The hidden state in, where This is the total number of layers in the transformer. Therefore, in order to predict... The beginning and end positions of the correct answer segment can be determined by... By feeding in a linear classification layer and a softmax function, a probability distribution is introduced over the entire sequence. : ,in and These are the weights and biases of the linear classifier.
[0053] 1. Gradient decoupling and knowledge sharing While machine translation from high-resource languages to low-resource languages can be used to train multilingual models, its drawbacks are obvious: i) machine translation quality varies by language; ii) original semantics are easily lost during translation; iii) acquiring task labels is relatively costly, especially for token-level cross-lingual tasks. Therefore, as... Figure 6 As shown, parallel language pairs are used as input and cross-language representations are fused.
[0054] Cross-attention can be used for feature fusion. However, performance loss can be observed in the source language. A reasonable assumption for this loss is that helping the target language extract target-related information from the hidden state of the source language leads to degradation of the source language representation. To mitigate this problem, this invention proposes Gradient Decoupling Knowledge Sharing (GDKS), an improved version of cross-attention blocks. Specifically, this method prevents backpropagation from the target language output to the hidden state of the source language. The gradient. As compensation, a trainable correction term is added:
[0055] here, Used to stop backpropagation of gradients to prevent interference with the source language representation. This refers to a trainable linear transformation with dropout (Dropout is a common operation in the field used to stop the activation value of a neuron during forward propagation with a certain probability p, thereby improving the model's generalization ability). Then, the target hidden state is used as the query (Q), and the transformed source hidden state is used... Cross-attention is performed using keys (K) and values (V), as defined below:
[0056] MHA stands for Multi-Head Attention. Then, the target hidden state is determined by weights. The target hidden state is fused with the source-aware target hidden state, and the calculation is as follows:
[0057] in ,in and These are trainable parameters. It's worth noting that GDKS is only implemented in a specific transformer layer. For example... Figure 6 As shown in the middle, in a transformer intermediate layer that includes cross attention, the source column does not fuse features from the target column, while the target column fuses features from the source column through an additional multi-head attention module.
[0058] 2. Attention Teacher-Guided Calibration (ATGC) GDKS focuses on transferring knowledge from the hidden states of a teacher model (trained by the source language) and can also calibrate the model's output distribution with teacher guidance.
[0059] Regularization. A prerequisite for good guidance is to first regularize the representations across different languages. Here, we assume that the representations of the multilingual model consist of language-specific and language-independent representations. We estimate language-specific features as the mean of the language representations and remove language-specific features by subtracting the mean, retaining only general semantic features. This operation is based on the fact that a language may contain a large number of phenomena such as function words. Therefore, the average representation of that language is prominent. Inspired by batch regularization, we transform the general semantic representations to a standard normal distribution space:
[0060] in and It is a batch The mean and variance are represented by the marker level. This is a constant used for numerical stability. For ease of use in reasoning, this constant is set to be linguistically independent.
[0061] Calibration. After regularization, the hidden state of the target language is used as the query (Q), and the hidden state of the source language and the output distribution are used as the key (K) and value (V), respectively. MHA is still utilized, and the transformation results from multiple heads are averaged. Therefore, the output distribution of the transfer... for:
[0062] in and These are the hidden states of regularization for the source language and the target language, respectively.
[0063] During the model training phase, the loss from teacher guidance can be incorporated. To calculate Therefore, tags with the same semantics but different languages can still be brought closer together through annotated data, even if their representations are very different. Specifically, we will use sample-level loss. The definition is as follows:
[0064] For model inference, we utilize The output of the target language is calibrated by averaging the results of the two output distributions.
[0065] 3. Multi-granularity semantic alignment (MGSA) Multi-granularity semantic alignment technology can further enhance the knowledge transfer of the model.
[0066] 3.1 Sentence-level alignment The common approach to learning alignment is to start at the sentence level. Here, contrastive learning can be used to enhance cross-linguistic alignment:
[0067] in This is an average pooling sentence representation. and These represent positive samples from parallel translation data and negative samples from mini-batch data, respectively. It is cosine similarity, that is . This is the temperature hyperparameter, which we set to 0.05 by default.
[0068] 3.2 Alignment at the Marker Level The entropy of the cross-attention distribution (ECA) can be used to measure the quality of machine translation. A smaller entropy, indicating more focused attention, suggests relatively higher translation quality. Similarly, ECA can also represent cross-lingual alignment quality; we use it as a penalty term when training cross-lingual models to avoid distractions in GDKS. (Tag-level alignment loss) It can be defined as:
[0069] in Indicates attention weights, It's a hidden size. It is the number of target tags. This is the number of source labels. Next, the total alignment loss is the sum of two parts, where... and η For coefficients:
[0070] 4. Ultimate Training Goal In one embodiment, the ultimate training objective of X-STA is:
[0071] in It is a loss of teacher guidance Factors. This refers to the cross-entropy loss of the MRC task. The MRC loss can be... Decompose into source language loss and target language loss with a balance factor of α:
[0072] 5. Ablation Studies Ablation studies were conducted by removing each key component individually to evaluate the effectiveness of each module. The following table illustrates the performance impact of removing each key component on commonly used cross-semantic MRC datasets. and The report indicates a performance degradation for English versions 1.1 / 1.0 and 1.3 / 1.0.
[0073]
[0074] As shown in the table above, removing any component will result in a performance degradation. While removing GDKS has little impact on overall performance, it will significantly affect the representation of the source language, causing a noticeable performance drop in the source language (i.e., English).
[0075] Removing the Attention Teacher-Guided Calibration (ATGC) component most significantly degrades model performance, demonstrating that mapping the source language output to the target language space is effective and feasible. Furthermore, some performance loss still exists compared to removing ATGC only during inference, indicating that the improvement from ATGC does not solely stem from the weighted outputs of the source and target languages. Using answer fragments as additional knowledge can mitigate the teacher-guided loss. To enhance cross-language alignment. As mentioned above, Figure 4 The image shows the visual distribution of sentence representations before and after regularization. In the original space, the distributions of the same language (same color) tend to cluster together, while after regularization, these representations are sparsely distributed, which also shows that regularization can indeed decompose some language-specific representations.
[0076] Finally, the effectiveness of MGSA is analyzed. As can be seen, marker-level alignment (alignment) t Sentence-level alignment s It contributes more. A reasonable assumption is that MRC tasks are more concerned with token-level representation. Figure 7 A heatmap of attention distribution with and without marker-level alignment is shown. The figure illustrates the average results of multi-head attention. As shown, without marker-level alignment, attention is more scattered and cross-linguistic alignment is poor. Marker-level alignment penalizes this behavior, focusing attention on markers related to the question-answer sequence (e.g., "many").
[0077] The above-described operation method for cross-language machine reading comprehension tasks of the present invention can also be incorporated into existing natural language processing systems to improve the reasoning ability of the system (e.g., cloud platform) for cross-language machine reading comprehension tasks. Figure 8A schematic diagram of a natural language processing system according to an embodiment of the present invention is shown. As shown, the system 800 includes a storage node 810 for storing various models, particularly a trained bi-column model obtained using the method described above. An interaction node 820 is used for interaction with the system user. Specifically, the interaction node 820 loads the trained bi-column model, acquires input data of the target language and source language translation data based on the input data as parallel language pairs for inference as model input, and uses the acquired model output as the inference result for a cross-language machine reading comprehension task.
[0078] Figure 9 A schematic diagram of a computing device is shown, which can be used to implement the above-described cross-language machine reading comprehension task according to an embodiment of the present invention.
[0079] See Figure 9 The computing device 900 includes a memory 910 and a processor 920.
[0080] Processor 920 may be a multi-core processor or may contain multiple processors. In some embodiments, processor 920 may include a general-purpose main processor and one or more special coprocessors, such as a graphics processing unit (GPU), a digital signal processor (DSP), etc. In some embodiments, processor 920 may be implemented using custom circuitry, such as an application-specific integrated circuit (ASIC) or a field-programmable gate array (FPGA).
[0081] Memory 910 may include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage devices. ROM may store static data or instructions required by processor 920 or other modules of the computer. Permanent storage devices may be read-write storage devices. Permanent storage devices may be non-volatile storage devices that retain stored instructions and data even when the computer is powered off. In some embodiments, permanent storage devices use mass storage devices (e.g., magnetic or optical disks, flash memory) as permanent storage devices. In other embodiments, permanent storage devices may be removable storage devices (e.g., floppy disks, optical drives). System memory may be a read-write storage device or a volatile read-write storage device, such as dynamic random access memory. System memory may store some or all of the instructions and data required by the processor during operation. Furthermore, memory 910 may include any combination of computer-readable storage media, including various types of semiconductor memory chips (DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), and disks and / or optical disks may also be used. In some embodiments, memory 910 may include removable storage devices that are readable and / or writable, such as laser discs (CDs), read-only digital multifunction optical discs (e.g., DVD-ROMs, dual-layer DVD-ROMs), read-only Blu-ray discs, ultra-high density optical discs, flash memory cards (e.g., SD cards, mini SD cards, Micro-SD cards, etc.), magnetic floppy disks, etc. Computer-readable storage media do not contain carrier waves or transient electronic signals transmitted wirelessly or via wired connections.
[0082] The memory 910 stores executable code, which, when processed by the processor 920, enables the processor 920 to perform the operation method of the cross-language machine reading comprehension task described above.
[0083] The operating method and natural language processing system for cross-language machine reading comprehension tasks according to the present invention have been described in detail above with reference to the accompanying drawings. The present invention makes better use of training data, not only for feature fusion, but also for calibrating the output answers in the target language, thereby improving the accuracy of finding the corresponding answers.
[0084] This paper proposes a novel operational approach for cross-lingual machine reading comprehension tasks, addressing the challenges of cross-lingual MRC in effectively utilizing translated data and linguistic and cultural differences. Through sharing, teaching, and coordination, this invention leverages gradient-decoupled knowledge-sharing techniques to transfer language representations, and further enhances the model's cross-lingual transfer capabilities using output calibration and semantic alignment. Experimental results on three datasets demonstrate that our method achieves state-of-the-art performance compared to strong baselines.
[0085] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0086] Furthermore, the method according to the present invention can also be implemented as a computer program or computer program product, which includes computer program code instructions for performing the steps defined in the above-described method of the present invention.
[0087] Alternatively, the present invention can also be implemented as a non-transitory machine-readable storage medium (or computer-readable storage medium, or machine-readable storage medium) storing executable code (or computer program, or computer instruction code) thereon, which, when executed by a processor of an electronic device (or computing device, server, etc.), causes the processor to perform the various steps of the method described above according to the present invention.
[0088] Those skilled in the art will also understand that the various exemplary logic blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein can be implemented as electronic hardware, computer software, or a combination of both.
[0089] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems and methods according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0090] The various embodiments of the present invention have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A method for performing a cross-language machine reading comprehension task, comprising: Obtain target language training data corresponding to the source language training data; Construct parallel language pairs for training, including source language training data and target language training data; The training parallel language pairs are fed into a bi-column model constructed based on a pre-trained language model, and the backpropagation algorithm is used to train a cross-language machine reading comprehension task. The bi-column model includes a source column that uses source language training data as input and a target column that uses target language training data as input. The bi-column model uses the hidden state of the target language training data obtained from the target column as the query and the hidden state of the source language training data obtained from the source column as the key; and uses the source language output answer output from the source column as the value. Based on a multi-head attention mechanism, it uses the above query, key, and value to obtain the output distribution of the transfer, which serves as an answer fragment semantically similar to the source language output answer, in order to calibrate the answer fragment output from the target column.
2. The method as described in claim 1, wherein, The query uses the hidden state of the target language training data obtained from the target column as the query result. The target column's hidden state is obtained by subtracting the average representation of the target language from the hidden state of the last layer of the target column and projecting the result back onto a standard normal distribution to obtain the regularized hidden state of the target column as the query. The hidden state of the source language training data obtained from the source column is used as the key, including: The hidden state of the last layer of the source column is subtracted from the average representation of the source language, and the result is projected back onto a standard normal distribution to obtain the regularized hidden state of the source column as the key.
3. The method as described in claim 1, wherein, The training of parallel language pairs is carried out by feeding them into a bi-column model constructed based on a pre-trained language model, and then using the backpropagation algorithm to train them for a cross-language machine reading comprehension task. A first loss function is constructed based on answer fragments semantically similar to the source language output answers, in order to narrow the distance between semantically identical but linguistically different tags; and The cross-language machine reading comprehension task is trained using the backpropagation algorithm based on the first loss function.
4. The method of claim 1, wherein, The process of obtaining the output distribution of the migration using the above-described queries, keys, and values, as answer fragments semantically similar to the source language output answer, to calibrate the answer fragments of the target column output includes: The weighted average of the answer fragments that are semantically similar to the answer output of the source language and the answer fragments output of the target column is used as the output of the dual-column model.
5. The method of claim 1, wherein, In the intermediate layer of the dual-column model, the features of the hidden state of the intermediate layer of the target column and the hidden state of the intermediate layer of the source column are fused based on the cross-attention mechanism, and the fused features are then incorporated into the source column.
6. The method of claim 5, wherein The feature fusion is performed only in one intermediate layer of the bi-column model; and Prevent gradients associated with feature fusion from backpropagating to the source column.
7. The method of claim 1, wherein, The training of parallel language pairs is carried out by feeding them into a bi-column model constructed based on a pre-trained language model, and then using the backpropagation algorithm to train them for a cross-language machine reading comprehension task. Construct a second loss function that aligns the source tags in the source language training data with the target tags in the target language training data at the tag level; and The backpropagation algorithm is used based on the second loss to train the cross-language machine reading comprehension task.
8. The method of claim 1, wherein, The training of parallel language pairs is carried out by feeding them into a bi-column model constructed based on a pre-trained language model, and then using the backpropagation algorithm to train them for a cross-language machine reading comprehension task. Construct a third loss function based on contrastive learning that aligns the source sentence representations in the source language training data with the target sentence representations in the target language training data at the sentence level; and The cross-language machine reading comprehension task is trained using the backpropagation algorithm based on the third loss.
9. The method of claim 1, wherein, The training of parallel language pairs is carried out by feeding them into a bi-column model constructed based on a pre-trained language model, and then using the backpropagation algorithm to train them for a cross-language machine reading comprehension task. Construct a fourth loss function to characterize the loss of the cross-language machine reading comprehension task; and The backpropagation algorithm is used based on the fourth loss to train the cross-language machine reading comprehension task.
10. A natural language processing system, comprising: Storage nodes are used to store the trained bi-column model obtained by the method as described in any one of claims 1 to 9; as well as An interactive node is used to load the trained dual-column model, acquire input data in the target language and source language translation data based on the input data as inference parallel language pairs as model input, and use the acquired model output as the inference result of the cross-language machine reading comprehension task.
11. A computing device, comprising: processor; as well as A memory having executable code stored thereon, which, when executed by the processor, causes the processor to perform the method as described in any one of claims 1 to 9.
12. A computer program product comprising executable code that, when executed by a processor of an electronic device, causes the processor to perform the method as claimed in any one of claims 1 to 9.
13. A non-transitory machine-readable storage medium having executable code stored thereon, which, when executed by a processor of an electronic device, causes the processor to perform the method as claimed in any one of claims 1 to 9.
Citation Information
Patent Citations
Reading understanding task recognition method and device based on multiple languages
CN112182151A
Processing method of natural language system based on machine reading understanding
CN115455985A
