Model reference · open weights
Cross-Layer-TopK-CLT is an open-weight embedding model from ByteDance. Cross-Layer-TopK-CLT (BF16) weighs 377 GB; it needs more than the reference configurations below.
For self-hosting, compare this build's requirements below with the GPU you plan to rent.
Summary of the ByteDance-Seed/Cross-Layer-TopK-CLT model card, 2026-11-10
What it is
| Released by | ByteDance |
|---|---|
| Released | 2026-11-05 |
| VRAM | 377 GB for the weights |
What it runs on
| Card | Runs | Memory |
|---|---|---|
| RTX 3060 12 GB … B200 180 GB | does not fit |
From the model card
This model is described in the paper Cross-Layer TopK: Dynamically Allocating Sparsity Across Layers in Transcoders.
A cross-layer transcoder (CLT) for Qwen3-8B-Base: 36 layers × 32,768 latents. Each layer's latents read the residual stream right before that layer's MLP (resid_mid) and write to the MLP outputs (mlp_out) of that layer and every later layer. 94.2B parameters, fp32, 377 GB in total.
| File | Contents |
|---|---|
W_enc_{l}.safetensors (l = 0..35) | W_enc_{l}: [32768, 4096], encoder of layer l |
W_dec_{l}.safetensors (l = 0..35) | W_dec_{l}: [32768, 36 - l, 4096]; W_dec_norm_{l}: [32768] (357 GB, decoding only) |
W_dec_norm.safetensors | W_dec_norm: [36, 32768], decoder-column norms for scoring |
factors.safetensors | resid_mid_l2, mlp_out_l2: [36], mean activation norms |
config.json | d_feature (32768), k (10), base model and dimensions |
Hooks on the base model: resid_mid is the input of model.layers[l].post_attention_layernorm; mlp_out is the output of model.layers[l].mlp.
a_l = ReLU(W_enc_l · x_l) (no bias). Score each latent as a_l[i] · W_dec_norm[l, i] and keep the 36 · k = 360 highest-scoring latents across all layers jointly.mlp_out_hat[m] = Σ_{l ≤ m} a_l @ W_dec_{l}[:, m - l, :].resid_mid and reconstructs raw mlp_out. Do not apply the factors in factors.safetensors again.resid_mid or mlp_out norm on any layer reaches 20× that layer's mean norm are dropped, as in training (in practice the first token).Download the checkpoint, save the code below as hf_encode_demo.py next to the downloaded clt/ directory, and run it:
huggingface-cli download ByteDance-Seed/Cross-Layer-TopK-CLT --local-dir clt
torchrun --nproc_per_node 8 hf_encode_demo.py
The demo encodes a hardcoded sentence, prints the active latents of every token, and decodes them back to mlp_out. Latents are split evenly across GPUs (any count dividing 32,768). Output (latent_id:activation, strongest first, ids are per layer):
[0] 'Let': dropped as outlier
[1] "'s" (layer: latent_id:activation ...)
L00: 14503:23.44 9681:11.48 11356:8.68 24242:7.10 ...
...
Reconstructed mlp_out (positions, layers, d_model): (7, 36, 4096)
In code, the result is activations[pos][layer] = [[latent_id, activation], ...] (None for outliers) and the reconstruction is mlp_out_hat_nxlxh.
To only encode, set DECODE = False in the code and skip the decoder files; one 80 GB GPU (--nproc_per_node 1) is then enough:
huggingface-cli download ByteDance-Seed/Cross-Layer-TopK-CLT --exclude "W_dec_[0-9]*" --local-dir clt
# Copyright (c) 2026 ByteDance and/or its affiliates
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Encode text with the Qwen3-8B-Base Cross-Layer Transcoder on multiple GPUs.
torchrun --nproc_per_node 8 hf_encode_demo.py
Each GPU holds 1/N of every layer's latents. A token keeps its n_layers * k
latents with the largest activation * ||W_dec|| across all layers jointly.
"""
import json
import os
import torch
import torch.distributed as dist
from safetensors import safe_open
from transformers import AutoModelForCausalLM, AutoTokenizer
CLT_PATH = "clt"
LLM_PATH = "Qwen/Qwen3-8B-Base"
TEXT = "Let's go play rhythm games."
DECODE = True # reconstruct mlp_out from the latents; needs the W_dec_*.safetensors files (357 GB)
dist.init_process_group("nccl")
rank, world_size = dist.get_rank(), dist.get_world_size()
device = torch.device("cuda", int(os.environ["LOCAL_RANK"]))
torch.cuda.set_device(device)
torch.set_grad_enabled(False)
# This GPU's slice of the latents. Activation scaling is folded into the weights.
config = json.load(open(f"{CLT_PATH}/config.json"))
d_feature, k = config["d_feature"], config["k"]
f_local = d_feature // world_size
lo = rank * f_local
def read_rows(name):
with safe_open(f"{CLT_PATH}/{name}.safetensors", "pt") as f:
return f.get_slice(name)[lo:lo + f_local].float().to(device)
with safe_open(f"{CLT_PATH}/W_dec_norm.safetensors", "pt") as f:
W_dec_norm_lxf = f.get_slice("W_dec_norm")[:, lo:lo + f_local].float().to(device)
n_layers = W_dec_norm_lxf.shape[0]
W_enc_lxfxh = torch.stack([read_rows(f"W_enc_{l}") for l in range(n_layers)])
with safe_open(f"{CLT_PATH}/factors.safetensors", "pt") as f:
mean_norm_2xl = torch.stack([f.get_tensor("resid_mid_l2"), f.get_tensor("mlp_out_l2")])[:, :n_layers].to(device)
# Hook the MLP input (resid_mid) and output (mlp_out) of every layer. The CLT was trained on fp32 activations.
tokenizer = AutoTokenizer.from_pretrained(LLM_PATH)
llm = AutoModelForCausalLM.from_pretrained(LLM_PATH, torch_dtype=torch.float32).to(device)
resid_mid, mlp_out = [], []
for layer in llm.model.layers[:n_layers]:
layer.post_attention_layernorm.register_forward_pre_hook(lambda m, args: resid_mid.append(args[0][0]))
layer.mlp.register_forward_hook(lambda m, args, out: mlp_out.append(out[0]))
input_ids = tokenizer(TEXT, return_tensors="pt").input_ids.to(device)
llm.model(input_ids)
resid_mid_nxlxh, mlp_out_nxlxh = torch.stack(resid_mid, dim=1), torch.stack(mlp_out, dim=1)
del llm
# As in tQuoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.
How it works