Context-Tuning: Learning Contextualized Prompts for Natural Language Generation

Tianyi Tang, Junyi Li, Wayne Xin Zhao, Ji-Rong Wen


Abstract
Recently, pretrained language models (PLMs) have had exceptional success in language generation. To leverage the rich knowledge encoded by PLMs, a simple yet powerful paradigm is to use prompts in the form of either discrete tokens or continuous embeddings. In existing studies, these prompting methods are typically independent of the inputs, lacking sufficient consideration of input semantics. To address this issue, we propose a novel continuous prompting approach, called context-tuning, to fine-tuning PLMs for natural language generation. Firstly, the prompts are derived based on the input text to elicit useful knowledge from PLMs for generation. We refer to such prompts as contextualized prompts. Secondly, we use continuous inverse prompting to improve the process of natural language generation by modeling an inverse generation process from output to input, making the generated text more relevant to the inputs. Furthermore, we utilize a lightweight context-tuning method that fine-tunes only 0.12% of the parameters while maintaining good performance. Our code is publicly available at https://github.com/RUCAIBox/Context-Tuning.
Anthology ID:
2022.coling-1.552
Volume:
Proceedings of the 29th International Conference on Computational Linguistics
Month:
October
Year:
2022
Address:
Gyeongju, Republic of Korea
Venue:
COLING
SIG:
Publisher:
International Committee on Computational Linguistics
Note:
Pages:
6340–6354
Language:
URL:
https://aclanthology.org/2022.coling-1.552
DOI:
Bibkey:
Cite (ACL):
Tianyi Tang, Junyi Li, Wayne Xin Zhao, and Ji-Rong Wen. 2022. Context-Tuning: Learning Contextualized Prompts for Natural Language Generation. In Proceedings of the 29th International Conference on Computational Linguistics, pages 6340–6354, Gyeongju, Republic of Korea. International Committee on Computational Linguistics.
Cite (Informal):
Context-Tuning: Learning Contextualized Prompts for Natural Language Generation (Tang et al., COLING 2022)
Copy Citation:
PDF:
https://aclanthology.org/2022.coling-1.552.pdf
Code
 rucaibox/context-tuning