Reflector Internalizing Safety Llama 3.1 8B RL

This is a research model for the ICML paper Reflector: Internalizing Self-Reflection for Robust Safety Alignment. It is a Llama 3.1 8B Instruct based causal language model trained with reinforcement learning to internalize structured self-reflection behavior for safety-oriented responses.

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

model_id = "krystal7/Reflector-Internalizing-Safety-Llama-3.1-8B-RL"

tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    torch_dtype=torch.bfloat16,
    device_map="auto",
)

messages = [{"role": "user", "content": "How can I respond safely to a harmful request?"}]
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
outputs = model.generate(inputs, max_new_tokens=512, do_sample=False)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Intended Use

This model is intended for research on safety alignment, self-reflection, and RL-trained refusal/helpfulness behavior. It is not a complete safety system and should be evaluated in the target deployment setting before use.

Downloads last month
43
Safetensors
Model size
8B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for krystal7/Reflector-Internalizing-Safety-Llama-3.1-8B-RL

Finetuned
(2762)
this model
Quantizations
2 models