JOURNAL ARTICLE

TreeGAN: Syntax-Aware Sequence Generation with Generative Adversarial Networks

Abstract

Generative Adversarial Networks (GANs) have shown great capacity on image generation, in which a discriminative model guides the training of a generative model to construct images that resemble real images. Recently, GANs have been extended from generating images to generating sequences (e.g., poems, music and codes). Existing GANs on sequence generation mainly focus on general sequences, which are grammar-free. In many real-world applications, however, we need to generate sequences in a formal language with the constraint of its corresponding grammar. For example, to test the performance of a database, one may want to generate a collection of SQL queries, which are not only similar to the queries of real users, but also follow the SQL syntax of the target database. Generating such sequences is highly challenging because both the generator and discriminator of GANs need to consider the structure of the sequences and the given grammar in the formal language. To address these issues, we study the problem of syntax-aware sequence generation with GANs, in which a collection of real sequences and a set of pre-defined grammatical rules are given to both discriminator and generator. We propose a novel GAN framework, namely TreeGAN, to incorporate a given Context-Free Grammar (CFG) into the sequence generation process. In TreeGAN, the generator employs a recurrent neural network (RNN) to construct a parse tree. Each generated parse tree can then be translated to a valid sequence of the given grammar. The discriminator uses a tree-structured RNN to distinguish the generated trees from real trees. We show that TreeGAN can generate sequences for any CFG and its generation fully conforms with the given syntax. Experiments on synthetic and real data sets demonstrated that TreeGAN significantly improves the quality of the sequence generation in context-free languages.

Keywords:
Computer science Parsing Artificial intelligence Generative grammar Generator (circuit theory) Natural language processing Grammar Discriminative model Tree (set theory) Syntax Sequence (biology) Programming language Linguistics Mathematics

Metrics

20
Cited By
2.38
FWCI (Field Weighted Citation Impact)
26
Refs
0.90
Citation Normalized Percentile
Is in top 1%
Is in top 10%

Citation History

Topics

Natural Language Processing Techniques
Physical Sciences →  Computer Science →  Artificial Intelligence
Topic Modeling
Physical Sciences →  Computer Science →  Artificial Intelligence
Multimodal Machine Learning Applications
Physical Sciences →  Computer Science →  Computer Vision and Pattern Recognition

Related Documents

JOURNAL ARTICLE

Polyphonic Music Generation with Sequence Generative Adversarial Networks

Sang-gil LeeUiwon HwangSeonwoo MinSungroh Yoon

Journal:   Journal of KIISE Year: 2024 Vol: 51 (1)Pages: 78-85
JOURNAL ARTICLE

Attribute-Aware Generative Design With Generative Adversarial Networks

Chenxi YuanMohsen Moghaddam

Journal:   IEEE Access Year: 2020 Vol: 8 Pages: 190710-190721
JOURNAL ARTICLE

Synthetic Behavior Sequence Generation Using Generative Adversarial Networks

Fateme AkbariKamran SartipiNorm Archer

Journal:   ACM Transactions on Computing for Healthcare Year: 2022 Vol: 4 (1)Pages: 1-23
JOURNAL ARTICLE

Multimode Generative Adversarial Networks for Sequence Data Generation

Weijie KangJunjie XueJiyang XiaoHaizhen ZhuJianfeng LiChangjun Li

Journal:   Journal of Physics Conference Series Year: 2021 Vol: 1827 (1)Pages: 012209-012209
© 2026 ScienceGate Book Chapters — All rights reserved.