mlsanityData to 7 Oct 2026

How to Query Language Models?

arXiv 2108.01928 ↗First posted 4 Aug 2021cs.CL cs.IR cs.LGcited by 11

Not on the map. Why?

Abstract (arXiv)

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.

Key facts. Cited by 11 papers in the map (data through 7 Oct 2026). Builds on 27 of its 38 references that are in the map. First posted on arXiv 4 Aug 2021.

Builds on

27 of 38 references.

References · 27

  1. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  2. 2020Language Models are Few-Shot Learnerscited by 32,199
  3. 2013Efficient Estimation of Word Representations in Vector Spacecited by 4,346
  4. 2016SQuAD: 100,000+ Questions for Machine Comprehension of Textcited by 4,115
  5. 2020Dense Passage Retrieval for Open-Domain Question Answeringcited by 3,779
  6. 2019ALBERT: A Lite BERT for Self-supervised Learning of Language Representationscited by 2,772
  7. 2019HuggingFace's Transformers: State-of-the-art Natural Language Processingcited by 2,201
  8. 2020DeBERTa: Decoding-enhanced BERT with Disentangled Attentioncited by 2,157
  9. 2019Language Models as Knowledge Bases?cited by 1,922
  10. 2020Making Pre-trained Language Models Better Few-shot Learnerscited by 1,255
  11. 2016ConceptNet 5.5: An Open Multilingual Graph of General Knowledgecited by 1,065
  12. 2019How Can We Know What Language Models Know?cited by 953
15 more
  1. 2020Exploiting Cloze Questions for Few Shot Text Classification and Natural Language Inferencecited by 934
  2. 2020A Primer in BERTology: What we know about how BERT workscited by 807
  3. 2020How Much Knowledge Can You Pack Into the Parameters of a Language Model?cited by 713
  4. 2020It's Not Just Size That Matters: Small Language Models Are Also Few-Shot Learnerscited by 668
  5. 2019Generalizing from a Few Examples: A Survey on Few-Shot Learningcited by 462
  6. 2018TextWorld: A Learning Environment for Text-based Gamescited by 304
  7. 2020How Context Affects Language Models' Factual Predictionscited by 181
  8. 2019Do NLP Models Know Numbers? Probing Numeracy in Embeddingscited by 157
  9. 2020Birds have four legs?! NumerSense: Probing Numerical Commonsense Knowledge of Pre-trained Language Modelscited by 110
  10. 2019StructBERT: Incorporating Language Structures into Pre-training for Deep Language Understandingcited by 108
  11. 2019E-BERT: Efficient-Yet-Effective Entity Embeddings for BERTcited by 96
  12. 2020Retrospective Reader for Machine Reading Comprehensioncited by 86
  13. 2020Learning Dynamic Belief Graphs to Generalize on Text-Based Gamescited by 49
  14. 2020Text-based RL Agents with Commonsense Knowledge: New Challenges, Environments and Baselinescited by 37
  15. 2019LeDeepChef: Deep Reinforcement Learning Agent for Families of Text-Based Gamescited by 17

Built on by

Cited by year

Citing papers per year: 2021: 1; 2022: 4; 2023: 2; 2024: 3; 2025: 1.

11 papers.