Dynamic Evaluation Architecture for Long Text Generation Using Enhanced Transformer-Xl and Adversarial Feedback Mechanisms
Abstract
As natural language generation technology expands to long-text scenarios, existing models face significant semantic coherence and contextual consistency challenges. The fixed-length attention mechanism limits traditional generative models and struggles to effectively capture long-distance dependencies, leading to logical breaks or duplicate redundancy in the generated text. To address this issue, this study proposes a dynamic evaluation framework that integrates Transformer-XL and confrontation training. By integrating the recurrent memory mechanism and real-time discriminant feedback, a closed-loop system for generation and evaluation collaborative optimization is constructed. At the model architecture level, Transformer-XL's segmented loop mechanism is used to extend the context window to 4096 characters. Compared with the 512-character limit of the traditional Transformer model, the remote dependency modeling ability is improved by 3.8 times, and it realizes the transfer and reuse of hidden states between different text fragments with the help of cyclic memory mechanism and relative position encoding, solving the problem of context fragmentation. At the same time, a dual-channel confrontation training strategy is designed, and the generator generates text segment by paragraph based on dynamic memory units. The discriminator calculates semantic consistency scores and logical conflict probabilities in real-time through a multi-granularity evaluation module to trigger adversarial loss backpropagation per 256 characters generated.In terms of method details, data preprocessing is carried out on a dataset containing 50,000 novel chapters and 24,000 academic abstracts: novel chapters are labeled with NLTK segments and spaCy entities, and are divided into 512 length sequences by paragraph and contextual association is preserved. The scholarly abstract uses BPE word segmentation to extract structured elements such as research questions. The training is conducted in a mixed batch (the ratio of new chapter to summary data is 7:3), and the training set, validation set, and test set are divided into 8:1:1. Key hyperparameters include Transformer-XL's 12-layer encoder, 768-dimensional model dimension, 12-head attention, and 1024 memory cache size; confrontation training perturbation amplitude 0.001, discriminator is a 3-layer CNN architecture (convolutional kernel size 3/5/7), etc. The experiment uses the above dataset, and the results show that the text coherence index (semantic similarity based on BERT) of the framework reaches 89.7%, which is 12.3 percentage points higher than the benchmark model. Logical coherence was evaluated using logical error rate, which was manually evaluated to show a logical error rate drop from 17.6% to 6.9% and 89.5% plot consistency when generating text longer than 2,000 characters. In addition, the dynamic intervention of adversarial discriminators effectively inhibited 38.4% of semantic offset events during model generation, and the terminology accuracy reached 82.9% in scientific literature generation tasks, which was 28.7% higher than that of traditional confrontation training methods. Ablation experiments show that removing the dynamic evaluation module reduces the local-global consistency score of the generated long text by 19.3%, validating the real-time evaluation mechanism for long textDOI:
https://doi.org/10.31449/inf.v49i27.10059Downloads
Published
How to Cite
Issue
Section
License
I assign to Informatica, An International Journal of Computing and Informatics ("Journal") the copyright in the manuscript identified above and any additional material (figures, tables, illustrations, software or other information intended for publication) submitted as part of or as a supplement to the manuscript ("Paper") in all forms and media throughout the world, in all languages, for the full term of copyright, effective when and if the article is accepted for publication. This transfer includes the right to reproduce and/or to distribute the Paper to other journals or digital libraries in electronic and online forms and systems.
I understand that I retain the rights to use the pre-prints, off-prints, accepted manuscript and published journal Paper for personal use, scholarly purposes and internal institutional use.
In certain cases, I can ask for retaining the publishing rights of the Paper. The Journal can permit or deny the request for publishing rights, to which I fully agree.
I declare that the submitted Paper is original, has been written by the stated authors and has not been published elsewhere nor is currently being considered for publication by any other journal and will not be submitted for such review while under review by this Journal. The Paper contains no material that violates proprietary rights of any other person or entity. I have obtained written permission from copyright owners for any excerpts from copyrighted works that are included and have credited the sources in my article. I have informed the co-author(s) of the terms of this publishing agreement.
Copyright © Slovenian Society Informatika







