Text Generation
Transformers
Safetensors
English
qwen3
long-context
sparse-attention
aha
l2a-style
reproducibility
conversational
text-generation-inference
Instructions to use keepsloading/icml_repro_scratch with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use keepsloading/icml_repro_scratch with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="keepsloading/icml_repro_scratch") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("keepsloading/icml_repro_scratch") model = AutoModelForCausalLM.from_pretrained("keepsloading/icml_repro_scratch", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use keepsloading/icml_repro_scratch with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "keepsloading/icml_repro_scratch" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "keepsloading/icml_repro_scratch", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/keepsloading/icml_repro_scratch
- SGLang
How to use keepsloading/icml_repro_scratch with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "keepsloading/icml_repro_scratch" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "keepsloading/icml_repro_scratch", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "keepsloading/icml_repro_scratch" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "keepsloading/icml_repro_scratch", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use keepsloading/icml_repro_scratch with Docker Model Runner:
docker model run hf.co/keepsloading/icml_repro_scratch
| { | |
| "definition": "hard AHA gate zeros / all token x KV-head x layer decisions, token-weighted over prefill and decode", | |
| "router_granularity": "token", | |
| "native_router_decisions": 5391064, | |
| "effective_router_decisions": 43128512, | |
| "native_router_note": "Native decisions count learned gate logits before broadcast; effective decisions always use token x KV-head x layer for matched sparsity.", | |
| "sparse_decisions": 5716296, | |
| "total_decisions": 43128512, | |
| "sparsity": 0.13254099747285508, | |
| "full_attention_usage": 0.8674590025271449, | |
| "per_layer": { | |
| "0": { | |
| "sparse_decisions": 0, | |
| "total_decisions": 1540304, | |
| "sparsity": 0.0 | |
| }, | |
| "1": { | |
| "sparse_decisions": 0, | |
| "total_decisions": 1540304, | |
| "sparsity": 0.0 | |
| }, | |
| "2": { | |
| "sparse_decisions": 0, | |
| "total_decisions": 1540304, | |
| "sparsity": 0.0 | |
| }, | |
| "3": { | |
| "sparse_decisions": 0, | |
| "total_decisions": 1540304, | |
| "sparsity": 0.0 | |
| }, | |
| "4": { | |
| "sparse_decisions": 0, | |
| "total_decisions": 1540304, | |
| "sparsity": 0.0 | |
| }, | |
| "5": { | |
| "sparse_decisions": 0, | |
| "total_decisions": 1540304, | |
| "sparsity": 0.0 | |
| }, | |
| "6": { | |
| "sparse_decisions": 0, | |
| "total_decisions": 1540304, | |
| "sparsity": 0.0 | |
| }, | |
| "7": { | |
| "sparse_decisions": 0, | |
| "total_decisions": 1540304, | |
| "sparsity": 0.0 | |
| }, | |
| "8": { | |
| "sparse_decisions": 0, | |
| "total_decisions": 1540304, | |
| "sparsity": 0.0 | |
| }, | |
| "9": { | |
| "sparse_decisions": 0, | |
| "total_decisions": 1540304, | |
| "sparsity": 0.0 | |
| }, | |
| "10": { | |
| "sparse_decisions": 0, | |
| "total_decisions": 1540304, | |
| "sparsity": 0.0 | |
| }, | |
| "11": { | |
| "sparse_decisions": 0, | |
| "total_decisions": 1540304, | |
| "sparsity": 0.0 | |
| }, | |
| "12": { | |
| "sparse_decisions": 0, | |
| "total_decisions": 1540304, | |
| "sparsity": 0.0 | |
| }, | |
| "13": { | |
| "sparse_decisions": 32, | |
| "total_decisions": 1540304, | |
| "sparsity": 2.0775119716627365e-05 | |
| }, | |
| "14": { | |
| "sparse_decisions": 1640, | |
| "total_decisions": 1540304, | |
| "sparsity": 0.0010647248854771525 | |
| }, | |
| "15": { | |
| "sparse_decisions": 402208, | |
| "total_decisions": 1540304, | |
| "sparsity": 0.2611224797182894 | |
| }, | |
| "16": { | |
| "sparse_decisions": 4664, | |
| "total_decisions": 1540304, | |
| "sparsity": 0.0030279736986984387 | |
| }, | |
| "17": { | |
| "sparse_decisions": 287640, | |
| "total_decisions": 1540304, | |
| "sparsity": 0.18674235735283426 | |
| }, | |
| "18": { | |
| "sparse_decisions": 87720, | |
| "total_decisions": 1540304, | |
| "sparsity": 0.05694979692320477 | |
| }, | |
| "19": { | |
| "sparse_decisions": 321632, | |
| "total_decisions": 1540304, | |
| "sparsity": 0.20881072827182168 | |
| }, | |
| "20": { | |
| "sparse_decisions": 374168, | |
| "total_decisions": 1540304, | |
| "sparsity": 0.24291828106659463 | |
| }, | |
| "21": { | |
| "sparse_decisions": 333200, | |
| "total_decisions": 1540304, | |
| "sparsity": 0.21632093404938246 | |
| }, | |
| "22": { | |
| "sparse_decisions": 508832, | |
| "total_decisions": 1540304, | |
| "sparsity": 0.33034517861409174 | |
| }, | |
| "23": { | |
| "sparse_decisions": 857744, | |
| "total_decisions": 1540304, | |
| "sparsity": 0.5568666964443383 | |
| }, | |
| "24": { | |
| "sparse_decisions": 574504, | |
| "total_decisions": 1540304, | |
| "sparsity": 0.3729809180525403 | |
| }, | |
| "25": { | |
| "sparse_decisions": 375984, | |
| "total_decisions": 1540304, | |
| "sparsity": 0.24409726911051324 | |
| }, | |
| "26": { | |
| "sparse_decisions": 46264, | |
| "total_decisions": 1540304, | |
| "sparsity": 0.030035629330314017 | |
| }, | |
| "27": { | |
| "sparse_decisions": 1540064, | |
| "total_decisions": 1540304, | |
| "sparsity": 0.9998441866021253 | |
| } | |
| }, | |
| "by_phase": { | |
| "decode": { | |
| "sparse_decisions": 156624, | |
| "total_decisions": 2358720, | |
| "sparsity": 0.0664021164021164, | |
| "full_attention_usage": 0.9335978835978835 | |
| }, | |
| "prefill": { | |
| "sparse_decisions": 5559672, | |
| "total_decisions": 40769792, | |
| "sparsity": 0.1363674359682777, | |
| "full_attention_usage": 0.8636325640317223 | |
| } | |
| } | |
| } | |