A large language model multilingual enhancement method and system based on model combination

By using a model combination approach, multilingual understanding and generation capabilities are decoupled from large language models. By utilizing external multilingual translation models and semantic representation mapping, the problems of capability imbalance and forgetting in large language models in multilingual applications are solved, achieving efficient and stable multilingual capability expansion and improved generation quality.

CN122263904APending Publication Date: 2026-06-23INST OF COMPUTING TECH CHINESE ACAD OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
INST OF COMPUTING TECH CHINESE ACAD OF SCI
Filing Date
2026-03-12
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Existing large language models suffer from imbalanced multilingual capabilities, insufficient support for low-resource and unseen languages, and catastrophic forgetting issues when trained directly in multiple languages.

Method used

We adopt a model-based approach, which decouples multilingual understanding and generation capabilities from the large language model by introducing a pre-trained multilingual translation model and a semantic representation mapping module. The external multilingual translation model then undertakes these capabilities. We design a word-level soft alignment method for cross-model representation mapping and optimal transport to achieve semantic representation consistency and collaborative work among different models.

Benefits of technology

Without compromising the general capabilities of large language models, it significantly improves multilingual understanding and generation capabilities, especially in low-resource and unseen languages. It also reduces training costs and the risk of catastrophic forgetting, and improves the linguistic accuracy of multilingual generated text and the accuracy of downstream inference tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122263904A_ABST
    Figure CN122263904A_ABST
Patent Text Reader

Abstract

This application discloses a method and system for multilingual enhancement based on a large language model using model ensemble. The system includes: a pre-trained multilingual translation model, a semantic representation mapping module, and a large language model. The multilingual translation model is used for multilingual semantic modeling and language generation, including a multilingual encoder module and a multilingual decoder module. The semantic representation mapping module is used to transform the latent space representations of different models into an interactive unified semantic space based on a cross-model representation mapping mechanism. The output of the multilingual encoder is mapped to the unified semantic representation space of the large language model, and the mapped semantics are input into the large language model to perform language-independent instruction understanding. The intermediate semantic representation output by the large language model is mapped and transformed to a cross-attention representation space, generating the final output text under the target language distribution. The system of this application outperforms existing technologies in terms of efficiency, stability, and generation quality in multilingual capability extension.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of large language models and multilingualism, specifically to a method and system for multilingual enhancement of large language models based on model combination. Background Technology

[0002] With the widespread application of large language models in natural language processing, multilingual capability has gradually become one of the important indicators for evaluating the practicality of models. Ideally, a large language model should have the ability to understand and generate multiple languages ​​and share knowledge and reasoning abilities across different languages. However, limited by the scale and distribution of pre-training data, existing mainstream large language models generally exhibit an imbalance in multilingual capability, centered on English. That is, they perform well for high-resource languages ​​such as English, but their support for low-resource languages ​​and languages ​​not seen during the model's pre-training stage is significantly insufficient. To address these issues, existing technologies mainly employ the following approaches to enhance multilingual capability.

[0003] The first type of approach is based on fine-tuning with multilingual data. This involves continuously pre-training or fine-tuning the large language model using larger or more balanced multilingual datasets. For example, some studies have continued training the model on large-scale multilingual or parallel corpora to enhance its multilingual coverage; others have injected multilingual alignment information into the large language model by constructing multilingual instructions, cross-language instructions, and translation instructions.

[0004] The second type of approach is based on a cascaded structure of translation enhancement. Through a cascaded "translation-processing-retranslation" method, the low-resource language input is first translated into English, then the large language model completes the task processing, and finally the output is translated back into the target language.

[0005] The third approach introduces an external cross-language adaptation module. This involves introducing an external pre-trained multilingual encoder to assist large language models in understanding multilingual inputs. For example, some studies directly inject the representation encoded by the pre-trained encoder into the large language model to enhance its understanding capabilities; other works further integrate the encoder's multilingual representations with the large model's English understanding and reasoning capabilities from the perspectives of input data format and encoder representation injection methods.

[0006] Although the aforementioned existing technologies have improved the multilingual capabilities of large language models to some extent, the following prominent problems and shortcomings still exist in practical applications, which also constitute the core technical problems to be solved by this invention:

