## Diagram: Knowledge Graph Training and Generalization Framework
### Overview
The diagram illustrates a framework for training and evaluating knowledge graphs, focusing on atomic facts, held-out facts, inferred facts, systematic generalization, and depth extrapolation. It uses colored boxes (blue, green) and arrows to represent relationships between entities (e1, e2, etc.) and relations (r1, r2, etc.).
### Components/Axes
1. **Training Section**:
- **Atomic facts (1-hop facts)**:
- Examples: `e1 →r1→ e2`, `e2 →r2→ e3`, `e3 →r3→ e4`, `e4 →r4→ e5`
- **Held-out atomic facts (1-hop facts)**:
- Examples: `e1 →r2→ e5`, `e5 →r1→ e6` (highlighted in green)
- **Inferred facts (k-hop facts)**:
- Examples: `e1 →r1→ e2 →r2→ e3`, `e2 →r2→ e3 →r3→ e4` (dashed arrows indicate inferred steps)
2. **Systematic Generalization**:
- Composed from held-out atomic facts: `e1 →r2→ e5 →r1→ ?` (green boxes with a question mark for extrapolation)
3. **Depth Extrapolation**:
- Beyond training hop depth:
- Example 1: `e1 →r1→ e2 →r2→ e3 →r3→ ?` (3-hop sequence)
- Example 2: `e1 →r1→ e2 →r2→ e3 →r3→ e4 →r4→ ?` (4-hop sequence)
### Detailed Analysis
- **Training Section**:
- Atomic facts represent direct, single-hop relationships (e.g., `e1 →r1→ e2`).
- Held-out atomic facts are reserved for testing generalization (e.g., `e1 →r2→ e5`).
- Inferred facts demonstrate multi-hop reasoning (e.g., `e1 →r1→ e2 →r2→ e3`).
- **Systematic Generalization**:
- Combines held-out facts to test if the model can generalize to unseen combinations (e.g., `e1 →r2→ e5 →r1→ ?`).
- **Depth Extrapolation**:
- Tests the model's ability to reason beyond the maximum hop depth seen during training (e.g., 3-hop or 4-hop sequences ending in `?`).
### Key Observations
1. **Color Coding**:
- Blue boxes: Training data (atomic and inferred facts).
- Green boxes: Held-out facts (systematic generalization).
- Question marks (`?`): Unseen entities or relations for extrapolation.
2. **Flow Direction**:
- Arrows (`→`) indicate directional relationships between entities.
- Dashed arrows in inferred facts suggest multi-step reasoning.
3. **Progression**:
- Training → Held-out → Inferred → Systematic Generalization → Depth Extrapolation shows increasing complexity.
### Interpretation
This diagram demonstrates how knowledge graph models learn from structured data (atomic facts) and generalize to unseen combinations (systematic generalization) and longer reasoning chains (depth extrapolation). The use of held-out facts ensures the model isn't overfitting to training data, while depth extrapolation evaluates its capacity to handle multi-hop reasoning beyond explicit training examples. The progression from simple 1-hop facts to complex k-hop inferences highlights the model's ability to build and apply logical rules, a critical aspect of symbolic AI and graph neural networks.