Papers › Grammar Variational Autoencoder

Grammar Variational Autoencoder

6 Mar 2017ICML 2017 8arXiv:1703.01925archive 2025-07-28

Matt J. Kusner, Brooks Paige, José Miguel Hernández-Lobato

Deep generative models have been wildly successful at learning coherent latent representations for continuous data such as video and audio. However, generative modeling of discrete data such as arithmetic expressions and molecular structures still poses significant challenges. Crucially, state-of-the-art methods often produce outputs that are not valid. We make the key observation that frequently, discrete data can be represented as a parse tree from a context-free grammar. We propose a variational autoencoder which encodes and decodes directly to and from these parse trees, ensuring the generated outputs are always valid. Surprisingly, we show that not only does our model more often generate valid outputs, it also learns a more coherent latent space in which nearby points decode to similar discrete outputs. We demonstrate the effectiveness of our learned models by showing their improved performance in Bayesian optimization for symbolic regression and molecular synthesis.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="1703.01925")

Code

Syntology Ran 4 of 19 code samples harvested from 3 repositories linked to this paper; 15 have no recorded run. Of those that ran: 1 ran · violated contract; 3 ran · our draft was wrong.

By repository: community (archive-listed): 19 samples from 3 repositories, 4 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

ZmeiGorynych/generative_playground mentioned on GitHubpytorchMIT report
dbkgroup/GVAE4Smiles mentioned on GitHub report
mkusner/grammarVAE mentioned on GitHubtf report
omerronen/scales mentioned on GitHubpytorchMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

19 samples harvested; 4 ran; 0 honoured the contract we drafted; 15 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · violated contract
3ran · our draft was wrong
15unverified

Licence: 3 of the 19 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 3 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

getFileList dbkgroup/GVAE4Smiles/doGVAE_genHPO.py community (archive-listed) ran · our draft was wrong MIT (permissive) · 316ca309f1ba9cdf · report
jac dbkgroup/GVAE4Smiles/GVAE.py community (archive-listed) ran · violated contract fingerprinted MIT (permissive) · 8ac1771f54eb5485 · report
pop_or_nothing mkusner/grammarVAE/molecule_vae.py community (archive-listed) ran · our draft was wrong fingerprinted no licence file found · pointer only · 16eaf789c4a4401d · report
prods_to_eq mkusner/grammarVAE/molecule_vae.py community (archive-listed) ran · our draft was wrong no licence file found · pointer only · 0bf41e0b28d9835c · report
apply_rule ZmeiGorynych/generative_playground/src/generative_playground/codec/____mask_gen_new.py community (archive-listed) unverified MIT (permissive) · 3faecaf57e145016 · report
binarize ZmeiGorynych/generative_playground/src/generative_playground/codec/cyk.py community (archive-listed) unverified MIT (permissive) · bc3ae4805ca43d87 · report
bond_to_properties ZmeiGorynych/generative_playground/src/generative_playground/codec/hypergraph.py community (archive-listed) unverified MIT (permissive) · 1e29ad9a8377becb · report
cyk_parser ZmeiGorynych/generative_playground/src/generative_playground/codec/cyk.py community (archive-listed) unverified MIT (permissive) · 20bd268acd9f9e89 · report
eq_tokenizer ZmeiGorynych/generative_playground/src/generative_playground/codec/grammar_codec.py community (archive-listed) unverified MIT (permissive) · 9ac868c2c5da2396 · report
get_terminals_nonterminals ZmeiGorynych/generative_playground/src/generative_playground/codec/cyk.py community (archive-listed) unverified MIT (permissive) · c872f1c087b0e4e9 · report
get_zinc_tokenizer mkusner/grammarVAE/molecule_vae.py community (archive-listed) unverified no licence file found · pointer only · bd5df031b64e57d3 · report
get_zinc_tokenizer ZmeiGorynych/generative_playground/src/generative_playground/codec/grammar_codec.py community (archive-listed) unverified MIT (permissive) · 840377e5c6d40a66 · report
graph_tree_to_rules_list ZmeiGorynych/generative_playground/src/generative_playground/codec/hypergraph.py community (archive-listed) unverified MIT (permissive) · d6375326f73fec04 · report
normalize_frequencies ZmeiGorynych/generative_playground/src/generative_playground/codec/hypergraph_grammar.py community (archive-listed) unverified MIT (permissive) · d442fe47e76ee11d · report
pop_or_nothing ZmeiGorynych/generative_playground/src/generative_playground/codec/grammar_mask_gen.py community (archive-listed) unverified MIT (permissive) · 8b8b890289f16b07 · report
prods_to_eq ZmeiGorynych/generative_playground/src/generative_playground/codec/grammar_codec.py community (archive-listed) unverified MIT (permissive) · be8874e2b946911f · report
properties_to_bond ZmeiGorynych/generative_playground/src/generative_playground/codec/hypergraph.py community (archive-listed) unverified MIT (permissive) · f158928111217e25 · report
rule_d_term_dist ZmeiGorynych/generative_playground/src/generative_playground/codec/____mask_gen_new.py community (archive-listed) unverified MIT (permissive) · 6a2f91d9a7114208 · report
terminal_distance ZmeiGorynych/generative_playground/src/generative_playground/codec/____mask_gen_new.py community (archive-listed) unverified MIT (permissive) · b2a256f2bda78c93 · report

Tasks

Bayesian OptimizationSymbolic Regression

1 archive task tag without a task page not shown.

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections