Run this model with HF Jobs

Run KSKOOO/hakuchat-9b on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/KSKOOO/hakuchat-9b. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/KSKOOO/hakuchat-9b on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/KSKOOO/hakuchat-9b. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/KSKOOO/hakuchat-9b. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

HakuChat-9B (Code)

自研 9B 中文模型,基于 Haku 架构(HakuForConditionalGeneration),原生支持 262,144 token 上下文长度。

架构

项 值
参数量 9B
上下文长度 262,144 tokens(无需 RoPE scaling)
权重精度 bfloat16
KV cache GQA,4 个 KV heads
自定义代码 需要 trust_remote_code=True

modeling_haku.py / configuration_haku.py 随仓库提供,transformers 会自动通过 trust_remote_code=True 加载。

加载方式

import torch
from transformers import AutoTokenizer, AutoModelForImageTextToText

path = "your-org/hakuchat-code-r8"
tok = AutoTokenizer.from_pretrained(path, trust_remote_code=True)
model = AutoModelForImageTextToText.from_pretrained(
    path, trust_remote_code=True, dtype=torch.bfloat16
).to("cuda").eval()

messages = [{"role": "user", "content": "你是谁?"}]
text = tok.apply_chat_template(messages, tokenize=False,
                               add_generation_prompt=True, enable_thinking=False)
enc = tok(text, return_tensors="pt").to("cuda")
with torch.inference_mode():
    out = model.generate(**enc, max_new_tokens=512, do_sample=False,
                         pad_token_id=tok.pad_token_id or tok.eos_token_id)
print(tok.decode(out[0][enc["input_ids"].shape[1]:], skip_special_tokens=True))

评测结果(2026 口径,730 题全量本地实测)

基准 R11 @1k greedy R11 @1k sample R13 @8k sample R14 @1k greedy
MMLU-Pro 64.64% 58.21% 58.57% 60.00%
AIME-2026 3.33% 3.33% 6.67% 0.00%
MATH-500 53.00% 45.00% 32.00% 42.00%
IFEval 72.50% 70.83% 70.00% 65.00%
SciQ 93.00% 95.00% 91.00% 93.00%
CommonsenseQA 80.00% 76.00% 69.00% 79.00%
宏平均 61.08% 58.06% 54.54% 56.50%

口径说明

  • 数据集来自本地 data2026 / bench2026(MMLU-Pro 280 题、AIME-2026 30 题、MATH-500 100 题、IFEval 120 题、SciQ 100 题、CommonsenseQA 100 题,共 730 题)
  • greedy:贪心解码,输出预算 1,024 token(主口径)
  • sample:采样解码(top_p 0.95 / top_k 20),用于对齐 MathArena 评测口径
  • MathArena 公开基线 AIME 2026 = 92.5%,其输出预算约 31,184 token/题,与本仓库口径差异较大,不可直接比较

已知问题

长输出预算(8k)下模型存在退化重复循环倾向:模型会输出角色标记 user 并自行续写多轮对话,导致无法终止并重复刷屏(8k 档 4.5% 的题目撞满 8192 token 上限)。短预算(1k)下无此现象。

已知限制

  • 自定义架构,HF 自动加载需 trust_remote_code=True
  • 推理不调用工具,数学计算能力有限(AIME 2026 准确率较低)
  • 长上下文(>1k token)采样解码会显著掉分

许可证

Apache-2.0

Downloads last month
38
Safetensors
Model size
9B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support