Controllable Text Generation with Residual Memory Transformer
Hanqing Zhang, Sun Si, Haiming Wu, Dawei Song
TL;DR
The paper tackles controllable text generation (CTG) for large causal language models by introducing a non-intrusive, lightweight control plug-in called Residual Memory Transformer (RMT). RMT uses an encoder–decoder architecture to encode control signals and fuse them with a frozen CLM's generation through residual learning, enabling control at arbitrary steps with minimal overhead. Key contributions include a detailed RMT design with three targeted attention streams, a denoising auto-encoder pre-training regime, and task-specific fine-tuning that achieves competitive or superior control on word inclusion, length control, and sentiment, while preserving text quality and generation speed. The approach offers a flexible, parameter-efficient path to augment existing CLMs without full model fine-tuning, with potential for extension to retrieval-augmented or multimodal generation.
Abstract
Large-scale Causal Language Models (CLMs), e.g., GPT3 and ChatGPT, have brought great success in text generation. However, it is still an open challenge to control the generation process of CLM while balancing flexibility, control granularity, and generation efficiency. In this paper, we provide a new alternative for controllable text generation (CTG), by designing a non-intrusive, lightweight control plugin to accompany the generation of CLM at arbitrary time steps. The proposed control plugin, namely Residual Memory Transformer (RMT), has an encoder-decoder setup, which can accept any types of control conditions and cooperate with CLM through a residual learning paradigm, to achieve a more flexible, general, and efficient CTG. Extensive experiments are carried out on various control tasks, in the form of both automatic and human evaluations. The results show the superiority of RMT over a range of state-of-the-art approaches, proving the effectiveness and versatility of our approach.
