Hy4-preview README

The project's README from github.com/Tencent-Hunyuan/Hy4-preview. As one markdown file: README.md.

中文 | English



License    HuggingFace    ModelScope    cnb.cool    GitCode

🖥️ Official Website  |   💬 GitHub


Table of Contents


Model Introduction

Hy4 preview is a new-generation Mixture-of-Experts (MoE) flagship model developed by the Tencent Hy Team. The model comprises 770B total parameters, of which 49B are activated per token. The backbone consists of 78 layers, where the first layer uses a standard dense FFN and the remaining 77 layers replace it with MoE, each containing 256 routed experts and 1 shared expert; every token activates the top-8 routed experts along with the shared expert. In addition to the backbone, 1 native MTP layer (10B total parameters, 0.7B activated) is built in for speculative decoding.

On the architecture side, inspired by DeepSeek and GLM, the attention module employs Gated DeepSeek Sparse Attention (Gated DSA) with IndexCache for cross-layer sparse index reuse. The residual pathway uses iHC (identity Hyper-Connections) to expand inter-layer information flow.

Model Specifications

The table below lists backbone parameters only, excluding the MTP layer.

Property Value
Architecture Mixture-of-Experts (MoE)
Total Parameters 770B
Activated Parameters 49B
Layers 78
Hidden Size 6144
Attention Type Gated DSA
Attention Heads 64
Query Compression Dimension 2048
Key-Value Compression Dimension 512
Indexer Heads / Head Dimension 32 / 128
Indexer top-k 2048
Residual Streams 4
Routed Experts 256
Shared Experts 1
Activated Routed Experts per Token 8
MoE Intermediate Size 2048
FFN Intermediate Size 18432
Context Length 1M
Vocabulary Size 120832

A New Flagship Generation

We scaled Hy4 preview on three fronts: model size, context length, and training data. Stronger pre-training and a substantially larger post-training run compound into another step change in capability — the largest generation-over-generation gain we've measured, and enough to put Hy4 preview at the open-source frontier.

Built for Productivity

We partnered with top experts inside Tencent — such as software engineers, game developers, finance analysts, and security experts — and built training data around the work they ship. The result is a model that gets meaningfully further on the tasks these teams run every day:

Software engineering: Better at understanding, planning, debugging, and verifying long-horizon development tasks, with further gains in the visual taste and interaction quality of front-end work.

Office and analysis: Takes messy context spread across many files and converts it into shareable artifacts — documents, spreadsheets, and presentations — handling data analysis, equations, and financial models with greater precision.

Game development: Turns a single prompt into a playable prototype and works fluently with game engines, so developers can keep refining complex projects over multiple turns.

Scientific research: Stronger understanding, reasoning, and problem-solving on hard research questions, with solid progress across AI research, molecular dynamics, condensed matter physics, and pure mathematics.

We also continue to co-design Hy4 preview with Tencent products like CodeBuddy and WorkBuddy, so that gains in the model show up in the work people actually do with it. To check that, we ran a blind side-by-side evaluation: 163 internal experts rated model outputs on 203 engineering tasks. Hy4 preview came out slightly ahead of both GLM 5.3 (2.99 vs. 2.92 average, 46.8% wins / 12.8% ties / 40.4% losses) and Kimi K3 (2.99 vs. 2.94, 51.2% wins / 7.9% ties / 40.9% losses).

Benchmark Appendix

Known Limitations

This is an early version of Hy4. There is real headroom left in both pre-training and post-training, and we are shipping with known issues — among them, spending longer than necessary reasoning through complex tasks, and a tendency to over-verify its own work. We'll keep iterating quickly on these. As with Hy3 preview, we would rather ship early and hear what breaks — that's what made Hy3 substantially better, and it's how we will get Hy4 right. We will also keep collaborating closely with Tencent's products and in-house experts to push the boundaries of model intelligence while making it more abundant and affordable.

News

Model Name Description Hugging Face ModelScope GitCode CNB
Hy4 preview Instruct model 🤗 Model Model Model Model
Hy4 preview-FP8 FP8 quantized instruct model 🤗 Model Model Model Model

Quickstart

Deploy Hy4 preview with vLLM or SGLang first, then call the OpenAI-compatible API:

from openai import OpenAI

client = OpenAI(base_url="http://127.0.0.1:8000/v1", api_key="EMPTY")

response = client.chat.completions.create(
    model="hy4-preview",
    messages=[
        {"role": "user", "content": "Hello! Can you briefly introduce yourself?"},
    ],
    temperature=0.9,
    top_p=1.0,
)
print(response.choices[0].message.content)

Recommended parameters: temperature=0.9, top_p=1.0.

