Yoon Kim, Tianle Cai, Han Guo, James Liu, Pragaash Ponnusamy, Ben Athiwaratkun
We lifted 14 functions out of this paper's own repositories and ran 7 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.
| Repository | Role | Ran |
|---|---|---|
| FasterDecoding/TEAL | canonical | 3 of 3 |
| fasterdecoding/teal | — | 4 of 11 |
| Function | Status | Where it lives |
|---|---|---|
| ActivationModule | Ran | fasterdecoding/teal/teal/model.py code served (permissive licence) · get_code("4f283dcb0a0422d7") |
| Distribution | Ran | fasterdecoding/teal/teal/model.py code served (permissive licence) · get_code("c5354bfc34cf09a3") |
| get_layer_greedy_sparsities | Ran | fasterdecoding/teal/teal/model.py code served (permissive licence) · get_code("9b77813d7a7d746d") |
| interp | Ran | fasterdecoding/teal/teal/model.py code served (permissive licence) · get_code("e141b830083564c0") |
| logits_to_probs | Ran | FasterDecoding/TEAL/gpt-fast/generate.py code served (permissive licence) · get_code("f4d39ec8a89dcfa0") |
| multinomial_sample_one_no_sync | Ran | FasterDecoding/TEAL/gpt-fast/generate.py code served (permissive licence) · get_code("5b6f45360aa68edd") |
| sample | Ran | FasterDecoding/TEAL/gpt-fast/generate.py code served (permissive licence) · get_code("8465782fc7e1fe39") |
| SparseModelMixin | Not yet run | fasterdecoding/teal/teal/model.py code served (permissive licence) · get_code("dc1705f0ac812a98") |
| SparsifyFn | Not yet run | fasterdecoding/teal/teal/model.py code served (permissive licence) · get_code("8247ca701a965ec3") |
| _FA2_forward | Not yet run | fasterdecoding/teal/teal/model.py code served (permissive licence) · get_code("82f026ca4d133e3f") |
| _mlp_forward | Not yet run | fasterdecoding/teal/teal/model.py code served (permissive licence) · get_code("8f9f6dcb910a3d1e") |
| _monkeypatch_layer | Not yet run | fasterdecoding/teal/teal/model.py code served (permissive licence) · get_code("9d238e7c8da0339a") |
| _monkeypatch_mlp | Not yet run | fasterdecoding/teal/teal/model.py code served (permissive licence) · get_code("31cd3abe1ae1c21e") |
| _monkeypatch_self_attn | Not yet run | fasterdecoding/teal/teal/model.py code served (permissive licence) · get_code("f89bf27e96be35db") |
Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.
Activation sparsity can enable practical inference speedups in large language models (LLMs) by reducing the compute and memory-movement required for matrix multiplications during the forward pass. However, existing methods face limitations that inhibit widespread adoption. Some approaches are tailored towards older models with ReLU-based sparsity, while others require extensive continued pre-training on up to hundreds of billions of tokens. This paper describes TEAL (Training-Free Activation Sparsity in LLMs), a simple training-free method that applies magnitude-based activation sparsity to hidden states throughout the entire model. TEAL achieves 40-50% model-wide sparsity with minimal performance degradation across Llama-2, Llama-3, and Mistral families, with sizes varying from 7B to 70B. We improve existing sparse kernels and demonstrate wall-clock decoding speed-ups of up to 1.53× and 1.8× at 40% and 50% model-wide sparsity. TEAL is compatible with weight quantization, enabling further efficiency gains.
The same record, over MCP at https://syntology.ai/mcp:
get_harvested_code_for_paper("2408.14690")
get_code_for_paper("2408.14690")
have("2408.14690")
Connect an agent — have() is free.