LaPA$^2$: Length-Aware Prefix and Prompt Attention Augmentation for Long-Form Controllable Text Generation

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Yang, Jiabing, Chen, Yixiang, Wen, Zichen, Cui, Chenhang, Li, Peiyan, Xu, Yuan, Fang, Bowen, Yu, Tao, Lin, Ruikang, Huang, Yan, Wang, Liang
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866910224103768064
author Yang, Jiabing
Chen, Yixiang
Wen, Zichen
Cui, Chenhang
Li, Peiyan
Xu, Yuan
Fang, Bowen
Yu, Tao
Lin, Ruikang
Huang, Yan
Wang, Liang
author_facet Yang, Jiabing
Chen, Yixiang
Wen, Zichen
Cui, Chenhang
Li, Peiyan
Xu, Yuan
Fang, Bowen
Yu, Tao
Lin, Ruikang
Huang, Yan
Wang, Liang
contents Prefix-based methods have emerged as a promising paradigm for Controllable Text Generation (CTG) due to their parameter efficiency. However, while effective in short sequences, their controllability tends to diminish as the generated sequence grows. In this paper, we identify Attention Dilution as a key factor behind this phenomenon: as the sequence length increases, the attention allocated to the control signal naturally decays due to the softmax mechanism, leading to a "fading" control effect. To address this, we propose LaPA$^2$ (Length-aware Prefix and Prompt Attention Augmentation), a training-free and model-agnostic framework designed to sustain robust control in long contexts. Specifically, LaPA$^2$ employs Length-Aware Logarithmic Scaling to dynamically amplify prefix attention weights, mathematically counteracting the dilution effect, while an optional Contextual Anchor Reinforcement applies synchronized augmentation to prompt tokens, preserving semantic coherence when strong attribute control risks overshadowing the original prompt. LaPA$^2$ is versatile, supporting both soft prefixes (continuous embeddings) and hard prefixes (discrete instructions). Experiments on multiple CTG tasks demonstrate that LaPA$^2$ consistently improves the performance of various prefix-based methods in long-form settings, leading to superior attribute controllability while preserving content relevance and fluency. Our code and data are publicly available at https://github.com/jiabingyang01/LaPA2.
format Preprint
id arxiv_https___arxiv_org_abs_2508_04047
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle LaPA$^2$: Length-Aware Prefix and Prompt Attention Augmentation for Long-Form Controllable Text Generation
Yang, Jiabing
Chen, Yixiang
Wen, Zichen
Cui, Chenhang
Li, Peiyan
Xu, Yuan
Fang, Bowen
Yu, Tao
Lin, Ruikang
Huang, Yan
Wang, Liang
Computation and Language
Prefix-based methods have emerged as a promising paradigm for Controllable Text Generation (CTG) due to their parameter efficiency. However, while effective in short sequences, their controllability tends to diminish as the generated sequence grows. In this paper, we identify Attention Dilution as a key factor behind this phenomenon: as the sequence length increases, the attention allocated to the control signal naturally decays due to the softmax mechanism, leading to a "fading" control effect. To address this, we propose LaPA$^2$ (Length-aware Prefix and Prompt Attention Augmentation), a training-free and model-agnostic framework designed to sustain robust control in long contexts. Specifically, LaPA$^2$ employs Length-Aware Logarithmic Scaling to dynamically amplify prefix attention weights, mathematically counteracting the dilution effect, while an optional Contextual Anchor Reinforcement applies synchronized augmentation to prompt tokens, preserving semantic coherence when strong attribute control risks overshadowing the original prompt. LaPA$^2$ is versatile, supporting both soft prefixes (continuous embeddings) and hard prefixes (discrete instructions). Experiments on multiple CTG tasks demonstrate that LaPA$^2$ consistently improves the performance of various prefix-based methods in long-form settings, leading to superior attribute controllability while preserving content relevance and fluency. Our code and data are publicly available at https://github.com/jiabingyang01/LaPA2.
title LaPA$^2$: Length-Aware Prefix and Prompt Attention Augmentation for Long-Form Controllable Text Generation
topic Computation and Language
url https://arxiv.org/abs/2508.04047