Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

Controlled Text Generation for Large Language Model with Dynamic Attribute Graphs

About

Controlled Text Generation (CTG) aims to produce texts that exhibit specific desired attributes. In this study, we introduce a pluggable CTG framework for Large Language Models (LLMs) named Dynamic Attribute Graphs-based controlled text generation (DATG). This framework utilizes an attribute scorer to evaluate the attributes of sentences generated by LLMs and constructs dynamic attribute graphs. DATG modulates the occurrence of key attribute words and key anti-attribute words, achieving effective attribute control without compromising the original capabilities of the model. We conduct experiments across four datasets in two tasks: toxicity mitigation and sentiment transformation, employing five LLMs as foundational models. Our findings highlight a remarkable enhancement in control accuracy, achieving a peak improvement of 19.29% over baseline methods in the most favorable task across four datasets. Additionally, we observe a significant decrease in perplexity, markedly improving text fluency.

Xun Liang, Hanyu Wang, Shichao Song, Mengting Hu, Xunzhi Wang, Zhiyu Li, Feiyu Xiong, Bo Tang• 2024

Related benchmarks

TaskDatasetResultRank
Toxicity MitigationToxicRandom
Relevance45.1
30
Toxicity MitigationToxicTop
Relevance0.458
30
Sentiment transformationIMDB NegToPos 1.0 (test)
Relevance0.525
30
Sentiment transformationIMDB PosToNeg 1.0 (test)
Relevance0.514
30
Sentiment transformationSentiment Transformation Task
Generation Speed (s/item)2.41
30
Toxicity MitigationToxicity Mitigation Task
Generation Speed (s/item)2.44
30
Sentiment transformationNegToPos average
Perplexity32.23
6
Sentiment transformationPosToNeg (average)
Perplexity35.75
6
Toxicity MitigationToxicTop (test)
Perplexity33.92
6
Toxicity MitigationToxicRandom (test)
Perplexity31.54
6
Showing 10 of 10 rows

Other info

Code

Follow for update