Knowledge Circuits in Pretrained Transformers

Yunzhi Yao, Ningyu Zhang, Zekun Xi, Mengru Wang, Ziwen Xu +2 more
2/3/2026

No official code found. Best implementation: zjunlp/KnowledgeCircuits (173 stars, MIT, last commit 2025-11-14).

Abstract

The remarkable capabilities of modern large language models are rooted in their vast repositories of knowledge encoded within their parameters, enabling them to perceive the world and engage in reasoning. The inner workings of how these models store knowledge have long been a subject of intense interest and investigation among researchers. To date, most studies have concentrated on isolated components within these models, such as the Multilayer Perceptrons and attention head. In this paper, we delve into the computation graph of the language model to uncover the knowledge circuits that are instrumental in articulating specific knowledge. The experiments, conducted with GPT2 and TinyLLAMA, have allowed us to observe how certain information heads, relation heads, and Multilayer Perceptrons collaboratively encode knowledge within the model. Moreover, we evaluate the impact of current knowledge editing techniques on these knowledge circuits, providing deeper insights into the functioning and constraints of these editing methodologies. Finally, we utilize knowledge circuits to analyze and interpret language model behaviors such as hallucinations and in-context learning. We believe the knowledge circuits hold potential for advancing our understanding of Transformers and guiding the improved design of knowledge editing. Code and data are available in https://github.com/zjunlp/KnowledgeCircuits.

View on arXivView PDF

Code Implementations(1)

MIT

[NeurIPS 2024] Knowledge Circuits in Pretrained Transformers

1739Shell, PythonJan 16, 202411 months agoMIT
artificial-intelligencecircuithallucinationinterpretabilityknowledge-circuit+6 more

Similar Papers

Cite this paper

@article{yao2026knowledge,
  title  = {Knowledge Circuits in Pretrained Transformers},
  author = {Yunzhi Yao and Ningyu Zhang and Zekun Xi and Mengru Wang and Ziwen Xu and Shumin Deng and Huajun Chen},
  year   = {2026},
  eprint = {2405.17969},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2405.17969},
  url    = {https://arxiv.org/abs/2405.17969},
  journal = {NEURIPS 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2405.17969.svg)](https://codeofpaper.com/paper/2405.17969)

Discussion