Skip to main content
QUICK REVIEW

[论文解读] Mask-guided BERT for Few Shot Text Classification

Wenxiong Liao, Zhengliang Liu|arXiv (Cornell University)|Feb 21, 2023
Topic ModelingComputer Science被引用 3
一句话总结

本文提出 Mask-BERT,一种新颖的少样本文本分类框架,通过应用可学习掩码来过滤无关标记并引导注意力聚焦于判别性特征,从而提升 BERT 的性能。通过将对比学习与基础领域中的锚点样本相结合,Mask-BERT 在开放域和医学 NLP 基准测试中均取得了最先进结果,相较于提示微调和元学习方法,展现出更高的鲁棒性和稳定性,且在不同掩码比例下表现稳定。

ABSTRACT

Transformer-based language models have achieved significant success in various domains. However, the data-intensive nature of the transformer architecture requires much labeled data, which is challenging in low-resource scenarios (i.e., few-shot learning (FSL)). The main challenge of FSL is the difficulty of training robust models on small amounts of samples, which frequently leads to overfitting. Here we present Mask-BERT, a simple and modular framework to help BERT-based architectures tackle FSL. The proposed approach fundamentally differs from existing FSL strategies such as prompt tuning and meta-learning. The core idea is to selectively apply masks on text inputs and filter out irrelevant information, which guides the model to focus on discriminative tokens that influence prediction results. In addition, to make the text representations from different categories more separable and the text representations from the same category more compact, we introduce a contrastive learning loss function. Experimental results on public-domain benchmark datasets demonstrate the effectiveness of Mask-BERT.

研究动机与目标

  • 解决因标注数据有限而导致的过拟合和泛化能力差的问题。
  • 为少样本 NLP 提供一种简单、模块化的替代方案,以替代复杂的提示微调和元学习方法。
  • 通过可学习掩码聚焦注意力于判别性标记,提升模型的鲁棒性和泛化能力。
  • 利用稳定锚点样本的对比学习,提升类间特征的可分性和紧凑性。

提出的方法

  • 在输入文本上应用可学习掩码机制,以过滤低贡献标记,并引导 BERT 的注意力聚焦于更具判别性的特征。
  • 利用基础数据集中的锚点样本,稳定表示学习,并在新类别适应过程中引导模型。
  • 引入对比学习损失,以最小化类内方差并最大化类间边际距离。
  • 该框架在基础数据集上通过微调进行训练,随后仅使用少量标注样本即可适应新类别。
  • 掩码比例从 0.05 到 0.85 不等,模型在该范围内表现出稳定性能,表明其具备鲁棒性。
  • 使用 UMAP 可视化中间表示,以证明相比标准 BERT,Mask-BERT 的类别分离效果更好,聚类更紧密。
Figure 1: (A). The overall framework of Mask-BERT. This framework includes three steps: 1) Fine-tune the parameters of BERT on the base dataset. 2) Select anchor samples from the base dataset. 3) Take few-shot novel samples and anchor samples to fine-tune the model. (B). Generate input masks for anc
Figure 1: (A). The overall framework of Mask-BERT. This framework includes three steps: 1) Fine-tune the parameters of BERT on the base dataset. 2) Select anchor samples from the base dataset. 3) Take few-shot novel samples and anchor samples to fine-tune the model. (B). Generate input masks for anc

实验结果

研究问题

  • RQ1可学习掩码策略是否能在不依赖提示工程的情况下提升少样本文本分类性能?
  • RQ2锚点样本与对比学习的结合如何影响低资源设置下的模型泛化能力?
  • RQ3所提出的掩码机制是否能在不同掩码比例下实现更稳定和鲁棒的性能表现?
  • RQ4Mask-BERT 是否能在少样本文本分类任务中超越现有的提示微调和元学习基线方法?

主要发现

  • 在医学领域数据集上,Mask-BERT 的性能优于所有对比方法,包括 BERT、Re-init-BERT、CNN-BERT 和 FPT-BERT。
  • 在 AG News 和 NICTA-PIBOSO 数据集上,消融实验表明,加入对比损失可使 5-shot 设置下的准确率从 0.753 提升至 0.821(±0.040)。
  • 同时包含锚点样本和掩码机制时,准确率相比仅使用对比损失(从 0.809 提升至 0.821)提高了 0.012。
  • 模型在不同掩码比例下保持高度稳定性,所有数据集的准确率平均标准差仅为 0.006。
  • 可视化结果表明,与标准 BERT 相比,Mask-BERT 生成的类别聚类更均匀、更紧凑,尤其在新类别空间中表现更优。
  • 该方法有效减少了嵌入空间中大而重叠的聚类形成,而这类聚类在少样本场景中常成为分类的障碍。
Figure 2: Visualization of training iteration on Dbpedia14.
Figure 2: Visualization of training iteration on Dbpedia14.

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。