Large language models (LM) based on Transformers allow to generate plausible long texts. In this paper, we explore how this generation can be further controlled at decoding time to satisfy certain constraints (e.g. being non-toxic, conveying certain emotions, using a specific writing style, etc.) without fine-tuning the LM. Precisely, we formalize constrained generation as a tree exploration process guided by a discriminator that indicates how well the associated sequence respects the constraint. This approach, in addition to being easier and cheaper to train than fine-tuning the LM, allows to apply the constraint more finely and dynamically. We propose several original methods to search this generation tree, notably the Monte Carlo Tree Search (MCTS) which provides theoretical guarantees on the search efficiency, but also simpler methods based on re-ranking a pool of diverse sequences using the discriminator scores. These methods are evaluated, with automatic and human-based metrics, on two types of constraints and languages: review polarity and emotion control in French and English. We show that discriminator-guided MCTS decoding achieves state-of-the-art results without having to tune the language model, in both tasks and languages. We also demonstrate that other proposed decoding methods based on re-ranking can be really effective when diversity among the generated propositions is encouraged.
翻译:以变换器为基础的大型语言模型( LM) 能够产生合理的长文本。 在本文中, 我们探索如何在解码时间进一步控制这一代人, 以满足某些限制( 例如无毒, 传达某些情绪, 使用特定的写作风格等), 而无需微调LM 。 我们将受限制的代代代( 由歧视者指导的树勘探过程正式化, 说明相关序列对限制的制约程度。 这个方法除了比微调LM 更容易和便宜地培训, 还能更精细和更有活力地应用限制。 我们提出了几种原始方法来搜索这代人树( 例如, 无毒, 传达某些情绪, 使用特定的写作风格等 ) 。 我们建议了几种原始方法, 来寻找这代( 蒙特卡洛 树搜索 ) ( Montecar Trow Search ( Match Tearch), ) 提供理论上的保证, 但也采用了更简单的方法, 利用歧视者的评分数重新排列不同的顺序。 这些方法用两种类型的衡量限制和语言: 审查法语和英语的极对极性和情绪控制, 。 我们指出, 差别指导的MCT导的解方法也可以在其它语言中, 的排序上展示其他语言之间, 也能够真正地展示。