Views
No views yet
steklov-activations (pip install steklov-activations)| Checkpoint | Activation | α | Per-token zeros | 2:4 Compliance | PPL | Seeds |
|---|---|---|---|---|---|---|
steklov-a2.0 | SteklovSiLU | 2.0 | 3.4% | — | 30.88 ± 0.89 | 3 |
steklov-a0.8 | SteklovSiLU | 0.8 | 28.0% | 31.3% | 30.99 ± 0.88 | 3 |
steklov-learned | SteklovSiLU | →1.73 | 6.5% | — | 30.79 ± 0.90 | 3 |
steklov-a0.1 | SteklovSiLU | 0.1 | 87.2% | 98.4% | 30.57 | 1 |
steklov-a0.05 | SteklovSiLU | 0.05 | 88.9% | 98.9% | 30.47 | 1 |
steklov-a0.01 | SteklovSiLU | 0.01 | ~90% | 99.5% | ~30.5 | 1 |
steklov-a0.005 | SteklovSiLU | 0.005 | 90.2% | 99.2% | 30.47 | 1 |
| Checkpoint | ARC-E | HellaSwag | LAMBADA | PIQA | WinoGrande | Mean |
|---|---|---|---|---|---|---|
| SiLU baseline* | 35.61 | 26.28 | 19.31 | 57.34 | 49.80 | 37.67 |
| steklov-a2.0 | 36.78 | 26.63 | 20.51 | 57.78 | 50.36 | 38.41 |
| steklov-a0.8 | 36.24 | 26.45 | 17.98 | 56.58 | 50.20 | 37.49 |
| steklov-learned | 35.31 | 26.24 | 20.43 | 57.73 | 52.57 | 38.46 |
| steklov-a0.1 | 35.65 | 26.30 | 18.52 | 56.69 | 49.96 | 37.42 |
| steklov-a0.05 | 36.32 | 26.33 | 18.86 | 57.18 | 52.17 | 38.17 |
| steklov-a0.01 | 36.24 | 26.29 | 18.55 | 56.96 | 49.57 | 37.52 |
| steklov-a0.005 | 35.52 | 26.64 | 19.15 | 56.58 | 52.09 | 38.00 |
1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
3
4repo = "masalskikh/steklov-llama-105m"
5
6# Load the α=0.05 checkpoint (89% sparse, beats SiLU)
7model = AutoModelForCausalLM.from_pretrained(repo, subfolder="steklov-a0.05", trust_remote_code=True)
8tokenizer = AutoTokenizer.from_pretrained(repo)
9
10# Generate text
11model.eval()
12input_ids = tokenizer.encode("The future of artificial intelligence is", return_tensors="pt")
13with torch.no_grad():
14 for _ in range(50):
15 logits = model(input_ids).logits[:, -1, :]
16 next_token = torch.multinomial(torch.softmax(logits / 0.8, dim=-1), 1)
17 input_ids = torch.cat([input_ids, next_token], dim=1)
18print(tokenizer.decode(input_ids[0]))
19
20# Check sparsity: count exact zeros in MLP activations
21# (see steklov_llama.py get_sparsity_stats() for full profiling)LlamaForCausalLM(
embed_tokens: Embedding(50257, 768)
layers: 12 × LlamaDecoderLayer(
self_attn: LlamaAttention(768, 12 heads)
mlp: LlamaMLP(
up_proj: Linear(768 → 2048)
act_fn: SteklovSiLU(alpha=α, order=3)
down_proj: Linear(2048 → 768)
)
input_layernorm: LlamaRMSNorm(768)
post_attention_layernorm: LlamaRMSNorm(768)
)
)1@article{masalskikh2026steklov,
2 author = {Masalskikh, A.},
3 title = {Steklov Activations: Piecewise-Polynomial Gates with Compact Support and Tunable Sparsity},
4 journal = {Zenodo},
5 year = {2026},
6 doi = {10.5281/zenodo.19454642},
7 url = {https://doi.org/10.5281/zenodo.19454642}
8}