Self-Control of LLM Behaviors by Compressing Suffix Gradient into Prefix Controller

Min Cai, Yuchen Zhang, Shichang Zhang, Fan Yin, Difan Zou, Yisong Yue, Ziniu Hu · DOI

Introduction

Aligning Large Language Models (LLMs) with human intentions—ensuring they are non-toxic, truthful, and protective of privacy—typically requires massive amounts of human-annotated preference data. This process, known as Reinforcement Learning from Human Feedback (RLHF), is expensive, static, and often fails in out-of-distribution scenarios. This paper introduces SELFCONTROL, a framework that allows LLMs to use their own internal "judge" to generate steering signals on the fly, effectively controlling their own behavior at inference time.

Comparison of uncontrolled output versus steering via Suffix Gradients and Prefix Controllers.

Methodology

The researchers propose a two-stage framework to move from slow, iterative steering to fast, modular control.

1. Instance-Level SELFCONTROL

When a model generates a response, the system appends a "suffix string"—a self-evaluation question such as: "Was your response happy? Yes or No?" The model then calculates the probability of answering "Yes" versus "No," termed the Suffix Score. By taking the gradient of this score with respect to the model's internal latent representations, the system can iteratively nudge those representations until the output aligns with the desired behavior.

The five-step iterative process of SELFCONTROL, from initial sampling to gradient-based representation updates.

2. Across-Instance SELFCONTROL-PREFIX

Because iterative gradient descent is too slow for real-time interaction, the authors "compress" the knowledge gained from these gradients into a PrefixController. This is a small, Parameter-Efficient Fine-Tuning (PEFT) module. Once trained on a few examples of the iterative process, this adapter can be plugged into the model to provide the same level of control instantly, with zero added latency.

Key Insights and Results

The researchers evaluated SELFCONTROL across diverse benchmarks, including RealToxicityPrompts, DecodingTrust (privacy), and GSM-8K (reasoning). Key findings include:

  • The Model as Its Own Critic: LLMs are often better at evaluating a behavior than generating it initially. Treating self-evaluation as a differentiable objective allows the model to "backpropagate" desired behaviors directly into hidden states.
  • Performance Gains: The method improved detoxification by 8.3% over state-of-the-art methods and achieved a 48.2% improvement in privacy protection, effectively eliminating leakage in tests.
  • Reasoning Boost: Maximizing a "reasoning" suffix score improved math performance on GSM-8K from 26.6% to 37.3%.
  • Efficiency and Composition: The SELFCONTROL-PREFIX method is 10x faster than the iterative version. Furthermore, these controllers are modular; for example, a "Happy" and "Calm" controller can be activated simultaneously.

Conclusion

SELFCONTROL moves LLM alignment toward a more transparent and efficient future. By transforming internal self-evaluation into actionable steering vectors, models can actively adjust their internal states to better serve user intent without the need for exhaustive human-labeled datasets.

Summary updated

BibTeX
@misc{cai2024self,
  author = {Min Cai and Yuchen Zhang and Shichang Zhang and Fan Yin and Difan Zou and Yisong Yue and Ziniu Hu},
  title = {{Self-Control of LLM Behaviors by Compressing Suffix Gradient into Prefix Controller}},
  year = {2024},
  eprint = {2406.02721},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2406.02721},
}
Figure