arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2402.08225cs.LG
收藏

利用上下文重写改进黑盒鲁棒性

Improving Black-box Robustness with In-Context Rewriting

EleutherAI;University of Toronto(多伦多大学);Vector Institute(矢量研究所);MIT CSAIL(麻省理工学院计算机科学与人工智能实验室);Google(谷歌);University of Virginia(弗吉尼亚大学)

Kyle O'Brien, Nathan Ng, Isha Puri, Jorge Mendez, Hamid Palangi, Yoon Kim, Marzyeh Ghassemi, Thomas Hartvigsen

AI总结:

针对黑盒文本分类模型的 OOD 鲁棒性问题,提出用 LLM 生成上下文重写增强的 LLM-TTA,并通过熵选择性增强降低开销。

摘要:

用于文本分类的机器学习模型通常在分布内(ID)数据上表现出色,但在面对未见过的分布外(OOD)输入时会遇到困难。大多数用于提升 OOD 鲁棒性的技术并不适用于模型实际上是黑盒的场景,例如权重被冻结、重新训练成本高昂,或模型通过 API 调用。测试时增强(TTA)是一种简单的事后技术,通过聚合测试输入的多种增强结果的预测来提升鲁棒性,从而绕开黑盒限制。由于生成有效的自然语言增强存在挑战,TTA 在 NLP 中的应用一直有限。在本研究中,我们提出 LLM-TTA,它使用 LLM 生成的增强作为 TTA 的增强函数。在 BERT 和 T5 模型的情感、毒性和新闻分类任务中,LLM-TTA 优于传统增强函数;BERT 的 OOD 鲁棒性平均提升 4.48 个百分点,且平均 ID 性能没有退化。我们探索根据预测熵选择性地增强输入,以减少昂贵的 LLM 增强调用比例,从而在保持性能收益的同时,将生成增强的平均数量减少 57.74%。LLM-TTA 不依赖任务模型架构,不需要 OOD 标签,并在低资源和高资源场景下均有效。为便于复现,我们共享了数据、模型和代码。

英文摘要:

Machine learning models for text classification often excel on in-distribution (ID) data but struggle with unseen out-of-distribution (OOD) inputs. Most techniques for improving OOD robustness are not applicable to settings where the model is effectively a black box, such as when the weights are frozen, retraining is costly, or the model is leveraged via an API. Test-time augmentation (TTA) is a simple post-hoc technique for improving robustness that sidesteps black-box constraints by aggregating predictions across multiple augmentations of the test input. TTA has seen limited use in NLP due to the challenge of generating effective natural language augmentations. In this work, we propose LLM-TTA, which uses LLM-generated augmentations as TTA's augmentation function. LLM-TTA outperforms conventional augmentation functions across sentiment, toxicity, and news classification tasks for BERT and T5 models, with BERT's OOD robustness improving by an average of 4.48 percentage points without regressing average ID performance. We explore selectively augmenting inputs based on prediction entropy to reduce the rate of expensive LLM augmentations, allowing us to maintain performance gains while reducing the average number of generated augmentations by 57.74\%. LLM-TTA is agnostic to the task model architecture, does not require OOD labels, and is effective across low and high-resource settings. We share our data, models, and code for reproducibility.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