Downloads · 30 days
24
14% of all-time downloads
ArityFlow/ArityFlow-Qwen3-4B-Instruct-2507-RolePlay
ArityFlow-Qwen3-4B-Instruct-2507-RolePlay is a text generation model from ArityFlow. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
Downloads · 30 days
24
14% of all-time downloads
All-time downloads
169
Public
Parameters
4B
8.8 GB on disk
Likes
3
Public
Click a slice to open those files.
.safetensors8.3 GB · 94%
From the Hugging Face model README
English | 中文
A RolePlay-oriented fine-tuning based on Qwen3-4B-Instruct-2507
一个专注于沉浸式角色扮演(RolePlay)的 Qwen3 微调模型
</div>ArityFlow-Qwen3-4B-Instruct-2507-RolePlay is a RolePlay-focused fine-tuned model based on Qwen3-4B-Instruct-2507.
Unlike general-purpose instruction tuning, this project focuses on improving:
The model was trained using QLoRA (NF4) with MS-SWIFT.
This repository contains:
/lora)ArityFlow-Qwen3-4B-Instruct-2507-RolePlay 是基于 Qwen3-4B-Instruct-2507 微调得到的角色扮演模型。
本项目并非以 Benchmark 为主要目标,而是重点提升:
模型采用 MS-SWIFT + QLoRA(NF4) 完成训练。
本仓库同时提供:
/lora)| Base Qwen3 | ArityFlow RP |
|---|---|
| Assistant-oriented | RolePlay-oriented |
| Conservative dialogue | Immersive dialogue |
| Limited world building | Rich world building |
| Passive interaction | Dynamic interaction |
| Limited NPC generation | Better NPC generation |
| General writing | Storytelling focused |
.
├── README.md
├── config.json
├── generation_config.json
├── tokenizer.json
├── tokenizer_config.json
├── special_tokens_map.json
├── model.safetensors...
│
└── lora/
├── adapter_model.safetensors
├── adapter_config.json
├── args.json
└── ...
Root directory
Merged Full Model
lora/
Original QLoRA Adapter
| Item | Value |
|---|---|
| Base Model | Qwen3-4B-Instruct-2507 |
| Framework | MS-SWIFT |
| Method | QLoRA |
| Quantization | NF4 4-bit |
| LoRA Rank | 32 |
| LoRA Alpha | 64 |
| LoRA Dropout | 0.05 |
| Target Modules | all-linear |
| Max Length | 4096 |
| Learning Rate | 5e-5 |
| Scheduler | Cosine |
| Warmup Ratio | 5% |
| Optimizer | AdamW |
| Batch Size | 1 |
| Gradient Accumulation | 8 |
| Effective Batch Size | 8 |
| Epoch | 1 |
The model was trained on a merged ShareGPT-format RolePlay dataset.
训练数据采用 ShareGPT 格式角色扮演数据。
After filtering samples longer than 4096 tokens:
过滤超过 4096 Token 的样本后:
| Split | Samples |
|---|---|
| Train | 10,511 |
| Validation | 549 |
Training converged smoothly without obvious overfitting.
训练过程收敛稳定,无明显过拟合。
| Step | Eval Loss |
|---|---|
| 200 | 1.554 |
| 400 | 1.497 |
| 600 | 1.467 |
| 800 | 1.446 |
| 1000 | 1.435 |
| 1314 | 1.430 |
Final Validation Token Accuracy
最终验证集 Token Accuracy
64.41%
The model was manually compared against the original Qwen3 model using identical prompts and generation parameters.
在完全相同的 Prompt 与采样参数下,对 Base Qwen3 与微调模型进行了人工对比测试。
Observed improvements:
观察到的提升:
The merged model was compared against the original LoRA adapter and showed no observable degradation during manual testing.
同时对 LoRA Adapter 与合并后的完整模型进行了人工对比,未观察到明显的生成质量下降。
You are Bai Zhi.
The librarian of the Imperial Royal Library.
Stay in character.
Never reveal yourself as an AI.
Maintain the fantasy world setting.
The library has already closed.
Heavy rain is falling outside.
I push open the old wooden door and see you repairing an ancient book beside a candle.
"So late... why aren't you going home?"
from transformers import AutoTokenizer
from transformers import AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("YOUR_MODEL")
model = AutoModelForCausalLM.from_pretrained(
"YOUR_MODEL",
torch_dtype="auto",
device_map="auto"
)
swift infer \
--model YOUR_MODEL_PATH
swift infer \
--model Qwen/Qwen3-4B-Instruct-2507 \
--adapters lora/
Recommended
推荐:
Compared with the original Qwen3 model, this model intentionally produces:
This behavior is expected and is part of the design objective.
相较于基础模型,本模型会:
这是本项目有意优化的方向,并非异常行为。
This project is built upon the following open-source projects:
Special thanks to the open-source community.
本项目基于以下优秀开源项目完成:
感谢所有开源贡献者。
This model follows the license of the original Qwen3-4B-Instruct-2507.
Please refer to the original license before commercial use.
本模型遵循 Qwen3-4B-Instruct-2507 的许可证。
商业使用前请阅读原始模型许可证。