P-Adapters: Robustly Extracting Factual Information from Language Models with Diverse Prompts

Benjamin Newman, Prafulla Kumar Choubey, Nazneen Rajani
10/14/2021
cs.CL
moe

Official code: makcedward/nlpaug (4,664 stars, Jupyter Notebook, MIT, last commit 2024-06-24).

Abstract

Recent work (e.g. LAMA (Petroni et al., 2019)) has found that the quality of the factual information extracted from Large Language Models (LLMs) depends on the prompts used to query them.

Show full abstract

This inconsistency is problematic because different users will query LLMs for the same information using different wording, but should receive the same, accurate responses regardless. In this work we aim to address this shortcoming by introducing P-Adapters: lightweight models that sit between the embedding layer and first attention layer of LLMs. They take LLM embeddings as input and output continuous prompts that are used to query the LLM. Additionally, we investigate Mixture of Experts (MoE) models that learn a set of continuous prompts ("experts") and select one to query the LLM. They require a separate classifier trained on human-annotated data to map natural language prompts to the continuous ones. P-Adapters perform comparably to the more complex MoE models in extracting factual information from BERT and RoBERTa while eliminating the need for additional annotations. P-Adapters show between 12-26% absolute improvement in precision and 36-50% absolute improvement in consistency over a baseline of only using natural language queries. Finally, we investigate what makes P-Adapters successful and conclude that a significant factor is access to the LLM's embeddings of the original natural language prompt, particularly the subject of the entity pair being queried.

View on arXivView PDF

Code Implementations(1)

makcedward/nlpaugOfficial100%
MIT

Data augmentation for NLP

4,664470Jupyter Notebook, PythonMar 21, 20192 years agoMIT
adversarial-attacksadversarial-exampleaiartificial-intelligenceaugmentation+5 more

Similar Papers

Cite this paper

@article{newman2021padapters,
  title  = {P-Adapters: Robustly Extracting Factual Information from Language Models with Diverse Prompts},
  author = {Benjamin Newman and Prafulla Kumar Choubey and Nazneen Rajani},
  year   = {2021},
  eprint = {2110.07280},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2110.07280}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2110.07280.svg)](https://codeofpaper.com/paper/2110.07280)

Discussion