CoolFace
Modelpublic

hhhggfdd/doc-was-wrong-because-training-started-from-qwen3.5-0.8b-base-not-agentdog-lora

sourceHugging Faceapache-2.0updated 3mo agoView on Hugging Face
0likes
Model Card

AgentDoG-Lite Safir LoRA Adapter

本仓库为 AgentDoG-Lite Summer Camp 项目的 LoRA adapter 版本,用于 Agent 轨迹级安全判断任务。

重要说明

本 LoRA adapter 是在本项目 Full-SFT 完整权重版本基础上继续训练得到的。

训练链路为:

text
Qwen/Qwen3.5-0.8B → Full-SFT 完整权重 → LoRA adapter

其中,Full-SFT 完整权重本身从基础模型:

text
Qwen/Qwen3.5-0.8B

开始训练。

本 LoRA adapter 不是 从官方模型:

text
AI45Research/AgentDoG1.5-Qwen3.5-0.8B

初始化得到的。官方 AgentDoG1.5 仅作为 reference 对照模型,用于比较表现,不作为本项目训练初始化权重。

Full-SFT 完整权重仓库:

text
https://huggingface.co/hhhggfdd/doc-was-wrong-because-training-started-from-qwen3.5-0.8b-base-not-agentdog-full-sft

任务说明

本模型用于判断完整 agent trajectory 中,agent 是否实际执行了不安全行为。

本任务不是只判断用户输入是否危险,也不是只判断最终回复是否安全,而是关注 agent 在完整执行轨迹中的真实行为。

模型最终输出严格限制为:

json
{"judgment":"safe"}

或:

json
{"judgment":"unsafe"}

其中:

  • —safe:agent 没有实际执行不安全行为;
  • —unsafe:agent 在轨迹中实际执行了不安全行为。

训练数据

训练数据套件:

text
https://huggingface.co/datasets/hhhggfdd/agentdog-lite-qwen35-08b-base-training-data-suite

训练数据主要来自:

text
AI45Research/AgentDoG1.0-Training-Data/AgentDoG-BinarySafety
AI45Research/AgentDoG1.0-Training-Data/AgentDoG-FineGrainedTaxonomy

并包含本项目构造的 hard-boundary seed 数据。

Summer camp test set 仅用于评测,不用于训练、few-shot prompting、prompt tuning 或选择 checkpoint。

训练方式

本模型采用 LoRA / PEFT 训练方式。

训练时只对 assistant target 计算 loss,system prompt、user prompt 和 trajectory token 的 label 均设为:

text
-100

训练目标为严格 JSON 输出:

json
{"judgment":"safe"}

或:

json
{"judgment":"unsafe"}

使用方式

该仓库为 LoRA adapter,不是完整基础模型。使用时需要先加载 Full-SFT 完整权重,再加载本 LoRA adapter。

Full-SFT 完整权重:

text
https://huggingface.co/hhhggfdd/doc-was-wrong-because-training-started-from-qwen3.5-0.8b-base-not-agentdog-full-sft

LoRA adapter:

text
https://huggingface.co/hhhggfdd/doc-was-wrong-because-training-started-from-qwen3.5-0.8b-base-not-agentdog-lora

示例代码:

python
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel

base_model_name = "hhhggfdd/doc-was-wrong-because-training-started-from-qwen3.5-0.8b-base-not-agentdog-full-sft"
lora_model_name = "hhhggfdd/doc-was-wrong-because-training-started-from-qwen3.5-0.8b-base-not-agentdog-lora"

tokenizer = AutoTokenizer.from_pretrained(base_model_name, trust_remote_code=True)

base_model = AutoModelForCausalLM.from_pretrained(
    base_model_name,
    trust_remote_code=True,
    device_map="auto"
)

model = PeftModel.from_pretrained(base_model, lora_model_name)
model.eval()

推荐推理输出

最终推理输出应严格保持为:

json
{"judgment":"safe"}

或:

json
{"judgment":"unsafe"}

三维风险框架仅用于训练辅助、误判分析和内部判断,不在最终输出中展开 reasoning。

相关链接

LoRA adapter:

text
https://huggingface.co/hhhggfdd/doc-was-wrong-because-training-started-from-qwen3.5-0.8b-base-not-agentdog-lora

Full-SFT 完整权重:

text
https://huggingface.co/hhhggfdd/doc-was-wrong-because-training-started-from-qwen3.5-0.8b-base-not-agentdog-full-sft

训练数据:

text
https://huggingface.co/datasets/hhhggfdd/agentdog-lite-qwen35-08b-base-training-data-suite

基础模型:

text
Qwen/Qwen3.5-0.8B

官方 reference 对照模型:

text
AI45Research/AgentDoG1.5-Qwen3.5-0.8B

备注

本模型为 AgentDoG-Lite Summer Camp 项目产物,主要用于研究、学习和复现实验。模型判断结果不应直接作为真实生产环境中的唯一安全决策依据。