Skip to main content
QUICK REVIEW

[Paper Review] BertNet: Harvesting Knowledge Graphs with Arbitrary Relations from Pretrained Language Models

Shibo Hao, Bowen Tan|arXiv (Cornell University)|Jun 28, 2022
Topic ModelingComputer Science13 citations
TL;DR

BertNet is a framework that automatically extracts large-scale, symbolic knowledge graphs (KGs) with arbitrary relations from pretrained language models (LMs) using minimal user input—just a relation prompt and a few few-shot examples. By combining an efficient search-and-rescore mechanism with prompt weighting, it achieves high accuracy in harvesting diverse, complex relations (e.g., 'capable of but not good at') across 400+ new relations from models like BERT, RoBERTa, and DistilBERT.

ABSTRACT

It is crucial to automatically construct knowledge graphs (KGs) of diverse new relations to support knowledge discovery and broad applications. Previous KG construction methods, based on either crowdsourcing or text mining, are often limited to a small predefined set of relations due to manual cost or restrictions in text corpus. Recent research proposed to use pretrained language models (LMs) as implicit knowledge bases that accept knowledge queries with prompts. Yet, the implicit knowledge lacks many desirable properties of a full-scale symbolic KG, such as easy access, navigation, editing, and quality assurance. In this paper, we propose a new approach of harvesting massive KGs of arbitrary relations from pretrained LMs. With minimal input of a relation definition (a prompt and a few shot of example entity pairs), the approach efficiently searches in the vast entity pair space to extract diverse accurate knowledge of the desired relation. We develop an effective search-and-rescore mechanism for improved efficiency and accuracy. We deploy the approach to harvest KGs of over 400 new relations from different LMs. Extensive human and automatic evaluations show our approach manages to extract diverse accurate knowledge, including tuples of complex relations (e.g., "A is capable of but not good at B"). The resulting KGs as a symbolic interpretation of the source LMs also reveal new insights into the LMs' knowledge capacities.

Motivation & Objective

  • To address the limitation of existing knowledge graph construction methods that are restricted to predefined, manually curated relations.
  • To enable the automatic extraction of symbolic, structured knowledge from pretrained language models for any new relation, not just those in existing corpora or KGs.
  • To develop an efficient and accurate method that transforms implicit LM knowledge into explicit, navigable, and ~editable symbolic KGs.
  • To evaluate the method across diverse LMs and relations, including complex and multi-argument relations, to understand the knowledge capacity of LMs.

Proposed method

  • The framework takes a relation definition as input, consisting of a natural language prompt (e.g., 'X is capable of but not good at Y') and a few few-shot examples of entity pairs.
  • It performs a search over the vast space of entity pairs using a retrieval strategy that leverages the LM’s autoregressive generation to predict tail entities for given head entities and relations.
  • An effective search-and-rescore mechanism is introduced to improve efficiency and accuracy: it ranks candidate tuples using a learned scoring function based on prompt likelihood and confidence.
  • The method enhances prompt paraphrasing techniques by introducing a rescore-based prompt weighting strategy to improve robustness and consistency across diverse prompts.
  • It supports multiple LMs (e.g., BERT, RoBERTa, DistilBERT) and generates full KGs as symbolic interpretations of the underlying LM’s knowledge.
  • The framework includes automatic and human evaluation protocols to validate the quality and diversity of extracted knowledge.

Experimental results

Research questions

  • RQ1Can we extract high-quality, diverse knowledge graphs with arbitrary, previously unseen relations from pretrained language models?
  • RQ2How effective is the search-and-rescore mechanism in balancing efficiency and accuracy when exploring the massive entity pair space?
  • RQ3To what extent can different LMs (e.g., BERT, RoBERTa, DistilBERT) encode and retrieve complex or multi-argument relations?
  • RQ4Does model size and pretraining strategy affect the quality of harvested knowledge, and can knowledge distillation improve knowledge retention?
  • RQ5Can the resulting KGs serve as a symbolic interpretation of the LM’s internal knowledge, revealing insights into its knowledge capacity?

Key findings

  • BertNet successfully extracts knowledge for over 400 new relations not present in existing KGs like ConceptNet, significantly expanding the scope of available structured knowledge.
  • The method achieves high accuracy in extracting complex relations such as 'A is capable of but not good at B', demonstrating its ability to capture nuanced semantic relationships.
  • Larger LMs (e.g., RoBERTa-large, BERT-large) show ~3–7% higher accuracy than their base counterparts, indicating that model scale improves knowledge encoding.
  • Better pretraining strategies (e.g., RoBERTa vs. BERT) lead to better knowledge quality, with RoBERTaNet-large outperforming BertNet-large by 3 percentage points in accuracy.
  • Knowledge distillation (e.g., DistilBERT) improves knowledge retention, increasing accuracy by ~4% compared to the teacher model (BERT-base), likely due to noise reduction.
  • The framework outperforms baselines like COMET and LPAQA on both ConceptNet and LAMA benchmarks, especially in scoring full tuples rather than just predicting tail entities.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.