Add the final 49.152B-token checkpoint
Browse files- README.md +69 -0
- model.safetensors +3 -0
- model_config.json +111 -0
- tokenizer.tiktoken.json +0 -0
README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: pytorch
|
| 3 |
+
pipeline_tag: text-generation
|
| 4 |
+
tags:
|
| 5 |
+
- nexttransformer
|
| 6 |
+
- others
|
| 7 |
+
- arena
|
| 8 |
+
- causal-lm
|
| 9 |
+
- pretrained
|
| 10 |
+
- safetensors
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# NextTransformer Hydra
|
| 14 |
+
|
| 15 |
+
This is the final Hydra checkpoint (method `hydra`) from the NextTransformer 49.152B-token comparison. It has 1,780,828,720 parameters and a 2,048-token context. Pretraining used ClimbMix for 46,875 updates at seed 42.
|
| 16 |
+
|
| 17 |
+
A deeper, narrower AttnRes-Canon trunk that reads a hashed bigram and trigram memory as one more depth source.
|
| 18 |
+
|
| 19 |
+
Hydra is an entry in the [NextTransformer Arena](https://interactive-active-ai.github.io/NextTransformer/docs/arena/overview/). Claude Opus 5.5 proposed, implemented and selected the architecture in one NextT-Gym research session without human intervention. Its formal run followed the same protocol as every leaderboard method. It is ranked on the leaderboard.
|
| 20 |
+
|
| 21 |
+
| Final evaluation | Result |
|
| 22 |
+
|---|---:|
|
| 23 |
+
| Validation BPB | 0.6550 |
|
| 24 |
+
| CORE-22 (×100) | 37.04 |
|
| 25 |
+
|
| 26 |
+
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.
|
| 27 |
+
|
| 28 |
+
[Architecture](https://github.com/Interactive-Active-AI/NextTransformer/blob/1cc58931aa9db7fd258c982a41d6adcd697bb45b/results/methods/hydra.json) · [Run record](https://github.com/Interactive-Active-AI/NextTransformer/blob/1cc58931aa9db7fd258c982a41d6adcd697bb45b/results/runs/hydra.json) · [Checkpoint audit](https://github.com/Interactive-Active-AI/NextTransformer/blob/1cc58931aa9db7fd258c982a41d6adcd697bb45b/evidence/audits/hydra.json) · [Arena entry](https://github.com/Interactive-Active-AI/NextTransformer/blob/1cc58931aa9db7fd258c982a41d6adcd697bb45b/results/arena/hydra.json)
|
| 29 |
+
|
| 30 |
+
## Load the weights
|
| 31 |
+
|
| 32 |
+
Install the pinned NextTransformer implementation and the safetensors reader with Python 3.10–3.13.
|
| 33 |
+
|
| 34 |
+
```bash
|
| 35 |
+
pip install "nexttransformer @ git+https://github.com/Interactive-Active-AI/NextTransformer.git@1cc58931aa9db7fd258c982a41d6adcd697bb45b" safetensors
|
| 36 |
+
```
|
| 37 |
+
|
| 38 |
+
The example encodes a prompt with the checkpoint's tokenizer and prints its most likely next token.
|
| 39 |
+
|
| 40 |
+
```python
|
| 41 |
+
import base64
|
| 42 |
+
import json
|
| 43 |
+
from pathlib import Path
|
| 44 |
+
|
| 45 |
+
import tiktoken
|
| 46 |
+
import torch
|
| 47 |
+
from huggingface_hub import snapshot_download
|
| 48 |
+
from safetensors.torch import load_file
|
| 49 |
+
from nexttransformer.models import build_model, config_from_dict
|
| 50 |
+
|
| 51 |
+
root = Path(snapshot_download("NextTransformer/Hydra-49B-Tokens"))
|
| 52 |
+
config = config_from_dict(json.loads((root / "model_config.json").read_text()))
|
| 53 |
+
model = build_model(config, device="cpu")
|
| 54 |
+
model.load_state_dict(load_file(root / "model.safetensors"), strict=True)
|
| 55 |
+
model.set_step(46875)
|
| 56 |
+
model.eval()
|
| 57 |
+
|
| 58 |
+
spec = json.loads((root / "tokenizer.tiktoken.json").read_text())
|
| 59 |
+
encoding = tiktoken.Encoding(
|
| 60 |
+
name=spec["name"],
|
| 61 |
+
pat_str=spec["pat_str"],
|
| 62 |
+
mergeable_ranks={base64.b64decode(b): rank for b, rank in spec["mergeable_ranks"]},
|
| 63 |
+
special_tokens=spec["special_tokens"],
|
| 64 |
+
)
|
| 65 |
+
prompt = [encoding.encode_single_token("<|bos|>")] + encoding.encode_ordinary("The sky is")
|
| 66 |
+
with torch.inference_mode():
|
| 67 |
+
logits = model(torch.tensor([prompt]))
|
| 68 |
+
print(encoding.decode([int(logits[0, -1].argmax())]))
|
| 69 |
+
```
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d409faa9f9839c9c4d779babafb34bd3c7c72f2013cdb67a93e0c242b9132481
|
| 3 |
+
size 4942352536
|
model_config.json
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"method": "hydra",
|
| 3 |
+
"width": 1536,
|
| 4 |
+
"heads": 12,
|
| 5 |
+
"vocab_size": 32768,
|
| 6 |
+
"sequence_len": 2048,
|
| 7 |
+
"mlp_width": 4608,
|
| 8 |
+
"layers": 27,
|
| 9 |
+
"pre_layers": 3,
|
| 10 |
+
"core_layers": 9,
|
| 11 |
+
"post_layers": 3,
|
| 12 |
+
"loops": 2,
|
| 13 |
+
"window_pattern": "L",
|
| 14 |
+
"max_loops": 3,
|
| 15 |
+
"act_epsilon": 0.01,
|
| 16 |
+
"ponder_weight": 0.01,
|
| 17 |
+
"huginn_mean": 3.0,
|
| 18 |
+
"huginn_sigma": 0.5,
|
| 19 |
+
"huginn_backprop_loops": 2,
|
| 20 |
+
"routing_seed": 1729,
|
| 21 |
+
"eval_loops": 3,
|
| 22 |
+
"ouro_entropy_weight": 0.1,
|
| 23 |
+
"ouro_gate_steps": 1024,
|
| 24 |
+
"ouro_exit_quantile": 0.5,
|
| 25 |
+
"sparse_topk": 256,
|
| 26 |
+
"block_size": 128,
|
| 27 |
+
"compression_size": 4,
|
| 28 |
+
"local_window": 512,
|
| 29 |
+
"index_heads": 4,
|
| 30 |
+
"index_dim": 128,
|
| 31 |
+
"index_rope_dim": 64,
|
| 32 |
+
"index_loss_weight": 1.0,
|
| 33 |
+
"burnin_steps": 512,
|
| 34 |
+
"slots": 64,
|
| 35 |
+
"gate_rank": 16,
|
| 36 |
+
"conv_size": 4,
|
| 37 |
+
"reference_chunk": 32,
|
| 38 |
+
"backend": "reference",
|
| 39 |
+
"scale": "formal",
|
| 40 |
+
"residual_streams": 4,
|
| 41 |
+
"residual_gate_init": 0.01,
|
| 42 |
+
"sinkhorn_iterations": 20,
|
| 43 |
+
"attnres_groups": 8,
|
| 44 |
+
"sliding_window": 2048,
|
| 45 |
+
"q_rank": 768,
|
| 46 |
+
"kv_rank": 256,
|
| 47 |
+
"qk_nope_dim": 64,
|
| 48 |
+
"qk_rope_dim": 64,
|
| 49 |
+
"v_head_dim": 128,
|
| 50 |
+
"options": [
|
| 51 |
+
[
|
| 52 |
+
"expert_width",
|
| 53 |
+
1536
|
| 54 |
+
],
|
| 55 |
+
[
|
| 56 |
+
"moe_aux",
|
| 57 |
+
0.01
|
| 58 |
+
],
|
| 59 |
+
[
|
| 60 |
+
"moe_capacity",
|
| 61 |
+
1.0
|
| 62 |
+
],
|
| 63 |
+
[
|
| 64 |
+
"moe_experts",
|
| 65 |
+
0
|
| 66 |
+
],
|
| 67 |
+
[
|
| 68 |
+
"moe_topk",
|
| 69 |
+
2
|
| 70 |
+
],
|
| 71 |
+
[
|
| 72 |
+
"ngram_dim",
|
| 73 |
+
512
|
| 74 |
+
],
|
| 75 |
+
[
|
| 76 |
+
"ngram_heads",
|
| 77 |
+
2
|
| 78 |
+
],
|
| 79 |
+
[
|
| 80 |
+
"ngram_init",
|
| 81 |
+
0.8
|
| 82 |
+
],
|
| 83 |
+
[
|
| 84 |
+
"ngram_inject",
|
| 85 |
+
"source"
|
| 86 |
+
],
|
| 87 |
+
[
|
| 88 |
+
"ngram_orders",
|
| 89 |
+
[
|
| 90 |
+
2,
|
| 91 |
+
3
|
| 92 |
+
]
|
| 93 |
+
],
|
| 94 |
+
[
|
| 95 |
+
"ngram_rows",
|
| 96 |
+
327680
|
| 97 |
+
],
|
| 98 |
+
[
|
| 99 |
+
"router_init",
|
| 100 |
+
0.02
|
| 101 |
+
],
|
| 102 |
+
[
|
| 103 |
+
"shared_width",
|
| 104 |
+
3072
|
| 105 |
+
],
|
| 106 |
+
[
|
| 107 |
+
"value_embeds",
|
| 108 |
+
"shell"
|
| 109 |
+
]
|
| 110 |
+
]
|
| 111 |
+
}
|
tokenizer.tiktoken.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|