Skip to content

Latest commit

Β 

History

74 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DecodeShare: Tracing the Shared Subspace of LLM Decode-Time Decisions

πŸ“„ Paper PDF | 🌐 Project Page | 🎬 Demo

License: MIT Python


🎬 Demo

DecodeShare steering demo comparing baseline, prefill steering, and decode steering

Try the free CPU Hugging Face Space

The hosted Space can take about 2-3 minutes to wake up. It runs without local setup, Hugging Face login, or paid hardware.

πŸ—žοΈ News

  • πŸ† 2026.06 DecodeShare was selected as an ICML 2026 Spotlight.
  • πŸ”§ 2026.06 Released paper-aligned implementation and H1/H2/H3 rerun summaries.
  • πŸš€ 2026.05 Public CPU demo and reproduction scripts released.

πŸ” What Is DecodeShare?

DecodeShare pipeline

DecodeShare identifies compact task-general directions in KV-cached decode-time hidden states, then tests whether those directions causally affect LLM decisions by removing them only during decoding.

The repository contains the method code, paper experiment runners, smoke tests, full reproduction scripts, lightweight figures, and a small interactive demo.

⚑ Quick Start

conda env create -f environment.yml
conda activate decodeshare
bash scripts/run_all_smoke_tests.sh

Inspect full GPU commands without launching model inference:

DRY_RUN=1 bash scripts/reproduce_ablation_tables.sh

Run the local Gradio demo:

pip install -r demo/requirements-demo.txt
python demo.py --server_port 7860

πŸ§ͺ Reproduce

bash scripts/reproduce_h1_tables.sh
bash scripts/reproduce_ablation_tables.sh
bash scripts/reproduce_table_1_patchback.sh
bash scripts/reproduce_steering_flip_tables.sh
bash scripts/reproduce_table_3_h3.sh

Section command notes:

Section Commands
H1 sharedness scripts/01_h1_sharedness/COMMANDS.md
H2 decode ablation scripts/02_h2_decode_ablation/COMMANDS.md
H2 patchback scripts/03_h2_patchback/COMMANDS.md
H3 prefill/decode scripts/04_h3_prefill_decode/COMMANDS.md
Steering rank flip scripts/05_steering_rank_flip/COMMANDS.md

πŸ“Œ Paper-Aligned Reruns. The released implementation is aligned with the estimator described in the paper: task-balanced and task-centered pooled PCA/SVD, no feature-wise standardization before PCA, and decode-time projection removal in the raw hidden-state coordinate system.

Lightweight rerun summaries are in docs/paper_aligned_reruns/. They show no material change to the H1/H2/H3 qualitative conclusions. The full H2 raw JSON is not committed because it is 257 MB; the docs include a compact summary and SHA-256 hash.

πŸ—‚οΈ Repository Map

decodeshare/              Method and shared utilities
experiments/              Paper-section experiment runners
scripts/                  Smoke tests and full reproduction wrappers
downstream/               Steering and patchback bundles
demo/                     Local and hosted demo code
docs/                     Installation, reproduction, and rerun notes
paper_artifacts/figures/  Lightweight figures
tests/                    Lightweight local checks

πŸ“š Documentation

Document Contents
docs/index.html Project-page overview and citation
docs/installation.md Environment setup
docs/data_and_models.md Dataset and model access
docs/reproduce.md Smoke checks and full reruns
docs/paper_aligned_reruns/ Paper-aligned rerun summaries
docs/troubleshooting.md Common runtime issues

πŸ“– Citation

@inproceedings{shao2026decodeshare,
  title     = {DecodeShare: Tracing the Shared Subspace of LLM Decode-Time Decisions},
  author    = {Shao, Zishan and Zhang, Lixun and Cui, Kangning and Wang, Yixiao
               and Jiang, Ting and Ye, Hancheng and Wang, Qinsi and Du, Zhixu
               and Fu, Yuzhe and Yang, Fan and Zhuo, Danyang and Chen, Yiran
               and Li, Hai Helen},
  booktitle = {Proceedings of the 43rd International Conference on Machine Learning},
  year      = {2026}
}

πŸ“„ License

This repository is released under the MIT License. See LICENSE.

About

πŸ†[ICML 2026 Spotlight] Official implementation of "DecodeShare: Tracing the Shared Subspace of LLM Decode-Time Decisions"

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages