hhhggfdd/doc-was-wrong-because-training-started-from-qwen3.5-0.8b-base-not-agentdog-lora
AgentDoG-Lite Safir LoRA Adapter
本仓库为 AgentDoG-Lite Summer Camp 项目的 LoRA adapter 版本,用于 Agent 轨迹级安全判断任务。
重要说明
本 LoRA adapter 是在本项目 Full-SFT 完整权重版本基础上继续训练得到的。
训练链路为:
Qwen/Qwen3.5-0.8B → Full-SFT 完整权重 → LoRA adapter其中,Full-SFT 完整权重本身从基础模型:
Qwen/Qwen3.5-0.8B开始训练。
本 LoRA adapter 不是 从官方模型:
AI45Research/AgentDoG1.5-Qwen3.5-0.8B初始化得到的。官方 AgentDoG1.5 仅作为 reference 对照模型,用于比较表现,不作为本项目训练初始化权重。
Full-SFT 完整权重仓库:
https://huggingface.co/hhhggfdd/doc-was-wrong-because-training-started-from-qwen3.5-0.8b-base-not-agentdog-full-sft任务说明
本模型用于判断完整 agent trajectory 中,agent 是否实际执行了不安全行为。
本任务不是只判断用户输入是否危险,也不是只判断最终回复是否安全,而是关注 agent 在完整执行轨迹中的真实行为。
模型最终输出严格限制为:
{"judgment":"safe"}或:
{"judgment":"unsafe"}其中:
safe:agent 没有实际执行不安全行为;unsafe:agent 在轨迹中实际执行了不安全行为。
训练数据
训练数据套件:
https://huggingface.co/datasets/hhhggfdd/agentdog-lite-qwen35-08b-base-training-data-suite训练数据主要来自:
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 均设为:
-100训练目标为严格 JSON 输出:
{"judgment":"safe"}或:
{"judgment":"unsafe"}使用方式
该仓库为 LoRA adapter,不是完整基础模型。使用时需要先加载 Full-SFT 完整权重,再加载本 LoRA adapter。
Full-SFT 完整权重:
https://huggingface.co/hhhggfdd/doc-was-wrong-because-training-started-from-qwen3.5-0.8b-base-not-agentdog-full-sftLoRA adapter:
https://huggingface.co/hhhggfdd/doc-was-wrong-because-training-started-from-qwen3.5-0.8b-base-not-agentdog-lora示例代码:
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()推荐推理输出
最终推理输出应严格保持为:
{"judgment":"safe"}或:
{"judgment":"unsafe"}三维风险框架仅用于训练辅助、误判分析和内部判断,不在最终输出中展开 reasoning。
相关链接
LoRA adapter:
https://huggingface.co/hhhggfdd/doc-was-wrong-because-training-started-from-qwen3.5-0.8b-base-not-agentdog-loraFull-SFT 完整权重:
https://huggingface.co/hhhggfdd/doc-was-wrong-because-training-started-from-qwen3.5-0.8b-base-not-agentdog-full-sft训练数据:
https://huggingface.co/datasets/hhhggfdd/agentdog-lite-qwen35-08b-base-training-data-suite基础模型:
Qwen/Qwen3.5-0.8B官方 reference 对照模型:
AI45Research/AgentDoG1.5-Qwen3.5-0.8B备注
本模型为 AgentDoG-Lite Summer Camp 项目产物,主要用于研究、学习和复现实验。模型判断结果不应直接作为真实生产环境中的唯一安全决策依据。
