SWA-RetNet-v2-0.5B-Tide (汐 / Tide)

Bilingual ZH+EN chat and controllable-thinking checkpoint (SFT v3) trained from scratch on top of Ayaka157/SWA-RetNet-v2-0.5B-Base.

Spec Value
Parameters 513,081,852 (tied embeddings)
Architecture 24 layers = 19 Multi-Scale Gated Delta-Retention + 5 Local SWA GQA ([4, 9, 14, 19, 23], W=512)
Width d_model=1280, 10 heads (head_dim=128, kv_heads=2), SwiGLU 3200, depthwise conv k=4
Vocabulary / Context 32,768 bilingual BPE (tokenizer_32k.json) / 4,096 context
Inference memory O(1) recurrent state + W=512 ring buffer (no global KV cache)
Precision model.safetensors stored in fp32; load in bf16 for inference
SHA256 (model.safetensors) a87f34ce85fb6dc1087cfa0f817e7268a7db22ea27ced9ee659e78f7febd9a5d

Training summary

  • Base: SWA-RetNet-v2-0.5B-Base (5.45B unique bilingual tokens, 4k val CE 2.6035).
  • SFT v3 corpus: 132,919 clean bilingual conversations (97.10M supervised tokens), including 16,370 open-domain bilingual CoT rows mapped to reserved special tokens 8:<|think|> / 9:<|/think|>, 5,000 short-turn predicate-switch anti-echo dialogues, 11,681 long-context update/correction trajectories with filler turns masked out (code=2), and 12,000 4k pretrain replay rows.
  • Schedule: 5,600 steps (64 seq/step, 2Γ—RTX PRO 6000 DDP, BF16, cosine 3e-5 -> 2.5e-6).
  • Held-out SFT v3 validation (step 0 -> 5,600): weighted 2.6619 -> 1.6366, dialogue 2.3847 -> 1.7677, tide 2.6582 -> 1.7376, memory 3.5924 -> 0.0168, lm 2.6101 -> 2.6420.
  • 4k beyond-SWA two-arm context gain (512 vs 4096 on final 256 tokens): EN Ξ”_marginal = +0.0565 (95% CI [+0.0236, +0.1025]), ZH Ξ”_marginal = +0.0254 ([+0.0112, +0.0445]).

Chat format and 5-mode thinking

Special token IDs in tokenizer_32k.json: 1:<|bos|>, 2:<|eos|>, 3:<|im_start|>, 4:<|im_end|>, 5:<|system|>, 6:<|user|>, 7:<|assistant|>, 8:<|think|>, 9:<|/think|>.

Append one control tag to the system prompt to select thinking depth:

  • [ζ€θ€ƒοΌšε…³ι—­] / [Thinking: off] β€” direct answer (mask token 8 during decoding)
  • [ζ€θ€ƒοΌšθ‡ͺ动] / [Thinking: auto] β€” direct on casual chat, concise <|think|> on reasoning/updates
  • [ζ€θ€ƒοΌšθ½»] / [Thinking: low] β€” brief reasoning (≀160 tok)
  • [ζ€θ€ƒοΌšδΈ­] / [Thinking: medium] β€” multi-step reasoning (≀420 tok)
  • [ζ€θ€ƒοΌšζ·±] / [Thinking: high] β€” thorough derivation (≀1024 tok)

Usage

Load with modeling_retnet_v2.py (included in this repo and at github.com/Ayaka157/RetNet):

import torch
from tokenizers import Tokenizer
from modeling_retnet_v2 import RetNetV2ForCausalLM

tok = Tokenizer.from_file("tokenizer_32k.json")
model = RetNetV2ForCausalLM.from_pretrained(".", use_fla=False, use_liger=False, use_flex_swa=False)
model = model.to("cuda", dtype=torch.bfloat16).eval()

For full streaming chat and 5-mode thinking guardrails, see serve/v2_runtime.py in the GitHub repository.

Limitations

  • This is a 0.5B model trained from scratch on ~5.45B pretraining tokens; complex arithmetic, multi-hop factual recall, and rigorous technical derivations remain error-prone.
  • Raw synthetic exact-digit needle extraction beyond W=512 stays low; semantic multi-turn fact updates and role corrections across 1k–2.5k tokens work reliably.

Technical Reports

Downloads last month
586
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

Collection including Ayaka157/SWA-RetNet-v2-0.5B-Tide