[0007] (1) Data-driven multilingual augmentation methods have high training costs and limited generalization capabilities. Such methods usually rely on large-scale, multilingual, high-quality datasets, while low-resource languages ​​themselves have scarce data, making it difficult to meet training requirements; at the same time, the data distribution differences between different languages ​​are large, making it difficult for the model to achieve stable improvements in multiple languages ​​at the same time.

[0008] (2) Directly updating the parameters of a large language model in multiple languages ​​can easily lead to catastrophic forgetting problems. During continuous pre-training or fine-tuning of instructions in multiple languages, the model needs to adapt to multiple languages ​​at the same time, which often interferes with the original general knowledge capabilities or high-resource language capabilities, resulting in a decrease in the performance of the model in some original languages ​​or tasks.

[0009] (3) Translation cascade schemes suffer from error accumulation and semantic shift. The overall performance of existing schemes based on "translation-processing-retranslation" is highly dependent on translation quality. The noise and information loss introduced during the translation process will be further amplified in subsequent processing and reverse translation, making it difficult to guarantee the accuracy of the final output in terms of semantics and language style.

[0010] (4) The solution of introducing external adaptation modules is difficult to solve the essential differences between cross-model and cross-word segmentation systems. Different models usually use different word segmentation methods and representation space structures. Simple linear mapping or local alignment is difficult to achieve stable and consistent representation transformation at the semantic level. Especially in cross-language and cross-model scenarios, it is difficult to guarantee the correspondence between fine-grained semantic units.

[0011] Therefore, existing technologies have not yet provided a unified technical solution that can simultaneously take into account the general capabilities of large language models and the language coverage capabilities of multilingual translation models without compromising the general capabilities of large language models, especially solutions for low-resource languages ​​and unseen languages. Summary of the Invention

[0012] To address the problems of unbalanced multilingual capabilities, insufficient support for low-resource and unseen languages, and catastrophic forgetting caused by direct multilingual training in existing large language models, a method and system for constructing a multilingual general-purpose large language model based on model combination is proposed.

[0013] In a first aspect, embodiments of this application provide a multilingual enhancement system based on a large language model with model combination, the system comprising: a pre-trained multilingual translation model, a semantic representation mapping module, and a large language model;

[0014] Multilingual translation models are used for multilingual semantic modeling and language generation. They include a multilingual encoder module and a multilingual decoder module, which are used to encode input text in different languages ​​and decode it to generate the final output text in the target language distribution, respectively.

[0015] The semantic representation mapping module connects the multilingual translation model and the large language model. It is used to transform the latent space representations of different models into an interactive unified semantic space based on the cross-model representation mapping mechanism. It includes: encoder representation mapping module and decoder representation mapping module.

[0016] The output of the multilingual encoder is mapped to a unified semantic representation space of a large language model. The mapped semantics are then input into the large language model to perform language-independent instruction comprehension. The intermediate semantic representation output by the large language model is mapped and transformed to a cross-attention representation space, and the final output text is generated under the target language distribution.

[0017] In this embodiment of the invention, the above-mentioned large language model multilingual enhancement system based on model combination further includes:

[0018] Semantic alignment module: Used to perform semantic alignment between the output representation of the mapped large language model and the output of the multilingual decoder.

[0019] In this embodiment of the invention, the multilingual encoder module is connected to the encoder representation mapping module, which is used to encode the input text, map the input text of different languages ​​to a unified semantic representation space, and generate a language-independent hidden state sequence.

[0020] The multilingual decoder module is connected to the decoder representation mapping module and is used to generate the final output text under the target language distribution based on the target language labels and the mapped output representation of the large language model.

[0021] In this embodiment of the invention, the encoder representation mapping module is used to map the hidden state representation output by the multilingual encoder to the input representation space of the large language model, so as to perform cross-model semantic information transmission.

[0022] The decoder representation mapping module is used to transform the intermediate semantic representation output by the large language model to the cross-attention representation space of the multilingual decoder to adapt to the generation requirements of different languages.

[0023] In this embodiment of the invention, the semantic alignment module is used to perform semantic alignment between the mapped large language model output representation and the multilingual decoder cross-attention representation by employing a soft alignment method based on optimal transportation at the lexical level, thereby mitigating semantic deviations caused by different word segmentation mechanisms and inconsistent representation granularities.

