A method for semantic compression based on quantum computing

By reconstructing the compression problem of machine translation models into a QUBO problem and utilizing parallel optimization through quantum computing, the problems of insufficient semantic preservation and limited compression efficiency in the compression process of machine translation models are solved, achieving efficient semantic compression and improved translation quality.

CN120851095BActive Publication Date: 2026-06-26北京中科闻歌科技股份有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
北京中科闻歌科技股份有限公司
Filing Date
2025-07-15
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing machine translation models suffer from insufficient semantic preservation, limited compression efficiency, and an imbalance between translation efficiency and quality during compression. Traditional methods struggle to find the optimal compression scheme in high-dimensional parameter spaces, leading to a decline in translation quality.

Method used

The compression problem of machine translation models is reconstructed into a quadratic unconstrained binary optimization (QUBO) problem. A semantic preservation term related to the BLEU value is introduced, and the parallel optimization advantage of quantum computing is utilized to optimize the pruning and quantization processes through quantum annealing devices, thereby achieving multi-objective joint optimization of compression ratio, pruning loss, quantization loss, and translation quality.

Benefits of technology

While achieving a large-scale quantum semantic compression, it significantly improves the efficiency and semantic preservation of machine translation, keeps the BLEU value loss within a small range, and provides an efficient machine translation solution for resource-constrained environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120851095B_ABST
    Figure CN120851095B_ABST
Patent Text Reader

Abstract

The application relates to the field of machine translation, in particular to a semantic compression method based on quantum computing. The method comprises the following steps: reconstructing a compression problem of a machine translation model into a quadratic unconstrained binary optimization (QUBO) problem, including: constructing an objective function of a machine translation task; mapping a pruning mask vector P and a quantization parameter vector Q into quantum bits; optimizing and solving the QUBO problem based on a quantum annealing device to obtain a compressed machine translation model; and performing semantic retention degree evaluation and optimization on the compressed machine translation model, so that the compression rate and BLEU value of the compressed machine translation model meet target compression rate and target BLEU value. The application can improve the efficiency and semantic retention degree of machine translation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine translation, and in particular to a semantic compression method based on quantum computing. Background Technology

[0002] In the field of machine translation, with the development of neural network models, such as the widespread application of the Transformer architecture, the number of model parameters has grown exponentially. Taking the WMT14 English-French translation task as an example, the number of parameters in a large Transformer model can reach billions, which poses a great challenge to the model's storage, deployment, and inference efficiency.

[0003] Current machine translation model compression primarily employs classic methods such as pruning, quantization, and knowledge distillation. Pruning reduces parameters by removing unimportant connections, but it can easily disrupt the continuity of semantic mapping; quantization reduces parameter accuracy, potentially leading to semantic bias in translation; knowledge distillation learns knowledge from a larger model through a smaller model, but suffers from semantic information loss. These traditional methods have the following problems in machine translation tasks:

[0004] Insufficient semantic preservation: In machine translation tasks, traditional compression methods often delete or quantify semantically sensitive key parameters, which can easily lead to distortion of the semantic mapping from the source language to the target language, resulting in a significant loss of the bilingual evaluation substitute (BLEU) value of the translation result.

[0005] Limited compression efficiency: Due to the local search characteristics of classical optimization algorithms, traditional methods have difficulty finding the optimal compression scheme in high-dimensional parameter space, and the room for improvement in compression ratio is limited.

[0006] Imbalance between translation efficiency and quality: In pursuit of compression rate, traditional methods often sacrifice translation quality, or fail to achieve sufficient compression rate to preserve translation quality. This makes it impossible to simultaneously meet the needs of efficient compression and high-quality translation. Typically, when a high compression rate is achieved, the BLEU score will decrease significantly, affecting the translation quality. Summary of the Invention

[0007] The purpose of this invention is to provide a semantic compression method based on quantum computing to improve the efficiency and semantic preservation of machine translation.

[0008] According to the present invention, a semantic compression method based on quantum computing is provided, comprising the following steps:

