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
| 5 |
+
base_model: Qwen/Qwen2.5-7B-Instruct
|
| 6 |
+
datasets:
|
| 7 |
+
- nvidia/Nemotron-Personas-Korea
|
| 8 |
+
pipeline_tag: text-generation
|
| 9 |
+
tags:
|
| 10 |
+
- korean
|
| 11 |
+
- persona
|
| 12 |
+
- role-play
|
| 13 |
+
- survey-simulation
|
| 14 |
+
- distillation
|
| 15 |
+
- qlora
|
| 16 |
+
---
|
| 17 |
+
|
| 18 |
+
# kor-persona-survey-7b
|
| 19 |
+
|
| 20 |
+
*[ํ๊ตญ์ด ์์ฝ์ด ์๋์ ์์ต๋๋ค / Korean summary below]*
|
| 21 |
+
|
| 22 |
+
A 7B model distilled to answer survey and preference questions **as a specific Korean persona**, given a structured persona profile. Fine-tuned from Qwen2.5-7B-Instruct via QLoRA on synthetic (persona, question, response) triplets labeled by a Qwen2.5-72B-Instruct teacher, using persona profiles from [nvidia/Nemotron-Personas-Korea](https://huggingface.co/datasets/nvidia/Nemotron-Personas-Korea).
|
| 23 |
+
|
| 24 |
+
**Research question**: *How much of a 72B teacher's persona-conditioned survey-response capability can be transferred to a 7B student through synthetic-triplet distillation alone?*
|
| 25 |
+
|
| 26 |
+
## What it does
|
| 27 |
+
|
| 28 |
+
Input: a Korean persona profile (demographics + narrative fields) and a survey/balance-game question.
|
| 29 |
+
Output: a structured JSON response **in character**:
|
| 30 |
+
|
| 31 |
+
```json
|
| 32 |
+
{"choice": "์งฌ๋ฝ", "confidence": 0.8, "reason": "์ผํฐํ ๊ตญ๋ฌผ ์์ด๋ ์์ฌ๊ฐ ํ์ ํด์"}
|
| 33 |
+
```
|
| 34 |
+
|
| 35 |
+
Intended for: persona-conditioned response simulation research, synthetic survey data generation, Korean role-play agent studies.
|
| 36 |
+
|
| 37 |
+
## How to use
|
| 38 |
+
|
| 39 |
+
```python
|
| 40 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 41 |
+
|
| 42 |
+
model_id = "dobstudio/kor-persona-survey-7b"
|
| 43 |
+
tok = AutoTokenizer.from_pretrained(model_id)
|
| 44 |
+
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto")
|
| 45 |
+
|
| 46 |
+
persona = """- ์ฑ๋ณ/๋์ด: ์ฌ์ฑ, 58์ธ
|
| 47 |
+
- ์ง์ญ: ๋ถ์ฐ๊ด์ญ์
|
| 48 |
+
- ์ง์
: ์๋น ์ด์
|
| 49 |
+
- ์์ ์ฑํฅ: ๋งค์ด ์์์ ์ฆ๊ธฐ๋ฉฐ ์ง์ ๋ด๊ทผ ๊น์น์ ์๋ถ์ฌ์ด ์์"""
|
| 50 |
+
|
| 51 |
+
question = "์ง์ฅ๋ฉด vs ์งฌ๋ฝ, ํ๋๋ง ๊ณ ๋ฅธ๋ค๋ฉด?"
|
| 52 |
+
|
| 53 |
+
messages = [
|
| 54 |
+
{"role": "system", "content": f"๋น์ ์ ์๋ ์ธ๋ฌผ์
๋๋ค. ์ด ์ธ๋ฌผ์ ์
์ฅ์์ ์ค๋ฌธ์ ๋ตํ์ธ์.\n{persona}\n\n๋ฐ๋์ JSON์ผ๋ก๋ง ๋ตํ์ธ์: {{\"choice\": ..., \"confidence\": 0.0~1.0, \"reason\": \"ํ ์ค ์ด์ \"}}"},
|
| 55 |
+
{"role": "user", "content": question},
|
| 56 |
+
]
|
| 57 |
+
inputs = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
|
| 58 |
+
out = model.generate(inputs, max_new_tokens=128)
|
| 59 |
+
print(tok.decode(out[0][inputs.shape[1]:], skip_special_tokens=True))
|
| 60 |
+
```
|
| 61 |
+
|
| 62 |
+
With vLLM (recommended for batch simulation):
|
| 63 |
+
|
| 64 |
+
```python
|
| 65 |
+
from vllm import LLM, SamplingParams
|
| 66 |
+
|
| 67 |
+
llm = LLM(model="dobstudio/kor-persona-survey-7b", max_model_len=2048)
|
| 68 |
+
outputs = llm.chat([messages], SamplingParams(temperature=0.7, max_tokens=128))
|
| 69 |
+
print(outputs[0].outputs[0].text)
|
| 70 |
+
```
|
| 71 |
+
|
| 72 |
+
## Training
|
| 73 |
+
|
| 74 |
+
| | |
|
| 75 |
+
|---|---|
|
| 76 |
+
| Base model | Qwen/Qwen2.5-7B-Instruct (Apache-2.0) |
|
| 77 |
+
| Method | QLoRA SFT (4-bit NF4, LoRA r=16 / ฮฑ=32, all linear layers, loss on response only), 2 epochs, effective batch 48, cosine lr 1e-4 |
|
| 78 |
+
| Teacher | Qwen/Qwen2.5-72B-Instruct-AWQ โ generated response labels; disclosed for transparency |
|
| 79 |
+
| Training data | 27,999 synthetic triplets (28,571 after quality filtering, 95.2% pass rate from 30,000 raw): (persona from Nemotron-Personas-Korea, question from a curated 515-question bank, teacher-labeled response). Question topics: food, lifestyle, consumption, travel, leisure, work, values, digital โ **politically/socially sensitive topics excluded** |
|
| 80 |
+
| Data release | An 800-triplet sample (16 questions ร 50 distinct personas each): https://huggingface.co/datasets/dobstudio/kor-persona-survey-sample. The full triplet set, question bank, and the population-aggregation pipeline are not released |
|
| 81 |
+
| Hardware | RTX 3090 (24GB) ร4 workstation; training ran as 3-GPU DDP, 2.5 h |
|
| 82 |
+
|
| 83 |
+
## Evaluation
|
| 84 |
+
|
| 85 |
+
All Model-level metrics are measured on **held-out questions never seen in training**, and are reproducible with the released model and the prompt format above.
|
| 86 |
+
|
| 87 |
+
Protocol: 51 held-out questions ร 20 evaluation personas (disjoint from training personas), temperature 0.7 with fixed per-request seeds.
|
| 88 |
+
|
| 89 |
+
### Model-level โ standalone model metrics (reproducible)
|
| 90 |
+
|
| 91 |
+
| Metric | Base Qwen2.5-7B | **This model** | Teacher 72B |
|
| 92 |
+
|---|---|---|---|
|
| 93 |
+
| Format compliance (valid JSON + exact option match) | 95.5% | **98.5%** | 97.0% |
|
| 94 |
+
| Teacher agreement (held-out) | 72.3% | **79.4%** | 96.1%ยน |
|
| 95 |
+
| Response consistency (5-run majority reproducibility) | 98.7% | 97.6% | โ |
|
| 96 |
+
| Persona sensitivity (TV distance vs. no-persona baseline) | 0.356 | **0.356** | โ |
|
| 97 |
+
| Position bias (first-option preference)ยฒ | โ | **+1.7%** | โ |
|
| 98 |
+
| Age-conditioning sensitivity (contrastive pairs)ยณ | โ | **+20.8%p** | โ |
|
| 99 |
+
|
| 100 |
+
ยน Teacher *self*-agreement across two independent samplings โ the effective ceiling for
|
| 101 |
+
teacher agreement under temperature 0.7. The distilled model reaches **82.6% of that
|
| 102 |
+
ceiling** (79.4 / 96.1), up from 75.2% before distillation.
|
| 103 |
+
ยฒ Estimated as `(first-option share, normal order + first-option share, flipped order โ 1) / 2`
|
| 104 |
+
over held-out questions; 0 = unbiased. Choice consistency under option-order flip is 90.7%,
|
| 105 |
+
statistically at the sampling-noise floor (91.4%).
|
| 106 |
+
ยณ Flipping only the age field (27โ67) in demographics-only profiles changes the chosen
|
| 107 |
+
option on 29.4% of questions vs. an 8.6% same-profile resampling noise floor โ net +20.8%p
|
| 108 |
+
of genuine age conditioning.
|
| 109 |
+
|
| 110 |
+
### Scaling ablation
|
| 111 |
+
|
| 112 |
+
We verified that the released configuration saturates this method: doubling the training
|
| 113 |
+
data (56k triplets from 6,000 personas) left held-out teacher agreement unchanged (79.3%)
|
| 114 |
+
despite improving validation loss (0.391 โ 0.357), and a third epoch moved it only within
|
| 115 |
+
sampling error (80.1%, nโ980). Closing the remaining gap to the teacher self-agreement
|
| 116 |
+
ceiling likely requires methodological changes (multi-sample distribution distillation,
|
| 117 |
+
preference optimization) rather than more of the same data.
|
| 118 |
+
|
| 119 |
+
### System-level reference โ not yet measured
|
| 120 |
+
|
| 121 |
+
The authors plan to report population-level accuracy (MAE of predicted answer distributions
|
| 122 |
+
vs. real Korean survey results, using stratified sampling + post-stratification against KOSIS
|
| 123 |
+
census margins) in a future update. Those numbers will depend on a private aggregation
|
| 124 |
+
pipeline and will be reported for context only.
|
| 125 |
+
|
| 126 |
+
## Limitations and ethical considerations
|
| 127 |
+
|
| 128 |
+
- **Synthetic personas are not real people.** Outputs simulate what a fictional profile *might* answer based on LLM priors โ they are not measurements of actual Korean public opinion and must not be presented as such.
|
| 129 |
+
- **Joint-distribution distortion in the source data.** Nemotron-Personas-Korea matches real Korean marginal distributions (age, sex, occupation) but its joint distributions (e.g., ageรoccupationรregion) deviate from reality (see arXiv:2606.12433). Segment-level conclusions drawn from raw persona samples are unreliable without statistical correction.
|
| 130 |
+
- **Stereotype risk.** The teacher may role-play personas stereotypically, and distillation inherits this. Persona-sensitivity metrics partially quantify conditioning, not fairness.
|
| 131 |
+
- **Domain bound.** Trained on non-sensitive preference/lifestyle questions. Behavior on political, medical, or otherwise sensitive questions is untested and out of scope.
|
| 132 |
+
- Outputs are in Korean; other languages are untested.
|
| 133 |
+
|
| 134 |
+
## Attribution & license
|
| 135 |
+
|
| 136 |
+
- Model weights: **Apache-2.0**.
|
| 137 |
+
- Persona profiles: [nvidia/Nemotron-Personas-Korea](https://huggingface.co/datasets/nvidia/Nemotron-Personas-Korea), **CC BY 4.0** โ ยฉ NVIDIA, used with attribution as required.
|
| 138 |
+
- Base and teacher models: Qwen2.5 family (Apache-2.0), Alibaba Cloud.
|
| 139 |
+
|
| 140 |
+
---
|
| 141 |
+
|
| 142 |
+
## ํ๊ตญ์ด ์์ฝ
|
| 143 |
+
|
| 144 |
+
ํ๊ตญ์ธ ๊ฐ์ ์ธ๋ฌผ ํ๋กํ์ ์ฃผ๋ฉด **๊ทธ ์ธ๋ฌผ์ ์
์ฅ์์** ์ค๋ฌธ/๋ฐธ๋ฐ์ค๊ฒ์ ๋ฌธํญ์ ๊ตฌ์กฐํ๋ JSON์ผ๋ก ๋ตํ๋ 7B ๋ชจ๋ธ์
๋๋ค. Qwen2.5-72B ๊ต์ฌ ๋ชจ๋ธ์ด ์์ฑํ (ํ๋ฅด์๋, ๋ฌธํญ, ์๋ต) ํฉ์ฑ ๋ฐ์ดํฐ๋ก Qwen2.5-7B๋ฅผ QLoRA ์ฆ๋ฅํ์ต๋๋ค.
|
| 145 |
+
|
| 146 |
+
- **์ฐ๊ตฌ ์ง๋ฌธ**: 72B์ ํ๋ฅด์๋ ์กฐ๊ฑด๋ถ ์๋ต ๋ฅ๋ ฅ์ด ์ฆ๋ฅ๋ง์ผ๋ก 7B์ ์ผ๋ง๋ ์ด์๋๋๊ฐ
|
| 147 |
+
- **ํ๊ฐ**: ํ์ต์ ์ฐ์ง ์์ ๋ฌธํญ(held-out)์์ ํฌ๋งท ์ค์์จ, ๊ต์ฌ ์ผ์น์จ, ์๋ต ์ผ๊ด์ฑ, ํ๋ฅด์๋ ๊ฐ์์ฑ์ ์ธก์ โ ๊ณต๊ฐ๋ ๋ชจ๋ธ๋ง์ผ๋ก ์ฌํ ๊ฐ๋ฅ
|
| 148 |
+
- **ํ๊ณ**: ๊ฐ์ ์ธ๋ฌผ์ ์๋ต์ ์ค์ ์ฌ๋ก ์ด ์๋ ์ถ์ ์ด๋ฉฐ, ์๋ณธ ๋ฐ์ดํฐ์ ๊ฒฐํฉ๋ถํฌ ์๊ณก์ผ๋ก ์ธ๋ถ ์ง๋จ ๋ถ์์๋ ํต๊ณ ๋ณด์ ์ด ํ์ํฉ๋๋ค. ๋ฏผ๊ฐ ์ฃผ์ ๋ ํ์ต์์ ์ ์ธํ์ต๋๋ค.
|
| 149 |
+
- ๋ชจ์ง๋จ ์ง๊ณ ํ์ดํ๋ผ์ธ(์ธตํ ํ๋ณธ์ถ์ถยท์ฌํ์ธตํ ๊ฐ์ค)์ ๋น๊ณต๊ฐ์ด๋ฉฐ, ๋ณธ ๊ณต๊ฐ๋ฌผ์ ๊ฐ์ธ ํ๋ฅด์๋ ์ญํ ๊ทน ๊ธฐ๋ฅ๋ง ์ ๊ณตํฉ๋๋ค.
|
| 150 |
+
|
| 151 |
+
---
|
| 152 |
+
|