Update README.md
Browse files
README.md
CHANGED
|
@@ -1,15 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-4.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
configs:
|
| 6 |
+
- config_name: Temporal
|
| 7 |
+
data_files:
|
| 8 |
+
- split: default
|
| 9 |
+
path: Temporal/*.json
|
| 10 |
+
- config_name: Invariant
|
| 11 |
+
data_files:
|
| 12 |
+
- split: default
|
| 13 |
+
path: Invariant/*.json
|
| 14 |
+
task_categories:
|
| 15 |
+
- question-answering
|
| 16 |
+
- text-generation
|
| 17 |
+
tags:
|
| 18 |
+
- circuit
|
| 19 |
+
- temporal
|
| 20 |
+
- knowledge
|
| 21 |
+
- triplet
|
| 22 |
+
size_categories:
|
| 23 |
+
- 10K<n<100K
|
| 24 |
+
---
|
| 25 |
+
|
| 26 |
+
# \[ACL 2025\] Does Time Have Its Place? Temporal Heads: Where Language Models Recall Time-specific Information
|
| 27 |
+
|
| 28 |
+
<center><img src = "https://cdn-uploads.huggingface.co/production/uploads/5efbdc4ac3896117eab961a9/yzXDiuGZUHCaVkERZFSIO.png" width="1000" height="1000"></center>
|
| 29 |
+
|
| 30 |
+
**This repository contains two separate subsets of data (configs):**
|
| 31 |
+
- **Temporal**: JSON files in `Temporal` that include temporal knowledge.
|
| 32 |
+
- **Invariant**: JSON files in `Invariant` that describe time-invariant knowledge based on [LRE](https://arxiv.org/abs/2308.09124).
|
| 33 |
+
|
| 34 |
+
Each subset has its own schema. By defining them as two configs in the YAML header above, Hugging Face’s Dataset Viewer will show **“Temporal”** and **“Invariant”** as separate options in the configuration dropdown, allowing you to explore each schema independently without a schema‐mismatch error.
|
| 35 |
+
|
| 36 |
+
---
|
| 37 |
+
## Dataset Overview
|
| 38 |
+
|
| 39 |
+
**Motivation:**
|
| 40 |
+
Large language models (LLMs) often struggle to answer questions whose answers change over time. We investigated whether there exist specialized attention heads—**Temporal Heads**—that are triggered by explicit dates (e.g., “In 2004, …”) or by implicit textual cues (e.g., “In the year …”) and that help the model recall or update time-specific facts.
|
| 41 |
+
|
| 42 |
+
- **Method:** Using [Knowledge Circuit](https://arxiv.org/abs/2405.17969) analysis, we identified attention heads in LLMs that strongly activate on temporal signals (timestamps, years, etc.).
|
| 43 |
+
- **Findings:** These Temporal Heads are crucial for time-sensitive recall. When you ablate (disable) them, the model’s performance on time-dependent questions degrades significantly, whereas its performance on static (time-invariant) knowledge remains almost unchanged.
|
| 44 |
+
- **Implications:** By manipulating the outputs of these specific heads, one can potentially edit or correct a model’s temporal knowledge directly (e.g., if its internal knowledge about “Who was president in 1999?” is outdated).
|
| 45 |
+
|
| 46 |
+
---
|
| 47 |
+
|
| 48 |
+
## Usage
|
| 49 |
+
|
| 50 |
+
```python
|
| 51 |
+
from datasets import load_dataset
|
| 52 |
+
|
| 53 |
+
# 1. Load the "Temporal" config
|
| 54 |
+
# - Each example in this split has fields like:
|
| 55 |
+
# { "name": ..., "prompt_templates": [...], "samples": [ { "subject": ..., "object": ..., "time": ... }, ... ], ... }
|
| 56 |
+
Temporal = load_dataset("dmis-lab/TemporalHead", "Temporal")["default"]
|
| 57 |
+
|
| 58 |
+
# 2. Load the "Invariant" config
|
| 59 |
+
# - Each example here has fields like:
|
| 60 |
+
# { "name": ..., "prompt_templates": [...], "properties": { "relation_type": ..., ... }, "samples": [ { "subject": ..., "object": ... }, ... ], ... }
|
| 61 |
+
Invariant = load_dataset("dmis-lab/TemporalHead", "Invariant")["default"]
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
---
|
| 65 |
+
|
| 66 |
+
## Citation and Acknowledgements
|
| 67 |
+
|
| 68 |
+
If you find our work is useful in your research, please consider citing our [paper](https://arxiv.org/abs/2502.14258):
|
| 69 |
+
```
|
| 70 |
+
@article{park2025does,
|
| 71 |
+
title={Does Time Have Its Place? Temporal Heads: Where Language Models Recall Time-specific Information},
|
| 72 |
+
author={Park, Yein and Yoon, Chanwoong and Park, Jungwoo and Jeong, Minbyul and Kang, Jaewoo},
|
| 73 |
+
journal={arXiv preprint arXiv:2502.14258},
|
| 74 |
+
year={2025}
|
| 75 |
+
}
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
+
We also gratefully acknowledge the following open-source repositories and kindly ask that you cite their accompanying papers as well.
|
| 79 |
+
|
| 80 |
+
[1] https://github.com/zjunlp/KnowledgeCircuits
|
| 81 |
+
[2] https://github.com/hannamw/eap-ig
|
| 82 |
+
[3] https://github.com/evandez/relations
|
| 83 |
+
|
| 84 |
+
---
|
| 85 |
+
|
| 86 |
+
## Contact
|
| 87 |
+
For any questions or issues, feel free to reach out to [522yein (at) korea.ac.kr].
|