[0009] S100 reconstructs the compression problem of machine translation models into a quadratic unconstrained binary optimization (QUBO) problem, including: constructing the objective function for the machine translation task as H=L. p (P)+β×L q (Q)-γ×R(P,Q)+δ×L bleu (P,Q), where Lp (P) represents pruning loss, L q (Q) represents the quantization loss, and R(P,Q) represents the compression ratio; L bleu (P,Q) are semantic preservation terms related to BLEU values, and β, γ and δ are task-adaptive hyperparameters; the machine translation model includes the attention mechanism module and the feedforward neural network module of the Transformer model.

[0010] S200 maps the pruning mask vector P and the quantization parameter vector Q to qubits.

[0011] S300, Optimize and solve the QUBO problem using a quantum annealing device to obtain a compressed machine translation model; S300 includes: S310, Hamiltonian initialization, including: determining parameter modules directly related to semantic mapping through attention weight analysis of the pre-trained machine translation model; assigning lower initial energy offsets to the qubits of such modules during Hamiltonian initialization to guide the quantum system to preferentially preserve their parameter integrity; for parameters with semantic dependencies between the encoder's bottom layer and the decoder's top layer, adding inter-layer coupling terms to the Hamiltonian to maintain their cooperative optimization state through strong interactions between qubits. S320, phased adiabatic evolution, including: Phase 1: Activating only the qubits related to attention head pruning, setting the evolution time, and quickly screening the core attention head through quantum tunneling effect; Phase 2: Activating all weight-pruned qubits and quantized bits, designing a segmented evolution path, including prioritizing the optimization of weights strongly correlated with BLEU values, introducing interaction terms between quantized bits and weighted bits, and adding compression ratio constraints; S330, parallel search and translation quality linkage evaluation, including: generating multiple compression schemes using the parallel sampling characteristics of the quantum annealing device, performing real-time BLEU evaluation on each scheme, and filtering out invalid schemes.

[0012] S400 performs semantic preservation evaluation and optimization on the compressed machine translation model to ensure that the compression rate and BLEU value of the compressed machine translation model meet the target compression rate and target BLEU value.

[0013] Compared with the prior art, the present invention has at least the following beneficial effects:

[0014] Based on the structural characteristics and semantic mapping mechanism of the Transformer model in machine translation, this invention reconstructs the compression problem of machine translation models into a quadratic unconstrained binary optimization (QUBO) problem. A semantic preservation term related to the BLEU value is introduced into the QUBO model to achieve multi-objective joint optimization of compression ratio, pruning loss, quantization loss, and translation quality. Leveraging the parallel optimization advantages of quantum computing, this invention achieves a significant quantum semantic compression factor (at least 10 times) while keeping the BLEU value loss within a small value (5%), significantly improving the efficiency and semantic preservation of machine translation, and providing a solution for efficient machine translation in resource-constrained environments. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0016] Figure 1 A flowchart illustrating a quantum computing-based semantic compression method provided in an embodiment of the present invention;

[0017] Figure 2 A comparative schematic diagram of the semantic compression method based on quantum computing provided in the embodiments of the present invention. Detailed Implementation

[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] According to this embodiment, as Figure 1 As shown, a semantic compression method based on quantum computing is provided, including the following steps:

[0020] S100 reconstructs the compression problem of machine translation models into a quadratic unconstrained binary optimization (QUBO) problem, including: constructing the objective function for the machine translation task as H=L. p (P)+β×L q (Q)-γ×R(P,Q)+δ×L bleu (P,Q), where L p (P) represents pruning loss, L q (Q) represents the quantization loss, and R(P,Q) represents the compression ratio; L bleu(P,Q) are semantic preservation terms related to BLEU values, and β, γ and δ are task-adaptive hyperparameters; the machine translation model includes the attention mechanism module and the feedforward neural network module of the Transformer model.

