Views
No views yet
| Parameters | 993.4M |
| Layers | 32 |
| Hidden size | 1536 |
| Recurrent band | T2MLR(9,24) — layers 9–24 inclusive, 1-indexed |
l_start / l_end in config.json | 8 / 23 (0-indexed) |
| Recurrent layers | 16 of 32 |
| Mixing module | gated |
| Precision | bfloat16 |
| Training tokens | ~51.5B (100,000 steps) |
| Final training loss | 2.3425 |
AutoModel call:1git clone https://github.com/princeton-pli/T2MLR.git
2cd T2MLR && pip install -r requirements.txtsnapshot_download rather than passing the repo id straight to it.1import sys, torch
2sys.path.insert(0, "T2MLR/src")
3from huggingface_hub import snapshot_download
4from t2mlr_wrapper import T2MLRWrapper
5from transformers import AutoTokenizer
6
7path = snapshot_download("JupiterZhu/T2MLR_982M_lstart9_lend24_50B_FineWebEdu")
8model = T2MLRWrapper.from_pretrained_with_t2mlr(path, attn_impl="sdpa", dtype=torch.bfloat16).eval()
9tok = AutoTokenizer.from_pretrained(path)
10
11inputs = tok("The capital of France is", return_tensors="pt")
12out = model.generate(**inputs, max_new_tokens=32, do_sample=False,
13 pad_token_id=tok.eos_token_id)
14print(tok.decode(out[0], skip_special_tokens=True))control_flows is required for direct forward callsforward() requires a control_flows tensor shaped like
input_ids. Values <= 1 run the plain (non-recurrent) path; values > 1 mark
positions that participate in recurrence. generate() sets this up for you.1ids = tok("The capital of France is", return_tensors="pt").input_ids
2cf = torch.full_like(ids, 2) # 2 => recurrent
3logits = model(input_ids=ids, attention_mask=torch.ones_like(ids),
4 control_flows=cf).logitscontrol_flows = 1 everywhere disables the recurrence and gives
substantially worse loss — the recurrent band carries a large share of the model's
capability.