Backbone Language Modeling for Constrained Natural Language Generation

Lili Mou, Rui Yan, Ge Li, Lu Zhang, Zhi JinarXiv 2015

Introduction

Recurrent Neural Networks (RNNs) are the cornerstone of modern language modeling, typically operating through a sequential, left-to-right generation process. While this paradigm is highly effective for unconstrained text generation, it faces significant challenges when a specific target word must be included in the output—a requirement common in applications like keyword-based dialogue systems or entity-centric question answering.

Existing methods for constrained generation often fall short. Incorporating the target word as an auxiliary input feature does not guarantee its appearance in the final output. Conversely, "hard-coding" the word into a pre-defined position often disrupts the grammatical flow, particularly if the word naturally belongs in the middle of a phrase. This paper introduces a novel "Backward and Forward" (B/F) architecture designed to overcome these limitations by generating text outwards from the constraint itself.

The Backward and Forward (B/F) Architecture

The core innovation of the B/F model is the decomposition of the joint probability of a sentence into backward and forward sequences centered around a "split word" ($w_s$). Instead of starting at the beginning of a sentence, the model begins with the constraint word and expands the context in both directions using Gated Recurrent Units (GRUs).

The authors explore two main architectural variants:

  • Synchronous B/F (syn-B/F): This model uses a single RNN to generate tokens in both directions simultaneously, stepping outward from the split word.
  • Asynchronous B/F (asyn-B/F): This more sophisticated approach employs two separate RNNs. In the first step, a backward RNN generates the entire left-side context. In the second step, the forward RNN generates the right-side context, conditioned on the previously generated backward sequence.
The two-step generation process of the asynchronous B/F model (asyn-B/F), showing how the backward sequence is generated first to condition the subsequent forward generation.

By conditioning the forward pass on the complete backward sequence, the asyn-B/F model can better capture long-range dependencies and ensure global sentence coherence compared to a synchronous or independent (sep-B/F) approach.

Experimental Evaluation

The models were trained and tested on a domain-specific dataset of approximately 25,000 computer science paper titles crawled from arXiv. This dataset provides a structured yet diverse set of templates, making it an ideal testbed for generating plausible titles around specific research keywords. Rare words were handled using an <unk> token, and the vocabulary was capped at 3,380 words.

Results and Discussion

The primary metric for evaluation was perplexity (PPL). While the B/F models show higher overall perplexity in general evaluation—largely because the random selection of split words during training breaks predictable starting templates like "A new approach..."—their performance in constrained scenarios is exceptional.

Quantitative comparison of perplexity (PPL) across various models. The 'oracle' rows indicate performance when the constraint word ($w_s$) is provided.

As shown in the results table, when the split word is provided as an oracle constraint, the asyn-B/F model achieves a perplexity of 89.8, a dramatic improvement over the sequential baseline's 152.2. This indicates that the model is highly efficient at utilizing the provided constraint to generate likely surrounding text.

Qualitative analysis further supports these findings. In case studies involving keywords like "tracking" or "systems," the asyn-B/F model consistently produced grammatically sound and contextually relevant titles. For instance, given the constraint "convolutional," the model generated: "deep convolutional neural networks for unk - based image segmentation." In contrast, standard sequential models often struggled to integrate such keywords naturally if they were not at the beginning of the sentence.

Conclusion

The Backward and Forward language modeling approach offers a powerful solution for constrained natural language generation. By generating from the "inside out," the model guarantees the inclusion of target words while maintaining high levels of fluency and coherence. The asynchronous variant, in particular, demonstrates the value of conditioning generation on the full context of the constraint. Future research will focus on extending this framework to handle multiple simultaneous constraints and applying it to more complex tasks such as abstractive summarization and document-level generation.

Summary updated

BibTeX
@misc{mou2015backbone,
  author = {Lili Mou and Rui Yan and Ge Li and Lu Zhang and Zhi Jin},
  title = {{Backbone Language Modeling for Constrained Natural Language Generation}},
  year = {2015},
  eprint = {1512.06612},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1512.06612},
}
Figure