Adaptive Transformer Lexical Constraints in Poetry Translation
作者:佚名 时间:2026-07-25
This research introduces an Adaptive Transformer Lexical Constraints framework designed to solve longstanding gaps in poetry translation, where generic Transformer models often prioritize fluency and semantic accuracy over the strict multi-dimensional poetic requirements of rhyme, metre, cultural imagery preservation, and stylistic consistency. Moving beyond inflexible static lexical constraints, the system dynamically adjusts attention weights and decoding thresholds via a weighted multi-dimensional feature screening mechanism and genre-aligned penalty logic, rather than relying solely on probabilistic token prediction. Empirical testing across 1,200 parallel poetry translation pairs shows the model boosted allusion preservation rates by 22.7% and rhyme matching rates by 18.3%, with strong cross-genre, cross-lingual generalizability for regulated verse, free verse, and sonnets. This modular, low-retraining framework balances artistic form and semantic fidelity, advancing accessible automated literary preservation while offering a blueprint for integrating explicit domain rules into NLP generation.
Chapter 1 Introduction
Poetry translation is a difficult problem in computational linguistics that needs to be solved by combining the accuracy of meaning with artistic beauty. Versification is not the same as ordinary technical translation; it needs to follow a specific rhyme scheme, metre and rhythm, and is therefore a very constrained generation problem. The old neural machine translation systems have always focused on fluency and content preservation, so they have overlooked these structural details. Therefore, the output often cannot retain the poetic form, and although the translated text accurately expresses the meaning, it lacks the necessary musicality and structural beauty of the original work. Therefore, new methods need to be developed that can strictly control the lexicon and rhythm in the decoding stage without losing the flow of language [1].
The problem is relatively serious, and therefore, Adaptive Transformer Lexical Constraints will be employed. In short, this way adds a dynamic constraint to the attention score and decoding process of the original Transformer. A constrained beam search is employed to generate the next possible tokens, and these candidates are not only ranked according to their probability but also filtered based on structural rules, such as the number of target syllables and rhyming phonemes. The model will adjust the way it generates words according to the strict aesthetic rules and context of use. Therefore, it is no longer a problem of probabilistic prediction but rather a guided optimisation problem to ensure both the accuracy of meaning and correctness of form.
In practice, the value of this technology is far-reaching and has begun to be used for the preservation and spread of culture around the world. To reduce the cognitive load on human translators, some systems have begun to automate the construction of poetic structures and are able to produce verse in many languages quickly. It can also be used to enforce the lexical constraints of other specialised areas more strictly, such as in automated creative writing and the preservation of endangered literary forms. This technical progress is a first step towards bridging the gap between human artistic creation and the efficiency of algorithms in natural language processing.
Chapter 2 Conceptual Definition and Literature Review of Transformer-Based Poetry Translation
2.1 Core connotations of lexical constraints in poetry translation
Lexical constraints in poetry translation are not the same as those in general machine translation; they have a rigid, multi-dimensional structure and meaning that goes beyond semantic equivalence. The three connected factors that are necessary for the wholeness of a poem are as follows: First, due to the form of the language, there are restrictions on how many syllables a word can have, which rhymes are allowed, and what kind of rhythm is typical in poetry. Secondly, semantic constraints aim to keep the original images, cultural references and emotional connotations of the source text in the translation; that is to say, it should still have the same artistic effect as the original. Thirdly, there are style constraints; that is to say, the choice of words should be in line with the ancient, concise or lyrical style of the original poem, and modern or colloquial language should not be used to avoid breaking the aesthetic unity. To make the above definitions more concrete, let us consider the translation of classical Chinese poetry; in this case, the specific source term "yue" (moon) should not only be translated as a celestial body but also needs to be replaced with target lexical pairs such as "bright orb" or "silver disc" to meet the requirements of rhyme and rhythm and maintain the romantic mood. A word that means sadness may need to be replaced with an old synonym such as "woe" or "grief" for style. As shown in the above examples, the output is limited by several rules at the same time; thus, a strict definition has been laid for the following technical design of adaptive mechanisms in the translation model.
2.2 Limitations of generic Transformer models in preserving poetic lexical features
The general Transformer model has been optimised to improve the fluency of high-frequency semantics in the general domain, but it is not suitable for translating poetry because its purpose does not match the special requirements of poetic language. At the root of this problem is the standard cross-attention mechanism; it gives more weight to likely word sequences to ensure that the grammar is correct and the text is easy to understand. However, this probability-driven way is naturally unfavourable to the low-frequency and aesthetically important poetic lexicon. As a result, there is a systematic failure to preserve the culturally specific images; thus, some unique metaphors are lost in translation, and much of the rhyme-related vocabulary needed to maintain the sound structure of the original text is omitted. Generic models are also too simple in their expression of emotions; thus, the output is more like plain prose than poetry and lacks the special charm of literature. Based on the theory above, an empirical study of 300 randomly selected generic Transformer outputs for classical Chinese poetry translation shows that there are many errors, and the most common ones are lexical omission and semantic flattening. The reason for the repeated failure of preservation is that there is no special lexical screening and regulation module for poetry in the model. Without a way to guide the decoding process to select poetic words explicitly, the model will use practical language by default. Therefore, the addition of specific lexical constraints is not merely an improvement but a necessary way to ensure that the translation retains the structure and style of poetry in the original work.
表1 Limitations of Generic Transformer Models in Preserving Poetic Lexical Features
2.3 Current research gaps between adaptive constraint mechanisms and poetry translation performance
At present, most of the research on adding lexical constraints to Transformer-based poetry translation has been conducted in a hard or static manner. Therefore, the generated vocabulary list or rule set for the model is fixed in advance. Although it includes the required terms, the operating process is inflexible; that is to say, the constraint thresholds are fixed and do not vary according to different characteristics of the input text. As a result, these systems are unable to adjust to the different lexical densities of various types of poetry; thus, they may be forced to merge and lose their flow, or essential stylistic features will be missing. In addition, the current model does not distinguish between the importance of formal, semantic and stylistic constraints; thus, they are all given the same weight and fail to meet the specific requirements of different poems. Therefore, the translated text is too general and cannot express the subtle artistic conception in the original work. There is also an excessive dependence on manual pre-input of constraint rules, and thus it lacks the automation and scalability required for actual use.
The above deficiencies indicate that there are three problems in the existing research that this paper will address. First of all, there is no weighted selection mechanism for multi-dimensional poetic lexical features that can intelligently filter and rank vocabulary according to various linguistic attributes. Secondly, the current system does not have an automatic threshold adjustment function that can be adjusted according to different types of poetry, and therefore still uses fixed parameters. Thirdly, there has been no systematic cross-genre verification of the effect of adaptive constraints to confirm that they work in all styles. The identified deficiencies clearly show that the proposed research is needed and innovative; thus, it will provide a basis for building more responsive and context-aware translation systems.
Chapter 3 Construction and Empirical Analysis of Adaptive Transformer Lexical Constraints for Poetry Translation
3.1 Framework design of adaptive lexical constraint modules targeting poetic lexical attributes
3.1.1 Weighted screening mechanism for multi-dimensional poetic lexical features
To better realise the function of the adaptive lexical constraint module, a weighted selection method is employed to select five specific and measurable poetic lexical feature dimensions: allusion relevance, imagery novelty, rhyme harmony, emotional strength and formal syllable correspondence. The first is that a combined priority value for all the source vocabulary items will be calculated according to the above factors. The first step of the operating procedure is to set the feature scoring rules and then evaluate each lexical token in the source poem according to the five indicators. For example, to determine the relevance of allusions, one can count how often a token appears in the classical literary corpus; to measure the distinctiveness of imagery, distributional semantics are used to find word co-occurrences with low probability. A trainable weight assignment logic is used after that. A multi-layer perceptron is employed in the system to take the source context as input and dynamically produce different weights for each feature dimension. Therefore, the model can assign higher priority scores to lexicons that are more artistically significant in a particular poetic environment, such as rhyme alignment for sonnets and emotional expression for lyrics. Technically, it is directly connected to the source text embedding layer of the Transformer. Multiply the composite priority scores by the input embeddings to increase the semantic vectors of high-priority poetic lexicons and decrease those of low-priority common words. In the decoding process, this vector operation will cause the attention mechanism to ignore noise and give more weight to the important lexicon. This Design can meet the artistic requirements of the translation model and maintain fluency; it is a general way to add linguistic attributes to Neural Machine Translation.
3.1.2 Dynamic constraint threshold adjustment sub-module matching poetic genres
The genre-aligned dynamic threshold adjustment sub-module is to adjust the constraints flexibly based on different styles of poetry to achieve a good balance between semantic accuracy and language fluency. At the basic level, this module starts by loading a tagged multi-genre poetic corpus and divides the source texts into several categories, such as fixed-length regulated classical Chinese poetry, free verse, narrative poetry, etc. This division can help the system know about the particular lexical constraint priority rules in each genre and thus make sure that the translation mechanism meets the specific structural and artistic needs of the original work.
The main working method is to change the degree of strictness for lexical constraint enforcement in the decoding process automatically. Fixed-length regulated classical poetry needs to keep the images, rhythm and allusions in the original work, so a relatively high 95% semantic preservation threshold is used in this module. To prevent the loss of rich cultural connotations in condensation, it should be relatively free. On the other hand, for free verse, which aims to be easily understood and emotionally appealing in the target language, a relatively loose 75% formal constraint threshold is set. To avoid being too restrictive and causing the target language to be unnatural or forced, it is not very strict. Change the above thresholds to adjust the extent of the aesthetic effect and grammatical correctness in the generated text dynamically. To make the operation more convenient, specific examples of threshold values for the three kinds of poetry are shown in a table to provide some reference for the constraint parameters in the decoding stage of the model.
3.2 Comparative experiment on translation performance of constrained and unconstrained Transformer models
3.2.1 Experimental setup and evaluation indicator system covering form and semantics
To verify the effect of the proposed adaptive lexical constraint mechanism more reliably, a control experiment was carried out. The basis for the above empirical analysis is a relatively large set of 1200 parallel classical Chinese poetry and English translation pairs. The sources of these samples are all from the professional literary translation corpus that is open to the public, and they have good language quality and authentic style characteristics for training and testing. For the comparison framework, there are two kinds of models in the experimental setup: a baseline unconstrained general Transformer and the proposed adaptive Transformer lexical constraint model. Both models start with the same hyper-parameters to ensure fairness in the comparison, and the adaptive model has added some specific constraint algorithms to control the target vocabulary during decoding.
In addition to being smooth, the translated text should also meet the requirements of form and meaning in a two-part assessment system. The first is an automatic index of the general accuracy of translation, BLEU score; the second includes specific technical indicators such as rhyme matching rate and allusion preservation rate. The above specific indicators are used to determine how well the model conforms to the strict form and cultural connotations of classical poetry. In addition to the above automatic methods, a group of 15 qualified literary translators will also be employed to evaluate the quality manually. The above experts will judge the completeness of the pictures, the uniformity of style and other aspects of poetic aesthetics in the generated texts. By combining the precision of automated calculation with the expertise of people, this experiment will be able to evaluate both the accuracy of technical translation and the preservation of artistic value.
3.2.2 Analysis of case translation results for classical Chinese poetry to English translation
A comparison experiment of translation performance can help us learn more about how well the adaptive constrained Transformer model works compared to the unconstrained baseline in the specific scenario of translating classical Chinese poetry into English. At the basic level, it is to determine how well the proposed model can incorporate the given lexical constraints into the generative sequence without affecting the general flow of syntax. Based on the statistics, it can be seen that the experiment has improved all the main indicators significantly. Specifically, the adaptive model increased the allusion preservation rate by 22.7% and ensured that culturally specific references were accurately retained instead of being generalised or lost. In addition, the model had an 18.3% higher rhyme matching rate, showing that it has met the phonological requirements of poetry; at the same time, the average manual poetic aesthetic score increased by 0.82 points, and the perceived literary quality of the output has also risen.
In addition to the above indicators, eight typical difficult classical Chinese poems are presented in a side-by-side case study to show how this mechanism works in practice. By comparing the output of the general Transformer, the adaptive constraint model and professional human reference translation, it can be seen that the main function of the constraint mechanism is to retain essential poetic lexicons that the general model often mistranslates or omits due to statistical probability bias in the training data. However, based on the above analysis, there are still some problems with the model; that is to say, it cannot handle highly ambiguous metaphors or complex tonal patterns well and is too rigid in terms of syntax. Based on the above results, it can be concluded that the current functional scope of the system is limited; although the model has strengthened control over semantics and style, it performs best when there are specific lexical goals rather than open-ended creative interpretation.
3.3 Validation of the adaptive constraint mechanism’s generalization across different poetic text types
To test whether the adaptive constraint mechanism can be generalised, three different sets of data are used in this paper for cross-domain evaluation: English-to-French sonnets, modern Chinese free verse to English and Tang Dynasty narrative poetry to English. A fixed-constraint system is not rigid; therefore, a dynamic genre threshold adjustment sub-module has been added to the framework to maintain stability in all kinds of poetic structures. According to the complexity of the syntax in the input text, this way will be taken to change the constraint penalty coefficient. The optimisation goal is to minimise the negative log-likelihood plus a penalty term, as shown below:
In this formulation, is the model parameters, is the probability of the target token, and is the dynamic penalty coefficient specific to the genre . The term is an indicator function that is triggered when the generated token does not meet the constraint in the constraint set . Therefore, it will not be too restrictive for free verse or too loose for structured forms such as sonnets. The implementation logic of this adaptation is as follows:
According to the empirical results, all the test sets have shown good performance and increased the rate of constraint satisfaction without reducing translation fluency. It can be seen that the adaptive Transformer lexical constraint framework is applicable to other language pairs and types of poetic texts without needing to be retrained from scratch for the entire model; thus, it has good practical value.
Chapter 4 Conclusion
In short, the addition of adaptive lexical constraints to the Transformer model is a new development in computational linguistics that can address the problem of how to balance the meaning and form of poetry in translation. In other words, this way is to change the decoding part of the neural network and add some target words dynamically without losing the context information of the model. A constrained beam search is employed to alter the probability distribution of output tokens adaptively in light of the current state of inference, and it is necessary to give precedence to mandatory lexical choices while keeping the generated language natural. At the same time, a mask is applied to the logits and they are normalised again to guide the model to follow certain rhyming schemes, rhythmic patterns or culturally important terms that are often omitted in the standard unconstrained translation.
The operation process of this way is modular, and it is not necessary to retrain the whole model with a large number of paired poetic texts. It is to be used after training or as a fine-tuning step in the inference process. It is relatively easy to change and can be modified according to the style requirements of translators or systems. There will be some applications of this study in practice. To reduce the rigidity of fixed lexical constraints and lessen the need for manual post-editing in literary translation, automation has been introduced. It can be seen that neural machine translation is suitable for the task of high-context, creative translation, and it will not be a literal translation but will retain the artistic charm of the original text. Finally, this paper will provide an ordinary way to add explicit linguistic rules to neural models and connect statistical probability with the prescriptive nature of poetic creation, using a pre-trained Transformer as the backbone model to make the translation satisfy domain-specific lexical constraints in low-resource settings [4].
References
\[1\]Kondo, Seiichiro, Komachi, Mamoru. TMU NMT System with Automatic Post-Editing by Multi-Source Levenshtein Transformer for the Restricted Translation Task of WAT 2022[C]. 2022-01-01.
\[2\]Gangwani, Ronit, Kumaraguru, Diksha, Sawant, Ananya C.. Improving Machine Translation With PPO and Token-Adaptive Early Exit in Transformer-Based Models[J]. IEEE ACCESS, 2026, 14: 53336-53359.
\[3\]Jawahar, Ganesh, Mukherjee, Subhabrata, Li, Xiaodong. AutoMoE: Heterogeneous Mixture-of-Experts with Adaptive Computation for Efficient Neural Machine Translation[C]. 2023-01-01.
\[4\]Chen, Fan, Fang, Yongming, Man, Xuedong. Text Prompt Translation for Zero Shot Prediction under Lexical Constraint in Aviation Domain[C]. 2023-01-01.
