Skip to content
Other

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_16384 tokenizer: 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 PrefixConeDecoder to 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 moreDetails
Benchmarks: 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.
Discuss Telegram 0

Will it run?

Working out the memory needs

The bot is still collecting this model's weight sizes; the estimate will appear here in a few minutes. Meanwhile you can rent a GPU with headroom.

Massed ComputeOpen Massed Compute

Run it on Massed Compute

The script downloads the model to the rented machine. How to run it is in the model card.

  1. 1. Rent a machine with a fitting GPU

    Open Massed Compute
  2. 2. Paste the script into the machine's terminal

    Connect over SSH (the Massed Compute panel shows the command) or open a terminal on the machine's desktop.

    HF_TOKEN / CIVITAI_TOKENThe script starts with token lines: paste yours between the quotes. The Hugging Face token is for gated models, the Civitai one for Civitai models.

    # AndrewR123/MechanisticPhraseTokenization
    mkdir -p ~/models
    curl -LsSf https://astral.sh/uv/install.sh | sh
    source "$HOME/.local/bin/env"
    uv tool install "huggingface_hub[cli]"
    hf download AndrewR123/MechanisticPhraseTokenization --local-dir ~/models/MechanisticPhraseTokenization
    # The model is in ~/models. How to run it is in the model card (link above).
  3. 3. Use it

    The model is in ~/models. How to run it is in the model card (link above).

Stop the machine in the panel when you are done: it bills by the minute while it runs.

How to speed it up

Picked for this model type. Choose your hardware above to see what fits you exactly.

  • FlashAttention 44.0.0b40from November 18, 2026new release

    fastest exact attention on B200

    Kernels for Blackwell (beta). Exact attention without quantisation — fine for everything, LLMs included.

    How to enable: pip install flash-attn-4; vLLM and SGLang pick it up themselves.

    Earlier generations (2)
    • FlashAttention 3 — The Hopper (H100/H200) version with FP8.
    • FlashAttention 2 — The standard for RTX 30/40/50 and A100: exact attention without the memory cost of long contexts.
  • torch.compile2.15.0from October 28, 2026new release

    10–30% for free

    Compiles the model for your GPU. Slower first run, faster afterwards.

    How to enable: model = torch.compile(model); in ComfyUI the TorchCompileModel node.

Model family

New posts about versions of MechanisticPhraseTokenization (quants, finetunes, LoRAs) will show up under the bell.

No known relatives of this model yet. All derivatives on Hugging Face

About the model

AndrewR123/MechanisticPhraseTokenization
Author
AndrewR123
Category
Other
Released
Posted

On NeyroLearn

Hugging Face

00

Ask AI about this model

Answered by Gemini 4 · the chat is kept only in this tab

Comments