Successor Features for Efficient Multi-Subject Controlled Text Generation

Meng Cao, Mehdi Fatemi, Jackie Ck Cheung, Samira Shabanian

TL;DR

SF-GEN introduces a highly efficient way to steer Large Language Models (LLMs) by borrowing the concept of "Successor Features" from reinforcement learning. By decoupling the language model's internal dynamics from specific control goals (like toxicity or sentiment), it allows for simultaneous, multi-attribute control at inference time with almost zero additional computational overhead.

The Challenge of Controllable Text Generation

Controllable Text Generation (CTG) is the art of making an LLM follow specific rules—such as becoming more polite, avoiding spoilers, or staying factually accurate. While methods exist to achieve this, they typically suffer from three main bottlenecks:

  1. Static Control: Most methods are trained for one specific task. If you want to switch from "polite" to "scientific," you often need to train a new discriminator or fine-tune the model again.
  2. Scaling Issues: Controlling multiple attributes at once (e.g., "be polite," "be concise," AND "be positive") typically requires running multiple models in parallel, which doubles or triples the memory and time required.
  3. Computational Cost: Many high-quality steering methods (like PPLM) are notoriously slow at inference time, making them impractical for real-world applications.

The authors aim to create a framework that is modular (add/remove subjects easily), efficient (fast inference), and scalable (handles many subjects at once).

The SF-GEN Approach: Decoupling Dynamics from Goals

The core innovation of this paper is framing text generation as a Reinforcement Learning (RL) problem and applying Successor Features (SFs).

  • The RL Framework: The authors treat the LLM as an agent in a Markov Decision Process. Choosing a token is an "action," and the generated sequence is the "state."
  • Decoupling with SFs: In standard RL, you learn a value function ($Q$) that tells you how "good" a state is for a specific task. SF-GEN instead decomposes $Q$ into two parts:
  • Successor Features ($\psi$): A vector representing the "expected future features" of the text. This captures the dynamics of the language—how words tend to follow one another.
  • Reward Weights ($w$): A small vector representing the goals of a specific task (e.g., "how much do we care about toxicity?").
  • The "Magic" Formula: Because $Q = \psi^\top w$, the model only needs to compute the complex $\psi$ once. To change the task or add a new subject, you simply swap or combine the tiny $w$ vectors.
  • Dynamic Fusion: To handle multiple subjects, the authors use a "minimum value" approach, ensuring the generated text satisfies the "safety" or "style" requirements of all active subjects simultaneously.

Key Results and Performance

The authors evaluated SF-GEN on two primary benchmarks: Sentiment Control using the OpenWebText (OWT) corpus, and Detoxification using the RealToxicityPrompts (RTP) benchmark. Experiments were conducted using GPT-2 (large) and the GPT4All-J (6B) instruction-tuned model.

Performance comparison of SF-GEN against baselines on sentiment steering and language quality.

As shown in the table above, SF-GEN is highly competitive with State-of-the-Art (SOTA) methods like RECT and significantly outperforms older baselines like PPLM and GeDi in sentiment steering. Crucially, it achieves this while maintaining high fluency (low perplexity) and text diversity.

Zero-Cost Multi-Subject Control

In traditional methods, adding a second control subject doubles the inference time. In SF-GEN, the inference time remains almost flat regardless of how many subjects you add, because the heavy lifting (computing $\psi$) is only done once. In multi-subject scenarios, SF-GEN is 3x to 5x faster than competing methods like RECT as the number of subjects increases.

Scatter plots demonstrating multi-subject detoxification. SF-GEN successfully pushes generated text toward the origin (low toxicity across multiple axes simultaneously).

Qualitatively, the model successfully avoids toxic "traps" in prompts that usually trigger LLMs into offensive territory. The scatter plots above illustrate how SF-GEN can simultaneously minimize multiple harmful attributes (e.g., Attack and Threat, or Threat and Sexual content), clustering the generated outputs safely near the origin compared to the unsteered GPT baseline.

Limitations and Future Work

While SF-GEN represents a major leap in efficiency, it does have limitations:

  • Linear Approximation: The $Q = \psi^\top w$ assumption assumes that the "goodness" of a sentence is a linear combination of its features. While effective, this might struggle with extremely nuanced or non-linear constraints.
  • Classifier Bottleneck: The system is only as good as the labels it's trained on. If the Perspective API or sentiment classifier has biases, those biases will be baked into the reward weights ($w$).
  • Scaling to "Mega" Models: While tested on 6B parameter models, future work should explore how this scales to 70B+ parameter models where the "feature extraction" overhead might become more significant.

Summary updated

BibTeX
@inproceedings{cao2024successor,
  author = {Meng Cao and Mehdi Fatemi and Jackie CK Cheung and Samira Shabanian},
  title = {{Successor Features for Efficient Multi-Subject Controlled Text Generation}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=LJcIIhqGDN},
}
Figure