[0021] In this embodiment, the compression problem of the machine translation model is reconstructed into a quadratic unconstrained binary optimization (QUBO) problem, including: defining a pruning mask vector P={p m,n,i}, where p m,n,i =1 indicates that the i-th weight of the n-th attention head in the m-th layer of the machine translation model is pruned; define the quantization parameter vector Q={q m,k}, q m,k Let q be the k-th quantization parameter of the m-th layer. m,k =1 indicates that the original bit width of the m-th layer is removed by 2. k Bit.

[0022] In this embodiment, p m,n,i =0 indicates that the i-th weight of the n-th attention head in the m-th layer of the machine translation model is retained and not pruned.

[0023] In this embodiment, L p (P) Semantic importance calculation based on machine translation model weights, L p (P)=∑∑∑(A m,n,i ×p m,n,i )+∑∑∑∑(B m,n,i,j ×p m,n,i ×p m,n,j ), A m,n,i B is the pruning loss coefficient of the i-th weight of the n-th attention head in the m-th layer. m,n,i,j Let A be the coupling coefficient between the i-th weight of the n-th attention head in layer m and the j-th weight of the n-th attention head in layer m. Optional, A m,n,i Determined based on its semantic contribution to machine translation (e.g., through attention weight analysis); B m,n,i,j This reflects the correlation between the i-th weight of the n-th attention head in layer m and the j-th weight of the n-th attention head in layer m in the semantic mapping (e.g., obtained by obtaining the similarity between the two weights). It should be understood that ∑∑∑(A m,n,i ×p m,n,i ) represents the sum of direct losses from pruning individual weights, ∑∑∑∑(B m,n,i,j ×p m,n,i ×p m,n,j ) represents the sum of collaborative losses when two associated weights are pruned simultaneously; where the subscripts and superscripts of ∑ are omitted, indicating that all possible values ​​corresponding to the variable are summed, and the same applies below.

