nightdessert/Retrieval_Head
open-source code for paper: Retrieval Head Mechanistically Explains Long-Context Factuality
This tool helps AI researchers and practitioners understand which parts of a large language model are responsible for retrieving specific facts from very long contexts. You input a transformer model, and the tool outputs a list of "retrieval scores" for each attention head, indicating its importance in factual recall. This is for someone who works with LLMs and wants to dissect their internal workings.
236 stars. No commits in the last 6 months.
Use this if you are a machine learning researcher or engineer looking to mechanistically understand how specific attention heads in your transformer models contribute to factual retrieval from long texts.
Not ideal if you are looking for an off-the-shelf solution for general LLM fine-tuning or performance optimization without needing deep insight into model internals.
Stars
236
Forks
25
Language
Python
License
—
Category
Last pushed
Aug 02, 2024
Commits (30d)
0
Get this data via API
curl "https://pt-edge.onrender.com/api/v1/quality/transformers/nightdessert/Retrieval_Head"
Open to everyone — 100 requests/day, no key needed. Get a free key for 1,000/day.
Higher-rated alternatives
google-deepmind/long-form-factuality
Benchmarking long-form factuality in large language models. Original code for our paper...
gnai-creator/aletheion-llm-v2
Decoder-only LLM with integrated epistemic tomography. Knows what it doesn't know.
sandylaker/ib-edl
Calibrating LLMs with Information-Theoretic Evidential Deep Learning (ICLR 2025)
MLD3/steerability
An open-source evaluation framework for measuring LLM steerability.
kazemihabib/Mitigating-Reasoning-LLM-Social-Bias
A novel approach to mitigating social bias in Large Language Models through a multi-judge...