Add the final 49.152B-token checkpoint
Browse filesFiles changed (4)
- README.mdAdded+70
- model.safetensorsAdded+3
- model_config.jsonAdded+51
- tokenizer.tiktoken.jsonAdded
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970---library_name: pytorchpipeline_tag: text-generationtags: - nexttransformer - linear-attention - causal-lm - pretrained - safetensors---
# NextTransformer RetNet
This is the final RetNet checkpoint (method `retnet`) from the NextTransformer 49.152B-token comparison. It has 1,410,077,320 parameters and a 2,048-token context. Pretraining used ClimbMix for 46,875 updates at seed 42.
Retain memory across several decay timescales.
| Final evaluation | Result ||---|---:|| Validation BPB | 0.6797 || CORE-22 (×100) | 29.36 |
Validation BPB was measured on 20,971,520 tokens in a separate evaluation of the final checkpoint. CORE-22 is the mean of the 22 centered task scores.
[Architecture](https://github.com/Interactive-Active-AI/NextTransformer/blob/1cc58931aa9db7fd258c982a41d6adcd697bb45b/results/methods/retnet.json) · [Run record](https://github.com/Interactive-Active-AI/NextTransformer/blob/1cc58931aa9db7fd258c982a41d6adcd697bb45b/results/runs/retnet.json) · [Checkpoint audit](https://github.com/Interactive-Active-AI/NextTransformer/blob/1cc58931aa9db7fd258c982a41d6adcd697bb45b/evidence/audits/retnet.json)
## Load the weights
Install the pinned NextTransformer implementation and the safetensors reader with Python 3.10–3.13.
```bashpip install "nexttransformer @ git+https://github.com/Interactive-Active-AI/NextTransformer.git@1cc58931aa9db7fd258c982a41d6adcd697bb45b" safetensors```
The example uses the PyTorch reference recurrence on CPU. The saved model configuration records the fused recurrence used in training.
```pythonimport base64import jsonimport osfrom pathlib import Path
os.environ["CUDA_VISIBLE_DEVICES"] = ""
import tiktokenimport torchfrom huggingface_hub import snapshot_downloadfrom safetensors.torch import load_filefrom nexttransformer.models import build_model, config_from_dict
root = Path(snapshot_download("NextTransformer/RetNet-49B-Tokens"))raw = json.loads((root / "model_config.json").read_text())config = config_from_dict({**raw, "backend": "reference"})model = build_model(config, device="cpu")model.load_state_dict(load_file(root / "model.safetensors"), strict=True)model.set_step(46875)model.eval()
spec = json.loads((root / "tokenizer.tiktoken.json").read_text())encoding = tiktoken.Encoding( name=spec["name"], pat_str=spec["pat_str"], mergeable_ranks={base64.b64decode(b): rank for b, rank in spec["mergeable_ranks"]}, special_tokens=spec["special_tokens"],)prompt = [encoding.encode_single_token("<|bos|>")] + encoding.encode_ordinary("The sky is")with torch.inference_mode(): logits = model(torch.tensor([prompt]))print(encoding.decode([int(logits[0, -1].argmax())]))```123version https://git-lfs.github.com/spec/v1oid sha256:f7542116b9a36e37085a18e04a1732c7fe53896dda85d36f9633938c5449e437size 4331709816123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051{ "method": "retnet", "width": 1536, "heads": 12, "vocab_size": 32768, "sequence_len": 2048, "mlp_width": 6144, "layers": 23, "pre_layers": 3, "core_layers": 9, "post_layers": 3, "loops": 2, "window_pattern": "SSSL", "max_loops": 3, "act_epsilon": 0.01, "ponder_weight": 0.01, "huginn_mean": 3.0, "huginn_sigma": 0.5, "huginn_backprop_loops": 2, "routing_seed": 1729, "eval_loops": 3, "ouro_entropy_weight": 0.1, "ouro_gate_steps": 1024, "ouro_exit_quantile": 0.5, "sparse_topk": 256, "block_size": 128, "compression_size": 4, "local_window": 512, "index_heads": 4, "index_dim": 128, "index_rope_dim": 64, "index_loss_weight": 1.0, "burnin_steps": 512, "slots": 64, "gate_rank": 16, "conv_size": 4, "reference_chunk": 32, "backend": "fla_chunk64", "scale": "formal", "residual_streams": 4, "residual_gate_init": 0.01, "sinkhorn_iterations": 20, "attnres_groups": 8, "sliding_window": 2048, "q_rank": 768, "kv_rank": 256, "qk_nope_dim": 64, "qk_rope_dim": 64, "v_head_dim": 128, "options": []}README.mdAdded+70
model.safetensorsAdded+3
model_config.jsonAdded+51
tokenizer.tiktoken.jsonAdded