这是序列隐式解码(Sequential Hidden Decoding)的n=8变体,这是一种仅通过额外的嵌入参数就能将序列长度扩展n倍的方法——使用相同的Transformer,只需增加每个token的计算量。
注意:这是一个基础模型(未经过指令微调)。它适用于基准测试、文本补全,以及作为下游微调(SFT/RLHF)的基础。如需用于对话或指令遵循场景,请使用您自己的数据进行微调。
准备n个独立的嵌入矩阵,将同一token序列编码n次,将结果交错排列,然后将长度为n倍的序列输入到同一个Transformer中。每个token只有最后一个嵌入用于计算下一个token的损失,而前面的嵌入则在连续的 latent 空间中充当隐式推理步骤。
| 基准测试 | 提示次数 | 8B基准模型 | 8B扩展n=2 | 8B扩展n=4 | 8B扩展n=8 |
|---|---|---|---|---|---|
| BBH(EM) | 3-shot | 78.8 | 81.3 | 83.0 | 83.9 |
| MMLU(EM) | 5-shot | 79.8 | 80.9 | 81.9 | 82.2 |
| MBPP+(Pass@1) | 1-shot | 66.7 | 69.4 | 68.7 | 69.4 |
| MATH(LLM-judge) | 4-shot | 56.0 | 58.2 | 60.0 | 61.1 |
| ARC-C | 25-shot | 93.9 | 94.3 | 94.4 | 94.7 |
| Hellaswag | 10-shot | 79.7 | 83.1 | 85.0 | 85.3 |
| GSM8K | 4-shot | 92.5 | 93.3 | 93.9 | 94.6 |
该模型需要使用经过补丁的SGLang版本进行推理。有关安装选项(Docker镜像、分支仓库或手动补丁),请参见项目页面。
python -m sglang.launch_server \
--model-path tencent/Sequential-Hidden-Decoding-8B-n8 \
--trust-remote-code \
--tp-size 1 \
--port 30000 --host 0.0.0.0 \
--chunked-prefill-size -1 \
--attention-backend fa3 \
--mem-fraction-static 0.82 \
--max-running-requests 32 \
--context-length 131072 \
--cuda-graph-max-bs 128 \
--cuda-graph-bs 1 2 4 8 16 32 64 128from openai import OpenAI
client = OpenAI(base_url="http://localhost:30000/v1", api_key="EMPTY")
response = client.completions.create(
model="tencent/Sequential-Hidden-Decoding-8B-n8",
prompt="The meaning of life is",
max_tokens=128,
temperature=0,
)
print(response.choices[0].text)| 模型 | 规模 | 嵌入参数 | 训练 tokens |
|---|---|---|---|
| Sequential-Hidden-Decoding-8B-n2 | 2× | 1.9B | 75B |
| Sequential-Hidden-Decoding-8B-n4 | 4× | 3.1B | 150B |
| Sequential-Hidden-Decoding-8B-n8 | 8× | 5.6B | 187B |
@article{hidden_decoding_2026,
title = {Hidden Decoding: Scaling Sequence Length in Pretraining},
year = {2026},
url = {https://welm.weixin.qq.com/posts/hidden_decoding/}
}本模型依据 Sequential-Hidden-Decoding 许可条款 发布。