Emotion-Conditioned Text Generation through Automatic Prompt Optimization

Yarik Menchaca Resendiz, Roman Klinger
8/9/2023
cs.CL

No confident code implementation found for this paper.

Abstract

Conditional natural language generation methods often require either expensive fine-tuning or training a large language model from scratch. Both are unlikely to lead to good results without a substantial amount of data and computational resources. Prompt learning without changing the parameters of a large language model presents a promising alternative. It is a cost-effective approach, while still achieving competitive results. While this procedure is now established for zero- and few-shot text classification and structured prediction, it has received limited attention in conditional text generation. We present the first automatic prompt optimization approach for emotion-conditioned text generation with instruction-fine-tuned models. Our method uses an iterative optimization procedure that changes the prompt by adding, removing, or replacing tokens. As objective function, we only require a text classifier that measures the realization of the conditional variable in the generated text. We evaluate the method on emotion-conditioned text generation with a focus on event reports and compare it to manually designed prompts that also act as the seed for the optimization procedure. The optimized prompts achieve 0.75 macro-average F1 to fulfill the emotion condition in contrast to manually designed seed prompts with only 0.22 macro-average F1.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{resendiz2023emotionconditioned,
  title  = {Emotion-Conditioned Text Generation through Automatic Prompt Optimization},
  author = {Yarik Menchaca Resendiz and Roman Klinger},
  year   = {2023},
  eprint = {2308.04857},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2308.04857v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2308.04857.svg)](https://codeofpaper.com/paper/2308.04857)

Discussion