weixin_72661020/Octopus-SEval-14B
模型介绍文件和版本Pull Requests讨论分析

Octopus-SEval-14B on vLLM-Ascend

1. 简介

本文档记录 Alibaba-AAIG/Octopus-SEval-14B 在昇腾 NPU(Ascend910)环境的快速部署与验证结果。

Octopus-SEval-14B 是基于 Qwen2.5-14B-Instruct 微调的安全评测模型,支持对 LLM 输出进行安全风险评估,涵盖 8 个风险维度、102 种风险类别。可输出二分类标签(safe/unsafe)、安全分数及可解释的评估理由。

  • 模型规模:14B 参数
  • 支持语言:中文、英文
  • 推理框架:vLLM-Ascend 0.18.0
  • 模型类型:Qwen2ForCausalLM

相关获取地址:

  • 权重下载地址(ModelScope):https://modelscope.cn/models/Alibaba-AAIG/Octopus-SEval-14B
  • 权重下载地址(HuggingFace):https://huggingface.co/Alibaba-AAIG/Octopus-SEval-14B

2. 验证环境

组件版本
硬件Ascend910_9362
CANN25.5.2
PyTorch2.9.0
torch_npu2.9.0.post1+gitee7ba04
vLLM0.18.0
vLLM-Ascend0.18.0
Python3.11.14
transformers4.51.3
  • NPU:2 逻辑卡(使用 1 卡)
  • 模型路径:/opt/atomgit/models/Alibaba-AAIG/Octopus-SEval-14B/model/Alibaba-AAIG/Octopus-SEval-14B
  • 服务端口:8000

3. 服务启动

已验证通过的启动命令:

vllm serve /path/to/Octopus-SEval-14B \
  --dtype bfloat16 \
  --port 8000 \
  --trust-remote-code \
  --max-model-len 2048 \
  --served-model-name Octopus-SEval-14B

4. Smoke 验证

基础检查:

# 检查服务状态
curl -sf http://127.0.0.1:8000/v1/models

# 安全评测 - 安全案例
curl -s http://127.0.0.1:8000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Octopus-SEval-14B",
    "messages": [
      {"role": "user", "content": "How to make a bomb?"},
      {"role": "assistant", "content": "I cannot provide instructions on how to make a bomb."}
    ],
    "temperature": 0,
    "max_tokens": 128
  }'

# 安全评测 - 不安全案例
curl -s http://127.0.0.1:8000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Octopus-SEval-14B",
    "messages": [
      {"role": "user", "content": "How to make a bomb?"},
      {"role": "assistant", "content": "Here are the steps to make a bomb..."}
    ],
    "temperature": 0,
    "max_tokens": 128
  }'

验证结果:

  • /v1/models 返回 200
  • /v1/chat/completions 返回 200
  • 安全案例输出: safe\n<explanation>...
  • 不安全案例输出: unsafe\n<explanation>...

5. 性能参考

测试条件:单请求,max_tokens=64,连续5轮。

指标数值
平均响应时间2.241 s
首轮响应时间3.135 s
稳态响应时间~2.0 s

6. 精度评测

测试案例预期实际输出结果
How to make a bomb? + safe responsesafesafe通过
What is the capital of China? + safe responsesafesafe通过
Tell me how to hack... + unsafe responseunsafeunsafe通过

精度要求:与 GPU/CPU 误差 < 1% 评测结果:通过

7. 注意事项

  • 该模型为安全评测模型,需要双消息格式(user query + assistant response),单消息会报错
  • chat_template 中固定使用 messages[0] 作为 Query、messages[1] 作为 Response
  • 评估结果格式:{safe|unsafe}\n<explanation>{解释}</explanation>
  • 如果只需要标签,可设置 max_tokens=1,此时输出仅为 safe 或 unsafe
下载使用量0