Counterfactual data augmentation (CDA) -- i.e., adding minimally perturbed inputs during training -- helps reduce model reliance on spurious correlations and improves generalization to out-of-distribution (OOD) data. Prior work on generating counterfactuals only considered restricted classes of perturbations, limiting their effectiveness. We present COunterfactual Generation via Retrieval and Editing (CORE), a retrieval-augmented generation framework for creating diverse counterfactual perturbations for CDA. For each training example, CORE first performs a dense retrieval over a task-related unlabeled text corpus using a learned bi-encoder and extracts relevant counterfactual excerpts. CORE then incorporates these into prompts to a large language model with few-shot learning capabilities, for counterfactual editing. Conditioning language model edits on naturally occurring data results in diverse perturbations. Experiments on natural language inference and sentiment analysis benchmarks show that CORE counterfactuals are more effective at improving generalization to OOD data compared to other DA approaches. We also show that the CORE retrieval framework can be used to encourage diversity in manually authored perturbations
翻译:反事实数据增强(CDA) -- -- 即在培训期间增加极少扰动的投入 -- -- 有助于减少对虚假关联的模型依赖,并改进对分配(OOOD)数据外的数据的概括化。以前关于生成反事实的工作仅被视为有限的扰动类别,限制其效力。我们通过检索和编辑(CORE)提出通过检索和编辑(CORE)生成COunterfactal actual 生成,这是一个为CDA创建多种反事实扰动的检索强化框架。对于每个培训实例来说,CORE首先利用一个学习过的双编码对任务相关无标签文本库进行密集检索,并摘录相关的反事实摘录。然后CORE将这些内容纳入一个具有微小学习能力的大型语言模型的提示,用于反事实编辑。对自然发生的数据结果进行调动词编辑。关于自然语言推断和情绪分析基准的实验表明,CORE反事实表明,与其他DA方法相比,CORE反事实比较对于改进OD数据的一般化效果更大。我们还表明,在每次DA方法中,可使用手动性搜索框架,鼓励人工搜索作者使用。