liveBook · Manning

Knowledge graph

As explained in Introduction to Generative AI, Second Edition

A knowledge graph is a conceptual representation of entities as nodes and their relationships as edges.

Why might a large language model give a wrong answer to a factual question? One way to think about its knowledge is as a knowledge graph: individual entities are nodes, and relationships between them are edges. section 5.7

Figure 5.8 An example knowledge graph
A group of white circles with words

AI-generated content may be incorrect.

The diagram shows a small collection of entities and the relationships connecting them. section 5.7

For a language model, this graph is an analogy, not an inspectable map of its weights. Imagine that some relationships are less certain than others because of the information available during training. When information is limited or conflicting, the model may guess and produce a hallucination. Its inner workings are too opaque to determine exactly what knowledge it contains. section 5.7

How Introduction to Generative AI, Second Edition covers it

How deep it goes
Defines nodes and edges and imagines confidence on relationships, but does not map actual model weights into a graph.
Examples
Shows a small diagram of entities and relationships and mentions TriviaQA as a question-answering fine-tuning dataset.
What it assumes
Defines nodes and edges in plain language without requiring graph theory.
What you can do after
Evaluate/understand why a model may guess when information is limited or conflicting, without treating the graph analogy as an inspectable map.
How it connects
Connects knowledge graphs to large language models, neural network weights, pretraining, supervised fine-tuning, and hallucinations.

Also explained in

Compare how 12 books explain knowledge graph →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Introduction to Generative AI, Second Edition. The section links point to the parts of the book it draws on.