Explanation Graph Generation via Pre-trained Language Models: An Empirical Study with Contrastive Learning

Swarnadeep Saha, Prateek Yadav, Mohit Bansal · DOI

Introduction

While Large Language Models (LLMs) have demonstrated remarkable proficiency in generating fluent natural language, their ability to produce structured, logical outputs remains a significant challenge. In the context of reasoning tasks, "explanation graphs" serve as a transparent bridge between a belief and an argument, providing a structured chain of thought. However, standard pre-trained language models (PLMs) often struggle with these formats, frequently generating graphs that are either structurally invalid (e.g., disconnected or containing cycles) or semantically nonsensical. This study explores a framework to improve the structural and semantic integrity of these graphs using contrastive learning and targeted graph perturbations.

The Challenge of Structured Reasoning

The primary difficulty in generating explanation graphs lies in the dual requirement of structural soundness and semantic accuracy. Models often "hallucinate" graph components, leading to disconnected components or circular logic. Furthermore, they may assign incorrect relations between nodes—for instance, asserting that "fast food" is a "part of" "salads." Because high-quality, human-annotated graph data is both expensive and scarce, teaching models these constraints requires a more data-efficient approach than simple supervised fine-tuning.

Methodology: Contrastive Learning and Perturbations

The authors propose a framework that utilizes contrastive learning to provide models with explicit signals regarding the quality of generated graphs. Central to this approach is the creation of "negative" examples through graph perturbations.

1. Graph Perturbation Strategies

To train the model to distinguish between valid and invalid reasoning, the researchers generated three types of negative graphs from gold-standard data:

  • Synthetic Structural (SySt): These perturbations break the graph's topology by removing edges to cause disconnections or adding edges to create cycles.
  • Synthetic Semantic (SySe): These maintain the graph's structure but swap edge relations with incorrect alternatives (e.g., changing a "causes" relation to "is not a").
  • Human-like Semantic (HuSe): These utilize actual errors made by humans during data collection, representing "hard negatives" that are more difficult for a model to distinguish from correct reasoning.
  • Positive Perturbations: Variations of correct graphs are created by replacing nodes with synonyms to improve model robustness.

2. Contrastive Learning Models

The study evaluated several contrastive objectives:

  • Max-Margin Loss: This function penalizes the model if the probability assigned to a negative graph is too close to that of the gold-standard graph.
  • InfoNCE: This framework pulls the representations of positive graphs closer to the gold standard in the embedding space while pushing negative examples away.
  • HuSe-Gen: To address the scarcity of human error data, the authors trained a specialized model to generate synthetic "human-like" incorrect edges, effectively augmenting the training set with high-quality negative examples.

Experimental Results

The proposed methods were tested on two primary datasets: ExplaGraphs (commonsense reasoning) and Temporal Graph Generation (event sequencing). The contrastive approach yielded substantial improvements over the T5-Large baseline:

  • Structural and Semantic Gains: On the ExplaGraphs task, the contrastive model improved Structural Accuracy (StCA) from 51.0% to 60.5% and Semantic Accuracy (SeCA) from 34.7% to 43.5%.
  • Generalization: The method proved effective beyond commonsense reasoning; on temporal graphs, structural accuracy increased by nearly 8%.
  • Human Preference: In head-to-head evaluations via Amazon Mechanical Turk, human raters preferred graphs generated by the Max-Margin model 13% more often than those from the baseline T5 model.

Key Insights and Future Directions

A critical finding of this research is that "human-like" errors are the most effective teachers. These subtle, diverse errors force the model to learn finer semantic boundaries than random perturbations. While the contrastive learning approach acts as a vital "structural guardrail," limitations remain. Current models tend to favor simple linear chains over more complex, branching topologies. Future work will focus on improving structural diversity and moving toward "open-schema" generation, where models can define their own relations rather than relying on predefined sets like ConceptNet. Additionally, exploring how these techniques scale to massive decoder-only architectures like GPT-4 remains a promising avenue for ensuring logical consistency in the next generation of AI.

Summary updated

BibTeX
@inproceedings{saha2022explanation,
  author = {Swarnadeep Saha and Prateek Yadav and Mohit Bansal},
  title = {{Explanation Graph Generation via Pre-trained Language Models: An Empirical Study with Contrastive Learning}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2022},
  url = {https://openreview.net/forum?id=hLNMgVijTk},
}
Figure