Zero-shot LLM-guided Counterfactual Generation: A Case Study on NLP Model Evaluation

Amrita Bhattacharjee, Raha Moraffah, Joshua Garland, Huan Liu
5/8/2024
cs.CLcs.AIcs.LG

No official code found. Best implementation: AmritaBh/zero-shot-llm-counterfactual (1 star, last commit 2024-11-19).

Abstract

With the development and proliferation of large, complex, black-box models for solving many natural language processing (NLP) tasks, there is also an increasing necessity of methods to stress-test these models and provide some degree of interpretability or explainability. While counterfactual examples are useful in this regard, automated generation of counterfactuals is a data and resource intensive process. such methods depend on models such as pre-trained language models that are then fine-tuned on auxiliary, often task-specific datasets, that may be infeasible to build in practice, especially for new tasks and data domains. Therefore, in this work we explore the possibility of leveraging large language models (LLMs) for zero-shot counterfactual generation in order to stress-test NLP models. We propose a structured pipeline to facilitate this generation, and we hypothesize that the instruction-following and textual understanding capabilities of recent LLMs can be effectively leveraged for generating high quality counterfactuals in a zero-shot manner, without requiring any training or fine-tuning. Through comprehensive experiments on a variety of propreitary and open-source LLMs, along with various downstream tasks in NLP, we explore the efficacy of LLMs as zero-shot counterfactual generators in evaluating and explaining black-box NLP models.

View on arXivView PDF

Code Implementations(1)

10PythonSep 9, 20241 years ago

Similar Papers

Cite this paper

@article{bhattacharjee2024zeroshot,
  title  = {Zero-shot LLM-guided Counterfactual Generation: A Case Study on NLP Model Evaluation},
  author = {Amrita Bhattacharjee and Raha Moraffah and Joshua Garland and Huan Liu},
  year   = {2024},
  eprint = {2405.04793},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2405.04793v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2405.04793.svg)](https://codeofpaper.com/paper/2405.04793)

Discussion