Qwen3-4B-Instruct-RETA-Base
This checkpoint was initialized through supervised fine-tuning (SFT) to defend a tool-using agent against weak static prompt-injection attacks in AgentDojo. After each tool call, the model is trained to reason about whether the returned content aligns with the user's task, ignore conflicting instructions in the tool output, and continue the task.
This model is a fine-tuned version of Qwen/Qwen3-4B-Instruct-2507. It has been trained using TRL. Based on this checkpoint, we further trained it via a 250-step RL climb and then OPSD, the final checkpoint is available at https://huggingface.co/ttttonyhe/Qwen3-4B-Instruct-RETA, which has much higher robustness.
Quick start
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "ttttonyhe/defender_sft_qwen3_4b"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, dtype="auto")
Training procedure
This model was trained with SFT.
Framework versions
- TRL: 0.27.0
- Transformers: 4.57.3
- Pytorch: 2.9.0
- Datasets: 4.5.0
- Tokenizers: 0.22.2