[0024] In this embodiment of the invention, the word-level soft alignment method for optimal transportation is as follows: the encoder re-encodes the output response sequence of the large model, and the optimal transportation loss between the mapped output representation of the large language model and the cross-attention representation of the multilingual decoder is calculated. The loss is the optimization objective of the optimal transportation task.

[0025] Secondly, embodiments of this application provide a method for multilingual enhancement based on a large language model using model combination, employing the aforementioned multilingual enhancement system based on a large language model using model combination, and the method includes:

[0026] Model building and pre-training steps: Build a multilingual model and pre-train the model. Without adjusting the parameters of the large language model, perform cross-model representation alignment and expansion to achieve consistency of semantic representation and collaborative working ability between different models.

[0027] Multilingual enhancement steps: Encode input text in different languages, map the output of the multilingual encoder to a unified large language model semantic representation space, input the mapped semantics into the large language model, execute language-independent instruction understanding, map and transform the intermediate semantic representation output by the large language model to the cross-attention representation space, and generate the final output text under the target language distribution.

[0028] In this embodiment of the invention, the above-mentioned model construction and pre-training steps include:

[0029] Cross-model mapping steps: train the large language model to understand the semantic representation of the encoder module, train the decoder module to generate multilingual text by accepting the hidden state of the large language model, train the encoder representation mapping module, the decoder representation mapping module, and the parameters of the decoder's cross-attention module, and the training loss includes the cross-entropy loss of the large language model and the decoder, as well as the optimal transport optimization loss.

[0030] Encoder adaptation steps: Fine-tune the encoder representation mapping module, with the training loss being the cross-entropy loss of the large language model;

[0031] Decoder adaptation steps: Fine-tune the parameters of the decoder representation mapping module and the decoder's cross-attention module. The training loss is the cross-entropy loss of the decoder and the optimal transport optimization loss. The overall training loss is the sum of the cross-entropy loss of the large language model with different hyperparameter adjustments at different stages, the cross-entropy loss of the decoder, and the optimal transport optimization loss.

[0032] Thirdly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of a multilingual enhancement method for a large language model based on model composition.

[0033] Fourthly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the steps of the large language model multilingual enhancement method based on model combination as described above.

[0034] Compared with existing technologies, it has the following outstanding advantages:

[0035] 1) This invention proposes a multilingual general-purpose large language model architecture based on model combination, which functionally decouples multilingual processing capabilities from general knowledge processing capabilities. By introducing a multilingual encoder at the input end and a multilingual decoder at the output end, an externally pre-trained multilingual translation model is responsible for multilingual semantic modeling and language generation, while the large language model, as the core of knowledge processing, performs language-independent understanding and reasoning tasks. Technical results: It effectively enhances the understanding and generation capabilities of the large language model for multiple languages. On four commonly used large language models, the understanding capability for ten languages ​​is improved by an average of 6.46 BLEU, and the generation capability is improved by an average of 7.34 BLEU. The performance is particularly significant for low-resource languages ​​and unseen languages ​​(Bengali, Swahili, and Thai), with an average improvement of 19.46 BLEU in the understanding capability and an average improvement of 18.70 BLEU in the generation capability. Overall, the multilingual understanding and generation capabilities are close to the performance of the combined translation model.

[0036] 2) This invention proposes a cross-model semantic representation mapping mechanism and a cross-model lexical-level semantic alignment method based on optimal transport to address the representation inconsistency problem under different word segmentation mechanisms and training modes, achieving fine-grained representation space alignment between multilingual encoders, large language models, and multilingual decoders. By introducing representation mapping layers between the multilingual encoder and the large language model, and between the large language model and the multilingual decoder, the latent space representations of different models are transformed into an interactive unified semantic space. Optimal transport theory is used to establish soft alignment relationships between the semantic units output by different models, aligning the semantic correspondence between the multilingual decoder's generation space and the large language model's output representation. Technical effects: While ensuring semantic consistency, it avoids forced constraints on the target language generation distribution, improving the linguistic accuracy of multilingual generated text. The effect is particularly significant in generating low-resource languages ​​and unseen languages, and has been validated in downstream inference tasks. Compared to the instruction fine-tuning method, the average inference accuracy for 10 languages ​​is improved by 10.99% on four commonly used large language models. Attached Figure Description

