HGRN-1.3B · Wanda 80% sparse
HGRN-1.3B, a 1.3B gated linear-recurrent LM with no attention, pruned one-shot to 80% weight sparsity with Wanda. It is a baseline in the CWS comparison on this model.
Model details
| Base model | ikimyaii/hgrn-1.3B-dense-baseline |
| Method | Wanda |
| Target / achieved sparsity | 80% / 79.98% |
| Calibration | dataset not recorded, 64 batches × 4 × 512 tokens |
| Weight correction | none |
| Retraining | none |
What is pruned: every nn.Linear in the 24 HGRN blocks (i_proj, f_proj, g_proj, o_proj, gate_proj, up_proj, down_proj) and lm_head. The same fraction is removed from every output row (semi-structured, constant k per row). Embeddings and norms stay dense.
Method
Wanda (Sun et al., ICLR 2024, arXiv:2306.11695) scores each weight by |W[i,j]| · √E[x_j²] (weight magnitude × input-channel activation RMS) and removes the lowest-scoring weights in each output row. No weight correction.
Evaluation
| Metric | This model | Dense |
|---|---|---|
| ARC-Easy (acc_norm) | 0.260 | 0.510 |
| ARC-Challenge (acc_norm) | 0.290 | 0.275 |
| HellaSwag (acc_norm) | 0.257 | 0.480 |
| PIQA (acc_norm) | 0.487 | 0.712 |
| WinoGrande (acc) | 0.519 | 0.528 |
| LAMBADA-OpenAI (acc) | 0.000 | 0.383 |
| Average (6 tasks) | 0.302 | 0.481 |
Zero-shot tasks use lm-evaluation-harness. ARC-e, ARC-c, HellaSwag and PIQA report acc_norm; WinoGrande and LAMBADA report acc. The dense baseline is ikimyaii/hgrn-1.3B-dense-baseline, a copy of fla-hub/hgrn-1.3B-100B. Raw results: results/benchmark_hgrn_wanda_80pct.json.
One-shot WikiText-2 perplexity at 80% sparsity on HGRN-1.3B (dense 11.8), as reported in the CWS paper sweep (results/paper_reported_sweep.csv):
| Method | WikiText-2 PPL ↓ |
|---|---|
| CWS | 131.27 |
| SparseGPT | 6,956 |
| Wanda (this model) | 76,051 |
| RIA | 28,615 |
| AWP | 17,195 |
Usage
The model uses the HGRN architecture from flash-linear-attention (FLA).
pip install flash-linear-attention transformers torch
import torch
import fla # registers HGRN with transformers
from fla.models.hgrn import HGRNConfig, HGRNForCausalLM
from transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer
AutoConfig.register("hgrn", HGRNConfig, exist_ok=True)
AutoModelForCausalLM.register(HGRNConfig, HGRNForCausalLM, exist_ok=True)
model_id = "ikimyaii/hgrn-1.3B-wanda-80pct"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16).cuda()
# Pruned weights are stored as explicit zeros in a dense tensor.
lin = model.model.layers[0].mlp.down_proj
print(f"sparsity: {(lin.weight == 0).float().mean():.3f}")
The checkpoint is stored densely, with zeros in the pruned positions, so it runs as-is on GPUs and CPUs. Speedups require a sparse kernel or hardware that skips zero weights. On Intel Loihi and other event-driven neuromorphic hardware, a zero weight generates no synaptic event, so the sparsity directly reduces active computation.
Limitations
- These are research checkpoints for studying pruning. They are not instruction-tuned or safety-tuned, and they inherit the base model's biases.
- Weights are stored densely, with zeros at the pruned positions. Sparsity alone gives no speedup without a sparse kernel or event-driven hardware.
- At 70–80% sparsity this model does not produce usable text. Zero-shot accuracy is near chance.
Related repositories
- Sparse-LLMs-on-Loihi: pruning scripts, baselines and raw results for this checkpoint.
- CWS: reference implementation of the CWS method these baselines are compared against.
- Weight-Sparsity-Using-Real-Loss and EHWS: follow-up work that optimises the real next-token loss instead of layer-wise reconstruction.