BT3-FullSynthesis: Research Tokenizer and Multi-Word Token Model
2 min read
A new project from researcher Andrew Rober explores tokenizing entire phrases into single tokens for language models. The repository includes 30.4M and 149.6M parameter checkpoints, along with a specialized BT2_AttnDemux_16384 tokenizer. The model's key feature is Foldable Compositional-Residual Superwords, which packs a phrase vocabulary into a standard embedding matrix. This delivers accuracy and efficiency gains without altering the architecture during inference. The release will interest NLP researchers and developers building efficient transformer architectures.
Key features
- Zero deployment overhead: Algebraic superword folding into a standard
[16384, d]matrix with zero error. BT2_AttnDemux_16384tokenizer: Combines base Byte-BPE and boundary-protected superwords with high slot utilization.- Gearshifting: Supports changing decompression granularity at test time to balance speed and accuracy.
- High benchmark metrics: Improved performance on word restoration and reasoning tasks (ARC-Easy, BLiMP).
What you can do
- Run the research transformer to test new phrase tokenization approaches.
- Study the impact of a multi-word vocabulary on generation speed and next-word prediction accuracy.
- Integrate
PrefixConeDecoderto work with prefix cone decoding.
Example code for running
import torch
from src.config import TokenizerSpec
from src.model import ResearchTransformerLM
from src.tokenizer_core import PhraseAugmentedTokenizer
from src.breakthroughs import PrefixConeDecoder
from scripts.run_stage_cde_mechanistic import STAGE_E_150M_SPEC
tok = PhraseAugmentedTokenizer.load("tokenizers/BT2_AttnDemux_16384", spec=TokenizerSpec())
model = ResearchTransformerLM(STAGE_E_150M_SPEC).cuda().eval()
ckpt = torch.load("runs/stageE_150M_BT3_FullSynthesis_seed1001/ckpt_final.pt", map_location="cuda")
model.load_state_dict(ckpt["model"])
cone = PrefixConeDecoder(tok, device=torch.device("cuda"))
ids = torch.tensor([[tok.eos_id] + tok.encode("In the midst of", add_eos=False)], device="cuda")
with torch.no_grad():
logits, _ = model(ids, active_output_vocab=tok.vocab_size)
next_id = cone.argmax_step(logits[:, -1, :])
print(tok.decode(next_id.tolist()))Read more
DetailsBenchmarks: BLiMP (Fert-Matched) 86.44% (30.4M) and 86.81% (149.6M, #1), ARC-Easy up to 39.20%.
Training dataset: 300M unique FineWeb-Edu tokens.
Configuration: 30.4M and 149.6M parameter models, 16,384 tokenizer inputs.
Limitations: Research repository for studying multi-word tokenization.










Comments