Introduction
Standard sequence-to-sequence (seq2seq) models, widely used in tasks like machine translation and text simplification, typically employ a "reactive" attention mechanism. In these architectures, the model determines which part of the input to focus on at each individual decoding step. While effective for local alignment, this approach makes it difficult to control global characteristics of the output, such as sentence length, syntactic complexity, or specific stylistic attributes. This paper introduces a novel framework that treats the attention mechanism as a structural "blueprint" that can be planned before the decoding process begins.
Methodology
The core innovation is the use of a Conditional Variational Autoencoder (CVAE) to learn and generate attention matrices. The process involves two primary stages:
- Initial Training: A standard attention-based seq2seq model is trained on a parallel corpus to generate "gold standard" attention matrices that represent natural alignments between source and target sequences.
- CVAE Integration: These attention matrices are treated as 2D grayscale images. A CVAE is then trained to learn the distribution of these matrices, conditioned on the source sentence encoding.
At inference time, instead of calculating attention dynamically, the model samples a latent vector $z$ from the learned space. This vector is decoded into a "Prior Attention" matrix, which serves as a fixed guide for the seq2seq decoder. This decoupling of structural planning from word-level execution allows researchers to "steer" the model's output by navigating different regions of the latent space.
Experimental Setup
The researchers evaluated the model on the task of Text Simplification, which requires reducing linguistic complexity while preserving core meaning. They utilized the Wikilarge dataset, containing approximately 296,000 sentence pairs from standard and Simple English Wikipedia. Performance was measured using BLEU scores for fluency and SARI scores, which specifically evaluate simplification quality (additions, deletions, and keepings).
Key Results and Controllability
The "Prior Attention" model demonstrated superior performance over standard baselines. It achieved a SARI score of 38.30, a significant improvement over the 33.06 achieved by a standard seq2seq model. The BLEU score also saw a modest increase to 90.14.
Beyond raw metrics, the model provides a high degree of controllability. By visualizing the 2D latent space ($z_1, z_2$), the authors showed that different regions correspond to distinct stylistic outcomes. For instance, one axis might predominantly control the degree of paraphrasing, while another influences the level of content deletion.
As shown in the heatmaps above, metrics like output length and readability (FKGL) vary smoothly across the latent space. This confirms that the model has learned a structured representation of style, allowing users to select a point in the latent space to achieve a desired output length or complexity level from the same input sentence.
Conclusion and Future Work
By treating attention as a generative image, this work provides a powerful mechanism for style-aware text generation. The ability to pre-plan sentence structure prevents the model from losing global coherence during long decodes. While currently demonstrated on text simplification, future research could extend this "Prior Attention" approach to more complex style transfer tasks, such as altering sentiment or persona, provided that representative attention patterns can be learned for those domains.
Summary updated