KFCNet: Knowledge Filtering and Contrastive Learning Network for Generative Commonsense Reasoning

Haonan Li, Yeyun Gong, Jian Jiao, Ruofei Zhang, Timothy Baldwin, Nan DuanarXiv 2021

Abstract

KFCNet (Knowledge Filtering and Contrastive learning Network) addresses the limitations of large pre-trained language models in generative commonsense reasoning. By integrating a two-stage "retrieval-and-filter" system with dual contrastive learning at both the encoder and decoder levels, KFCNet effectively leverages external knowledge while mitigating noise. Experimental results on the CommonGen benchmark show that KFCNet achieves a new state-of-the-art, outperforming previous models by over 6 BLEU-4 points and demonstrating superior capture of semantic propositional content.

Introduction

Generative commonsense reasoning remains a significant challenge for large pre-trained language models (PLMs) like GPT and BART. While these models generate fluent text, they often struggle to maintain logical consistency or capture implicit relationships between concepts (e.g., {dog, frisbee, catch, park}). This difficulty arises from three primary factors: a gap in real-world relational knowledge, the introduction of irrelevant "noise" from retrieved external prototypes, and the inability of standard training objectives to force the capture of global target semantics during encoding.

Methodology

KFCNet introduces a multi-stage framework designed to bridge the knowledge gap and refine semantic mapping.

The architecture of KFCNet, illustrating the dual contrastive learning framework and the retrieval-augmented generation process.

Two-Stage Retrieval and Filtering

To provide the model with relevant context, KFCNet utilizes a retrieval mechanism:

  1. Sparse Search (BM25): Identifies candidate sentences containing the required concept keywords.
  2. BERT-Filter: A dense BERT-based model scores these candidates to ensure semantic alignment with the target goal, effectively filtering out noisy or irrelevant prototypes.

Dual Contrastive Learning

To ensure the model learns robust semantic representations, KFCNet employs contrastive learning in two areas:

  • Encoder Contrastive Learning: Uses a memory bank and the MoCo framework to force the encoder to distinguish the global semantics of the target sentence from negative examples.
  • Decoder Contrastive Learning: Minimizes the distance between representations of sentences generated from different high-quality prototypes of the same concept set, ensuring the model learns underlying logic rather than surface-level mimicry.

Experiments and Results

The primary evaluation was conducted on the CommonGen benchmark, which tests a model's ability to generate coherent sentences from sets of 3–5 concepts.

Performance comparison and ablation study of KFCNet against state-of-the-art models on the CommonGen dataset.

As shown in the results, KFCNet achieved a new state-of-the-art on the CommonGen leaderboard with a BLEU-4 of 42.45, a substantial improvement over the previous best of 35.9. The ablation studies (KFCNet w/o FC and w/o C) confirm that both the filtering and contrastive components are essential for these gains. Furthermore, the model showed significant improvements in the SPICE metric (33.27 vs. 29.6), indicating a better grasp of semantic propositional content.

Discussion and Insights

A critical finding of this research is that filtering is as important as retrieval. The authors observed that adding retrieved sentences without filtering can actually degrade performance due to noise. Additionally, KFCNet's reliance on natural language prototypes proved more effective than using structured knowledge graphs (e.g., KG-BART), suggesting that PLMs are better at exploiting the inherent fluency of natural language than the rigid structure of graph nodes.

Conclusion

KFCNet sets a new standard for generative commonsense reasoning by combining retrieval-augmentation with dual contrastive learning. While the framework involves computational overhead during training due to the two-stage retrieval and memory bank requirements, the contrastive modules are disabled during inference, ensuring efficiency. Future work will explore applying this contrastive framework to a broader range of natural language understanding and representation learning tasks.

Summary updated

Abstract

Pre-trained language models have led to substantial gains over a broad range of natural language processing (NLP) tasks, but have been shown to have limitations for natural language generation tasks with high-quality requirements on the output, such as commonsense generation and ad keyword generation. In this work, we present a novel Knowledge Filtering and Contrastive learning Network (KFCNet) which references external knowledge and achieves better generation performance. Specifically, we propose a BERT-based filter model to remove low-quality candidates, and apply contrastive learning separately to each of the encoder and decoder, within a general encoder--decoder architecture. The encoder contrastive module helps to capture global target semantics during encoding, and the decoder contrastive module enhances the utility of retrieved prototypes while learning general features. Extensive experiments on the CommonGen benchmark show that our model outperforms the previous state of the art by a large margin: +6.6 points (42.5 vs. 35.9) for BLEU-4, +3.7 points (33.3 vs. 29.6) for SPICE, and +1.3 points (18.3 vs. 17.0) for CIDEr. We further verify the effectiveness of the proposed contrastive module on ad keyword generation, and show that our model has potential commercial value.
BibTeX
@misc{li2021kfcnet,
  author = {Haonan Li and Yeyun Gong and Jian Jiao and Ruofei Zhang and Timothy Baldwin and Nan Duan},
  title = {{KFCNet: Knowledge Filtering and Contrastive Learning Network for Generative Commonsense Reasoning}},
  year = {2021},
  eprint = {2109.06704},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2109.06704},
}
Figure