[0037] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0038] Figure 1 This is a schematic diagram of the large language model multilingual enhancement system based on model combination according to the present invention;

[0039] Figure 2 This is a schematic diagram of the overall framework of the large language model multilingual enhancement system according to an embodiment of the present invention;

[0040] Figure 3 This is a schematic diagram of the multilingual enhancement method for large language models based on model combination according to the present invention;

[0041] Figure 4 This is a schematic diagram of the model training process in an embodiment of the present invention;

[0042] Figure 5 This is a schematic diagram of the computer hardware of the present invention. Detailed Implementation

[0043] In this 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 refer to any combination of these items, including any combination of a single item or a plurality of items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be a single item or multiple items.

[0044] It should also be understood that the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. A and B can be singular or plural. Additionally, the character " / " in this article generally indicates an "or" relationship between the preceding and following related objects, but it can also represent an "and / or" relationship. Please refer to the context for a more accurate understanding.

[0045] It should also be understood that, in various embodiments of the present invention, the order of the above-mentioned processes does not imply 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.

[0046] In the several embodiments provided by this invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0047] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0048] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0049] If the aforementioned functions are implemented as 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 this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0050] To make the above-mentioned features and effects of the present invention clearer and easier to understand, specific embodiments are described below in conjunction with the accompanying drawings. This specification discloses one or more embodiments incorporating the features of the present invention. The disclosed embodiments are merely illustrative. The scope of protection of the present invention is not limited to the disclosed embodiments, but is defined by the appended claims.

[0051] The following are system embodiments corresponding to the above method embodiments. This embodiment can be implemented in conjunction with the above embodiments. The relevant technical details mentioned in the above embodiments are still valid in this embodiment, and will not be repeated here to reduce repetition. Accordingly, the relevant technical details mentioned in this embodiment can also be applied to the above embodiments.

[0052] This invention first analyzes the sources of the imbalance in multilingual capabilities of large language models, finding that the limited multilingual performance in existing technologies is not primarily due to a lack of knowledge reasoning ability, but rather to insufficient adaptability of the model to multilingual input and output formats. In other words, large language models have strong language independence at the knowledge processing and reasoning levels, while their performance bottlenecks are mainly concentrated in the perception and generation stages of different language forms.

[0053] Further analysis reveals the following limitations of existing technologies: First, data-based methods often assume that multilingual problems can be solved by increasing multilingual training data or fine-tuning representations, without fully considering the interference between different languages ​​and the trade-offs between new and old languages ​​and knowledge; Second, translation concatenation-based methods suffer from inherent defects such as the accumulation of translation errors and semantic shifts, failing to fully combine the multilingual capabilities of translation models with the general knowledge processing capabilities of large language models; Third, methods that introduce external adaptation modules are limited to introducing encoders to enhance multilingual understanding, failing to solve the multilingual generation problem, and large language models also struggle to fully understand encoder representations.

[0054] Based on the above understanding, the inventors proposed a model combination-based technical solution: a model combination structure of "encoder-large language model-decoder" is proposed, in which the multilingual understanding and generation capabilities are separated from the large language model and handed over to a dedicated multilingual translation model, so that the large language model can focus on language-independent knowledge processing and reasoning processes.

[0055] This technical concept faces several key technical challenges in its implementation: First, the representation spaces of different models are inconsistent, making direct information exchange difficult. This solution proposes a cross-model representation mapping mechanism, directly combining the encoder, large language model, and decoder at the representation level, thus avoiding the error problem of explicit translation concatenation. Second, different models employ different word segmentation strategies, leading to mismatches in semantic unit granularity. This solution proposes a word-level soft alignment strategy based on optimal transport, effectively aligning representations under different word segmentation strategies. Third, how to achieve cross-model and cross-language semantic collaboration without destroying the original model parameters. This solution proposes a three-stage optimization strategy, freezing the parameters of the large language model throughout the process, directly avoiding the loss of original language capabilities.

