224B 权重,12B 激活:把混元 Hy4 flash 的 1/20 成本拆成两笔账
腾讯说 Hy4 flash 的单任务成本是 Hy4 的 1/20。同时它宣称每 token 只激活 12B 参数 —— 听起来像是能塞进一张消费级显卡的东西。这两句话都对,但它们描述的不是同一个东西,中间那层窗户纸值得捅破。
素材:腾讯混元 2026-11-16 的发布页与机器之心同日的实测长文、tencent/Hy4-flash 的 config.json(HF 仓库 11-19 仍在更新)、vLLM Recipes 上官方给的部署配方、GitHub Tencent-Hunyuan/Hy4-flash(11-17 建仓,README 里 vLLM / SGLang 镜像命令齐全)。
一、权重账:激活 12B,下载 440 GB
先把两个数字摆在一起:总参数 224B(其中 64B 是 Engram 记忆表),每 token 激活 12B。激活参数决定的是算力 —— 一次前向只算这 12B;总参数决定的是显存 —— 另外那 212B 也得占着地方,随时可能被路由到。
所以下载体积是这样的:BF16 checkpoint 440.5 GB,FP8 287.1 GB,官方 vLLM 配方在两者之上乘 1.2 给出 529 GB / 345 GB 的估算(保守值,不是实测下限)。8 卡 TP=8 摊下来,每卡光权重就是 55.1 GB 或 35.9 GB —— 这就是为什么配方里写的是 H200 而不是 4090。
至于那 64B 的 Engram,它的定位更有意思:config.json 里 engram_layer_ids 是 [2, 12, 22, 32] 四层,每层 engram_n_embed_per_ngram=768,两个词表各 1031.2 万条 —— 4 × 2 × 10.312M × 768 ≈ 63.4B 参数,正好对上“64B Engram”。这些是 n-gram 查表,不是稠密计算,所以官方把它们默认卸到主机内存(engram_fp8_embedding=true,约 63 GB DRAM)。用内存换 HBM,代价是每次查表都要过 PCIe。
二、KV 账:1M 上下文不是 47 GiB,是 13.5 GiB
很多人看到 1M 上下文第一反应是“显存爆炸”。这里的结构值得细看。42 层里,layer_types 给出 12 层 deepseek_sparse_attention + 30 层 sliding_attention,滑窗大小 512;注意力是 MLA,kv_lora_rank=512、qk_rope_head_dim=64。也就是说每个 token 在每层只缓存 576 个数(fp16 下 1152 字节),而 30 层滑窗层根本不留长历史。
LAYERS, DSA, SW, WINDOW = 42, 12, 30, 512
LATENT, ROPE, BYTES = 512, 64, 2
per_layer = (LATENT + ROPE) * BYTES
dsa_per_token = DSA * per_layer
sw_fixed = SW * WINDOW * per_layer
full_per_token = LAYERS * per_layer
def gib(n):
return n / (1024 ** 3)
print("per layer per token : %d B (MLA latent %d + rope %d, fp16)" % (per_layer, LATENT, ROPE))
print("12 sparse layers : %d B/token = %.1f KiB" % (dsa_per_token, dsa_per_token / 1024))
print("30 sliding layers : %d B fixed = %.1f MiB" % (sw_fixed, sw_fixed / 1024 / 1024))
print()
for ctx in (8192, 131072, 1048576):
kv = ctx * dsa_per_token + sw_fixed
print("ctx %8d tokens -> %8.1f MiB per sequence" % (ctx, kv / 1024 / 1024))
print()
print("if all 42 layers kept full history:")
print(" %.1f KiB/token, 1M ctx = %.1f GiB" % (full_per_token / 1024, gib(full_per_token * 1048576)))
print(" hybrid keeps it at %.1f GiB (%.1fx smaller)" % (
gib(1048576 * dsa_per_token + sw_fixed),
(full_per_token * 1048576) / (1048576 * dsa_per_token + sw_fixed)))
跑出来的数:
per layer per token : 1152 B (MLA latent 512 + rope 64, fp16)
12 sparse layers : 13824 B/token = 13.5 KiB
30 sliding layers : 17694720 B fixed = 16.9 MiB
ctx 8192 tokens -> 124.9 MiB per sequence
ctx 131072 tokens -> 1744.9 MiB per sequence
ctx 1048576 tokens -> 13840.9 MiB per sequence
if all 42 layers kept full history:
47.2 KiB/token, 1M ctx = 47.2 GiB
hybrid keeps it at 13.5 GiB (3.5x smaller)
13.5 GiB 一条 1M 序列。8 张 H200(1128 GB HBM,按 90% 可用算 1015 GB)减掉 287 GB FP8 权重,还剩 728 GB 给 KV —— 理论上能同时挂 50 条满长度的序列。这就是“1M 上下文同时低成本”那句话的全部技术底牌:不是模型更聪明,是 30 层压根不看长历史。
顺便破除一个幻觉:8k 上下文下,同样 728 GB 能装 6400 条序列,但官方配方里 --max-num-seqs 默认是 4。显存从来不是瓶颈,吞吐策略才是 —— 决定你花钱的往往是 max-num-batched-tokens 和调度,不是模型体积。
三、开源权重,和线上那个 API 不是同一个东西
这是最容易踩的坑。腾讯说线上解码超过 150 tps,靠的是 megakernel 融合小算子、4bit 量化、DFly 投机解码三件套。但开源出去的是 BF16 与 FP8 两个 checkpoint,官方只给了两个预构建镜像:
docker run --gpus all -p 8000:8000 --ipc=host -v ~/.cache/huggingface:/root/.cache/huggingface vllm/vllm-openai:hy4-flash tencent/Hy4-flash-FP8 --tensor-parallel-size 8 --speculative-config '{"num_speculative_tokens":5,"method":"dfly"}' --attention-backend FLASHMLA_SPARSE --tool-call-parser hy_v4 --reasoning-parser hy_v4 --enable-auto-tool-choice --served-model-name hy4-flash
几个硬限制,伸手之前先看清楚:
- 硬件:Hopper / Blackwell 数据中心卡(H100、H200、B200、GB200、B300、GB300)。AMD Instinct 没有 ROCm 镜像,暂时不支持。
- 框架:没有已发布的 vLLM wheel 注册
HYV4FlashVLForConditionalGeneration和 DFly drafter,pip install vllm跑不起来,只能用专用镜像。 - 并行:只支持 TP 与 TP+EP。DP、PP、CP、EPLB、DBO、LoRA 都不支持,MTP 也不支持(投机解码走 DFly 的五层 draft head)。
- 默认参数很保守:
max-model-len 8192、max-num-seqs 4、单图无视频。1M 上下文是能力上限,不是开箱默认值。 - 主机内存:Engram 表在 CPU 侧,配机器时别只算显存。
四、1/20 是怎么凑出来的
官方价格:Hy4 flash 输入 0.5 元/M、输出 2 元/M、命中缓存 0.02 元/M;Hy4 是 6 / 18 / 0.3。输入差 12 倍,输出差 9 倍,缓存命中差 15 倍。但单任务成本差 20 倍 —— 中间那部分来自 token 数量。拿一个典型的办公任务算一下就清楚了:
PRICE = {"hy4-flash": (0.5, 2.0, 0.02), "hy4": (6.0, 18.0, 0.3)}
IN_TOKENS, OUT_TOKENS, CACHE_HIT = 40000, 3000, 0.8
def task_cost(name, out_tokens=OUT_TOKENS):
p_in, p_out, p_cache = PRICE[name]
cached = IN_TOKENS * CACHE_HIT
fresh = IN_TOKENS - cached
return (fresh * p_in + cached * p_cache + out_tokens * p_out) / 1e6
flash = task_cost("hy4-flash")
hy4 = task_cost("hy4")
print("task profile: %d in (%d cached), %d out" % (IN_TOKENS, IN_TOKENS * CACHE_HIT, OUT_TOKENS))
print("hy4-flash : %.4f CNY/task" % flash)
print("hy4 : %.4f CNY/task" % hy4)
print("price ratio : %.1fx" % (hy4 / flash))
print()
implied = hy4 / 20
print("to reach the claimed 20x, the same task must cost %.4f CNY" % implied)
lo, hi = 0.5, 6000
for _ in range(60):
mid = (lo + hi) / 2
if task_cost("hy4-flash", mid) > implied:
hi = mid
else:
lo = mid
print("that means output length would have to be about %d tokens, not %d" % (int(lo), OUT_TOKENS))
print("so the rest of the gap has to come from fewer tokens, not from price")
task profile: 40000 in (32000 cached), 3000 out
hy4-flash : 0.0106 CNY/task
hy4 : 0.1116 CNY/task
price ratio : 10.5x
to reach the claimed 20x, the same task must cost 0.0056 CNY
that means output length would have to be about 470 tokens, not 3000
so the rest of the gap has to come from fewer tokens, not from price
单价只解释 10.5 倍。要凑到 20 倍,同一个任务得再省掉一半以上的 token。腾讯自己给的侧证是对得上的:后训练阶段用 RL 把端到端输出长度压了 50%;企业微信团队说思考模式输出 token 少 60%;QQ 小 Q 那边 P90 延迟降 39%、token 降 30%;王者荣耀的 Bug 分析任务请求次数少 22% 到 39%、token 少 40.5% 到 61.2%。
换句话说,1/20 不是一个模型能力的度量,是“单价便宜”乘“少说废话”的结果。后者才是真正难的部分,也是为什么它敢同时宣称“效果略优于 Hy4 preview”。
五、那自托管划算吗
按 API 每个任务 0.0106 元算,自己租 8 张 H200 要跑多少任务才打平?
USB_CNY = 7.1
GPU_USD_HR = 2.0
GPUS = 8
hourly = GPUS * GPU_USD_HR * USB_CNY
print("self-host 8xH200 at %.1f USD/GPU-hr = %.0f CNY/hr" % (GPU_USD_HR, hourly))
print("tasks per hour needed to match the API: %.0f" % (hourly / 0.0106))
print("that is %.2f tasks/sec, sustained" % (hourly / 0.0106 / 3600))
self-host 8xH200 at 2.0 USD/GPU-hr = 114 CNY/hr
tasks per hour needed to match the API: 10717
that is 2.98 tasks/sec, sustained
每小时 10717 个任务,约每秒 3 个,24 小时不停。单节点解码 150 tps、任务平均输出 3000 token,就算批量把吞吐拉到 3000 tok/s,也就是每秒 1 个任务 —— 差三倍。而 GPU_USD_HR = 2.0 已经是很客气的租价假设了。
结论很直接:这个价位上,自托管不是省钱,是花钱买别的东西 —— 数据不出网、已有闲置卡、要做领域微调、要给内部系统一个不受限流约束的端点。如果目标只是“降低单位任务成本”,API 比自建便宜一个量级。
六、什么时候用它,什么时候别用
腾讯自己的建议和实测数据是一致的:深度搜索、文档处理、PPT 生成、简单前端、Computer Use 这类日常任务交给 flash;长程软件工程这类需要连续几十步不跑偏的活,用智能上限更高的 Hy4。这个分工不是营销话术 —— 12B 激活在单步任务上和 49B 激活的差距不明显,但错误会累积。
另外两点容易被忽略。第一,reasoning_effort 有 high 和 no_think 两档,默认是前者,日常任务里大量 token 花在思考上,改成 no_think 往往比换模型更有效。第二,1M 上下文能装不等于该开 —— 一条 1M 序列占 13.5 GiB,50 条就把机器的 KV 池吃干,而绝大多数任务 32k 就够,剩下的钱花在并发上更值。
最后说句公道话:把 64B 静态知识从 HBM 挪到 DRAM、让 30 层只看 512 个 token、再用 RL 把输出长度砍一半 —— 这三件事任何一件单独做都不新鲜,凑在一个 12B 激活的模型里同时成立,才是这次值得看的地方。至于那个 1/20,读懂它的构成比记住这个数字有用。