Abstract
Training Variational Auto-Encoders (VAEs) with discrete structured latent variables—such as trees, graphs, or sequences—presents significant challenges due to the non-differentiable nature of discrete operations and the exponential complexity of structured latent spaces. Traditional approaches rely on complex gradient approximations or task-specific mathematical relaxations. This paper explores the use of Natural Evolution Strategies (NES), a gradient-free, black-box optimization method, as a simpler and more scalable alternative. We demonstrate that NES is as effective as state-of-the-art gradient-based methods while offering superior parallelization and implementation simplicity. Our findings include state-of-the-art results in unsupervised dependency parsing and high-accuracy latent structure recovery.
Introduction
In generative modeling, representing data through structured latent spaces (e.g., a dependency tree for a sentence or a graph for a molecule) is highly desirable for interpretability and downstream utility. However, training Discrete Structured VAEs is notoriously difficult. Standard deep learning relies on backpropagation, which requires differentiable functions. Discrete operations, such as selecting a maximum spanning tree or a shortest path, are inherently non-differentiable, creating a "gradient wall."
To circumvent this, researchers often employ relaxations like Gumbel-Softmax or specialized techniques like "perturb-and-parse." While effective, these methods often suffer from exponential computational complexity as the input size grows or require custom-built solvers for every unique structure. This paper proposes a shift toward Natural Evolution Strategies (NES), treating the discrete structure as a black box and estimating gradients through parameter perturbation.
The Challenge of Discrete Latent Spaces
Two primary hurdles define the difficulty of training structured discrete models:
- Non-Differentiability: Operations like
argmaxhave zero gradients almost everywhere, making standard backpropagation impossible. - Exponential Complexity: Many gradient-based relaxations require summing over all possible structures. For a graph with $n$ nodes, the number of possible trees or paths grows exponentially, making exact marginalization computationally prohibitive for large inputs.
Existing solutions like Stochastic Softmax Tricks (SST) or Differentiable Perturb-and-Parse (DPP) address these issues but are mathematically dense and often difficult to scale or generalize across different structural constraints.
Proposed Method: Natural Evolution Strategies (NES)
NES approaches the optimization problem by treating the model parameters as the mean of a search distribution. Instead of calculating a direct gradient through the discrete structure, NES performs the following steps:
- Perturbation: The model parameters are jittered with Gaussian noise to create a population of model variants.
- Evaluation: Each variant undergoes a forward pass to calculate the Evidence Lower Bound (ELBO). Crucially, this only requires the forward pass of the discrete solver, not a differentiable version.
- Gradient Estimation: By observing which perturbations lead to higher ELBO, NES estimates a search direction that serves as a surrogate gradient.
- Parallelism: Since each evaluation is independent, the process is highly parallelizable across multiple GPUs, significantly reducing wall-clock training time.
Furthermore, this work provides a theoretical convergence proof for NES in the context of non-Lipschitz functions—functions with sharp jumps or discontinuities—which are characteristic of discrete decision-making processes.
Experimental Evaluation
The efficacy of NES was tested across three distinct domains:
1. Latent Structure Recovery
Using a synthetic task involving 10 moving objects, the model was tasked with inferring the hidden interaction graph (a spanning tree). NES achieved an Edge F1-score of 92.0, outperforming the gradient-based SST (91.0) and significantly surpassing standard REINFORCE estimators, which struggled to exceed a 42.0 F1-score.
2. Unsupervised Dependency Parsing
Testing on the Universal Dependencies (UD) dataset across Galician, Indonesian, and Russian languages, NES was evaluated on its ability to recover linguistic structures without explicit supervision. NES achieved the best Unlabeled Attachment Score (UAS) on five out of six target domains, demonstrating its robustness in handling real-world linguistic data.
3. Image Benchmarks
To ensure generality, NES was applied to standard unstructured image datasets, including FashionMNIST, KMNIST, and Omniglot. The results were competitive with standard VAE training, proving that the method does not sacrifice general generative performance for structural accuracy.
Key Insights
- Implementation Simplicity: NES removes the need for custom differentiable layers or complex matrix operations in the backward pass. If a forward pass can be computed, the model can be trained.
- Scalability: While differentiable methods often face $O(n^3)$ complexity or worse as input dimensions increase, NES's wall-clock time remains relatively flat due to its parallel nature and avoidance of complex backward passes.
- Variance and Stability: Although the NES gradient estimate is biased, it frequently exhibits lower variance than the REINFORCE estimator, leading to more stable convergence in structured settings.
Conclusion and Future Work
Natural Evolution Strategies provide a powerful, simple, and scalable framework for training Discrete Structured VAEs. By bypassing the need for complex relaxations, NES allows researchers to focus on model architecture rather than optimization workarounds. Future research may explore jointly optimizing the noise covariance to further improve sample efficiency and investigating the method's performance in environments where forward passes are computationally expensive.
Summary updated