[0056] This method innovatively proposes a multilingual general-purpose large language model construction scheme based on model combination. By introducing pre-trained multilingual encoders and decoders at the input and output ends of the large language model and designing a cross-model semantic mapping mechanism, it realizes the effective connection between multilingual semantic representation and knowledge processing, thereby providing stable and scalable support capabilities for low-resource languages ​​and unseen languages.

[0057] The system of this application embodiment will be described in detail below with reference to specific embodiments:

[0058] like Figure 1 As shown, this invention proposes a method and system for implementing a multilingual general-purpose large language model based on model combination. Its core idea is to decouple multilingual understanding and generation capabilities from the large language model. The multilingual processing function is undertaken by an externally pre-trained multilingual encoder-decoder model, while the large language model acts as the knowledge processing core to perform language-independent understanding, reasoning, and information conversion tasks. The collaborative work between different models is achieved through cross-model representation mapping and semantic alignment mechanisms.

[0059] This invention proposes a multilingual enhancement system based on a large language model with model combination. The system includes: a pre-trained multilingual translation model 10, a semantic representation mapping module 20, and a large language model 30.

[0060] The multilingual translation model 10 is used for multilingual semantic modeling and language generation, including a multilingual encoder module 101 and a multilingual decoder module 102, which are used to encode input text in different languages ​​and decode it to generate the final output text under the target language distribution, respectively.

[0061] The semantic representation mapping module 20 connects the multilingual translation model 10 and the large language model 30, and is used to transform the latent space representations of different models into an interactive unified semantic space based on the cross-model representation mapping mechanism. It includes: encoder representation mapping module 201 and decoder representation mapping module 202.

[0062] The output of the multilingual encoder 101 is mapped to the semantic representation space of the unified large language model 30. The mapped semantics are input into the large language model 30 to perform language-independent instruction understanding. The intermediate semantics output by the large language model 30 are represented and mapped to the cross-attention representation space by the multilingual decoder 102, and the final output text is generated under the target language distribution.

[0063] In this embodiment of the invention, the above-mentioned large language model multilingual enhancement system based on model combination further includes:

[0064] Semantic alignment module 40: Used to perform semantic alignment between the output representation of the mapped large language model and the output of the multilingual decoder.

[0065] In this embodiment of the invention, the multilingual encoder module 101 is connected to the encoder representation mapping module 201, which is used to encode the input text, map the input text of different languages ​​to a unified semantic representation space, and generate a language-independent hidden state sequence.

[0066] The multilingual decoder module 102 is connected to the decoder representation mapping module 202 and is used to generate the final output text under the target language distribution based on the target language tags and the mapped output representation output by the large language model.

[0067] In this embodiment of the invention, the encoder representation mapping module 201 is used to map the hidden state representation output by the multilingual encoder 101 to the input representation space of the large language model, so as to perform cross-model semantic information transmission.

[0068] The decoder representation mapping module 202 is used to transform the intermediate semantic representation output by the large language model 30 to the cross-attention representation space of the multilingual decoder 102 to adapt to the generation requirements of different languages.

[0069] In this embodiment of the invention, the semantic alignment module 40 is used to perform semantic alignment between the mapped large language model output representation and the multilingual decoder cross-attention representation by employing a soft alignment method based on optimal transportation at the lexical level, thereby mitigating semantic deviations caused by different word segmentation mechanisms and inconsistent representation granularities.

[0070] In this embodiment of the invention, the word-level soft alignment method for optimal transportation is as follows: the output response sequence of the large model is re-encoded using an encoder, and the optimal transportation loss between the mapped output representation of the large language model and the cross-attention representation of the multilingual decoder is calculated, where the loss is the optimization objective of the optimal transportation task.

[0071] Specifically, in specific embodiments of the present invention, such as Figure 2 As shown, the overall system structure of this invention mainly includes: a multilingual encoder module, an encoder-large language model representation mapping module (i.e., encoder representation mapping module 201 in Embodiment 1), a large language model module, a large language model-decoder representation mapping module (i.e., decoder representation mapping module 202 in Embodiment 1), a multilingual decoder module, and a semantic alignment module. According to the text processing flow, the functions of each module are as follows:

