Distributional Reinforcement Learning for Energy-Based Sequential Models

Tetiana Parshakova, Jean-Marc Andreoli, Marc DymetmanarXiv 2019

Abstract

Global Autoregressive Models (GAMs) are a recent proposal for exploiting global properties of sequences for data-efficient learning of seq2seq models. In the first phase of training, an Energy-Based model (EBM) over sequences is derived. This EBM has high representational power, but is unnormalized and cannot be directly exploited for sampling. To address this issue, we propose a general approach applicable to any sequential EBM by relating this problem to Policy Gradient techniques in RL, but from a distributional rather than optimization perspective. Its effectiveness is illustrated on GAM-based experiments.

Introduction

In sequence modeling, standard autoregressive models like LSTMs or Transformers generate tokens locally. While easy to train, they struggle to incorporate global constraints—such as ensuring a specific keyword appears in the output. Energy-Based Models (EBMs) address this by scoring sequences globally. However, EBMs produce unnormalized distributions, making them difficult to sample from directly.

Global Autoregressive Models (GAMs) attempt to bridge this gap using a two-phase training strategy. First, an unnormalized EBM is learned from data. Second, a normalized autoregressive "policy" is extracted from that EBM to enable efficient sampling.

The two-phase training process of Global Autoregressive Models (GAMs). Training-1 learns the global energy landscape $P_\lambda(x)$, while Training-2 derives a tractable policy $\pi_\theta(x)$.

Previously, this second phase relied on distillation via rejection sampling. However, rejection sampling requires a strict mathematical upper bound on the distribution, which is often intractable for complex models. This work introduces Distributional Policy Gradient (DPG), a more general and flexible alternative.

Methodology: Distributional Policy Gradient

The core innovation is reframing the extraction of a normalized policy as a Reinforcement Learning (RL) problem. In standard RL, one treats the EBM score as a reward and optimizes a policy to maximize it. However, this leads to "mode collapse," where the model only generates the single highest-scoring sequence.

To preserve the diversity of the original EBM, the authors adopt a distributional perspective. Instead of maximizing reward, the goal is to minimize the cross-entropy between the unnormalized EBM and a parameterized policy $\pi_\theta$.

Off-Policy Stabilization

On-policy DPG can be unstable because the sampling distribution changes with every update. To ensure convergence, the authors implement an off-policy approach using Importance Sampling. They sample from a fixed proposal distribution $q$, update the policy $\pi_\theta$, and only update the proposal ($q \leftarrow \pi_\theta$) if the new policy demonstrates improved validation perplexity. This "gating" mechanism, inspired by modern RL algorithms like PPO, is critical for stable training.

Experimental Results

The approach was evaluated on synthetic binary sequences ($n=30$) where sequences are filtered based on the presence of a specific "motif." This controlled environment allows for exact computation of theoretical entropy and precise measurement of how well the model captures global constraints.

Performance comparison of DPG, Distillation, and baseline models. DPG (magenta) and Distillation (blue) significantly outperform the baseline (green) in low-data regimes, capturing the true distribution (red) and motif frequency (dotted lines) much earlier.

Data Efficiency and Global Constraints

DPG demonstrates exceptional data efficiency. In low-data regimes (500 to 5,000 sequences), the DPG-trained policy achieves test cross-entropy much closer to the theoretical ideal than the baseline. Notably, at a dataset size of 500, the DPG policy generates the required motif approximately 281 times more frequently than the baseline autoregressive model.

DPG vs. Distillation

While DPG achieves performance comparable to the specialized Distillation method, it does so without the restrictive requirement of an analytical upper bound. DPG even shows a slight advantage in motif frequency, proving it to be a robust and general-purpose tool for projecting EBMs onto tractable autoregressive policies.

Conclusion

By repurposing Reinforcement Learning for distributional matching rather than reward optimization, DPG provides a powerful mechanism for sampling from complex Energy-Based Models. While currently demonstrated on synthetic data, the framework decouples representation from inference, allowing researchers to learn sophisticated global energy landscapes and navigate them using stable, RL-inspired policies. Future work will explore scaling DPG to natural language tasks and incorporating Actor-Critic architectures for improved local credit assignment.

Summary updated

BibTeX
@misc{parshakova2019distributional,
  author = {Tetiana Parshakova and Jean-Marc Andreoli and Marc Dymetman},
  title = {{Distributional Reinforcement Learning for Energy-Based Sequential Models}},
  year = {2019},
  eprint = {1912.08517},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1912.08517},
}
Figure