HGRN-1.3B · RIA 80% sparse · fine-tuned
The one-shot RIA 80% checkpoint hgrn-1.3B-ria-80pct after mask-fixed fine-tuning. Gradients at pruned positions are zeroed, and pruned weights are re-zeroed after every step, so the model keeps about 80% sparsity. It is one of the post-pruning recovery baselines compared against CWS.
Training details
| Init | hgrn-1.3B-ria-80pct |
| Loss | cross-entropy on next-token labels |
| Data | C4, streaming |
| Steps / LR / batch | 20,000 / 2e-05 / 16 |
| Mask | fixed (pruned weights stay zero) |
Run settings are in finetune_meta.json.
Evaluation
| Metric | This model | Dense |
|---|---|---|
| WikiText-2 PPL ↓ | 2,015 | 11.8 |
| ARC-Easy (acc_norm) | 0.273 | 0.510 |
| ARC-Challenge (acc_norm) | 0.288 | 0.275 |
| HellaSwag (acc_norm) | 0.258 | 0.480 |
| PIQA (acc_norm) | 0.500 | 0.712 |
| WinoGrande (acc) | 0.506 | 0.528 |
| LAMBADA-OpenAI (acc) | 0.000 | 0.383 |
| Average (6 tasks) | 0.304 | 0.481 |
PPL uses non-overlapping 2048-token WikiText-2 windows (results/ppl_hgrn_80pct_recovery.json). Recovery lowers it from 28,681 (one-shot, same protocol) to 2,015, but task accuracy stays near chance. The training script logged a final PPL of 2,002.8 under its own evaluation setup. 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_ria_80pct_ft.json.
For comparison, CWS 80% reaches 1,086 after the same fine-tuning and 693 after the same distillation (see hgrn-1.3B-cws-80pct-ft-c4).
Method
RIA (Zhang et al., ICLR 2024) scores each weight by (|W[r,c]| / ‖W[r,:]‖₁ + |W[r,c]| / ‖W[:,c]‖₁) · act_rms[c]^α with α = 0.5. This is relative importance against both its row and its column, scaled by activation size. No weight correction.
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-ria-80pct-ft"
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.