RetNet-0.5B, epoch 1
First training leg of the 0.5B model, run on a rented RTX 3090 24 GB. Validation loss 2.1035. The final model is RetNet-0.5B at 1.9459.
Same architecture and configuration: 504,179,896 parameters, 20 layers, d_model 1408, 22 heads,
vocab 20000, context 2048, chunk size 128.
Training
One epoch over chat_pack_v13 (552,330,489 token slots). Batch 4 × accum 1, 67,390 steps,
11.316 h wall clock, 13,551 tokens/s. Full cosine 1.1e-4 → 1.1e-5, warmup 500, AdamW 8-bit,
seed 1234. Peak memory 23,230 MiB out of 24,576 MiB — 1,346 MiB of headroom, which is why the
batch stayed at 4 on this card.
The run was split into two segments by a control flag: it stopped at step 10,661 and resumed from 10,509 after the last checkpoint at 10,508, so 153 steps were run twice.
Usage
Identical to the final model — trust_remote_code=True, standard AutoTokenizer:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "Ayaka157/RetNet-0.5B-ep1"
tok = AutoTokenizer.from_pretrained(repo, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(repo, trust_remote_code=True, dtype=torch.float32).eval()
ids = tok("<bos>用户:你好。\n助手:")["input_ids"]
out = model.generate(torch.tensor([ids]), max_new_tokens=64, temperature=0.7)
print(tok.decode(out[0].tolist()[len(ids):]))
As in the other checkpoints, mode in config.json is parallel for inference; the training
run used chunkwise.
Evaluation numbers and the failure notes are on the final model card and in the technical report.
License
MIT.