[0024] In this embodiment, L q(Q) Incorporating semantic sensitivity design for translation tasks, L q (Q)=∑∑(C m,k ×q m,k )+∑∑∑(D m,k,l ×q m,k ×q m,l ), C m,k D represents the self-loop coefficient of the quantization bit corresponding to the k-th quantization parameter of the m-th layer. m,k,l The quantization bits corresponding to the k-th quantization parameter of the m-th layer and the quantization bit of the m-th layer. l The interaction coefficients between quantized bits corresponding to each quantization parameter. ∑∑(C m,k ×q m,k ) represents the total loss due to the reduction in precision of a single bit, ∑∑∑(D m,k,l ×q m,k ×q m,l ) represents the sum of additional losses due to the simultaneous reduction of precision bits in both associated bits. Optional, C m,k The setting is based on the degree of influence of this bit on the translated semantics; D m,k,l Reflecting the k-th quantization parameter of the m-th layer and the m-th quantization parameter of the m-th layer l The synergistic effect of the precision bits corresponding to each quantization parameter in the semantic representation (which can be preset, e.g., |k- l When |=1, set it to a positive value; otherwise, set it to 0.

[0025] In this embodiment, R(P,Q)=∑∑∑(E) m,n,i ×p m,n,i )+∑∑(F m,k ×q m,k )+∑∑∑∑(G m,n,i,k ×p m,n,i ×q m,k E m,n,i F is the contribution coefficient of the pruning of the i-th weight of the n-th attention head in the m-th layer of the machine translation model to the compression ratio. m,k To remove 2 bits from the original bit width of the m-th layer k The contribution coefficient of bit to compression ratio, G m,n,i,k The i-th weight of the n-th attention head in the m-th layer of the machine translation model is pruned, and the original bit width of the m-th layer is removed by 2. k The contribution coefficient of bit interaction to compression ratio. Optional, E m,n,i F m,k and G m,n,i,k This is pre-set. ∑∑∑(E m,n,i ×p m,n,i ) represents the total volume reduction caused by pruning and deleting weights, ∑∑(F m,k ×q m,k) represents the total volume reduction resulting from the decrease in precision, ∑∑∑∑(G m,n,i,k ×p m,n,i ×q m,k ) represents the total additional volume reduction resulting from the combined effects of pruning and quantization.

[0026] In this embodiment, L bleu (P,Q)=-∑ (S,T)∈D [BLEU(S,T)-BLEU(S,T')], where D is the machine translation training set, (S,T) are source language-target language sentence pairs, T' is the translation result generated by the compression model, and BLEU() is used to obtain the BLEU value. Therefore, by comparing the BLEU values ​​of the original model and the compressed model, a semantic preservation loss term is constructed, which can guide the compression process to prioritize the retention of parameters that have a significant impact on translation quality.

[0027] S200 maps the pruning mask vector P and the quantization parameter vector Q to qubits.

[0028] In this embodiment, mapping the pruning mask vector P to qubits includes: for attention head pruning, p m,n,i =1 indicates that the nth attention head in the mth layer is pruned; for weight pruning, p m,n,i =1 indicates that the i-th weight of the n-th attention head in the m-th layer is pruned, and the pruning operation is represented as w'. m,n,i =(1-p m,n,i )×w m,n,i , where w m,n,i For the original weights, w' m,n,i The weights are calculated after pruning; mapping the quantization parameter vector Q to qubits includes: determining the quantization bit width b. m b m =b max -∑(q m,k ×2 k ), where b max q is the original bit width. m,k ∈{0,1}.

[0029] In this embodiment, the pruning mask parameter p is adjusted for the attention mechanism and feedforward network of the machine translation model. m,n,i Mapped to qubits; considering the sensitivity of machine translation to numerical precision, the quantization bit width b is... m It is mapped to qubits through binary encoding.

[0030] In this embodiment, q m,k ∈{0,1} represents the encoded bits, and the quantization precision of each layer is represented by tensor product combination, prioritizing the retention of parameter precision closely related to semantic mapping.

[0031] S300, the QUBO problem is optimized and solved using a quantum annealing device to obtain a compressed machine translation model.

[0032] In this embodiment, when mapping the constructed QUBO model to a quantum annealing device (such as the D-Wave system or Fujitsu Digital Annealer), the quantum annealing process is optimized from three aspects: Hamiltonian initialization, adiabatic evolution path design, and parallel search strategy, taking into account the sequence-to-sequence characteristics and semantic mapping complexity of machine translation. Preferably, S300 includes:

[0033] S310, Hamiltonian initialization, includes: determining parameter modules directly related to semantic mapping through attention weight analysis of the pre-trained machine translation model; assigning lower initial energy offsets to the qubits of such modules when initializing the Hamiltonian to guide the quantum system to prioritize the preservation of its parameter integrity; for parameters with semantic dependencies between the encoder bottom layer and the decoder top layer, adding inter-layer coupling terms to the Hamiltonian to maintain their cooperative optimization state through strong interactions between qubits.

[0034] As a specific implementation, the Hamiltonian initialization strategy includes semantic module priority ranking and cross-layer semantic association modeling. Semantic module priority ranking involves analyzing the attention weights of a pre-trained machine translation model to identify parameter modules directly related to semantic mapping (such as the encoder-decoder attention layer and the feedforward network of the target language generation layer). When initializing the Hamiltonian H0, the qubits of these modules are assigned a lower initial energy offset (e.g., setting A...). m,n,i (Negative values) guide the quantum system to prioritize preserving its parameter integrity. Cross-layer semantic association modeling: For parameters with semantic dependencies between the encoder's bottom layer and the decoder's top layer (such as the mapping weights between source language word embeddings and target language output word embeddings), add an inter-layer coupling term C to the Hamiltonian. cross-layer The co-optimized state is maintained through strong interactions between qubits (such as coupling coefficient C=0.8).

[0035] S320, a phased adiabatic evolution, includes: Phase 1: Activating only the attention head pruning-related qubits, setting the evolution time, and quickly screening the core attention head through the quantum tunneling effect; Phase 2: Activating all weight-pruned qubits and quantized bits, designing a segmented evolution path, including prioritizing the optimization of weights strongly correlated with BLEU values, introducing interaction terms between quantized bits and weighted bits, and adding compression rate constraints.

[0036] In this embodiment, the phased adiabatic evolution path design includes coarse-grained optimization using an attention mechanism (i.e., phase one) and fine-grained optimization using a weight-quantization joint approach (i.e., phase two).

[0037] As a specific implementation, the evolution time in Phase 1 is set to 50μs. Core attention heads are quickly screened through quantum tunneling effect. The specific constraints are: retaining attention heads that participate in source language entity recognition (such as heads that include named entity translation with a retention rate of ≥40%), and filtering out schemes that cause the loss of translated entities through classical BLEU evaluation (such as schemes with an entity translation error rate >10%).

[0038] As a specific implementation, all weight-pruned qubits and quantized bits are activated, and a segmented evolution path is designed with an evolution time of 200 μs: the first 30% of the evolution time is used to prioritize the optimization of weights strongly correlated with the BLEU value (e.g., A). m,n,i (weight >0.5), by increasing the energy of its qubit (such as setting A) m,n,i =2.0) to prevent pruning; 40% evolution time: introduce interaction terms between quantized bits and weighted qubits (e.g., setting the coupling coefficient G) m,n,i,k (e.g., 1.5), forcing high semantic importance weights to match higher quantization precision (e.g., b) m (6 bits or more); the last 30% of the evolution time: add a compression rate constraint term (the γ coefficient is dynamically increased to 0.3) to promote parameter compression while ensuring semantics.

[0039] S330, parallel search and translation quality linkage evaluation, includes: using the parallel sampling characteristics of quantum annealing devices to generate multiple compression schemes, performing real-time BLEU evaluation on each scheme, and filtering out invalid schemes.

[0040] As a specific implementation, multi-scheme quantum parallel generation includes: utilizing the parallel sampling characteristics of the D-Wave device (e.g., setting 32 reads) to simultaneously generate 32 compression schemes, each scheme corresponding to a different hyperparameter combination (e.g., δ is uniformly sampled in the range of 5.0~15.0). The real-time BLEU filtering mechanism includes: for each scheme output by quantum annealing, immediately performing translation inference on a small batch test set (e.g., 100 samples of English-French translation from WMT14), calculating the BLEU value and setting a real-time threshold: if BLEU < 38 (loss > 5% when the original value is 40), the qubit configuration corresponding to the scheme is marked as an invalid state and suppressed in the next round of annealing by increasing the penalty energy (e.g., setting δ to δ+1.0); if BLEU ≥ 38 and the compression ratio ≥ 10 times, the scheme is retained and the qubit coupling parameters are recorded for parameter initialization in subsequent annealing.

[0041] As a specific implementation method, the parallel search and translation quality linkage evaluation also includes cross-language parallel optimization. Cross-language parallel optimization includes: for the parallel tempering function of Fujitsu Digital Annealer, starting independent annealing copies for multilingual pairs (such as Chinese-English, English-German), each copy generates a unique compression scheme through language-specific semantic constraints (such as byte tensor product encoding for Chinese and word form change quantization rules for German), and finally selecting the universally optimal solution through cross-evaluation (such as the transfer of the Chinese-English scheme to the English-Chinese task BLEU).

[0042] This embodiment optimizes the qubit mapping method for the sequence-to-sequence characteristics of machine translation, designs an adiabatic evolution path suitable for the translation task, and leverages the advantages of quantum computing to quickly find the globally optimal solution that balances compression efficiency and translation quality.

[0043] S400 performs semantic preservation evaluation and optimization on the compressed machine translation model to ensure that the compression rate and BLEU value of the compressed machine translation model meet the target compression rate and target BLEU value.

[0044] Optionally, the target compression ratio is 10x and the target BLEU value is 5%. It should be understood that meeting the target compression ratio and target BLEU value means a compression ratio greater than or equal to 10x and a BLEU value less than or equal to 5%.

[0045] Optionally, S400 includes: dynamic hyperparameter tuning, including: initializing β (e.g., setting it to ∑∑∑A). m,n,i / ∑∑C m,k To balance the loss sensitivity of pruning and quantization at the start of optimization, γ=0.1, δ=10×β. If the BLEU loss after compression is >5%, increase β; if the compression ratio is <10 times, increase γ, and ensure that δ / γ≥20.

[0046] As a specific implementation, the dynamic hyperparameter adjustment algorithm includes initialization of β, γ, and δ, as well as binary search optimization. The binary search optimization includes: if the BLEU loss after compression is >5%, increasing β (step size 0.5) and re-quantum annealing until the loss is ≤5%; if the compression ratio is <10 times, increasing γ (step size 0.05), while ensuring that δ / γ ≥20 to balance semantic preservation.

[0047] Optionally, S400 also includes: cross-language adaptation, including: for byte-encoded languages, adding byte-level tensor product mapping to the quantization parameters; for inflectional languages, the decoder layer quantization bit width is reserved to at least 6 bits.

[0048] As a specific implementation, the cross-language adaptive strategy includes language-pair feature extraction and dynamic precision adjustment. Language-pair feature extraction includes: for byte-encoded languages ​​such as Chinese, adding byte-level tensor product mapping to the quantization parameters (e.g., each Chinese character corresponds to 4 bytes, and the byte vector direct product is represented by combining qubits); dynamic precision adjustment includes: for inflectional languages ​​such as German, due to rich lexical variations, adjusting the quantization bit width b in the decoder layer. m At least 6 (b) max=16 At that time, q m,0 to q m,2 Chinese q m,k =0), achieved through qubit constraints.

[0049] This embodiment improves the compression adaptability and semantic preservation capability of multilingual machine translation by adjusting the quantum optimization process according to the characteristics of different language pairs through adaptive hyperparameter search.

[0050] Based on the structural characteristics and semantic mapping mechanism of the Transformer model in machine translation, this embodiment reconstructs the compression problem of machine translation models into a quadratic unconstrained binary optimization (QUBO) problem. A semantic preservation term related to the BLEU value is introduced into the QUBO model to achieve multi-objective joint optimization of compression ratio, pruning loss, quantization loss, and translation quality. Leveraging the parallel optimization advantages of quantum computing, a significant quantum semantic compression factor (at least 10 times) is achieved while keeping the BLEU value loss within a small value (5%), significantly improving the efficiency and semantic preservation of machine translation, and providing a solution for efficient machine translation in resource-constrained environments.

[0051] As a specific implementation, for the translation task, four different language pair translation datasets were selected: IWSLT'14 German-English (German-English), OPUS-100 English-Italian (English-Italian), OPUS-100 English-Spanish (English-Spanish), and OPUS-100 English-Russian (English-Russian). For the German-English dataset, the training set contains approximately 160,000 samples, and the validation and test sets contain approximately 7,000 samples. Furthermore, byte pair encoding (BPE) with 10,000 tokens was used for preprocessing. For the three OPUS-100 datasets, the training set contains approximately 1 million samples, and the validation and test sets contain approximately 2,000 samples. Furthermore, byte pair encoding with 40,000 tokens was used for preprocessing, and the vocabulary for both the source and target languages ​​was shared.

[0052] The translation task was implemented using a Transformer model with 6 encoder and 6 decoder layers. All word embedding methods used the same model configuration, differing only in the word embedding layers. BLEU was used to evaluate the model's translation performance; a higher BLEU score indicates better performance. All word embedding compression methods were compared under the condition of compressing the original word embedding parameters by approximately 20 times.

[0053] This embodiment has been verified to achieve efficient compression and performance preservation based on the natural language translation task model. See [link / reference]. Figure 2 As shown. Specific evaluation indicators are as follows:

[0054] (1) For the IWSLT'14 German-English dataset, the word embedding parameters are compressed by about 20 times and the BLUE is 34.9, indicating that this embodiment can significantly reduce the parameter size and effectively maintain the translation quality in the translation task of low-resource language pairs.

[0055] (2) For the OPUS-100 English-Italian dataset, the word embedding parameters are compressed by about 20 times and the BLUE is 32.9, indicating that in the translation of Romance languages ​​with medium resources, the compression strategy of this embodiment has little impact on the model performance and is feasible for practical application.

[0056] (3) For the OPUS-100 English-Spanish dataset, the word embedding parameters are compressed by about 20 times and the BLUE is 39.1. The results show that for language pairs with relatively abundant resources, this embodiment can not only achieve efficient compression, but also maintain high translation accuracy of the model, which verifies the adaptability of this embodiment in different language resource scenarios.

[0057] (4) For the OPUS-100 English-Russian dataset, the word embedding parameters are compressed by about 20 times and the BLUE is 33.9. This shows that in cross-language (Indo-European to Slavic) translation tasks, this embodiment can still maintain stable translation performance with significant parameter compression, demonstrating its robustness to language differences.

[0058] While specific embodiments of the invention have been described in detail by way of example, those skilled in the art should understand that the examples are for illustrative purposes only and not intended to limit the scope of the invention. It should also be understood that various modifications can be made to the embodiments without departing from the scope and spirit of the invention. The scope of the invention is defined by the appended claims.

Claims

1. A semantic compression method based on quantum computing, characterized in that, Includes the following steps: S100 reconstructs the compression problem of machine translation models into a quadratic unconstrained binary optimization (QUBO) problem, including: constructing the objective function for the machine translation task as H=L. p (P)+β×L q (Q)-γ×R(P,Q)+δ×L bleu (P,Q), where L p (P) represents pruning loss, L q (Q) represents the quantization loss, and R(P,Q) represents the compression ratio; L bleu (P,Q) are semantic preservation terms related to BLEU values, and β, γ, and δ are task-adaptive hyperparameters; the machine translation model includes an attention mechanism module and a feedforward neural network module of the Transformer model; S200 maps the pruning mask vector P and the quantization parameter vector Q to qubits; S300, Optimize and solve the QUBO problem using a quantum annealing device to obtain a compressed machine translation model; S300 includes: S310, Hamiltonian initialization, including: determining parameter modules directly related to semantic mapping through attention weight analysis of the pre-trained machine translation model; assigning lower initial energy offsets to the qubits of such modules during Hamiltonian initialization to guide the quantum system to preferentially preserve their parameter integrity; for parameters with semantic dependencies between the encoder's bottom layer and the decoder's top layer, adding inter-layer coupling terms to the Hamiltonian to maintain their cooperative optimization state through strong interactions between qubits. S320, phased adiabatic evolution, including: Phase 1: Activating only the qubits related to attention head pruning, setting the evolution time, and quickly screening the core attention head through quantum tunneling effect; Phase 2: Activating all weight-pruned qubits and quantized bits, designing a segmented evolution path, including prioritizing the optimization of weights strongly correlated with BLEU values, introducing interaction terms between quantized bits and weighted bits, and adding compression ratio constraints; S330, parallel search and translation quality linkage evaluation, including: generating multiple compression schemes using the parallel sampling characteristics of the quantum annealing device, performing real-time BLEU evaluation on each scheme, and filtering out invalid schemes; S400 performs semantic preservation evaluation and optimization on the compressed machine translation model to ensure that the compression rate and BLEU value of the compressed machine translation model meet the target compression rate and target BLEU value.

2. The semantic compression method based on quantum computing according to claim 1, characterized in that, In Phase 1, the evolution time is set to 50μs. Attention heads participating in source language entity recognition are retained with a retention rate of ≥40%, and schemes with an entity translation error rate >10% are filtered out. In Phase 2, the evolution time is 200μs. The first 30% of the evolution time is used to optimize weights that are strongly correlated with BLEU values, the middle 40% of the evolution time introduces the interaction term between quantization bits and weight bits, and the last 30% of the evolution time adds a compression rate constraint term.

3. The semantic compression method based on quantum computing according to claim 1, characterized in that, S400 includes: dynamic hyperparameter adjustment, including: initializing β, γ=0.1, δ=10×β, if the BLEU loss after compression is >5%, increase β; if the compression ratio is <10 times, increase γ, and ensure that δ / γ≥20.

4. The semantic compression method based on quantum computing according to claim 1, characterized in that, S400 includes: cross-language adaptation, including: for byte-encoded languages, adding byte-level tensor product mapping to the quantization parameters; for inflectional languages, the decoder layer quantization bit width is reserved to at least 6 bits.

5. The semantic compression method based on quantum computing according to claim 1, characterized in that, L bleu (P,Q)=-∑ (S,T)∈D [BLEU(S,T)-BLEU(S,T')], where D is the machine translation training set, (S,T) is the source language-target language sentence pair, T' is the translation result generated by the compression model, and BLEU() is used to obtain the BLEU value.

6. The semantic compression method based on quantum computing according to claim 1, characterized in that, The compression problem of machine translation models is reconstructed into a quadratic unconstrained binary optimization QUBO problem, including: defining a pruning mask vector P={p m,n,i }, where p m,n,i =1 indicates that the i-th weight of the n-th attention head in the m-th layer of the machine translation model is pruned; define the quantization parameter vector Q={q m,k }, q m,k Let q be the k-th quantization parameter of the m-th layer. m,k =1 indicates that the original bit width of the m-th layer is removed by 2. k Bit.

7. The semantic compression method based on quantum computing according to claim 6, characterized in that, S200 includes: mapping the pruning mask vector P to qubits; the pruning operation is represented as w'. m,n,i =(1-p m,n,i )×w m,n,i , where w m,n,i For the original weights, w' m,n,i The weights are calculated after pruning; mapping the quantization parameter vector Q to qubits includes: determining the quantization bit width b. m b m =b max -∑(q m,k ×2 k ), where b max q is the original bit width. m,k ∈{0,1}.

8. The semantic compression method based on quantum computing according to claim 7, characterized in that, L p (P)=∑∑∑(A m,n,i ×p m,n,i )+∑∑∑∑(B m,n,i,j ×p m,n,i ×p m,n,j ), A m,n,i B is the pruning loss coefficient of the i-th weight of the n-th attention head in the m-th layer. m,n,i,j It is the coupling coefficient between the i-th weight of the n-th attention head in the m-th layer and the j-th weight of the n-th attention head in the m-th layer.

9. The semantic compression method based on quantum computing according to claim 7, characterized in that, L q (Q)=∑∑(C m,k ×q m,k )+∑∑∑(D m,k,l ×q m,k ×q m,l ), C m,k D represents the self-loop coefficient of the quantization bit corresponding to the k-th precision quantization parameter of the m-th layer. m,k,l The quantization bits corresponding to the k-th quantization parameter of the m-th layer and the quantization bit of the m-th layer. l The interaction coefficients between quantized bits corresponding to each quantization parameter.

10. The semantic compression method based on quantum computing according to claim 7, characterized in that, R(P,Q)=∑∑∑(E m,n,i ×p m,n,i )+∑∑(F m,k ×q m,k )+∑∑∑∑(G m,n,i,k ×p m,n,i ×q m,k E m,n,i F is the contribution coefficient of the pruning of the i-th weight of the n-th attention head in the m-th layer of the machine translation model to the compression ratio. m,k To remove 2 bits from the original bit width of the m-th layer k The contribution coefficient of bit to compression ratio, G m,n,i,k The i-th weight of the n-th attention head in the m-th layer of the machine translation model is pruned, and the original bit width of the m-th layer is removed by 2. k The contribution coefficient of bit interaction to compression ratio.