Views
No views yet
| Cache Budget | Accuracy | Evidence Survival |
|---|---|---|
| 10% | 8.0% | 19.3% |
| 25% | 82.0% | 100.0% |
| 50% | 68.0% | - |
| 75% | 40.0% | 69.8% |
mistralai/Mistral-7B-v0.31{
2 'importance_embedding': dict, # Token importance embeddings
3 'importance_head': dict, # Hard-anchor predictor (7 keys)
4}importance_head (vs 6 in stage3), indicating additional hard-anchor forcing components.1git clone https://github.com/nitroxido/token-importance-scoring
2cd token-importance-scoring
3python -m venv .venv
4source .venv/bin/activate
5pip install -e .1from token_importance.model.importance_head import ImportanceUpdateHead
2import torch
3
4# Load TIS components
5checkpoint = torch.load('tis_components.pt', map_location='cuda')
6
7# Extract components
8importance_head_state = checkpoint['importance_head']
9importance_embedding_state = checkpoint['importance_embedding']
10
11print(f"Importance head keys: {importance_head_state.keys()}")1# Download checkpoint first
2hf download oldman-dev/tis-v8b-hard-anchor --local-dir checkpoints/v8b_hard_anchor
3
4# Run evaluation
5python scripts/eval_niah_hard.py \
6 --learned-checkpoint checkpoints/v8b_hard_anchor \
7 --budgets 0.25 0.5 0.75 \
8 --num-tests 50 \
9 --context-tokens 2048 \
10 --device cuda \
11 --seed 42Loss = ranking_loss + 2.0 * retrieval_loss + 0.5 * stability_loss| Checkpoint | NIAH @ 25% | NIAH @ 50% | Best Use Case |
|---|---|---|---|
| tis-v8b-hard-anchor (this) | 82% | 68% | Low-budget retrieval |
| tis-stage3-ert | 98% | 100% | General retrieval + LITM |
| tis-stage1-oracle | 100% | 100% | Oracle baseline |
1@software{token_importance_scoring_2026,
2 title={Token Importance Scoring: Learned KV Cache Compression for Long-Context LLMs},
3 author={Token Importance Scoring Contributors},
4 year={2026},
5 url={https://github.com/nitroxido/token-importance-scoring}
6}