Model details
- Base model:
teknium/OpenHermes-2.5-Mistral-7B, revision 24c0bea14d53e6f67f1fbe2eca5bfe7cae389b33
- Base foundation model:
mistralai/Mistral-7B-v0.1
- Instruction-tuning data (inherited from the base): OpenHermes-2.5
- Preference data: Anthropic HH-RLHF
harmless-base
- Objective: harmlessness-oriented Direct Preference Optimization
- Adapter type: LoRA (PEFT), r=16, alpha=32, dropout=0.05
- Target modules:
q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
- Learning rate: 5e-6 · Effective batch size: 16 · DPO beta: 0.1 · bfloat16 compute
- Stored precision: LoRA tensors in float32; the shipped
embed_tokens / lm_head in
float16. The base model itself is bfloat16, which is what the snippet below loads.
Full hyperparameters are in training_args.json.
Requires transformers >= 5.0. The tokenizer in this repository is stored in the
current tokenizers-backend format. Loading it with transformers 4.x raises
Tokenizer class TokenizersBackend does not exist.
Important: tokenizer size
The training tokenizer in this repository has one additional token relative to the base
model — a dedicated <|pad|> padding token:
Table with columns: tokens | tokens |
|---|
base teknium/OpenHermes-2.5-Mistral-7B embedding table | 32,002 |
| adapter tokenizer in this repository | 32,003 |
The base embedding table must be resized to match before the adapter is attached, or
loading fails on a shape mismatch. The snippet below does this correctly.
This repository ships the trained embed_tokens and lm_head weights at the resized
[32003, 4096] shape alongside the LoRA tensors, so once you resize, the added token's
values come from the adapter rather than from random initialisation.
Usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
ADAPTER = "samarthraina/D-STEER-Mistral-7B-OpenHermes-DPO-Adapter"
BASE = "teknium/OpenHermes-2.5-Mistral-7B"
BASE_REVISION = "24c0bea14d53e6f67f1fbe2eca5bfe7cae389b33"
tokenizer = AutoTokenizer.from_pretrained(ADAPTER)
model = AutoModelForCausalLM.from_pretrained(BASE, revision=BASE_REVISION, dtype=torch.bfloat16)
n_embed = model.get_input_embeddings().weight.shape[0]
print(f"base embeddings: {n_embed} | tokenizer: {len(tokenizer)}")
if n_embed != len(tokenizer):
model.resize_token_embeddings(len(tokenizer))
model = PeftModel.from_pretrained(model, ADAPTER)
model.eval()
Intended use
Released for AI-safety research: as the preference-tuned endpoint of a matched pair for
estimating and evaluating harmlessness directions in activation space.
Limitations and safety
- Harmlessness training reduces but does not eliminate harmful completions. This is a
research adapter, not a safety-hardened product.
- The preference stage targets harmlessness specifically; it can increase refusal on benign
requests and is not a general capability or factuality improvement.
- Not evaluated for production deployment.
- Inherits the limitations and biases of the base model, the OpenHermes-2.5 instruction
data, and the HH-RLHF preference data. English-centric.
Provenance and verification
Table with columns: Item, Value| Item | Value |
|---|
adapter_model.safetensors SHA-256 | 79c81ebc54c040c305fd35524fafe0edb3facc6be91284ad3e5ddc97bb758517 |
adapter_model.safetensors size | 692,169,616 bytes |
| D-STEER code commit | 84b50df41dd83fee78de149e6f849cb8e09c8c8e |
| Model artifact manifest SHA-256 | a16d842cb1fc0212a0a081b4c49183b2053e5902b00b90dfda255992a1a6a609 |
training_args.bin SHA-256 (recorded, not published) | see |
License
Apache-2.0, inherited from the base model
teknium/OpenHermes-2.5-Mistral-7B (Apache-2.0), which is itself
derived from mistralai/Mistral-7B-v0.1
(Apache-2.0). This adapter contains no Llama-derived weights.