NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

ZeroGen: Zero-Shot Multimodal Controllable Text Generation with Multiple Oracles

Haoqin Tu, Bowen Yang, Xianfeng Zhao

Introduction

Controllable Text Generation (CTG) is the task of guiding a Language Model (LM) to produce text that adheres to specific attributes, such as a particular sentiment, topic, or visual context. Traditionally, achieving high-quality CTG required extensive fine-tuning on large, labeled datasets. While "Plug-and-Play" (PnP) methods emerged to guide pre-trained LMs during decoding without retraining, they faced significant challenges: they were often limited to a single modality, relied on static weighting for control signals, and were computationally expensive due to gradient-based optimization at each generation step.

ZeroGen addresses these hurdles by introducing a training-free, zero-shot framework that leverages multiple pre-trained "oracles" to guide a base language model (e.g., GPT-2). By shifting probabilities directly in a unified space, ZeroGen achieves state-of-the-art performance in multimodal tasks while operating significantly faster than previous gradient-based approaches.

Methodology: A Multi-Oracle Approach

ZeroGen treats pre-trained models as external oracles that provide guidance signals during the decoding process. This guidance is structured into a two-tier system:

1. Two-Tier Guidance System

  • Token-level (Textual Oracle): To incorporate textual attributes like "science" or "romance," ZeroGen uses a textual oracle (such as GloVe embeddings). This oracle shifts the probability distribution of the next token toward keywords associated with the target attribute before the base LM makes its selection.
  • Sentence-level (Visual Oracle): For multimodal grounding, the framework utilizes CLIP (Contrastive Language-Image Pre-training). During the beam search stage, CLIP evaluates how well candidate sequences align with a provided image, ensuring the generated text remains contextually relevant to the visual input.

2. Dynamic Weighting Mechanism

A critical innovation in ZeroGen is its move away from static control strengths. In traditional PnP methods, a constant weight is applied to control signals, which often leads to repetitive or non-fluent text if the signal overrides the base LM's natural language priors. ZeroGen introduces two dynamic parameters, $\alpha_t$ and $\beta_t$, which adjust the influence of the oracles based on the base LM's confidence. When the LM is certain about its next word, the control signal is reduced to maintain fluency; when the LM is uncertain, the control signal is amplified to ensure the desired attributes are met.

3. Unified Decoding

By mapping all signals into a single probability space, ZeroGen performs weighted addition of scores. This avoids the need for backpropagation during inference, which is the primary bottleneck in gradient-based methods like PPLM or ZeroCap.

Experimental Evaluation

The authors evaluated ZeroGen across several benchmarks to test its versatility in both "vertical" (complementary details) and "lateral" (new dimensions like sentiment) extensions:

  • Image Captioning: Tested on MS-COCO and Flickr30k.
  • Stylized Captioning: Evaluated on FlickrStyle10k, focusing on "Romantic" and "Humorous" styles.
  • Controllable News Generation: Using the VisNews dataset, the model generated news titles from images while adhering to specific sentiment controls.

Key Results and Insights

ZeroGen demonstrates that efficient, zero-shot multimodal control is not only possible but highly effective:

  • State-of-the-Art Performance: On the MS-COCO benchmark, ZeroGen achieved a CIDEr score of 55.4, outperforming MAGIC (48.3) and ZeroCap (34.5).
  • Efficiency: By eliminating the need for gradient calculations during inference, ZeroGen is approximately 10 times faster than gradient-based PnP methods.
  • Superior Controllability: In news generation tasks, ZeroGen showed a significantly higher "Accuracy Gain" ($\Delta Acc$) in sentiment control compared to baselines, indicating a stronger adherence to user-specified instructions.
  • Fluency and Diversity: The dynamic weighting mechanism successfully balanced attribute alignment with linguistic naturalness, avoiding the "gibberish" often seen in over-controlled zero-shot models.

Limitations and Future Directions

While ZeroGen represents a significant step forward, several challenges remain:

  • Supervision Gap: There remains a performance gap between zero-shot methods and models trained on massive paired datasets.
  • Diversity and Bias: The model can occasionally suffer from low linguistic variety or inherit spurious correlations from its oracles (e.g., CLIP's internal biases).
  • Causal Inference: Future work may involve incorporating causal inference to help the model distinguish between true contextual relevance and coincidental associations within the training data of the oracles.

Conclusion

ZeroGen provides a robust and efficient framework for multimodal controllable text generation. By treating pre-trained models as modular oracles and employing a dynamic weighting strategy, it offers a scalable solution for generating context-aware, attribute-driven text without the need for costly retraining or slow inference cycles.

Summary updated

BibTeX
@inproceedings{tu2023zerogen,
  author = {Haoqin Tu and Bowen Yang and Xianfeng Zhao},
  title = {{ZeroGen: Zero-Shot Multimodal Controllable Text Generation with Multiple Oracles}},
  booktitle = {NLPCC},
  year = {2023},
  url = {https://openreview.net/forum?id=TBpa3pcRy4l},
}
Figure