NEUROSTRUCTURAL DECODING: Neural Text Generation with Structural Constraints

Mohaddeseh Bastan, Mihai Surdeanu, Niranjan BalasubramanianACL 2023

Introduction

Controllable text generation has traditionally relied on lexical constraints—ensuring specific keywords appear in the output. However, this "bag-of-words" approach often fails to capture the intended meaning. For instance, the sentences "John introduced Kayla to Sarah" and "Kayla introduced Sarah to John" share the same keywords but describe entirely different events. To address this, we present NeuroStructural Decoding, an algorithm that enforces syntactic relationships during the decoding process to ensure generated text is both word-accurate and structurally correct.

Comparison of lexical vs. structural constraints.

Methodology

NeuroStructural Decoding integrates a dependency parser directly into the beam search process. This allows the model to track and satisfy lexico-syntactic constraints in real-time.

Constraint Hierarchy

The framework supports three levels of structural complexity:

  1. Unary: Assigns a specific role to a word (e.g., "ball" as an object).
  2. Binary: Defines a dependency between two words (e.g., "team" as the subject of "run").
  3. Triplet: Establishes a two-way relation (e.g., "team" as subject and "field" as object of the verb "run").

Real-time Parsing and Decoding

Standard dependency parsers are designed for complete sentences. To enable parsing during the step-by-step generation process, the authors adapted a parser (based on Stanza) by training it on sentence fragments. The decoding algorithm then treats generation as a maximization problem, using a scoring function that penalizes unsatisfied constraint clauses expressed in Conjunctive Normal Form (CNF).

Experimental Evaluation

The approach was tested across three diverse tasks: commonsense reasoning (CommonGen), biomedical mechanism generation (SuMe), and machine translation (WMT19 German-English).

Key Results

Across all benchmarks, structural constraints consistently outperformed vanilla beam search and lexical-only decoding. In the CommonGen task, using the BART model with Triplet constraints led to a significant increase in structural coverage, reaching 72.2% compared to 41.5% for the baseline.

Performance metrics for the CommonGen task across T5 and BART models.

In biomedical summarization, the model showed improved "Relation Generation" (RG) scores, indicating a better grasp of biological mechanisms. Notably, in machine translation, while lexical constraints alone reduced BLEU scores, NeuroStructural Decoding improved them to 42.35, suggesting that structural context is vital for accurate translation.

Discussion and Future Work

NeuroStructural Decoding demonstrates that syntax serves as an effective proxy for semantics in constrained generation. By moving beyond simple keyword matching, models can better preserve the "who did what to whom" logic of a sentence.

Future research will focus on expanding this framework to low-resource languages, scaling it to larger language models (LLMs), and incorporating more advanced semantic representations like Semantic Role Labeling (SRL). While the current reliance on a dependency parser introduces a potential bottleneck, the gains in structural fidelity mark a significant step forward for controllable neural text generation.

Summary updated

BibTeX
@inproceedings{bastan2023neurostructural,
  author = {Mohaddeseh Bastan and Mihai Surdeanu and Niranjan Balasubramanian},
  title = {{NEUROSTRUCTURAL DECODING: Neural Text Generation with Structural Constraints}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.acl-long.528},
}
Figure