Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

COLD Decoding: Energy-based Constrained Text Generation with Langevin Dynamics

About

Many applications of text generation require incorporating different constraints to control the semantics or style of generated text. These constraints can be hard (e.g., ensuring certain keywords are included in the output) and soft (e.g., contextualizing the output with the left- or right-hand context). In this paper, we present Energy-based Constrained Decoding with Langevin Dynamics (COLD), a decoding framework which unifies constrained generation as specifying constraints through an energy function, then performing efficient differentiable reasoning over the constraints through gradient-based sampling. COLD decoding is a flexible framework that can be applied directly to off-the-shelf left-to-right language models without the need for any task-specific fine-tuning, as demonstrated through three challenging text generation applications: lexically-constrained generation, abductive reasoning, and counterfactual reasoning. Our experiments on these constrained generation tasks point to the effectiveness of our approach, both in terms of automatic and human evaluation.

Lianhui Qin, Sean Welleck, Daniel Khashabi, Yejin Choi• 2022

Related benchmarks

TaskDatasetResultRank
Jailbreak AttackAdvbench subset
ASR5.72
64
Jailbreak AttackAdvBench 50 harmful behaviors
GPT-3.5 Turbo Jailbreak Rate36
32
Abductive ReasoningART (Abductive Reasoning in NLP) (test)--
18
JailbreakAdvBench (test)
ASR (GPT-3.5 Turbo)34.23
16
Jailbreak AttackChao 2024
ASR (DICT)5.72
16
Counterfactual Story RewritingTIMETRAVEL (test)
Min-Edit Overlap56.84
5
Sentence InfillingaNLG
BLEU-41.8
5
Toxicity avoidanceRealToxicityPrompts
Avg Max Toxicity Score0.34
4
Sentiment ControlYelp polarity corpus (test)
Internal Classification Accuracy61.46
4
Keyword-guided topic controlKeyword-guided topic control dataset
Succ. (%)100
3
Showing 10 of 12 rows

Other info

Code

Follow for update