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

Deep Generative Models with Learnable Knowledge Constraints

Zhiting Hu, Zichao Yang, Ruslan Salakhutdinov, Lianhui Qin, Xiaodan Liang, Haoye Dong, Eric P. Xing

Overview

This paper bridges the gap between Posterior Regularization (PR) and Reinforcement Learning (RL) to help deep generative models follow complex, structured rules. By treating domain knowledge constraints as learnable "rewards," the authors create a flexible, model-agnostic framework that allows generators to learn simultaneously from raw data and "fuzzy" structural constraints.

The Challenge of Incorporating Domain Knowledge

Deep Generative Models (DGMs)—such as GANs, VAEs, and autoregressive models—excel at mimicking data distributions. However, they often struggle to incorporate "common sense" or structured domain knowledge. For example, when generating a human image, the model should inherently know that a head belongs on top of a neck, regardless of pixel-level variations.

Traditionally, researchers used Posterior Regularization (PR) to impose these rules. But PR has two major flaws:

  1. Rigidity: It requires constraints to be perfectly defined a priori (hand-coded), which is nearly impossible for complex, real-world tasks.
  2. Incompatibility: It does not integrate easily with "implicit" models like GANs that lack a clear Bayesian formulation or explicit density functions.

To address this, the authors introduce a framework for incorporating learnable constraints that operate across diverse deep generative architectures.

A Unified Framework: Bridging PR and RL

The core contribution of this work is a mathematical bridge. The authors prove that the objective function for Posterior Regularization is mathematically equivalent to entropy-regularized policy optimization in Reinforcement Learning.

In this unified view:

  • The Generative Model acts as the "Policy."
  • The Domain Knowledge Constraint serves as the "Reward."
  • The Variational Distribution is the "New Policy" being optimized.
Architecture of the learnable constraint framework for image and text generation

By establishing this link, the authors leverage tools from Maximum Entropy Inverse Reinforcement Learning (MaxEnt IRL) to learn constraint parameters directly from data. Instead of relying on a human to write a flawless rule, the system takes a partial structure (like a pre-trained human part parser) and learns to refine that constraint so it actively helps the generator produce better results.

The resulting algorithm alternates between two steps:

  1. Constraint Learning: Updating the parameters of the rule (the reward function) to better distinguish between real data structures and generated ones.
  2. Model Learning: Updating the generator to maximize the "reward" (satisfy the constraint) while remaining close to the original data distribution.

Experimental Tasks and Datasets

The authors evaluated their framework on two distinct modalities to prove its versatility:

  • Image Generation (DeepFashion): The task was "Pose Conditional Person Image Generation"—taking a source photo of a person and a target pose (keypoints) to generate that person in the new pose.
  • Text Generation (IMDB Movie Reviews): The task was "Template Guided Sentence Generation," where the model had to fill in missing parts of a sentence while adhering to a specific structural template.

Key Insights and Results

The introduction of "Learnable Knowledge Constraints" significantly outperformed both base models and models relying on fixed, hand-coded constraints.

  • The PR-RL Connection: The realization that imposing a constraint on a probability distribution is functionally identical to an RL agent maximizing a reward while maintaining high entropy is a major theoretical stepping stone.
  • Learnable vs. Fixed Constraints: The paper demonstrates that "fixed" constraints are often too brittle. If a pre-trained human-part parser is slightly inaccurate, a standard PR model fails. A learnable constraint allows the model to "fix" the parser for the specific generation task.
  • Model Agnosticism: Because the framework treats the generator as a "black box" policy, it works effectively for GANs (which are notoriously hard to regularize) as well as VAEs.

Quantitative Improvements: * Human Image Generation: The proposed model achieved a Structural Similarity (SSIM) of 0.727, compared to 0.676 for the base model. In human surveys, users preferred the constrained model's outputs in 77% of test cases, noting much better preservation of body structure (e.g., avoiding missing limbs or "melting" faces). * Text Generation: The model achieved a lower Perplexity (28.69 vs. 30.30), indicating more coherent and predictable text. Qualitatively, it avoided common pitfalls like repeating words or generating nonsense to fill a template.

Limitations and Future Directions

While powerful, the method relies on Importance Sampling to estimate gradients. The authors note that this can be "consistent yet biased." In very high-dimensional spaces, this estimation might become unstable or require prohibitively large batch sizes.

Future work could explore more complex "modular" designs, where multiple independent constraints (e.g., one for sentiment, one for grammar, one for factual correctness) are learned simultaneously to guide a single generative model. This modularity could pave the way for highly controllable AI in creative tools and scientific simulations.

Summary updated

BibTeX
@inproceedings{hu2018deep,
  author = {Zhiting Hu and Zichao Yang and Ruslan Salakhutdinov and Lianhui Qin and Xiaodan Liang and Haoye Dong and Eric P. Xing},
  title = {{Deep Generative Models with Learnable Knowledge Constraints}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2018},
}
Figure