[0072] (1) Multilingual encoder module: This module encodes the input text, mapping input texts in different languages ​​to a unified semantic representation space. It can employ a pre-trained multilingual encoder model. This implementation supports semantic modeling for high-resource languages, low-resource languages, and languages ​​not found in large language models. Let the input text sequence be... The multilingual encoder outputs its hidden state sequence as follows: ,in For sequence length, The encoder's hidden state dimension.

[0073] (2) Encoder-Large Language Model Representation Mapping Module: Used to map the hidden state representations output by the multilingual encoder. This is mapped to the input representation space of a large language model, enabling the transfer of semantic information across models. This process can be represented as follows: ,in The hidden state dimension of a large language model.

[0074] (3) Large Language Model Module: This module is used to perform language-independent instruction comprehension, knowledge processing, and logical reasoning tasks. It employs a pre-trained large language model, with the mapped semantic representation as its input. And English commands, output as an English response sequence And the corresponding intermediate semantic representation, denoted as , where m is the length of the English response sequence.

[0075] (4) Large Language Model-Decoder Representation Mapping Module: This module transforms the intermediate semantic representation output by the large language model into the cross-attention representation space of the multilingual decoder to adapt to the generation requirements of different languages. This process can be represented as follows: ,in is the dimension of the decoder's hidden state.

[0076] (5) Multilingual Decoder Module: Used to generate the final output text under the target language distribution. The input of this module is the mapped output representation. and target language tags The output is a sequence of text in the target language. This module and the multilingual encoder come from the same pre-trained model system, such as NLLB.

[0077] (6) Semantic alignment module: used to output the representation of the large language model after mapping. Semantic alignment is performed between the multilingual decoder and the cross-attention representation to mitigate semantic biases caused by different word segmentation mechanisms and inconsistent representation granularities. This invention employs a word-level soft alignment method based on optimal transport, utilizing... and Construct alignment targets based on semantic equivalence. Re-encode using the encoder. get ,in This refers to the sequence length in the encoder's word segmentation system. and The optimal transportation cost is minimized as follows:

[0078]

[0079] in, Indicates from arrive The quality of transportation; The transportation cost per unit mass is calculated using cosine similarity; mass distribution. for The normalized representation of this loss is the optimization objective of the optimal transportation task.

[0080] As described above, the system and method of the present invention can be implemented well.

[0081] Compared with the prior art, the present invention has the following outstanding advantages and beneficial effects:

[0082] Compared to existing methods that directly train large language models in multiple languages ​​or rely solely on semantic alignment, this invention achieves efficient expansion of multilingual capabilities through model combination and functional decoupling, without requiring large-scale multilingual data and parameter updates. This approach fully leverages the advantages of external multilingual translation models in cross-lingual semantic modeling and language generation, while maintaining the original general knowledge processing and reasoning capabilities of large language models, significantly reducing training costs and the risk of catastrophic forgetting. On four commonly used large language models, the average improvement in language comprehension capability is 6.46 BLEU, and the average improvement in generation capability is 7.34 BLEU. In downstream inference tasks, the average inference accuracy is improved by 10.99% compared to the baseline of instruction fine-tuning. Table 1 presents the test results for language comprehension and generation capabilities, and Table 2 presents the test results for multilingual inference.

[0083]

[0084] Table 1. Comparison of the performance of this invention with other methods in multilingual understanding and generation of the FLORES-101 test set.

[0085]

[0086] Table 2. Comparison of the performance of this invention with other methods on the multilingual reasoning test set MGSM.

[0087] In summary, this invention outperforms existing technologies in terms of efficiency, stability, and generation quality in multilingual capability extension. It is applicable to various application scenarios such as multilingual question answering, cross-language generation, and low-resource language processing, and has significant technological advancements and practical application value.

[0088] Secondly, such as Figure 3 and Figure 4As shown in the embodiments of this application, a method for multilingual enhancement of a large language model based on model combination is provided. The method employs the aforementioned multilingual enhancement system based on a large language model using model combination, and includes:

[0089] Model building and pre-training step 501: Build the multilingual translation model and perform model pre-training. Without adjusting the parameters of the large language model, perform cross-model representation alignment and expansion to achieve consistency of semantic representation and collaborative working ability between different models.

