programmable-kv
Models Take Notes at Prefill: KV Cache Can Be Editable and Composable (arXiv:2606.17107) — paper, code, results, and interactive companion.
File Explorer
- EXPLAINER.md
- MECHANISM.md
- align.py
- capture.py
- contexts.py
- deviation.py
- plot_e1.py
- README.md
- run_e1.py
- plot_recovery.py
- plot_selection.py
- README.md
- run_e2.py
- run_e2b.py
- run_e2c.py
- run_horizon.py
- run_recovery.py
- run_selection.py
- run_taubench.py
- scenarios.py
- taubench_ctx.py
- dependency_links.txt
- PKG-INFO
- SOURCES.txt
- top_level.txt
- __init__.py
- core.py
- diagnostics.py
- example.py
- pyproject.toml
- README.md
- test_editkv.py
- ablation_thinking.py
- arch_erratum_v2.py
- baseline_table.py
- circ_components.py
- circ_direction.py
- circ_heads.py
- circ_sae.py
- circ_scrub.py
- circuit_common.py
- compile_bench.py
- compile_static_bench.py
- composable_agentic.py
- composable_facts.py
- composable_kv.py
- composable_vision.py
- composable_vision_shift.py
- compose_edit.py
- cost_frontier.py
- diagnostic_eval.py
- diverse_tasks.py
- editkv_agent.py
- editkv_agent_rigorous.py
- editkv_horizon.py
- editkv_unified.py
- erratum_arch_strength.py
- erratum_control.py
- erratum_robustness.py
- erratum_test.py
- frontier.py
- latency_bench.py
- make_composable_figures.py
- make_figures.py
- make_ksweep_figure.py
- make_scorecards.py
- mech_attention.py
- mech_causal_natural.py
- mech_causal_patch.py
- mech_compare.py
- mech_diverse.py
- mech_dose_response.py
- mech_oracle_control.py
- mech_probe.py
- mech_reasoning_reread.py
- mech_suite.py
- mechanism.py
- mechd_common.py
- mechd_general.py
- mechd_inject.py
- mechd_replicate.py
- mechd_specificity.py
- mechd_timing.py
- mechd_xcond.py
- mla_behavioral.py
- mla_composable.py
- multisample.py
- multisample_fast.py
- nonsafety_fidelity.py
- plot_frontier.py
- README.md
- robustness_multi.py
- rome.py
- selective_field.py
- selective_K_sweep.py
- selective_K_sweep_diverse.py
- selective_reasoning.py
- selective_recompute.py
- selective_sweep.py
- selective_tokens.py
- serving_bench.py
- sparse_refresh_probe.py
- stress_thinking.py
- surgical_suffices.py
- tau2_agent_loop.py
- tau2_composable.py
- tau2_editkv.py
- tau2_episode.py
- taubench_thinking.py
- thinking_test.py
- token_stats.py
- toy_model.py
- transplant_mech.py
- verify_faithful.py
- vision_ttft.py
- vllm_editkv_serving.py
- vllm_online_load.py
- vllm_serving_online.py
- weight_editing_compare.py
- why_erratum.py
- fig_architecture.png
- fig_baseline_frontier.png
- fig_composable_scaling.png
- fig_d1_generalization.png
- fig_dose_response.png
- fig_keystone.png
- fig_ksweep.png
- fig_memoization_map.png
- fig_online_load.png
- fig_selective_recompute.png
- fig_serving.png
- fig_surgical_suffices.png
- fig_toy_model.png
- README.md
- calib_Qwen3-0_6B.json
- calib_Qwen3-1_7B.json
- calib_Qwen3-4B.json
- e1_Llama-8B-long.jsonl
- e1_Meta-Llama-3_1-70B-Instruct-bnb-4bit.jsonl
- e1_Meta-Llama-3_1-8B-Instruct.jsonl
- e1_Qwen3-14B.jsonl
- e1_Qwen3-1_7B.jsonl
- e1_Qwen3-30B-A3B.jsonl
- e1_Qwen3-32B-FP8.jsonl
- e1_Qwen3-4B-long.jsonl
- e1_Qwen3-4B.jsonl
- e2_gemma-2-2b-it.jsonl
- e2_Llama-3.1-70B-4bit.jsonl
- e2_Meta-Llama-3_1-8B-Instruct.jsonl
- e2_Mistral-7B-Instruct-v0_3.jsonl
- e2_Qwen3-0_6B.jsonl
- e2_Qwen3-14B.jsonl
- e2_Qwen3-1_7B.jsonl
- e2_Qwen3-30B-A3B.jsonl
- e2_Qwen3-32B-FP8.jsonl
- e2_Qwen3-4B-long.jsonl
- e2_Qwen3-4B.jsonl
- e3_Meta-Llama-3_1-8B-Instruct.jsonl
- e3_Qwen3-14B.jsonl
- e3_Qwen3-1_7B.jsonl
- e3_Qwen3-32B-FP8.jsonl
- e3_Qwen3-4B.jsonl
- e4_Meta-Llama-3_1-8B-Instruct.jsonl
- e4_Qwen3-4B.jsonl
- e4cb_Qwen3-4B_contiguous.jsonl
- e4cb_Qwen3-4B_spread.jsonl
- e5_Meta-Llama-3_1-8B-Instruct.jsonl
- e5_Qwen3-14B.jsonl
- e5_Qwen3-1_7B.jsonl
- e5_Qwen3-32B-FP8.jsonl
- e5_Qwen3-4B-r0.1.jsonl
- e5_Qwen3-4B-r0.5.jsonl
- e5_Qwen3-4B.jsonl
- keystone_Llama70B_direct.jsonl
- ksweep_Qwen3-4B.jsonl
- locomo_Meta-Llama-3_1-8B-Instruct.jsonl
- locomo_Qwen3-14B.jsonl
- locomo_Qwen3-32B.jsonl
- locomo_Qwen3-4B.jsonl
- negctrl_Meta-Llama-3_1-8B-Instruct.jsonl
- negctrl_Qwen3-4B.jsonl
- summary.json
- xref_llama31_8b.jsonl
- xref_mistral_7b.jsonl
- xref_qwen3_8b.jsonl
- analyze.py
- app.py
- calibrate.py
- CALIBRATION.md
- data.py
- DESIGN.md
- FINDINGS_MEMORY.md
- make_figs.py
- memkv.py
- PREREG.md
- README.md
- run_e1.py
- run_e2.py
- run_e2_all.sh
- run_e3.py
- run_e4.py
- run_e5.py
- run_large.sh
- run_locomo.py
- run_locomo_full.sh
- run_negctrl.py
- run_rest.sh
- run_retry2.sh
- run_retry_robust.sh
- run_xref.py
- stats.py
- fig0_overview.pdf
- fig1_teaser.pdf
- fig2_mechanism.pdf
- fig3_editable.pdf
- fig4_composable.pdf
- fig5_keystone.pdf
- fig6_reach.pdf
- fig7_systems.pdf
- fig8_circuit.pdf
- fig9_horizon.pdf
- fig_e1_placement.pdf
- fig_e2_faithfulness.pdf
- fig_e3_editing.pdf
- fig_e4_granularity.pdf
- fig_e5_systems.pdf
- fig_locomo.pdf
- fig_operations.pdf
- figA1_frontier.pdf
- figA2_ksweep.pdf
- figA3_scorecard.pdf
- figA4_architecture.pdf
- figA5_multimodal.pdf
- figA6_mla_scaling.pdf
- figA7_adapters.pdf
- make_appendix_figures.py
- make_circuit_figure.py
- make_figures.py
- make_horizon_figure.py
- Makefile
- abstract.tex
- acknowledgements.tex
- appendix.tex
- composable.tex
- conclusion.tex
- editable.tex
- intro.tex
- keystone.tex
- limitations.tex
- mechanism.tex
- memory.tex
- reach.tex
- related.tex
- systems.tex
- arxiv.sty
- main.pdf
- main.tex
- references.bib
- frontier_qwen7b.png
- horizon_qwen7b.png
- P1_qwen1p5b_minor_attn.png
- P1_qwen1p5b_semantic_attn.png
- P1_qwen7b_minor_attn.png
- P1_qwen7b_semantic_attn.png
- P2P3_qwen1p5b_semantic.png
- P2P3_qwen7b_semantic.png
- P4_qwen1p5b.png
- P4_qwen7b.png
- README.md
- recovery_qwen7b.png
- selection_qwen7b.png
- account_role_minor.npz
- account_role_semantic.npz
- locale_minor.npz
- locale_semantic.npz
- nonce_minor.npz
- nonce_semantic.npz
- persona_minor.npz
- persona_semantic.npz
- region_minor.npz
- region_semantic.npz
- request_id_minor.npz
- request_id_semantic.npz
- safety_mode_minor.npz
- safety_mode_semantic.npz
- session_counter_minor.npz
- session_counter_semantic.npz
- subscription_tier_minor.npz
- subscription_tier_semantic.npz
- timestamp_minor.npz
- timestamp_semantic.npz
- account_role_minor.npz
- account_role_semantic.npz
- locale_minor.npz
- locale_semantic.npz
- nonce_minor.npz
- nonce_semantic.npz
- persona_minor.npz
- persona_semantic.npz
- region_minor.npz
- region_semantic.npz
- request_id_minor.npz
- request_id_semantic.npz
- safety_mode_minor.npz
- safety_mode_semantic.npz
- session_counter_minor.npz
- session_counter_semantic.npz
- subscription_tier_minor.npz
- subscription_tier_semantic.npz
- timestamp_minor.npz
- timestamp_semantic.npz
- ablation_thinking_qwen3_8b.json
- agent_rigorous_dsr1_llama8b.json
- agent_rigorous_gemma2_9b.json
- agent_rigorous_gemma3_27b.json
- agent_rigorous_llama31_70b_4bit.json
- agent_rigorous_llama31_8b.json
- agent_rigorous_mistral7b.json
- agent_rigorous_qwen3_0p6b.json
- agent_rigorous_qwen3_14b.json
- agent_rigorous_qwen3_1p7b.json
- agent_rigorous_qwen3_30a3b.json
- agent_rigorous_qwen3_32b.json
- agent_rigorous_qwen3_4b.json
- agent_rigorous_qwen3_8b.json
- arch_erratum_v2_Falcon-H1-1_5B-Instruct.json
- arch_erratum_v2_falcon-mamba-7b-instruct.json
- arch_erratum_v2_gemma2_9b.json
- arch_erratum_v2_gemma3_27b_bf16.json
- arch_erratum_v2_llama31_8b.json
- arch_erratum_v2_mistral7b.json
- arch_erratum_v2_Qwen3-8B.json
- arch_erratum_v2_qwen3_14b.json
- arch_erratum_v2_qwen3_4b.json
- baseline_table_qwen3_8b.json
- circ_components_gemma2_9b_T16.json
- circ_components_gemma2_9b_T22.json
- circ_components_gemma2_9b_T28.json
- circ_components_llama31_8b.json
- circ_components_llama31_8b_T12.json
- circ_components_llama31_8b_T14.json
- circ_components_llama31_8b_T20.json
- circ_components_mistral_7b_T12.json
- circ_components_mistral_7b_T16.json
- circ_components_mistral_7b_T20.json
- circ_components_qwen3_8b_T14.json
- circ_components_qwen3_8b_T18.json
- circ_components_qwen3_8b_T22.json
- circ_direction_gemma2_9b.json
- circ_direction_llama31_8b.json
- circ_direction_mistral_7b.json
- circ_direction_qwen3_8b.json
- circ_heads_gemma2_9b.json
- circ_heads_llama31_8b.json
- circ_heads_mistral_7b.json
- circ_heads_qwen3_8b.json
- circ_sae_llama31_8b_L14.json
- circ_sae_llama31_8b_L24.json
- circ_scrub_gemma2_9b.json
- circ_scrub_llama31_8b.json
- circ_scrub_mistral_7b.json
- circ_scrub_qwen3_8b.json
- comp_div_gemma2_9b.log
- comp_div_llama31_8b.log
- comp_div_mistral7b.log
- comp_div_qwen3_8b.log
- composable_agentic_gemma2_9b.json
- composable_agentic_gemma3_27b.json
- composable_agentic_llama31_70b_4bit.json
- composable_agentic_llama31_8b.json
- composable_agentic_mistral7b.json
- composable_agentic_qwen3_30a3b.json
- composable_agentic_qwen3_32b.json
- composable_agentic_qwen3_8b.json
- composable_facts_gemma2_9b.json
- composable_facts_gemma3_27b.json
- composable_facts_llama31_8b.json
- composable_facts_mistral7b.json
- composable_facts_qwen3_30a3b.json
- composable_facts_qwen3_32b.json
- composable_facts_qwen3_8b.json
- composable_multi_dsr1_llama8b.json
- composable_multi_gemma2_9b.json
- composable_multi_llama31_8b.json
- composable_multi_qwen3_0p6b.json
- composable_multi_qwen3_32b_fp8.json
- composable_multi_qwen3_4b.json
- composable_reason_qwen3_1p7b.json
- composable_reason_qwen3_8b.json
- composable_scaling_dsr1_llama8b.json
- composable_scaling_llama31_8b.json
- composable_scaling_qwen3_1p7b.json
- composable_scaling_qwen3_8b.json
- composable_seam_qwen3_1p7b.json
- composable_seam_qwen3_8b.json
- composable_staleness_qwen3_1p7b.json
- composable_staleness_qwen3_8b.json
- composable_vision_qwen25vl_32b.json
- composable_vision_qwen25vl_3b.json
- composable_vision_qwen25vl_3b_test.json
- composable_vision_qwen25vl_7b.json
- composable_vision_qwen2vl_7b.json
- composable_vision_qwen3vl_30a3b.json
- composable_vision_qwen3vl_8b.json
- compose_edit_dsr1_llama8b.json
- compose_edit_gemma2_9b.json
- compose_edit_gemma3_27b.json
- compose_edit_llama31_8b.json
- compose_edit_llama31_8b_8inst.json
- compose_edit_mistral7b.json
- compose_edit_qwen3_0p6b.json
- compose_edit_qwen3_14b.json
- compose_edit_qwen3_14b_8inst.json
- compose_edit_qwen3_1p7b.json
- compose_edit_qwen3_30a3b.json
- compose_edit_qwen3_32b.json
- compose_edit_qwen3_4b.json
- compose_edit_qwen3_8b.json
- compose_edit_qwen3_8b_8inst.json
- cost_frontier_qwen3_8b.json
- diagnostic_eval_qwen3_8b.json
- e1_qwen1p5b.json
- e1_qwen7b.json
- e2_qwen7b_chat.json
- e2b_qwen7b.json
- e2c_qwen7b.json
- editkv_agent_llama31_8b.json
- editkv_horizon_llama31_8b_p1.json
- editkv_horizon_llama31_8b_p6.json
- editkv_horizon_mistral_7b_p1.json
- editkv_horizon_mistral_7b_p6.json
- editkv_horizon_qwen3_8b_p1.json
- editkv_horizon_qwen3_8b_p6.json
- editkv_unified_gemma2_9b.json
- editkv_unified_qwen3_1p7b.json
- erratum_control_qwen3_8b.json
- erratum_qwen7b_nothink.json
- erratum_robustness_qwen3_8b.json
- facts_seamrepair_gemma2_9b.json
- frontier_qwen7b.json
- horizon_account_role_r0.json
- horizon_account_role_r256_r256.json
- horizon_qwen7b_r0.json
- horizon_timestamp_r0.json
- ksweep_diverse_dsr1_llama8b.json
- ksweep_diverse_gemma2_9b.json
- ksweep_diverse_llama31_8b.json
- ksweep_diverse_qwen3_14b.json
- ksweep_diverse_qwen3_1p7b.json
- ksweep_diverse_qwen3_4b.json
- ksweep_diverse_qwen3_8b.json
- latency_qwen3_1p7b.json
- latency_qwen3_8b.json
- mech_attention_qwen3_8b.json
- mech_causal_natural_qwen3_8b.json
- mech_causal_patch_gemma2_27b.json
- mech_causal_patch_gemma2_27b_int8.json
- mech_causal_patch_gemma2_9b.json
- mech_causal_patch_gemma3_27b_bf16.json
- mech_causal_patch_gemma3_27b_int8.json
- mech_causal_patch_llama31_8b.json
- mech_causal_patch_mistral7b.json
- mech_causal_patch_qwen3_14b.json
- mech_causal_patch_qwen3_32b.json
- mech_causal_patch_qwen3_4b.json
- mech_causal_patch_qwen3_8b.json
- mech_compare_qwen3_8b.json
- mech_diverse_dsr1llama8b.json
- mech_diverse_gemma2_2b.json
- mech_diverse_gemma2_9b.json
- mech_diverse_gemma3_4b.json
- mech_diverse_mistral7b.json
- mech_diverse_qwen3_0p6b.json
- mech_diverse_qwen3_1p7b.json
- mech_diverse_qwen3_4b.json
- mech_diverse_qwen3_8b.json
- mech_diverse_smollm2_1p7b.json
- mech_dose_response_qwen3_8b.json
- mech_oracle_qwen3_14b.json
- mech_oracle_qwen3_4b.json
- mech_oracle_qwen3_8b.json
- mech_probe_qwen3_8b.json
- mech_reasoning_reread_qwen3_14b.json
- mech_reasoning_reread_qwen3_14b_full.json
- mech_reasoning_reread_qwen3_32b_fp8.json
- mech_reasoning_reread_qwen3_8b.json
- mech_suite_qwen3_14b.json
- mech_suite_qwen3_30b.json
- mech_suite_qwen3_32b.json
- mech_suite_qwen3_4b.json
- mech_suite_qwen3_8b.json
- mechd_general_llama31_8b.json
- mechd_general_qwen3_4b.json
- mechd_general_qwen3_8b.json
- mechd_inject_llama31_8b.json
- mechd_inject_qwen3_4b.json
- mechd_inject_qwen3_8b.json
- mechd_replicate_gemma2_9b.json
- mechd_replicate_mistral_7b.json
- mechd_specificity_llama31_8b.json
- mechd_specificity_qwen3_4b.json
- mechd_specificity_qwen3_8b.json
- mechd_timing_llama31_8b.json
- mechd_timing_qwen3_4b.json
- mechd_timing_qwen3_8b.json
- mechd_xcond_llama31_8b.json
- mechd_xcond_qwen3_4b.json
- mechd_xcond_qwen3_8b.json
- mla_behavioral.json
- mla_composable_dscoderv2_mla.json
- mla_composable_dsv2lite_mla.json
- multisample_qwen3_8b.json
- nonsafety_qwen3_8b.json
- README.md
- recovery_qwen7b.json
- robustness_multi_qwen3_8b.json
- selection_qwen7b.json
- selective_field_qwen3_8b.json
- selective_Ksweep_dsr1_llama8b.json
- selective_Ksweep_qwen3_14b.json
- selective_Ksweep_qwen3_14b_par.json
- selective_Ksweep_qwen3_1p7b.json
- selective_Ksweep_qwen3_1p7b_par.json
- selective_Ksweep_qwen3_4b.json
- selective_Ksweep_qwen3_4b_par.json
- selective_Ksweep_qwen3_8b.json
- selective_Ksweep_qwen3_8b_par.json
- selective_reasoning_qwen3_8b.json
- selective_recompute_qwen3_1p7b.json
- selective_sweep_gemma2_9b.json
- selective_sweep_gemma3_27b.json
- selective_sweep_mistral7b.json
- selective_sweep_qwen3_14b.json
- selective_sweep_qwen3_1p7b.json
- selective_sweep_qwen3_4b.json
- selective_sweep_qwen3_8b.json
- serving_bench_qwen3_8b.json
- stress_qwen3_8b_think1.json
- stress_qwen7b_think0.json
- surgical_suffices_gemma3_27b_bf16.json
- surgical_suffices_Qwen3-14B.json
- surgical_suffices_Qwen3-32B.json
- surgical_suffices_Qwen3-8B.json
- tau2_agent_loop_qwen3_8b.json
- tau2_composable_llama31_8b.json
- tau2_composable_mistral7b.json
- tau2_editkv.json
- tau2_episode_qwen3_8b.json
- taubench_qwen7b.json
- taubench_thinking_qwen3_8b.json
- taubench_thinking_qwen3_8b_big.json
- thinking_qwen3_14b_think.json
- thinking_qwen3_8b_think.json
- token_stats_gemma2_9b.json
- token_stats_qwen3_1p7b.json
- token_stats_qwen3_8b.json
- toy_model.json
- transplant_mech_qwen3_8b.json
- vision_shift_qwen25vl_3b.json
- vision_shift_qwen25vl_7b.json
- vision_shift_qwen3vl_30a3b.json
- vision_shift_qwen3vl_8b.json
- vision_ttft_qwen25vl_7b.json
- vllm_online_load_qwen3_8b.json
- vllm_online_qwen3_8b.json
- vllm_serving_qwen3_8b.json
- weight_edit_compare_llama31_8b.json
- why_erratum_qwen3_8b.json
- build_data.py
- BarCI.tsx
- core.tsx
- DiagonalScatter.tsx
- Heatmap.tsx
- LineChart.tsx
- NotesTeaser.tsx
- RopeRotation.tsx
- SegmentedPrompt.tsx
- Controls.tsx
- Figure.tsx
- Section.tsx
- circuit.json
- composing.json
- constants.json
- controls.json
- editing.json
- horizon.json
- keystone.json
- mechanism.json
- memory.json
- prompts.json
- reach.json
- systems.json
- format.ts
- headline.ts
- useInView.ts
- useScrollSpy.ts
- Attention.tsx
- Boundaries.tsx
- Challenges.tsx
- Circuit.tsx
- Composable.tsx
- DeepControls.tsx
- Editable.tsx
- Explorer.tsx
- Hero.tsx
- Horizon.tsx
- Keystone.tsx
- Mechanism.tsx
- Memory.tsx
- Puzzle.tsx
- Reach.tsx
- Systems.tsx
- App.tsx
- main.tsx
- theme.css
- .gitignore
- index.html
- package-lock.json
- package.json
- README.md
- tsconfig.json
- vite.config.ts
- .gitignore
- CITATION.cff
- LICENSE
- README.md
- requirements.txt
# Use via CDN
jsDelivrjsDelivr serves any public GitHub repository as a CDN with zero setup. Pick a version and a file to get a ready-to-paste link and snippet.
Command Glossary
Commands referenced in this DOCs, explained below.
pip install
View Details ▼
pip install
Install Python packages.
pip install {{package1 package2 ...}}
Install one or more packages:
pip install {{package1 package2 ...}} {{[-U|--upgrade]}}
Upgrade all specified packages to the latest version, installing any that are not already present:
pip install {{package}}=={{version}}
Install a specific version of a package:
python
View Details ▼
python
Python language interpreter.
python
Start a REPL (interactive shell):
python {{path/to/file.py}}
Execute a specific Python file:
python -i {{path/to/file.py}}
Execute a specific Python file and start a REPL:
mem
View Details ▼
mem
Display free memory info.
MEM
Display free memory:
