Knowledge Lifecycle
Browse files
README.md
CHANGED
|
@@ -6,18 +6,115 @@ colorTo: blue
|
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
license: cc-by-4.0
|
|
|
|
| 9 |
thumbnail: https://huggingface.co/spaces/ameythakur/llm-knowledge-lifecycle/resolve/main/social-preview.png
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
---
|
| 11 |
|
| 12 |
-
|
| 13 |
|
| 14 |
-
|
| 15 |
|
| 16 |
-
|
| 17 |
|
| 18 |
-
|
| 19 |
-
- **I_ctx**, the full-vocabulary KL divergence between the model's output distributions with and without the document. Near zero means the document is present but inert.
|
| 20 |
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
license: cc-by-4.0
|
| 9 |
+
short_description: Measure a model ignoring a document in its own prompt
|
| 10 |
thumbnail: https://huggingface.co/spaces/ameythakur/llm-knowledge-lifecycle/resolve/main/social-preview.png
|
| 11 |
+
tags:
|
| 12 |
+
- knowledge-lifecycle
|
| 13 |
+
- retrieval-augmented-generation
|
| 14 |
+
- knowledge-conflicts
|
| 15 |
+
- interpretability
|
| 16 |
+
- gpt2
|
| 17 |
+
- research-demo
|
| 18 |
---
|
| 19 |
|
| 20 |
+
<div align="center">
|
| 21 |
|
| 22 |
+
# The Knowledge Lifecycle of Large Language Models
|
| 23 |
|
| 24 |
+
**A model holds two memories: what it learned in training, and what you put in its prompt. When they disagree, training usually wins, even when training is wrong.**
|
| 25 |
|
| 26 |
+
<br>
|
|
|
|
| 27 |
|
| 28 |
+
[](https://github.com/Amey-Thakur/LLM-KNOWLEDGE-LIFECYCLE)
|
| 29 |
+
[](https://www.kaggle.com/code/ameythakur20/cross-model-lifecycle-desynchronization)
|
| 30 |
+
[](https://github.com/Amey-Thakur)
|
| 31 |
+
[](https://github.com/Amey-Thakur/LLM-KNOWLEDGE-LIFECYCLE/blob/main/LICENSE)
|
| 32 |
|
| 33 |
+
<br>
|
| 34 |
+
|
| 35 |
+
[](#the-five-stages)
|
| 36 |
+
[](#the-five-stages)
|
| 37 |
+
[](#the-five-stages)
|
| 38 |
+
[](#the-five-stages)
|
| 39 |
+
[](#the-five-stages)
|
| 40 |
+
|
| 41 |
+
</div>
|
| 42 |
+
|
| 43 |
+
---
|
| 44 |
+
|
| 45 |
+
## What this demonstration measures
|
| 46 |
+
|
| 47 |
+
Rofecoxib, sold as Vioxx, was withdrawn worldwide in September 2004 after trials showed it raised the risk of heart attack and stroke.
|
| 48 |
+
|
| 49 |
+
Put that withdrawal notice directly into GPT-2's prompt, then ask whether the drug is safe to prescribe:
|
| 50 |
+
|
| 51 |
+
| | Without the notice | With the notice in the prompt |
|
| 52 |
+
| :--- | ---: | ---: |
|
| 53 |
+
| Answers **"safe"** | 37.53% | **42.58%** |
|
| 54 |
+
| Answers **"withdrawn"** | 0.0004% | 0.0006% |
|
| 55 |
+
|
| 56 |
+
The correction is sitting in front of the model, and its confidence that the drug is safe **goes up**.
|
| 57 |
+
|
| 58 |
+
This is not a hallucination in the usual sense. Retrieval worked: the right document was found and delivered. What failed is the step after it, where the model must decide which of its two memories to believe.
|
| 59 |
+
|
| 60 |
+
## The two numbers
|
| 61 |
+
|
| 62 |
+
**D<sub>sync</sub>** is the surprisal of the correct answer while the corrective document is present, measured in nats. A value of *n* nats means the correct answer holds probability e<sup>-n</sup>. Past **9.2 nats** the answer is below one chance in ten thousand, where no realistic decoding recovers it. The Vioxx probe measures **12.05**.
|
| 63 |
+
|
| 64 |
+
**I<sub>ctx</sub>** is the full-vocabulary divergence between the model's output with and without the document. It answers a different question: did the document change the model's mind about anything at all? On Vioxx it is **0.033 nats**, meaning the document is present and inert.
|
| 65 |
+
|
| 66 |
+
Together they separate a retrieval failure, where the document never arrived, from a resolution failure, where it arrived and was ignored. No single-stage benchmark can tell those apart.
|
| 67 |
+
|
| 68 |
+
<a name="the-five-stages"></a>
|
| 69 |
+
## The five stages
|
| 70 |
+
|
| 71 |
+
A fact inside a language model passes through five stages, each studied by a different research community that rarely cites the others.
|
| 72 |
+
|
| 73 |
+
| Stage | What happens to the fact | Studied as |
|
| 74 |
+
| :--- | :--- | :--- |
|
| 75 |
+
|  | Training compresses a corpus into the weights | Pre-training, fine-tuning |
|
| 76 |
+
|  | It lives in the weights, in an external index, or in both | Parametric memory, vector databases |
|
| 77 |
+
|  | Attention recalls it, or a search pipeline fetches a document | Retrieval-augmented generation |
|
| 78 |
+
|  | The world changes, and the stored copies must change with it | Knowledge editing, continual learning |
|
| 79 |
+
|  | It is removed on purpose, or lost by accident | Machine unlearning, catastrophic forgetting |
|
| 80 |
+
|
| 81 |
+
The failure measured here sits on the boundary between **Retrieve** and **Update**: the document arrives, and nothing in the architecture tells the model which copy of the fact to trust.
|
| 82 |
+
|
| 83 |
+
## Three presets, three regimes
|
| 84 |
+
|
| 85 |
+
| Case | What the model does |
|
| 86 |
+
| :--- | :--- |
|
| 87 |
+
| **Vioxx withdrawn**, 2004 | Ignores the notice entirely. Resolution failure. |
|
| 88 |
+
| **Elizabeth II died**, 2022 | The notice mostly boosts "Queen". Correct context strengthening the wrong answer. |
|
| 89 |
+
| **Twitter renamed X**, 2023 | Moves hard, still answers "Twitter". Influence without resolution. |
|
| 90 |
+
|
| 91 |
+
Any fact change with a single-word answer can be entered directly. Three rules make a clean probe: the query ends mid-sentence so the next token is the answer, the document states the new fact plainly, and the answer is one word.
|
| 92 |
+
|
| 93 |
+
## How it runs
|
| 94 |
+
|
| 95 |
+
GPT-2 base executes entirely in your browser through ONNX. Nothing you type leaves your machine, no account is needed, and identical inputs always return identical numbers.
|
| 96 |
+
|
| 97 |
+
The browser build uses 8-bit quantized weights, which shift individual probabilities relative to full precision. Every preset lands in the same regime and supports the same conclusion; the paper's exact values come from the deterministic PyTorch script in the repository.
|
| 98 |
+
|
| 99 |
+
## Citation
|
| 100 |
+
|
| 101 |
+
```bibtex
|
| 102 |
+
@article{thakur2026lifecycle,
|
| 103 |
+
author = {Thakur, Amey and Talele, Sarvesh},
|
| 104 |
+
title = {The Knowledge Lifecycle of Large Language Models},
|
| 105 |
+
journal = {arXiv preprint},
|
| 106 |
+
year = {2026}
|
| 107 |
+
}
|
| 108 |
+
```
|
| 109 |
+
|
| 110 |
+
---
|
| 111 |
+
|
| 112 |
+
<div align="center">
|
| 113 |
+
|
| 114 |
+
**Amey Thakur** 路 [ORCID](https://orcid.org/0000-0001-5644-1575) | **Sarvesh Talele** 路 [ORCID](https://orcid.org/0009-0002-0818-461X)
|
| 115 |
+
|
| 116 |
+
<br>
|
| 117 |
+
|
| 118 |
+
[Paper and code](https://github.com/Amey-Thakur/LLM-KNOWLEDGE-LIFECYCLE) 路 [Amey's Arc](https://amey-thakur.github.io)
|
| 119 |
+
|
| 120 |
+
</div>
|