Plug-and-Blend: A Framework for Controllable Story Generation with Blended Control Codes

Zhiyu Lin, Mark O. Riedl

Introduction

Large pre-trained language models (PLMs) like GPT-3 excel at generating fluent text but often lack precise steering mechanisms for creative tasks. For instance, a user might require a narrative that transitions smoothly from a "mystery" theme to "science fiction." Existing methods like fine-tuning are computationally expensive and require massive datasets, while prompt engineering often fails to provide fine-grained control over long sequences. Furthermore, "white-box" methods are inapplicable to proprietary models accessed via APIs.

The Plug-and-Blend Framework

Plug-and-Blend introduces a "plug-and-play" (PnP) framework that intervenes at the logit level to provide continuous control over multiple overlapping topics without retraining the base model.

The Plug-and-Blend architecture: A user-defined control sketch is processed by a Planner and a Blending Generative Model to steer the base LM's output.

The system consists of two main components:

  1. Blending Generative Model (BGM): Building on the GeDi framework, BGM uses a contrastive discriminator (Control Model) to calculate the likelihood of tokens belonging to specific topics. Unlike binary control, BGM allows for a weighted combination of multiple control codes, effectively "walking" through the latent vocabulary space.
  2. The Planner: This component translates high-level user sketches (e.g., "Sports for lines 1-5, Science for lines 5-10") into specific topic weights for each sentence using Gaussian distributions, ensuring smooth narrative transitions.

Experimental Evaluation

The authors evaluated the framework using the ROCStories dataset for story generation and the AG-news dataset to train the control model on four topics: Business, Science, Sports, and World.

The Control-Fluency Trade-off

A critical finding is the relationship between control strength and linguistic fluency. As control strength increases, the model adheres more strictly to topic-specific keywords, but at the cost of grammatical coherence.

Perplexity vs. Control Strength: Increasing control strength beyond a certain threshold leads to a significant rise in perplexity, indicating a loss of fluency.

Automated tests showed that perplexity remains stable at low-to-moderate strengths. Human evaluations further validated the approach, with participants preferring Plug-and-Blend's transitioning stories 75.1% of the time over single-topic baselines.

Conclusion and Future Work

Plug-and-Blend demonstrates that high-level narrative control can be achieved by re-weighting output probabilities. While currently limited to the topics in the training data, future work could involve expanding topic granularity and employing reinforcement learning for more complex narrative planning.

Summary updated

BibTeX
@inproceedings{lin2021plug,
  author = {Zhiyu Lin and Mark O. Riedl},
  title = {{Plug-and-Blend: A Framework for Controllable Story Generation with Blended Control Codes}},
  booktitle = {Aiide},
  year = {2021},
}
Figure