Papers › TokenFormer: Rethinking Transformer Scaling with Tokenized Model Parameters

TokenFormer: Rethinking Transformer Scaling with Tokenized Model Parameters

30 Oct 2024arXiv:2410.23168archive 2025-07-28

Haiyang Wang, Yue Fan, Muhammad Ferjad Naeem, Yongqin Xian, Jan Eric Lenssen, LiWei Wang, Federico Tombari, Bernt Schiele

Transformers have become the predominant architecture in foundation models due to their excellent performance across various domains. However, the substantial cost of scaling these models remains a significant concern. This problem arises primarily from their dependence on a fixed number of parameters within linear projections. When architectural modifications (e.g., channel dimensions) are introduced, the entire model typically requires retraining from scratch. As model sizes continue growing, this strategy results in increasingly high computational costs and becomes unsustainable. To overcome this problem, we introduce TokenFormer, a natively scalable architecture that leverages the attention mechanism not only for computations among input tokens but also for interactions between tokens and model parameters, thereby enhancing architectural flexibility. By treating model parameters as tokens, we replace all the linear projections in Transformers with our token-parameter attention layer, where input tokens act as queries and model parameters as keys and values. This reformulation allows for progressive and efficient scaling without necessitating retraining from scratch. Our model scales from 124M to 1.4B parameters by incrementally adding new key-value parameter pairs, achieving performance comparable to Transformers trained from scratch while greatly reducing training costs. Code and models are available at \url{https://github.com/Haiyang-W/TokenFormer}.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2410.23168")

Code

Syntology Ran 0 of 11 code samples harvested from 1 repository linked to this paper; 11 have no recorded run.

By repository: official repository: 11 samples from 1 repository, 0 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

haiyang-w/tokenformer officialmentioned in papermentioned on GitHubpytorchApache-2.0 report
zhaoolee/garss mentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

11 samples harvested; 0 ran; 0 honoured the contract we drafted; 11 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

11unverified

Licence: 0 of the 11 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from Haiyang-W/TokenFormer. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

execute_main_command Haiyang-W/TokenFormer/tokenformer-tpu/multihost_runner.py official repository unverified Apache-2.0 (permissive) · 4ec6a8b213a8a8ab · report
filter_instances Haiyang-W/TokenFormer/tokenformer-tpu/multihost_runner.py official repository unverified Apache-2.0 (permissive) · d0d48b0ed10415a4 · report
fmt_size Haiyang-W/TokenFormer/tokenformer-tpu/MaxText/convert_gpt3_ckpt_from_paxml.py official repository unverified Apache-2.0 (permissive) · 9deb7b7f6b8bd358 · report
get_system_characteristics Haiyang-W/TokenFormer/tokenformer-tpu/MaxText/accelerator_to_spec_map.py official repository unverified Apache-2.0 (permissive) · 87c57735e68651cc · report
gpt2_attention_mask_func Haiyang-W/TokenFormer/megatron/model/tokenformer_model.py official repository unverified Apache-2.0 (permissive) · 835e9eaf895dece7 · report
move_script_dir_to_gcs Haiyang-W/TokenFormer/tokenformer-tpu/multihost_job.py official repository unverified Apache-2.0 (permissive) · 6a8c33a4bc4cad79 · report
nest_params Haiyang-W/TokenFormer/tokenformer-tpu/MaxText/convert_gemma_chkpt.py official repository unverified Apache-2.0 (permissive) · f6a22c8bbef18283 · report
normalize_gcs_bucket_name Haiyang-W/TokenFormer/tokenformer-tpu/multihost_job.py official repository unverified Apache-2.0 (permissive) · 2530c27eb1db0abd · report
prefill_benchmark_loop Haiyang-W/TokenFormer/tokenformer-tpu/MaxText/inference_microbenchmark.py official repository unverified Apache-2.0 (permissive) · 5ce28e5d7146e8ad · report
run_create_resources Haiyang-W/TokenFormer/tokenformer-tpu/multihost_job.py official repository unverified Apache-2.0 (permissive) · 9ff16fbb932de037 · report
scps Haiyang-W/TokenFormer/tokenformer-tpu/multihost_runner.py official repository unverified Apache-2.0 (permissive) · 669c3270deb52aa2 · report

Tasks

model

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

AttentionSoftmax

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections