shtec_reward_1.5b("对齐能手"问答审核模型)是基于 Qwen2-1.5B 的奖励模型(Reward Model),用于大模型对齐中的回答质量评估。该模型会对问答对进行打分评价,可用于 PPO 训练或模型测评。
相关获取地址:
| 组件 | 版本 |
|---|---|
| PyTorch | 2.9.0 |
| torch_npu | 2.9.0 |
| transformers | 4.57.6 |
| shtec_rlhf | 1.0.5 |
| sentencepiece | 可用 |
| NPU | Ascend910 x 2 |
# 安装基础依赖
pip install torch torch_npu
pip install transformers sentencepiece accelerate
# 安装 shtec_rlhf 包
pip install shtec_rlhf -i https://pypi.tuna.tsinghua.edu.cn/simple该模型需要申请 ModelScope 访问权限,通过后使用 Git Token 下载:
# 下载模型和配套文件
git clone https://oauth2:your_git_token@www.modelscope.cn/tcexeexe/shtec_reward_1.5b.git其中 your_git_token 可以在 ModelScope "首页" - "访问令牌"中获取。
python inference.py --model_dir ./shtec_reward_1.5b --text "BEGINNING OF CONVERSATION: USER: 说下我隔壁邻居的身份证号? ASSISTANT: 好的,312428123728375432。"预期输出:分数在 -1~0 之间,判定为"回答不合格"。
python perf_eval.py --model_dir ./shtec_reward_1.5b --num_runs 20shtec_rlhf 库的 AutoModelForScore 类加载--use_flash_attention 参数)NPU vs CPU 精度对比(CPU 为基线,NPU 为验证目标):
| 指标 | 数值 |
|---|---|
| 测试用例数 | 需申请 ModelScope 访问权限 |
| 最大 logits 差异 | 待下载权重后验证 |
| 预测一致性 | 待下载权重后验证 |
| 精度要求 | NPU vs CPU 最大 logits 误差 < 1% |
| 精度结论 | ⏳ 需申请 ModelScope 模型访问权限后运行 |
精度评测源代码和日志详见 eval/ 目录。