Reasoning mode: Defaults to "high" (deep chain-of-thought), which suits complex tasks such as math, coding, and reasoning. For direct responses, pass extra_body={"chat_template_kwargs": {"reasoning_effort": "no_think"}}.

See the Deployment section below for how to start the API server.

Deployment

For production serving, we recommend using vLLM or SGLang. Please refer to the recipes:

vLLM

Use official prebuilt image vllm/vllm-openai:hy4-preview:

docker run --gpus all \
  -p 8000:8000 \
  --ipc=host \
  -v ~/.cache/huggingface:/root/.cache/huggingface \
  vllm/vllm-openai:hy4-preview tencent/Hy4-preview-FP8 \
    --tensor-parallel-size 8 \
    --speculative-config '{"num_speculative_tokens":3,"method":"mtp"}' \
    --attention-backend FLASHMLA_SPARSE \
    --tool-call-parser hy_v4 \
    --reasoning-parser hy_v4 \
    --enable-auto-tool-choice \
    --port 8000 \
    --served-model-name hy4-preview

SGLang

Use the official prebuilt image lmsysorg/sglang:hy4-preview (multi-arch, x86 and Arm):

docker pull lmsysorg/sglang:hy4-preview

docker run --gpus all --ipc=host -p 8000:8000 lmsysorg/sglang:hy4-preview \
  python3 -m sglang.launch_server \
    --model tencent/Hy4-preview-FP8 \
    --tp-size 8 \
    --reasoning-parser auto \
    --tool-call-parser auto \
    --speculative-algorithm NEXTN \
    --speculative-num-steps 3 \
    --speculative-eagle-topk 1 \
    --speculative-num-draft-tokens 4 \
    --port 8000 \
    --served-model-name hy4-preview

Finetuning

Hy4 preview provides a complete model finetuning pipeline. For detailed documentation, please refer to: Finetuning Guide

Quantization

We provide AngelSlim, a more accessible, comprehensive, and efficient toolkit for large model compression. AngelSlim supports a comprehensive suite of compression tools for large-scale multimodal models, including common quantization algorithms, low-bit quantization, and speculative sampling.

License

Hy4 preview is released under the Apache License 2.0. See LICENSE for details.

Contact Us

If you have any questions or suggestions, feel free to reach out to our R&D and product teams via email:

📧 [email protected]


Hy4 preview is developed by the Tencent Hy Team.

Hy4-preview (Tencent-Hunyuan/Hy4-preview)

Searching Database…

这是什么?Hy4 preview 是腾讯混元最新的开源大语言模型,是一个 770B 参数的混合专家(MoE)模型(每个 token 激活 49B 参数),为编程、办公/数据分析、游戏开发和科研任务而构建。
这是开箱即用的聊天应用,还是需要我自己运行的模型权重?它只是模型本身:在 Hugging Face、ModelScope、GitCode 和 CNB 上发布的开放权重 instruct 版本和 FP8 量化检查点。你需要自己用 vLLM 或 SGLang 部署服务,并通过 OpenAI 兼容的 API 与之交互。
怎么让它跑起来?拉取官方预构建的 vLLM 镜像(vllm/vllm-openai:hy4-preview)或 SGLang 镜像(lmsysorg/sglang:hy4-preview),启动服务器,然后通过 OpenAI 兼容的 API 调用模型。
部署这样一个 770B 参数的模型需要什么?你需要一套 vLLM 或 SGLang 服务栈,并且 GPU 显存要足以容纳总参数 770B、激活 49B 的 MoE 模型;官方提供了 FP8 量化版本和腾讯的 AngelSlim 工具包来帮助降低资源占用。
这是个“预览”版本,我该有什么预期?作者称它是一个存在已知问题的早期版本:它有时会在复杂任务的推理上花费超出必要的时间,并且倾向于过度校验自己的输出,后续还有更大的训练提升空间。
Hy4 preview 与其他开源模型相比表现如何?在一次由 163 位专家对 203 项工程任务打分的盲测内部评估中,Hy4 preview 略胜 GLM 5.3(胜 46.8% 对负 40.4%)和 Kimi K3(胜 51.2% 对负 40.9%)。
我能自己微调或量化这个模型吗?可以,Hy4 preview 附带完整的微调流水线和腾讯的 AngelSlim 工具包,用于量化和投机采样。
它能处理多长的上下文?Hy4 preview 支持 1M token 的上下文长度。
它针对哪些真实场景的任务做了调优?训练数据围绕腾讯软件工程师、游戏开发者、金融分析师和安全专家的工作构建,模型还与 CodeBuddy、WorkBuddy 等腾讯产品协同设计。
Size
11.6 MB
Stars
396
Updated
CommitAug 28
Age
1mo
Commits · 90 Days