Tailor: A Prompt-Based Approach to Attribute-Based Controlled Text Generation
About
Attribute-based Controlled Text Generation (CTG) refers to generating sentences that satisfy desirable attributes (e.g., emotions and topics). Existing works often utilize fine-tuning or resort to extra attribute classifiers, yet suffer from storage and inference time increases. To address these concerns, we explore attribute-based CTG in a prompt-based manner. In short, the proposed Tailor represents each attribute as a pre-trained continuous vector (i.e., single-attribute prompt) and guides the generation of a fixed PLM switch to a pre-specified attribute. We experimentally find that these prompts can be simply concatenated as a whole to multi-attribute CTG without any re-training, yet raises problems of fluency decrease and position sensitivity. To this end, Tailor provides a multi-attribute prompt mask and a re-indexing position-ids sequence to bridge the gap between the training (one prompt for each task) and testing stage (concatenating more than one prompt). To further enhance such single-attribute prompt combinations, Tailor also introduces a trainable prompt connector, which can be concatenated with any two single-attribute prompts to multi-attribute text generation. Experiments on 11 attribute-specific generation tasks demonstrate strong performances of Tailor on both single-attribute and multi-attribute CTG, with 0.08\% training parameters of a GPT-2.
Related benchmarks
| Task | Dataset | Result | Rank | |
|---|---|---|---|---|
| Controllable Text Generation | Yelp (test) | Perplexity (PPL)40.29 | 20 | |
| Attribute-Controlled Dialogue Generation | DailyDialog-CG (test) | Emotion Accuracy (E-ACC)60.91 | 12 | |
| Multi-attribute Controlled Text Generation | CompM-CTG ACD | Dist-3 (i.d.)0.677 | 10 | |
| Multi-attribute Controlled Text Generation | CompM-CTG Average | Dist-3 Average0.66 | 10 | |
| Multi-attribute Controlled Text Generation | CompM-CTG (Hold-Out) | Dist-3 (i.d.)0.636 | 10 | |
| Multi-attribute Controlled Text Generation | CompM-CTG Original | Dist-3 (i.d.)0.642 | 10 | |
| Multi-Aspect Controllable Text Generation | CompMCTG 1.0 (Original) | Aid Score63.91 | 10 | |
| Multi-Aspect Controllable Text Generation | CompMCTG 1.0 (Hold-Out) | Aid Score63.95 | 10 | |
| Multi-Aspect Controllable Text Generation | CompMCTG Overall Summary Average 1.0 | Aavg Score59.39 | 10 | |
| Multi-Constraint Text Generation | CompMCTG Average 1.0 | Relevance (avg)3 | 10 |