[0090] Multilingual enhancement step 502: Encode the input text in different languages, map the output of the multilingual encoder to a unified large language model semantic representation space, input the mapped semantics into the large language model, execute language-independent instruction understanding, map and transform the intermediate semantic representation output by the large language model to a cross-attention representation space, and generate the final output text under the target language distribution.

[0091] In this embodiment of the invention, the above-mentioned model construction and pre-training step 501 includes:

[0092] Cross-model mapping steps: train the large language model to understand the semantic representation of the encoder module, train the decoder module to generate multilingual text by accepting the hidden state of the large language model, train the encoder representation mapping module, the decoder representation mapping module, and the cross-attention module parameters of the decoder, and the training loss includes the cross-entropy loss of the large language model and the decoder, as well as the optimal transport optimization loss.

[0093] Encoder adaptation steps: Fine-tune the encoder representation mapping module, using the cross-entropy loss of a large language model as the training loss;

[0094] Decoder adaptation steps: Fine-tune the parameters of the decoder representation mapping module and the decoder's cross-attention module. The training loss is the decoder's cross-entropy loss and the optimal transport optimization loss. The overall training loss is the sum of the cross-entropy loss of the large language model with different hyperparameter adjustments at different stages, the decoder's cross-entropy loss, and the optimal transport optimization loss.

[0095] like Figure 4 The diagram illustrates a specific training strategy of this invention. The training process of this invention mainly revolves around cross-model representation alignment and expansion, aiming to achieve consistency and collaborative working capabilities in semantic representations among different models without adjusting the parameters of a large language model. The training process includes three stages:

[0096] (1) Cross-model mapping stage. Due to the inherent representation gap between different pre-trained models, the three-way parallel sentence pairs are first used. Training involves cross-lingual mappings, training the large language model to understand the semantic representations of the encoder, and training the decoder to generate multilingual text from the latent states of the large language model. This stage trains the parameters of the encoder-large language model representation mapping module, the large language model-decoder representation mapping module, and the decoder's cross-attention module. The training loss includes the cross-entropy loss of the large language model and the decoder. , and optimal transportation optimization loss The loss function is formalized as follows:

[0097]

[0098] (2) Encoder Adaptation Stage. After the first stage of training, the large language model has the ability to understand the semantic representation of the encoder. In this stage, the model is trained to complete specific instruction tasks using the encoder representation. This stage only fine-tunes the encoder-large language model representation mapping module, and the training loss is the cross-entropy loss of the large language model. .

[0099] (3) Decoder Adaptation Stage. The third stage focuses on improving the quality of multilingual generation for specific downstream tasks. This stage only fine-tunes the parameters of the large language model-decoder representation mapping module and the cross-attention module of the decoder. The training loss is the cross-entropy loss of the decoder. and optimal transportation optimization loss .

[0100] The overall loss function can be expressed as:

[0101]

[0102] in, , , is a hyperparameter. The activation states of different loss terms at different stages are as described above.

[0103] Thirdly, embodiments of this application provide a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the aforementioned method for multilingual enhancement of a large language model based on model composition.

[0104] Fourthly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the large language model multilingual enhancement method based on model combination as described above.

[0105] In addition, combined Figure 1The model-based multilingual enhancement method for large language models described in this application can be implemented by electronic devices, such as computer devices. Figure 5 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of this application.

[0106] In some embodiments, the computer device may further include a communication interface 83 and a bus 80. For example, Figure 5 As shown, the processor 81, memory 82, and communication interface 83 are connected through bus 80 and complete communication with each other.

[0107] Specifically, the processor 81 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.

[0108] The memory 82 can be used to store or cache various data files that need to be processed and / or communicated, as well as possible computer program instructions executed by the processor 81.

[0109] The processor 81 reads and executes computer program instructions stored in the memory 82 to implement any of the large language model multilingual enhancement methods based on model combination in the above embodiments.

