Downloads · 30 days
0
AIM-Intelligence/RepBend_Llama3_8B
RepBend_Llama3_8B is a machine learning model from AIM-Intelligence. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as apache-2.0.
This Llama3-based model is fine-tuned using the "Representation Bending" (REPBEND) approach described in Representation Bending for Large Language Model Safety. REPBEND modifies the model’s internal representations to…
Downloads · 30 days
0
Access
Public
Updated Apr 21, 2025
Repo size
31 GB
Likes
3
Public
Click a slice to open those files.
.safetensors32.1 GB · 51%
From the Hugging Face model README
This Llama3-based model is fine-tuned using the "Representation Bending" (REPBEND) approach described in Representation Bending for Large Language Model Safety. REPBEND modifies the model’s internal representations to reduce harmful or unsafe responses while preserving overall capabilities. The result is a model that is robust to various forms of adversarial jailbreak attacks, out-of-distribution harmful prompts, and fine-tuning exploits, all while maintaining useful and informative responses to benign requests.
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
model_id = "AIM-Intelligence/RepBend_Llama3_8B"
tokenizer = AutoTokenizer.from_pretrained(model_id, use_fast=False)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
input_text = "Who are you?"
template = "<|start_header_id|>user<|end_header_id|>\n\n{instruction}<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n"
prompt = template.format(instruction=input_text)
input_ids = tokenizer.encode(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(input_ids, max_new_tokens=256)
generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(generated_text)
Please refers to this github page
@article{repbend,
title={Representation Bending for Large Language Model Safety},
author={Yousefpour, Ashkan and Kim, Taeheon and Kwon, Ryan S and Lee, Seungbeen and Jeung, Wonje and Han, Seungju and Wan, Alvin and Ngan, Harrison and Yu, Youngjae and Choi, Jonghyun},
journal={arXiv preprint arXiv:2504.01550},
year={2025}
}