Abstract
Identifying causal relationships between events in natural language is a fundamental task for advanced NLP applications. Traditional methods often rely on complex graph structures or sensitive prompt engineering. We present In-Context Contrastive Learning (ICCL), a novel framework that enhances the "learning by example" capability of in-context learning with a supervised contrastive module. By explicitly separating causal from non-causal patterns in the embedding space, ICCL achieves state-of-the-art results while reducing the need for complex, hand-tuned prompt engineering.
Introduction
Event Causality Identification (ECI) aims to determine if a causal link exists between two event mentions (e.g., "The rain caused the flight delay"). This capability is critical for downstream tasks such as question answering, document summarization, and causal reasoning. Current ECI approaches generally fall into two categories: graph-based methods, which model event interactions but often miss latent common-sense knowledge, and prompt-based methods, which leverage large language models (LLMs) but are notoriously sensitive to minor changes in prompt phrasing.
A significant limitation of standard In-Context Learning (ICL) is its inability to explicitly distinguish between positive (causal) and negative (non-causal) demonstrations. While ICL provides examples to guide the model, it does not inherently teach the model the contrastive boundaries between these classes.
Methodology
The ICCL framework integrates three synergistic modules to improve causality identification:
- Prompt Learning Module: This module retrieves a set of causal and non-causal "demonstrations" from the training set and prepends them to the target query. It utilizes a simple cloze-style template to format the input for the language model.
- In-context Contrastive Module: This is the core innovation of the framework. It employs Supervised Contrastive Learning to refine the model's internal representations. Specifically, it calculates a "relation vector" ($z = h_{e1} - h_{e2}$) representing the offset between the hidden states of the two event mentions. The model is then trained to minimize the distance between the query's relation vector and positive demonstration vectors while maximizing the distance from negative ones.
- Causality Prediction Module: The final classification is performed using a
[MASK]token and a "verbalizer" that maps the model's internal states to discrete labels: "Causal" or "None."
The entire system is trained jointly, balancing the standard prediction loss ($L_{pre}$) with the new contrastive loss ($L_{con}$).
Experiments and Results
Datasets
The authors evaluated ICCL on two primary benchmarks: the EventStoryLine Corpus (ESC), featuring over 5,000 event mentions across 22 topics, and the Causal-TimeBank (CTB), a high-quality dataset of 184 news documents.
Key Findings
ICCL established new state-of-the-art (SOTA) benchmarks on both datasets. On the ESC benchmark, it achieved F1-scores of 70.4% for intra-sentence and 61.3% for cross-sentence causality using a RoBERTa-base backbone. On CTB, it reached an F1-score of 65.4%.
Beyond raw performance, several key insights emerged:
- Relation Offsets: Using the difference between event embeddings effectively captures the relational semantics of causality.
- Explicit Analogy: By forcing the model to compare queries to examples in the embedding space, ICCL improves the model's ability to generalize from few examples.
- Robustness: Unlike standard ICL, which can degrade with longer contexts, the contrastive module helps ICCL maintain focus on relevant event pairs.
- Few-Shot Efficiency: ICCL outperformed established models trained on full datasets even when using only 20% of the training data.
- Visualization: t-SNE plots of the embeddings show that ICCL creates much tighter, more distinct clusters for causal vs. non-causal pairs compared to standard prompting or basic ICL.
Conclusion
ICCL addresses the limitations of standard in-context learning for ECI by introducing an explicit contrastive mechanism. While currently constrained by the context window of underlying language models and the availability of balanced training pairs, the framework demonstrates significant potential. Future work will explore the application of in-context contrastive learning to other relationship extraction tasks within the NLP domain.
Summary updated