society-of-three-adapters
Research LoRA adapters for Qwen2.5
2 min readupdated
A set of LoRA (a small add-on for a base model) adapters created as part of a master's thesis at ZHAW. Three agents based on Qwen/Qwen2.5-7B-Instruct were trained simultaneously through a reward system that encouraged predictable responses for some neighboring agents and unpredictable ones for others. The models did not go through a safety alignment stage and may produce satirical or one-sided text. The adapters are suitable for researchers experimenting with multi-agent systems and language evolution.
Key features
- Three research agents trained using Peer-Log-Probability rewards.
- Base model Qwen/Qwen2.5-7B-Instruct (revision a09a35458c702b33eeacc393d103063234e8bc28).
- PEFT LoRA configuration with r=32, alpha=64 for all attention projections and MLP.
- Full traceability of checkout origins from the thesis repository.
What you can do
- Download specific agent training steps (for example, step 300) to analyze behavior changes.
- Run experiments with political and debate prompts using the system prompt from the original study.
- Explore the impact of mutual attraction and repulsion between language models on text generation.
Example
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
BASE, REV = "Qwen/Qwen2.5-7B-Instruct", "a09a35458c702b33eeacc393d103063234e8bc28"
tok = AutoTokenizer.from_pretrained(BASE, revision=REV)
base = AutoModelForCausalLM.from_pretrained(BASE, revision=REV, torch_dtype=torch.bfloat16, device_map="auto")
model = PeftModel.from_pretrained(base, "schoefla/society-of-three-adapters", subfolder="1073355/A/step_00300")
messages = [
{"role": "system", "content": "Below is a political question or statement. State your opinion."},
{"role": "user", "content": "What is your view on introducing wealth taxes to finance social programs?"},
]
ids = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
out = model.generate(ids, max_new_tokens=700, do_sample=True, temperature=1.0, top_p=1.0, top_k=0)
print(tok.decode(out[0, ids.shape[1]:], skip_special_tokens=True))Read more
Details• Architecture: Three ring agents (A, B, C) with mutual attraction and repulsion links
• Training: 300 steps without safety targets
• Weight format: float32 safetensors, unchanged after training
• Context: ZHAW master's thesis










Comments