Skip to main content
QUICK REVIEW

[Paper Review] Do LLMs Dream of Ontologies?

Marco Bombieri, Paolo Fiorini|arXiv (Cornell University)|Jan 26, 2024
Topic ModelingComputer Science3 citations
TL;DR

This paper investigates whether general-purpose large language models (LLMs) memorize ontology concept-label associations, finding that memorization correlates strongly with a concept's web popularity. Using prediction invariance under prompt repetition, temperature variation, and language shifts, the study proposes metrics to detect true memorization versus hallucination, showing high consistency in predictions for widely known concepts—indicating robust memorization from training data exposure.

ABSTRACT

Large Language Models (LLMs) have demonstrated remarkable performance across diverse natural language processing tasks, yet their ability to memorize structured knowledge remains underexplored. In this paper, we investigate the extent to which general-purpose pre-trained LLMs retain and correctly reproduce concept identifier (ID)-label associations from publicly available ontologies. We conduct a systematic evaluation across multiple ontological resources, including the Gene Ontology, Uberon, Wikidata, and ICD-10, using LLMs such as Pythia-12B, Gemini-1.5-Flash, GPT-3.5, and GPT-4. Our findings reveal that only a small fraction of ontological concepts is accurately memorized, with GPT-4 demonstrating the highest performance. To understand why certain concepts are memorized more effectively than others, we analyze the relationship between memorization accuracy and concept popularity on the Web. Our results indicate a strong correlation between the frequency of a concept's occurrence online and the likelihood of accurately retrieving its ID from the label. This suggests that LLMs primarily acquire such knowledge through indirect textual exposure rather than directly from structured ontological resources. Furthermore, we introduce new metrics to quantify prediction invariance, demonstrating that the stability of model responses across variations in prompt language and temperature settings can serve as a proxy for estimating memorization robustness.

Motivation & Objective

  • To investigate whether general-purpose pre-trained LLMs have memorized concept-label associations from known ontologies such as Gene Ontology and Uberon.
  • To determine the extent and variability of memorization across different LLMs, including GPT-3.5 and GPT-4.
  • To analyze why some ontology concepts are better memorized than others, focusing on web popularity as a key factor.
  • To develop and evaluate new metrics for estimating the degree of memorization of ontological information in LLMs.
  • To assess whether prediction invariance under prompt variations can serve as a reliable indicator of true memorization versus model hallucination.

Proposed method

  • The authors evaluate LLMs on retrieving correct ontology concept identifiers (e.g., GO:0001822) given natural language labels (e.g., 'kidney development'), using zero-shot prompting without fine-tuning.
  • They introduce three prediction invariance (PI) methods: PI-1 (repetition of same prompt), PI-2 (varying temperature), and PI-3 (using different languages for the prompt) to assess consistency of model outputs.
  • The Prediction Invariance (AvPI) score is computed as the average similarity of predictions across multiple invocations, with higher scores indicating greater consistency and likely memorization.
  • The study correlates AvPI scores and prediction accuracy with the frequency of concept mentions on the web, using Spearman’s rank correlation to assess significance.
  • Error analysis is performed to evaluate the semantic similarity (via Jaccard similarity) between incorrect predictions and the gold label, especially for low-frequency concepts.
  • The authors publicly release all code and data to support reproducibility and further research on LLM memorization of ontological knowledge.
Figure 1 : Mean number of elements per bucket and average number of web occurrences per bucket.
Figure 1 : Mean number of elements per bucket and average number of web occurrences per bucket.

Experimental results

Research questions

  • RQ1To what extent do general-purpose LLMs memorize concept-label associations from known ontologies like Gene Ontology and Uberon?
  • RQ2Why are some ontology concepts better memorized than others, and what factors influence this variation?
  • RQ3Can prediction invariance across prompt repetitions, temperature levels, and languages be used as a reliable proxy for memorization in LLMs?
  • RQ4How does the frequency of a concept’s occurrence on the web correlate with its memorization accuracy and consistency in LLMs?
  • RQ5To what extent do incorrect predictions remain semantically close to the correct label, and what does this imply about model behavior?

Key findings

  • GPT-4 achieves the highest performance in retrieving correct ontology concept identifiers, followed by other LLMs such as GPT-3.5 and Pythia-12B.
  • There is a strong positive correlation between the number of times a concept appears on the web and its memorization accuracy, indicating that web frequency is a key driver of memorization.
  • For frequently occurring concepts, all three prediction invariance methods (PI-1, PI-2, PI-3) yield AvPI scores close to 1, indicating high output consistency and likely memorization.
  • For low-frequency concepts, especially in the first bucket (B1), all methods achieve an average accuracy of zero, and AvPI scores drop significantly under PI-2 and PI-3, indicating inconsistency and lack of memorization.
  • The Spearman’s rank correlation between AvPI and accuracy is very high (0.95 for PI-2 and 0.85 for PI-3), showing that prediction invariance strongly predicts correctness and can thus be used to detect memorization.
  • Incorrect predictions for low-frequency concepts are still semantically close to the gold label in terms of Jaccard similarity, suggesting that models may be generating plausible but incorrect responses rather than random ones.
(a)
(a)

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.