In recent years, there has been a growing interest in the development of language models capable of generating text with controllable attributes. While several approaches have been proposed, many of these methods require condition-specific data or significant computational resources. In this study, we propose a novel method called Gamma Sampling, which enables controllable language generation without the need for any training data and maintains a fast generation speed. Gamma Sampling incorporates attribute-related information into the sampling process, effectively guiding the language model to produce text with desired attributes. Our experimental results demonstrate that Gamma Sampling, when applied to GPT2, outperforms representative baselines in terms of diversity, attribute relevance, and overall quality of the generated samples.
翻译:近年来,人们越来越关心开发能够产生具有可控属性的文本的语言模型,虽然提出了几种方法,但其中许多方法需要具体条件的数据或大量计算资源,在本研究中,我们提议采用一种叫作伽玛抽样的新颖方法,使无需任何培训数据就能进行可控语言生成,并保持快速生成速度。伽玛抽样将属性相关信息纳入取样过程,有效地指导语言模型产生具有预期属性的文本。我们的实验结果表明,伽玛抽样在应用到GPT2时,在多样性、属性相关性和所生成样本的总体质量方面超过了代表性基线。