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

如何进行查询语言模型?

How to Query Language Models?

ETH Zürich(苏黎世联邦理工学院)

Leonard Adolphs, Shehzaad Dhuliawala, Thomas Hofmann

摘要:

大型预训练的语言模型(LM)不仅能够恢复语言知识,而且能够恢复事实和常识知识。为了访问存储在基于掩码的LM中的知识,我们可以使用完形填空式的问题,让模型填补空白。结构化知识库的灵活性优势与为特定信息需求找到正确查询的缺点有关。受人类行为的启发,以消除歧义的问题,我们建议查询LM的例子。为了澄清矛盾的问题“诺伊尔为谁效力?“,一个成功的策略是使用另一个主题来证明关系,例如,“罗纳尔多为葡萄牙效力。诺伊尔为谁效力?".我们将这种通过示例进行查询的方法应用于LAMA探测器,并且在仅提供10个演示时,在T-REx数据上获得高达37.8%的BERT-large的实质性改进-甚至优于查询模型的基线,该模型具有多达40个问题的释义。这些例子是通过模型的上下文提供的,因此既不需要微调,也不需要额外的前向传递。这表明LM包含比以前假设的更多的事实和常识知识-如果我们以正确的方式查询模型。

英文摘要:

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.

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

↑