Adversarial Transformer Language Models for Contextual Commonsense Inference

Pedro Colon-Hernandez, Henry Lieberman, Yida Xin, Claire Yin, Cynthia Breazeal, Peter ChinarXiv 2023

Abstract

Contextualized or discourse-aware commonsense inference is the task of generating coherent commonsense assertions from a given story and a specific target sentence. This task faces challenges such as lack of controllability, insufficient commonsense knowledge during training, and the generation of hallucinated or false facts. We present an integrated system utilizing a transformer model that addresses these issues through three key innovations: a "hinting" technique for controllable generation, a methodology for joint inference across multiple knowledge bases (ConceptNet, ATOMIC2020, and GLUCOSE), and a GAN architecture to enhance the plausibility of generated assertions. Our results demonstrate that this approach produces controllable and highly plausible contextual commonsense inferences.

Introduction

While modern Large Language Models (LLMs) possess vast amounts of information, they often struggle with contextual commonsense. When provided with a narrative, they may generate generic facts that are true in isolation but irrelevant to the specific story context. This paper addresses three primary hurdles in contextual commonsense inference:

  1. Controllability: The difficulty in steering a model to generate inferences about specific topics or entities within a story.
  2. Knowledge Gaps: The tendency of standard pre-training to miss implicit knowledge humans take for granted.
  3. Factuality: The risk of models "hallucinating" plausible-sounding but contextually inappropriate assertions.
Overview of the contextual commonsense inference task

Methodology

The proposed framework tackles these challenges through a three-pronged approach involving controllable prompting, knowledge graph alignment, and adversarial refinement.

Hinting for Controllable Generation

To improve controllability, we introduce "hinting," a hybrid prefix-prompting technique. It combines "hard prompts"—actual words from a target assertion—with "soft prompts," which are trainable virtual templates represented by special symbols like <|subj|> or <|obj|>. This mechanism acts as a control signal, advising the language model on "what to talk about" without requiring full retraining for every new topic.

Examples of how hinting influences model output across different subjects and objects

Joint Inference across Knowledge Graphs

Joint inference of commonsense requires care due to its inherent imprecision and flexible levels of generality. To address this, we align textual assertions from three major knowledge graphs—ConceptNet (general world knowledge), ATOMIC2020 (social commonsense), and GLUCOSE (contextualized story explanations)—into a unified "contextual universe." We use semantic embeddings (Sentence-BERT) to map symbolic knowledge triples to specific sentences within the ROCStories corpus. This alignment allows a single model to perform joint inference across diverse types of commonsense reasoning, creating a massive training set of ~1.48 million examples.

Adversarial Training (GAN)

To ensure the plausibility of generated facts, we implement a Generative Adversarial Network (GAN) architecture. A Generator (based on BART) produces the inference, while a Discriminator (also BART) scores the assertion's authenticity. To handle the non-differentiable nature of discrete text generation, we employ a "soft argmax" approximation. This involves a dot product between softmax scores and the embedding matrix, allowing gradients to flow from the discriminator back to the generator for end-to-end training.

Experimental Results

Automated Metrics

Automated metrics show that hinting significantly boosts performance. On the ParaCOMET dataset, the hinted model achieved a BLEU score of 42.7, outperforming the non-hinted baseline of 41.9. This indicates that providing even minimal structural hints helps the model anchor its reasoning in the provided context.

Human Evaluation

Human evaluation further validated the model's reliability. Inferences were judged for plausibility on a 5-point Likert scale, with 84% to 90% of generated assertions rated as plausible (3 or higher). This suggests that the combination of hinting and adversarial training effectively steers the model toward contextually relevant and factually sound outputs.

Efficiency of Joint Inference

The results demonstrate that a single model can successfully perform joint inference across multiple knowledge bases without a significant drop in quality. This consolidation effectively integrates different dimensions of commonsense reasoning—from general world facts to social cause-and-effect—into one cohesive architecture.

Limitations and Future Work

While effective, the system has limitations. The "soft argmax" used for GAN training is an approximation that can introduce noise compared to discrete token selection. Additionally, the "confounder loss" (shuffling subjects and objects to train the discriminator) can occasionally produce "false negatives"—shuffled sentences that happen to be factually true—which might confuse the discriminator during training. Future work will focus on refining these approximations and exploring more complex decoding strategies, such as beam search or top-p sampling, to further enhance the quality of generated commonsense knowledge.

Conclusion

This work presents an integrated system for contextual commonsense inference that addresses the limitations of standard language models. By combining hybrid prompting, multi-source knowledge alignment, and adversarial training, we achieve a model capable of generating controllable, plausible, and contextually grounded assertions.

Summary updated

BibTeX
@misc{colonhernandez2023adversarial,
  author = {Pedro Colon-Hernandez and Henry Lieberman and Yida Xin and Claire Yin and Cynthia Breazeal and Peter Chin},
  title = {{Adversarial Transformer Language Models for Contextual Commonsense Inference}},
  year = {2023},
  eprint = {2302.05406},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2302.05406},
}
Figure