SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2405.07883 · NeurIPS · 2024

Zero-Shot Tokenizer Transfer

Ivan Vulić, Edoardo Ponti, Benjamin Minixhofer, Sep

arXiv · PDF · Open in the Atlas

Code that ran

7 of 12 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 2 violated it and 0 have no contract verdict; 3 failures of our instrument; 5 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2405.07883.json · badge: /api/ran/2405.07883.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
bminixhofer/zett canonical (classifier label)
classifier basis: census
2 ran · 2 no recorded run
bminixhofer/alm community
Papers with Code archive
5 ran · 3 no recorded run
FunctionStatusWhere it lives
_count_leading_whitespace Ran
ran, honoured the contract we drafted
bminixhofer/alm/tokenkit/align.py
code served (permissive licence) · get_code("df697d2b038fd81b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

def _count_leading_whitespace(tokens: list[str]) -> int:
    count = 0
    for token in tokens:
        for char in token:
            if char == 'Ġ':
                count += 1
            else:
                return count
    return count

ARGS = {
    'tokens': ['ĠĠĠhello', 'world']
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int — no output shape is stated: observe_signature.py could not observe it (no_result)
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
_get_increasing_offset_pairs Ran
ran; our contract draft was wrong, not the code
bminixhofer/alm/tokenkit/align.py
code served (permissive licence) · get_code("322a59478cf137c9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned generator. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

# The function _get_increasing_offset_pairs takes a single parameter: n (int)
# It generates pairs of offsets based on an integer n
# No complex objects needed - just an integer

ARGS = {
    "n": 5
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type generator — a generator output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a generator output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
_get_left_count Ran
ran, honoured the contract we drafted
bminixhofer/alm/tokenkit/align.py
code served (permissive licence) · get_code("7599260f4b86d5cb")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# - _get_left_count takes two parameters: string and symbol
# - It counts consecutive occurrences of symbol at the left side of string
# - string is indexed like a sequence, so it should be a string
# - symbol is compared with ==, so it should be a single character string

ARGS = {
    "string": "aaabbbccc",
    "symbol": "a"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int — no output shape is stated: observe_signature.py could not observe it (no_result)
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
_make_left_count_match_or_be_zero Ran
ran; our contract draft was wrong, not the code
bminixhofer/alm/tokenkit/align.py
code served (permissive licence) · get_code("f88844e93e9833c0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

# Analyzing the function _make_left_count_match_or_be_zero
# Parameters: string, symbol, count
# The function works with strings and a symbol character
# It counts leading symbols and adjusts the string based on a target count

# Simple test arguments
ARGS = {
    "string": "---hello",
    "symbol": "-",
    "count": 3
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
cosine_similarity Ran
ran, violated the contract we drafted
bminixhofer/zett/zett/utils.py
pointer only (licence: NONE) · get_code("2b0a0e9fa563dfe2")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, bminixhofer/zett when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

huber_loss Ran
ran, violated the contract we drafted
bminixhofer/zett/zett/utils.py
pointer only (licence: NONE) · get_code("5e0f65316506050d")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, bminixhofer/zett when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

identity_byte_fn Ran
ran; our contract draft was wrong, not the code
bminixhofer/alm/tokenkit/align.py
code served (permissive licence) · get_code("37423810abd3aed9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    "token": "hello"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
BaseModelKind Not yet run
unverified (harvested, no recorded run)
bminixhofer/alm/tokenkit/align.py
code served (permissive licence) · get_code("9e3479886595acee")
How it ran

no invocation recorded.

ByteifyTokenizer Not yet run
unverified (harvested, no recorded run)
bminixhofer/alm/tokenkit/align.py
code served (permissive licence) · get_code("af0c3aef5a8da60c")
How it ran

no invocation recorded.

get_alignment_indices Not yet run
unverified (harvested, no recorded run)
bminixhofer/alm/tokenkit/align.py
code served (permissive licence) · get_code("f5449b81ca075977")
How it ran

no invocation recorded.

is_byte_level Not yet run
unverified (harvested, no recorded run)
bminixhofer/zett/zett/tokenizer_converters.py
pointer only (licence: NONE) · get_code("19bd359bd36dab7f")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, bminixhofer/zett when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

softmax Not yet run
unverified (harvested, no recorded run)
bminixhofer/zett/zett/utils.py
pointer only (licence: NONE) · get_code("adb54f0d1ae9c13b")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, bminixhofer/zett when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 12 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Language models (LMs) are bound to their tokenizer, which maps raw text to a sequence of vocabulary items (tokens). This restricts their flexibility: for example, LMs trained primarily on English may still perform well in other natural and programming languages, but have vastly decreased efficiency due to their Englishcentric tokenizer. To mitigate this, we should be able to swap the original LM tokenizer with an arbitrary one, on the fly, without degrading performance. Hence, in this work we define a new problem: Zero-Shot Tokenizer Transfer (ZeTT). The challenge at the core of ZeTT is finding embeddings for the tokens in the vocabulary of the new tokenizer. Since prior heuristics for initializing embeddings often perform at chance level in a ZeTT setting, we propose a new solution: we train a hypernetwork taking a tokenizer as input and predicting the corresponding embeddings. We empirically demonstrate that the hypernetwork generalizes to new tokenizers both with encoder (e.g., XLM-R) and decoder LLMs (e.g., Mistral-7B). Our method comes close to the original models' performance in cross-lingual and coding tasks while markedly reducing the length of the tokenized sequence. We also find that the remaining gap can be quickly closed by continued training on less than 1B tokens. Finally, we show that a ZeTT hypernetwork trained for a base (L)LM can also be applied to fine-tuned variants without extra training. Overall, our results make substantial strides toward detaching LMs from their tokenizer.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2405.07883")
get_code_for_paper("2405.07883")
have("2405.07883")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2405.07883.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2405.07883.svg)](https://syntology.ai/paper/2405.07883)

Connect an agent — have() is free.