[0110] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0111] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A multilingual enhancement system based on a large language model using model combination, characterized in that, The system includes: a pre-trained multilingual translation model, a semantic representation mapping module, and a large language model; The multilingual translation model is used for multilingual semantic modeling and language generation, including a multilingual encoder module and a multilingual decoder module, which are used to encode input text in different languages ​​and decode it to generate the final output text under the target language distribution, respectively. The semantic representation mapping module connects the multilingual translation model and the large language model, and is used to transform the latent space representations of different models into an interactive unified semantic space based on the cross-model representation mapping mechanism. It includes: an encoder representation mapping module and a decoder representation mapping module. The output of the multilingual encoder is mapped to a unified large language model semantic representation space. The mapped semantics are input into the large language model to perform language-independent instruction understanding. The intermediate semantic representation output by the large language model is mapped and transformed to a cross-attention representation space to generate the final output text under the target language distribution.

2. The large language model multilingual enhancement system based on model combination according to claim 1, characterized in that, The system also includes: Semantic alignment module: used to perform semantic alignment between the output representation of the mapped large language model and the cross-attention representation of the multilingual decoder.

3. The large language model multilingual enhancement system based on model combination according to claim 1, characterized in that, The multilingual encoder module is connected to the encoder representation mapping module and is used to encode the input text, map the input text of different languages ​​to a unified semantic representation space, and generate a language-independent hidden state sequence. The multilingual decoder module is connected to the decoder representation mapping module and is used to generate the final output text under the target language distribution based on the target language tags and the mapped output representation output by the large language model.

4. The large language model multilingual enhancement system based on model combination according to claim 1, characterized in that, The encoder representation mapping module is used to map the hidden state representation output by the multilingual encoder to the input representation space of the large language model, so as to perform cross-model semantic information transmission. The decoder representation mapping module is used to transform the intermediate semantic representation output by the large language model to the cross-attention representation space of the multilingual decoder, so as to adapt to the generation requirements of different languages.

5. The large language model multilingual enhancement system based on model combination according to claim 1, characterized in that, The semantic alignment module is used to perform semantic alignment between the output representation of the mapped large language model and the cross-attention representation of the multilingual decoder by employing a soft alignment method based on optimal transportation at the lexical level, thereby mitigating semantic biases caused by different word segmentation mechanisms and inconsistent representation granularities.

6. The large language model multilingual enhancement system based on model combination according to claim 5, characterized in that, The word-level soft alignment method for optimal transportation is as follows: the output response sequence of the large model is re-encoded using the encoder, and the optimal transportation loss between the mapped output representation of the large language model and the cross-attention representation of the multilingual decoder is calculated. The loss is the optimization objective of the optimal transportation task.

7. A method for multilingual enhancement of a large language model based on model combination, employing the multilingual enhancement system for a large language model based on model combination as described in any one of claims 1-6, characterized in that, The method includes: Model building and pre-training steps: Build the multilingual translation model and perform model pre-training. Without adjusting the parameters of the large language model, perform cross-model representation alignment and expansion to achieve consistency of semantic representation and collaborative working ability between different models. Multilingual enhancement steps: Encode input text in different languages, map the output of the multilingual encoder to a unified large language model semantic representation space, input the mapped semantics into the large language model, execute language-independent instruction understanding, map and transform the intermediate semantic representation output by the large language model to a cross-attention representation space, and generate the final output text under the target language distribution.

8. The method for multilingual enhancement of a large language model based on model combination according to claim 7, characterized in that, The model building and pre-training steps include: Cross-model mapping steps: train the large language model to understand the semantic representation of the encoder module, train the decoder module to generate multilingual text by accepting the hidden state of the large language model, train the encoder representation mapping module, the decoder representation mapping module, and the cross-attention module parameters of the decoder, and the training loss includes the cross-entropy loss of the large language model and the decoder, as well as the optimal transport optimization loss. Encoder adaptation steps: Fine-tune the encoder representation mapping module, using the cross-entropy loss of a large language model as the training loss; Decoder adaptation steps: Fine-tune the parameters of the decoder representation mapping module and the decoder's cross-attention module. The training loss is the decoder's cross-entropy loss and the optimal transport optimization loss. The overall training loss is the sum of the cross-entropy loss of the large language model with different hyperparameter adjustments at different stages, the decoder's cross-entropy loss, and the optimal transport optimization loss.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the multilingual enhancement method for large language models based on model composition as described in any one of claims 7-8.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the multilingual enhancement method for large language models based on model composition as described in any one of claims 7-8.