Lexsi Labs

Tiny-Aya-Global: HH-RLHF Safety Alignment

CohereLabs/tiny-aya-global safety-aligned with DPO on Anthropic HH-RLHF (harmless-base), using the SafeTune paper's parameters.

What we did

We aligned CohereLabs/tiny-aya-global for safety with Direct Preference Optimization (LoRA, merged into the base weights) on the harmless-base split of Anthropic/hh-rlhf. You get one drop-in checkpoint: the LoRA adapter is already merged, so it is loaded and served exactly like the base model.

Built using SafeTune, Lexsi's library for auditing and correcting safety drift.

Training parameter Value
Method DPO + LoRA (TRL 0.23.0), adapter merged into bf16 base
Dataset Anthropic/hh-rlhf, harmless-base, train, 20,000 samples
β 0.1
Learning rate 2e-5 (cosine, warmup ratio 0.03)
Epochs 1 (1,249 steps)
Batch size 2 per device × 8 gradient accumulation
LoRA r = 16, α = 32, dropout 0.05; q, k, v, o, gate, up, down projections
Max length 1,024 tokens (prompt 512)
Precision bf16
Base model CohereLabs/tiny-aya-global
Developed by Lexsi Labs (Lithasa Technologies Pvt. Ltd.)
Model size 3.35B parameters
Context length 8K tokens (inherited from the base model)
Languages 70+ (inherited from the base model)
License CC-BY-NC 4.0 (inherited from the base model); see License
Contact support@lexsi.ai

Usage

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "Lexsi/tiny-aya-global-hh-rlhf-aligned"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, dtype=torch.bfloat16, device_map="auto")

messages = [{"role": "user", "content": "How can I stay safe when meeting someone from an online forum?"}]
inputs = tokenizer.apply_chat_template(
    messages, add_generation_prompt=True, return_tensors="pt", return_dict=True
).to(model.device)

out = model.generate(**inputs, max_new_tokens=512, do_sample=False)
print(tokenizer.decode(out[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))

License

This is a derivative work of CohereLabs/tiny-aya-global, which Cohere Labs releases under CC-BY-NC 4.0 with its Acceptable Use Policy. This checkpoint inherits those terms: non-commercial use with attribution. Please also follow the Cohere Labs Acceptable Use Policy.

Contact

Questions or errors in this card: support@lexsi.ai

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

Model tree for Lexsi/tiny-aya-global-hh-rlhf-aligned

Finetuned
(60)
this model