[论文解读] How to Query Language Models?
本文提出通过在输入上下文中提供少量shot示例来查询大型语言模型(LMs),以消除事实性查询中的歧义,显著提升知识探针任务的性能。仅添加10个示例——例如,'Ronaldo为葡萄牙队效力。Neuer为[MASK]效力'——BERT-large在T-REx上的性能相比基线完形填空查询提升了37.8%,甚至优于使用40个改写提示的集成方法,且仅需一次前向传播即可实现。
Large pre-trained language models (LMs) are capable of not only recovering linguistic but also factual and commonsense knowledge. To access the knowledge stored in mask-based LMs, we can use cloze-style questions and let the model fill in the blank. The flexibility advantage over structured knowledge bases comes with the drawback of finding the right query for a certain information need. Inspired by human behavior to disambiguate a question, we propose to query LMs by example. To clarify the ambivalent question "Who does Neuer play for?", a successful strategy is to demonstrate the relation using another subject, e.g., "Ronaldo plays for Portugal. Who does Neuer play for?". We apply this approach of querying by example to the LAMA probe and obtain substantial improvements of up to 37.8% for BERT-large on the T-REx data when providing only 10 demonstrations--even outperforming a baseline that queries the model with up to 40 paraphrases of the question. The examples are provided through the model's context and thus require neither fine-tuning nor an additional forward pass. This suggests that LMs contain more factual and commonsense knowledge than previously assumed--if we query the model in the right way.
研究动机与目标
- 解决在查询预训练语言模型以获取事实性知识时,因提示设计模糊或欠佳所带来的挑战。
- 探究在上下文中提供示例是否能提升掩码语言模型在知识探针中的准确性。
- 评估基于示例的提示方法是否能在无需微调或多轮前向传播的情况下,超越传统方法(如改写提示集成)。
- 评估该方法在多种知识探针基准(包括T-REx、ConceptNet和BATS)上的有效性。
提出的方法
- 该方法通过在完形风格查询中加入一个或多个相同关系的自然语言示例来增强,例如:'Ronaldo为葡萄牙队效力。Neuer为[MASK]效力'。
- 示例直接注入模型的上下文,无需微调或额外的前向传播。
- 该方法利用模型识别并迁移示例中的关系模式至新查询的能力。
- 性能通过标准基准进行评估:LAMA探针(T-REx、Google-RE、ConceptNet)、BATS用于词语类比,TBG用于常识推理。
- 对于每个查询,模型预测掩码标记,性能通过P@1(top-1精确率)和相对于基线的相对提升进行衡量。
- 该方法与最先进基线进行比较,包括改写提示集成(Jiang et al., 2020)和上下文增强探针(Petroni et al., 2020)
实验结果
研究问题
- RQ1在输入上下文中仅提供少量自然语言示例,是否能显著提升预训练语言模型在事实性知识检索中的准确性?
- RQ2基于示例的提示方法与使用40个改写提示的集成方法相比,其在知识探针中的表现如何?
- RQ3随着示例数量增加,基于示例的性能增益是否会趋于饱和?在何种情况下额外示例带来的收益可忽略不计?
- RQ4该方法在不同知识探针基准(包括事实性、常识性及类比推理任务)上的泛化能力如何?
主要发现
- 仅提供10个示例,BERT-large在T-REx数据集上的P@1性能相比标准完形提示基线提升了37.8%。
- 少量shot示例方法优于最多40个改写提示的集成,且仅需一次前向传播即可实现更高准确率。
- 在ConceptNet的常识关系任务中,Albert-xxlarge在使用10个示例时实现了25%的相对性能提升,优于GloVe基线在可解类比任务上的表现。
- 当示例数量超过10个后,性能增益逐渐减弱,表明存在性能饱和点,额外示例带来的改进微乎其微。
- 即使在高度模糊的情况下(如关系通过箭头操作符表示,例如[s] => [o]),仅需少数示例即可明确关系意图。
- 该方法在多种知识类型上表现出强大的泛化能力,包括事实性、常识性和形态关系,已在T-REx、BATS和TBG基准上得到验证。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。