Skip to main content
QUICK REVIEW

[论文解读] Efficient Few-Shot Learning Without Prompts

Lewis Tunstall, Nils Reimers|arXiv (Cornell University)|Sep 22, 2022
Topic Modeling被引用 98
一句话总结

SetFit 是一种无提示、Siamese 风格的句子变换器微调框架,能够在更小的模型上实现强大的少-shot 文本分类,并且比基于提示的方法有更快的训练/推断速度。

ABSTRACT

Recent few-shot methods, such as parameter-efficient fine-tuning (PEFT) and pattern exploiting training (PET), have achieved impressive results in label-scarce settings. However, they are difficult to employ since they are subject to high variability from manually crafted prompts, and typically require billion-parameter language models to achieve high accuracy. To address these shortcomings, we propose SetFit (Sentence Transformer Fine-tuning), an efficient and prompt-free framework for few-shot fine-tuning of Sentence Transformers (ST). SetFit works by first fine-tuning a pretrained ST on a small number of text pairs, in a contrastive Siamese manner. The resulting model is then used to generate rich text embeddings, which are used to train a classification head. This simple framework requires no prompts or verbalizers, and achieves high accuracy with orders of magnitude less parameters than existing techniques. Our experiments show that SetFit obtains comparable results with PEFT and PET techniques, while being an order of magnitude faster to train. We also show that SetFit can be applied in multilingual settings by simply switching the ST body. Our code is available at https://github.com/huggingface/setfit and our datasets at https://huggingface.co/setfit .

研究动机与目标

  • 解决基于提示的和大模型的少-shot 方法的局限性(提示工程、高计算量、不稳定性)。
  • 提出 SetFit 作为一个无提示、两步式的句子变换器微调框架,用于少-shot 设置。
  • 在不同数据集、语言和蒸馏场景中展示 SetFit 的性能。
  • 在准确性和效率方面,将 SetFit 与最前沿的 PET/PEFT 基于方法和基于提示的方法进行对比。
  • 提供公开可获取的代码和数据,帮助在实际少-shot 任务中推广应用。

提出的方法

  • 在小型带标签数据集上对预训练的 Sentence Transformer (ST) 进行微调,使用对比性 Siamese 目标函数来产生丰富的嵌入。
  • 通过跨类别的正样本和负样本三元组生成对比微调的增强训练数据(每个类别的 R 正样本、R 负样本)。
  • 使用微调后的 ST 对带标签的样本进行编码以创建嵌入,然后在这些嵌入上训练一个逻辑回归分类头。
  • 通过对新输入进行 ST 编码并使用训练好的头进行预测来执行推断。
  • 使用余弦相似度损失对 ST 进行微调,学习率 1e-3,批量大小 16,最大长度 256 tokens,训练 1 个 epoch。

实验结果

研究问题

  • RQ1在少-shot 学习中,基于句子变换的无提示方法是否能够达到与 PET/PEFT 和基于提示的方法相媲美的准确性?
  • RQ2SetFit 在多语言数据和各种文本分类任务中,在标记数据有限的情况下表现如何?
  • RQ3与大规模基于提示的方法相比,SetFit 在训练/推断方面有哪些效率优势?
  • RQ4SetFit 在少-shot 蒸馏和资源受限的硬件条件下是否有效?

主要发现

  • SetFit MPNet 在少-shot 情况下表现出色,平均在 N=8 时领先 FineTune 19.3 点,在 N=64 时差距缩小。
  • SetFit MPNet 在小样本下优于 Perfect 和 Adapet,在 T-Few 3B 竞争力强,同时无提示且模型规模显著更小。
  • 在 RAFT 数据集上,SetFit RoBERTa 超越 GPT-3 和 PET,甚至在若干任务上超过了人为基线,尽管落后于 T-Few 11B。
  • 在多语言 MARC 实验中,使用多语言 ST 嵌入的 SetFit 在 8-shot 情况下在各语言中持续优于 FineTune 和 Adapet。
  • 蒸馏实验显示存在一个 SetFit 教师-学生结构,其中较小的 SetFit 学生可以在有限的未标记数据下达到甚至超过基线学生,尤其在非常小的 N 时。
  • SetFit 的训练/推断速度比 T-Few 3B 快一个数量级,存储占用也更小,在实际部署方面具有显著优势。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。