[论文解读] OpenPrompt: An Open-source Framework for Prompt-learning
OpenPrompt 提供了一个统一、可扩展的开源工具包,用于提示学习,将模板、语言表述器和 PLMs 与训练模块化,以实现灵活的组合和在各类 NLP 任务中的快速实验。
Prompt-learning has become a new paradigm in modern natural language processing, which directly adapts pre-trained language models (PLMs) to $cloze$-style prediction, autoregressive modeling, or sequence to sequence generation, resulting in promising performances on various tasks. However, no standard implementation framework of prompt-learning is proposed yet, and most existing prompt-learning codebases, often unregulated, only provide limited implementations for specific scenarios. Since there are many details such as templating strategy, initializing strategy, and verbalizing strategy, etc. need to be considered in prompt-learning, practitioners face impediments to quickly adapting the desired prompt learning methods to their applications. In this paper, we present {OpenPrompt}, a unified easy-to-use toolkit to conduct prompt-learning over PLMs. OpenPrompt is a research-friendly framework that is equipped with efficiency, modularity, and extendibility, and its combinability allows the freedom to combine different PLMs, task formats, and prompting modules in a unified paradigm. Users could expediently deploy prompt-learning frameworks and evaluate the generalization of them on different NLP tasks without constraints. OpenPrompt is publicly released at {\url{ https://github.com/thunlp/OpenPrompt}}.
研究动机与目标
- 提供一个统一、易于使用的提示学习工具包,能够容纳多样的模板、语言表述器和 PLMs。
- 实现可组合的配置,以评估提示学习方法在跨任务上的泛化能力。
- 提高实现提示学习管道的研究人员和从业人员的可复现性和可访问性。
- 支持提示学习方法及基线的快速部署与实验。
提出的方法
- 具有可互换的 Template、Verbalizer、PromptModel 和 Trainer 组件的模块化架构。
- 支持三种 PLM 目标族:MLM、LM 和 Seq2Seq,通过 HuggingFace Transformers 加载。
- 一种新的模板语言,能够进行令牌级自定义和灵活的提示构造。
- 语言表述器包括手动和自动变体,并带有校准选项。
- 一个 PromptModel,将跨 PLMs 的训练/推理抽象出来,而无需任务特定的头部。
- 联合提示+PLM 微调和仅提示微调(以提高参数效率)的训练模式。
实验结果
研究问题
- RQ1如何将提示学习标准化为一个支持多种 PLMs 和提示策略的模块化、可重复使用的框架?
- RQ2OpenPrompt 能否统一不同的提示方法(手动和软模板、各种语言表述器),以实现跨 NLP 任务的公平比较?
- RQ3在低数据情境和大型 PLMs 下,哪些模板、语言表述器和训练方案能够产生高效的提示学习?
- RQ4该框架如何促进在分类、生成和知识探测等任务中的快速部署、实验和评估?
主要发现
- OpenPrompt 提供一个模块化、可组合的框架,能够灵活地将 PLMs、任务格式和提示模块进行组合。
- 该框架支持 MLM、LM 和 Seq2Seq 的 PLMs,并通过统一的接口自动处理损失计算。
- 模板语言和分词模块简化提示构造,减少模板/分词错误。
- 语言表述器允许从标签到词汇单词的手动和自动映射,且实现了校准特性。
- PromptModel 使得在不为每个 PLM 编写任务特定头部的情况下进行训练和推理成为可能。
- OpenPrompt 包含数据处理器和训练工具,以在多样的 NLP 任务中复现基线。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。