Text Counterfactuals via Latent Optimization and Shapley-Guided Search
Not on the map. Why?
Abstract (arXiv)
We study the problem of generating counterfactual text for a classifier as a means for understanding and debugging classification. Given a textual input and a classification model, we aim to minimally alter the text to change the model's prediction. White-box approaches have been successfully applied to similar problems in vision where one can directly optimize the continuous input. Optimization-based approaches become difficult in the language domain due to the discrete nature of text. We bypass this issue by directly optimizing in the latent space and leveraging a language model to generate candidate modifications from optimized latent representations. We additionally use Shapley values to estimate the combinatoric effect of multiple changes. We then use these estimates to guide a beam search for the final counterfactual text. We achieve favorable performance compared to recent white-box and black-box baselines using human and automatic evaluations. Ablation studies show that both latent optimization and the use of Shapley values improve success rate and the quality of the generated counterfactuals.
Key facts. Cited by 16 papers in the map (data through 14 Oct 2026). Builds on 22 of its 34 references that are in the map. First posted on arXiv 22 Oct 2021.
Builds on
22 of 34 references.
References · 22
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,372
- 2014Explaining and Harnessing Adversarial Examplescited by 7,364
- 2017A Unified Approach to Interpreting Model Predictionscited by 6,555
- 2016SQuAD: 100,000+ Questions for Machine Comprehension of Textcited by 4,148
- 2016Towards Evaluating the Robustness of Neural Networkscited by 2,998
- 2019Is BERT Really Robust? A Strong Baseline for Natural Language Attack on Text Classification and Entailmentcited by 671
- 2020BERT-ATTACK: Adversarial Attack Against BERT Using BERTcited by 491
- 2018Universal Sentence Encodercited by 489
- 2019The many Shapley values for model explanationcited by 344
- 2020BAE: BERT-based Adversarial Examples for Text Classificationcited by 316
- 2019Towards Efficient Data Valuation Based on the Shapley Valuecited by 281
10 more
- 2017Toward Controlled Generation of Textcited by 272
- 2016Counter-fitting Word Vectors to Linguistic Constraintscited by 140
- 2020Contextualized Perturbation for Textual Adversarial Attackcited by 136
- 2018L-Shapley and C-Shapley: Efficient Model Interpretation for Structured Datacited by 100
- 2019Counterfactual Story Reasoning and Generationcited by 88
- 2019Transforming Delete, Retrieve, Generate Approach for Controlled Text Style Transfercited by 81
- 2020There and Back Again: Revisiting Backpropagation Saliency Methodscited by 60
- 2020Generating Plausible Counterfactual Explanations for Deep Transformers in Financial Text Classificationcited by 40
- 2019Word-level Textual Adversarial Attacking as Combinatorial Optimizationcited by 37
- 2019Controllable Unsupervised Text Attribute Transfer via Editing Entangled Latent Representationcited by 34
Built on by
Citing papers per year: 2021: 1; 2022: 3; 2023: 4; 2024: 4; 2025: 3; 2026: 1.
16 papers.
Sort:
By area:
- 2021Counterfactual Shapley Additive Explanationscited by 22
- 2024A Survey on Natural Language Counterfactual Generationcited by 21
- 2022"FIJO": a French Insurance Soft Skill Detection Datasetcited by 8
- 2023TIGTEC : Token Importance Guided TExt Counterfactualscited by 8
- 2023Towards Algorithmic Fairness by means of Instance-level Data Re-weighting based on Shapley Valuescited by 7
- 2025Reproducing HotFlip for Corpus Poisoning Attacks in Dense Retrievalcited by 7
- 2023Counterfactuals of Counterfactuals: a back-translation-inspired approach to analyse counterfactual editorscited by 6
- 2024A Rationale-centric Counterfactual Data Augmentation Method for Cross-Document Event Coreference Resolutioncited by 5
- 2024A Comparative Analysis of Counterfactual Explanation Methods for Text Classifierscited by 5
- 2025Truth or Twist? Optimal Model Selection for Reliable Label Flipping Evaluation in LLM-based Counterfactualscited by 5
- 2025Guiding LLMs to Generate High-Fidelity and High-Quality Counterfactual Explanations for Text Classificationcited by 3
- 2022A General Search-based Framework for Generating Textual Counterfactual Explanationscited by 2
4 more
- 2024Mitigating Text Toxicity with Counterfactual Generationcited by 2
- 2023Explaining Recommendation System Using Counterfactual Textual Explanationscited by 1
- 2026DRIV-EX: Counterfactual Explanations for Driving LLMscited by 1
- 2022Automatically Generating Counterfactuals for Relation Classificationcited by 0
- 2026DRIV-EX: Counterfactual Explanations for Driving LLMs28 Feb 2026
- 2025Truth or Twist? Optimal Model Selection for Reliable Label Flipping Evaluation in LLM-based Counterfactuals20 May 2025
- 2025Guiding LLMs to Generate High-Fidelity and High-Quality Counterfactual Explanations for Text Classification6 Mar 2025
- 2025Reproducing HotFlip for Corpus Poisoning Attacks in Dense Retrieval8 Jan 2025
- 2024A Comparative Analysis of Counterfactual Explanation Methods for Text Classifiers4 Nov 2024
- 2024A Survey on Natural Language Counterfactual Generation4 Jul 2024
- 2024Mitigating Text Toxicity with Counterfactual Generation16 May 2024
- 2024A Rationale-centric Counterfactual Data Augmentation Method for Cross-Document Event Coreference Resolution2 Apr 2024
- 2023Counterfactuals of Counterfactuals: a back-translation-inspired approach to analyse counterfactual editors26 May 2023
- 2023TIGTEC : Token Importance Guided TExt Counterfactuals24 Apr 2023
- 2023Explaining Recommendation System Using Counterfactual Textual Explanations14 Mar 2023
- 2023Towards Algorithmic Fairness by means of Instance-level Data Re-weighting based on Shapley Values3 Mar 2023
4 more
- 2022A General Search-based Framework for Generating Textual Counterfactual Explanations1 Nov 2022
- 2022"FIJO": a French Insurance Soft Skill Detection Dataset11 Apr 2022
- 2022Automatically Generating Counterfactuals for Relation Classification22 Feb 2022
- 2021Counterfactual Shapley Additive Explanations27 Oct 2021
- 2026DRIV-EX: Counterfactual Explanations for Driving LLMscited by 1
- 2026DRIV-EX: Counterfactual Explanations for Driving LLMs28 Feb 2026
- 2021Counterfactual Shapley Additive Explanationscited by 22
- 2024A Survey on Natural Language Counterfactual Generationcited by 21
- 2022"FIJO": a French Insurance Soft Skill Detection Datasetcited by 8
- 2023TIGTEC : Token Importance Guided TExt Counterfactualscited by 8
- 2023Towards Algorithmic Fairness by means of Instance-level Data Re-weighting based on Shapley Valuescited by 7
- 2025Reproducing HotFlip for Corpus Poisoning Attacks in Dense Retrievalcited by 7
- 2023Counterfactuals of Counterfactuals: a back-translation-inspired approach to analyse counterfactual editorscited by 6
- 2024A Rationale-centric Counterfactual Data Augmentation Method for Cross-Document Event Coreference Resolutioncited by 5
- 2024A Comparative Analysis of Counterfactual Explanation Methods for Text Classifierscited by 5
- 2025Truth or Twist? Optimal Model Selection for Reliable Label Flipping Evaluation in LLM-based Counterfactualscited by 5
- 2025Guiding LLMs to Generate High-Fidelity and High-Quality Counterfactual Explanations for Text Classificationcited by 3
- 2022A General Search-based Framework for Generating Textual Counterfactual Explanationscited by 2
12 most cited of 15 All 15 (JSON)
- 2025Truth or Twist? Optimal Model Selection for Reliable Label Flipping Evaluation in LLM-based Counterfactuals20 May 2025
- 2025Guiding LLMs to Generate High-Fidelity and High-Quality Counterfactual Explanations for Text Classification6 Mar 2025
- 2025Reproducing HotFlip for Corpus Poisoning Attacks in Dense Retrieval8 Jan 2025
- 2024A Comparative Analysis of Counterfactual Explanation Methods for Text Classifiers4 Nov 2024
- 2024A Survey on Natural Language Counterfactual Generation4 Jul 2024
- 2024Mitigating Text Toxicity with Counterfactual Generation16 May 2024
- 2024A Rationale-centric Counterfactual Data Augmentation Method for Cross-Document Event Coreference Resolution2 Apr 2024
- 2023Counterfactuals of Counterfactuals: a back-translation-inspired approach to analyse counterfactual editors26 May 2023
- 2023TIGTEC : Token Importance Guided TExt Counterfactuals24 Apr 2023
- 2023Explaining Recommendation System Using Counterfactual Textual Explanations14 Mar 2023
- 2023Towards Algorithmic Fairness by means of Instance-level Data Re-weighting based on Shapley Values3 Mar 2023
- 2022A General Search-based Framework for Generating Textual Counterfactual Explanations1 Nov 2022
12 newest of 15 All 15 (JSON)