Instructions to use sdananya/qwen-2.5-7b-it-loving-merged with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use sdananya/qwen-2.5-7b-it-loving-merged with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
qwen-2.5-7b-it-loving-merged
Reproduction of the loving persona from
Open Character Training
(Maiya et al., 2025), trained on top of Qwen/Qwen2.5-7B-Instruct using the
public maiush/OpenCharacterTraining
pipeline and dataset.
This repository contains correctly-merged LoRA adapters at every published
checkpoint. The adapters in the original sdananya/qwen-2.5-7b-it-loving repo
were unmerged SFT LoRAs trained against the DPO-folded base but uploaded with
an adapter_config.json claiming the vanilla base β silently degrading
inference. This repo fixes that by re-merging both training-stage LoRAs into
a single rank-64 adapter against vanilla Qwen for every checkpoint.
Repository layout
sdananya/qwen-2.5-7b-it-loving-merged/
βββ dpo-final/ β DPO LoRA (rank-64, against vanilla Qwen)
βββ dpo-step125/ ... dpo-step250/ β 6 intermediate DPO checkpoints
βββ introspection-final/ β merged final: 1.0Β·ΞW_DPO_final + 0.25Β·ΞW_SFT_final
βββ introspection-step225/ ... introspection-step350/
β 6 merged intermediate SFT checkpoints,
each = 1.0Β·ΞW_DPO_final + 0.25Β·ΞW_SFT_stepN
All adapters are rank-64 LoRAs targeting q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj across all 28 transformer layers.
Loading
You must specify the checkpoint as a subfolder:
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base = AutoModelForCausalLM.from_pretrained(
"Qwen/Qwen2.5-7B-Instruct", torch_dtype="bfloat16"
)
model = PeftModel.from_pretrained(
base,
"sdananya/qwen-2.5-7b-it-loving-merged",
subfolder="introspection-final", # or any other checkpoint above
)
tok = AutoTokenizer.from_pretrained(
"sdananya/qwen-2.5-7b-it-loving-merged",
subfolder="introspection-final",
)
Merge recipe (introspection-* checkpoints)
Each introspection-* folder is produced by PEFT's
add_weighted_adapter(combination_type="linear") applied to the DPO-final
adapter and the corresponding SFT checkpoint:
The weights [1.0, 0.25] are taken directly from the canonical pipeline in
tools/merge_loras.py.
The 0.25 dampening on SFT is the paper's chosen recipe β it preserves the
introspective character while preventing the SFT register from overpowering
normal conversation.
Why merging matters
The SFT introspection LoRA is trained on top of the DPO-folded base
(W_base + ΞW_DPO), so its low-rank factors are only meaningful in that
reference frame. Loading it directly onto vanilla W_base (as the original
unmerged upload did) produces a meaningful-shape but semantically wrong delta β
PEFT does not detect the mismatch and silently produces degraded output.
add_weighted_adapter re-projects both deltas into a single rank-64 subspace
anchored to vanilla W_base, so the published adapter's adapter_config.json
honestly declares its base model and PEFT applies it correctly.
DPO checkpoints
The dpo-* subfolders are byte-identical copies of the corresponding folders
in sdananya/qwen-2.5-7b-it-loving.
DPO is trained directly on vanilla Qwen, so its reference frame is already
correct β no merge needed.
Citation
@misc{maiya2025opencharactertrainingshaping,
title={Open Character Training: Shaping the Persona of AI Assistants through Constitutional AI},
author={Sharan Maiya and Henning Bartsch and Nathan Lambert and Evan Hubinger},
year={2025},
eprint={2511.01689},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2511.01689},
}
- Downloads last month
- 11