RetNet-0.5B v21.2 β€” 16k long-context export (measured negative on retrieval)

Status: research export β€” 16k language modelling works, 16k retrieval does not.

Repository (code, analysis, report): https://github.com/Ayaka157/RetNet
Technical report (2026-10-29): https://github.com/Ayaka157/RetNet/blob/main/docs/latex/en/RetNet-0.5B-Technical-Report.pdf

Model

Parameters 504,179,896
Architecture RetNet (retention), 20 layers, width 1408, 22 heads, value/FFN dim 2816
Vocabulary / context 20,000 ByteLevel BPE / 2048 training context
Decay per-head learned $\gamma$; GLA branch implemented but gla_rank=0
Precision stored as fp32 safetensors (1.92 GB); load with orch_dtype=torch.bfloat16 for inference

Files

config.json, model.safetensors, modeling_retnet.py, retention_fast.py, fused_ce.py, tokenizer files. The modeling files come from the published RetNet codebase and are provided so the checkpoint can be loaded with trust_remote_code=True.

from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("Ayaka157/RetNet-0.5B-v21.2", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("Ayaka157/RetNet-0.5B-v21.2", trust_remote_code=True,
                                             torch_dtype="bfloat16")

For serving/prefill use the parallel form, training uses chunkwise, decoding uses recurrent (RETNET_FAST_CHUNKWISE=1 for batched chunkwise). The demo: https://retnet.ayaka157.icu/play/

Evidence and limitations

Long-context training (13,000 steps, 0.852 B tokens) lowered the 16k within-document long-tail from 3.2841 to 2.5942, but the gain is a uniform level shift (all position buckets improve by -0.68 to -0.72 nat), not a position effect. The learned decays collapsed during training: max half-life 1,649 tokens, no head has a half-life >=2,048, max weight at 16k is 0.00102. Needle retrieval at 16k is 0.0978 (chance; null arm 0.1024, item_acc 0/360). Do not advertise or use this export for 16k retrieval; it is evidence for the report.

Links

  • Code, data tooling, evaluation scripts, and the full analysis: https://github.com/Ayaka157/RetNet
  • 2026-10-29 technical report (English / Chinese PDFs) in the headline repository.
Downloads last month
145
Safetensors
Model size
0.5B params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support