Skip to main content
QUICK REVIEW

[Paper Review] Learning a Generative Model for Validity in Complex Discrete Structures

David M. Janz, Jos van der Westhuizen|arXiv (Cornell University)|Dec 5, 2017
Machine Learning in Materials ScienceMaterials Science6 citations
TL;DR

This paper proposes a deep recurrent validator model that learns to predict whether a partial sequence can lead to a valid discrete structure, such as a valid Python expression or SMILES string. By using reinforcement learning-inspired training and data augmentation, the model improves sequence generation in variational autoencoders, increasing valid molecule decoding from 0.5% to 22.3% in SMILES-based VAEs.

ABSTRACT

Deep generative models have been successfully used to learn representations for high-dimensional discrete spaces by representing discrete objects as sequences and employing powerful sequence-based deep models. Unfortunately, these sequence-based models often produce invalid sequences: sequences which do not represent any underlying discrete structure; invalid sequences hinder the utility of such models. As a step towards solving this problem, we propose to learn a deep recurrent validator model, which can estimate whether a partial sequence can function as the beginning of a full, valid sequence. This validator provides insight as to how individual sequence elements influence the validity of the overall sequence, and can be used to constrain sequence based models to generate valid sequences -- and thus faithfully model discrete objects. Our approach is inspired by reinforcement learning, where an oracle which can evaluate validity of complete sequences provides a sparse reward signal. We demonstrate its effectiveness as a generative model of Python 3 source code for mathematical expressions, and in improving the ability of a variational autoencoder trained on SMILES strings to decode valid molecular structures.

Motivation & Objective

  • To address the problem of invalid sequence generation in deep generative models for discrete structures such as molecules and code.
  • To develop a generative model that predicts the validity of partial sequences, enabling better constraint-aware generation.
  • To reduce reliance on hand-crafted grammars by learning validity rules directly from data.
  • To improve the utility of latent spaces in variational autoencoders by filtering invalid decodings post-hoc.
  • To enable effective training with limited or no labeled validity data using active learning and perturbation-based data augmentation.

Proposed method

  • Train a recurrent neural network to approximate a validity function $\tilde{v}(x_{1:t})$ that predicts whether a prefix $x_{1:t}$ can be extended into a valid full sequence.
  • Use a reinforcement learning-inspired objective where the model is trained to predict the probability of a prefix being extendable to a valid sequence.
  • Apply data augmentation via minimal perturbations to known valid sequences (e.g., SMILES strings) to generate informative negative examples.
  • For low-data regimes, use mutual-information-based active learning to select uncertain sequences for labeling, improving sample efficiency.
  • Integrate the validator as a post-hoc mask during decoding: only allow character generations that the model deems potentially valid.
  • Apply the validator to a pre-trained character-based VAE by masking decoder logits based on the validator’s confidence in prefix validity.

Experimental results

Research questions

  • RQ1Can a learned validator model effectively predict whether a partial sequence can be extended into a valid discrete structure?
  • RQ2How can validity constraints be learned without relying on hand-coded grammars or large labeled datasets?
  • RQ3To what extent can active learning and data augmentation improve the training of a sequence validity model with minimal supervision?
  • RQ4How much does integrating a learned validator improve the validity of generated sequences in downstream generative models like VAEs?
  • RQ5Can the validator be applied post-hoc to existing models without retraining, and does it significantly improve decoding quality?

Key findings

  • The proposed validator model increased the fraction of valid molecules generated from a VAE's prior latent space from 0.5% (baseline CVAE) to 22.3%.
  • The model achieved near-perfect validity prediction on perturbed SMILES strings, demonstrating strong generalization to minor structural changes.
  • When combined with active learning, the model showed strong performance on Python 3 mathematical expressions even with limited labeled data.
  • The method improved sample validity by an order of magnitude compared to the Grammar VAE (7.2%) and significantly outperformed the plain CVAE (0.5%).
  • The post-hoc integration of the validator into existing VAEs required no retraining and preserved reconstruction accuracy while drastically improving decoding validity.
  • The approach is robust to variable-length sequences and does not require modifications to the underlying autoencoder architecture.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.