Learning with Contrastive Examples for Data-to-Text Generation

Yui Uehara, Tatsuya Ishigaki, Kasumi Aoki, Hiroshi Noji, Keiichi Goshima, Ichiro Kobayashi, Hiroya Takamura, Yusuke Miyao

Abstract

Neural data-to-text models often generate fluent but factually incorrect summaries, such as reporting a stock "gain" when data indicates a "drop." This paper introduces a framework for training models using contrastive examples—incorrect sentences paired with correct ones—and specialized loss functions to provide a "what not to do" signal. Our results demonstrate a significant boost in factual correctness without sacrificing the natural flow of the generated text.

Introduction

In data-to-text generation, models transform structured data into human-readable summaries. While modern neural models produce fluent text, they frequently struggle with factual accuracy. In the financial domain, a single word choice can reverse the entire meaning of a report. For instance, a model might correctly identify a movement in the Nikkei index but mistakenly generate "gained" instead of "dropped." Standard training using Cross-Entropy loss maximizes the probability of the correct word but does not explicitly penalize factually opposite alternatives. This work aims to bridge this gap using contrastive learning to sharpen lexical choice.

Methods

The proposed framework consists of two main components: rule-based contrastive generation and specialized loss functions.

Rule-Based Contrastive Generation

The authors defined a set of "crucial terms" (e.g., gain, loss, rebound, high, low) and created rules to swap them. For example, if a gold sentence states "Nikkei gained," the rule generates a contrastive example: "Nikkei dropped."

Contrastive Loss Functions

Three loss functions were developed to incorporate negative examples into training:

  • Unlikelihood Loss (UNLIKE): Explicitly lowers the probability of the incorrect contrastive token.
  • Sentence-level Margin Loss (SENT): Ensures the likelihood of the entire correct sentence exceeds the incorrect one by a specified margin.
  • Token-level Margin Loss (TOKEN): A hybrid approach enforcing a margin between the correct and contrastive tokens at the point of divergence.
Overview of the proposed model architecture and contrastive loss framework.

The base architecture is an LSTM-based encoder-decoder model that processes multiple stock indices (e.g., Nikkei 225, Dow Jones) as input.

Experimental Setup

The study utilized a Japanese market comment dataset. The input consists of 10 market indices tracked every five minutes (short-term) and daily closing prices (long-term). The output comprises market comments from Nikkei Quick News. The dataset includes approximately 16,000 training sentences, with over 77% containing at least one "crucial term" suitable for contrastive rule application.

Results and Discussion

The models were evaluated using standard metrics like BLEU and a domain-specific Error Rate ($E_{fluc}$), which measures the frequency of incorrect contrastive terms.

Performance comparison of the baseline and proposed models across various metrics.

Key Findings

  • Correctness Boost: The TOKEN loss model reduced the error rate from 7.69% (Baseline) to 6.08%. Human evaluation confirmed this, with experts judging the TOKEN model as more correct 32 times compared to only 5 times for the baseline in a targeted subset.
  • The "Similar Meaning" Paradox: Replacing a word with a relatively close meaning (e.g., swapping "rebound" with "continual rise") was more effective for training than simply using direct antonyms. This suggests that models struggle most with fine-grained distinctions between similar movements.
  • Fluency Preservation: Human judges found no significant difference in fluency between the baseline and contrastive models, indicating that accuracy improvements do not come at the cost of naturalness.
  • BLEU Limitations: BLEU scores did not significantly change even when factual correctness improved, reinforcing that BLEU is a poor proxy for accuracy in data-to-text tasks.

Conclusion

This research demonstrates that contrastive learning with targeted negative examples can significantly improve the factual reliability of data-to-text models. While the current method relies on heuristic rules for the financial domain, future work will explore automatic generation of contrastive examples to extend this framework to more diverse vocabularies and complex contextual errors.

Summary updated

BibTeX
@inproceedings{uehara2020learning,
  author = {Yui Uehara and Tatsuya Ishigaki and Kasumi Aoki and Hiroshi Noji and Keiichi Goshima and Ichiro Kobayashi and Hiroya Takamura and Yusuke Miyao},
  title = {{Learning with Contrastive Examples for Data-to-Text Generation}},
  booktitle = {International Conference on Computational Linguistics},
  year = {2020},
  doi = {10.18653/v1/2020.coling-main.213},
}
Figure