Qwen3-VL-32B Distilled GPTQ
Qwen3-VL-32B์ ๊ธฐ๋ฐ์ผ๋ก Knowledge Distillation ๋ฐฉ์์ผ๋ก ํ์ตํ ํ GPTQ 4-bit ์์ํ๋ฅผ ์ ์ฉํ Vision-Language ๋ชจ๋ธ์
๋๋ค.
DeepSeek-v3.2(Teacher)๋ก ์์ฑํ ํ๊ตญ์ด CoT ๋ฐ์ดํฐ์
์ผ๋ก ํ์ต๋์์ผ๋ฉฐ, Prompt Pre-filling ๊ธฐ๋ฒ์ผ๋ก Tool Call ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ์ต๋๋ค.
๋ชจ๋ธ ์ ๋ณด
| ํญ๋ชฉ | ๋ด์ฉ |
|---|---|
| Base Model | Qwen/Qwen3-VL-32B-Instruct |
| Teacher Model | DeepSeek-v3.2 (OpenRouter API) |
| ์์ํ ๋ฐฉ์ | GPTQ 4-bit |
| ํ๋ผ๋ฏธํฐ ์ | 33.4B |
| ํ์ต ์ธ์ด | ํ๊ตญ์ด (์ฃผ), ์์ด |
| ํ์ต ๋ฐ์ดํฐ | 2,031๊ฑด ํ๊ตญ์ด ํ์ ์ง๋ฌธ (CoT ํฌํจ) |
ํ์ต ๋ฐฉ๋ฒ
1. CoT ๋ฐ์ดํฐ ์ฆ๋ฅ
DeepSeek-v3.2(Teacher)๋ฅผ ์ฌ์ฉํด 2,031๊ฑด์ ํ๊ตญ์ด ํ์ ์ง๋ฌธ์ ๋ํ Chain-of-Thought ๋ฐ์ดํฐ๋ฅผ ์์ฑํ์ต๋๋ค.
์ฆ๋ฅ ์ ๋ต (Zero-shot + Guided Fallback)
- 1์ฐจ: Teacher ๋ชจ๋ธ์ด
<think>ํ๊ทธ ํฌํจ ์ฌ๊ณ ๊ณผ์ ์์ฑ - 2์ฐจ: ์คํจ ์ ์ ๋ต ํํธ ์ ๊ณต ํ ์ฌ์์ฑ
- 3์ฐจ: ์์ ์คํจ ์ Ground Truth ๊ธฐ๋ฐ ๊ธฐ๋ณธ ๋ต๋ณ ์ฌ์ฉ
ํ์ง ๊ด๋ฆฌ ๊ฒฐ๊ณผ
- CoT ํ๊ทธ ์๊ฒฐ์ฑ: 100% (
</think>ํฌํจ ๋ณด์ฅ) - ์ ๋ต ํฌ๋งท ์ค์์จ: 100%
- ์ปค๋ฒ๋ฆฌ์ง: 2,031๊ฑด / 2,031๊ฑด (100%)
- ํ๊ท CoT ๊ธธ์ด: 1,200์
2. Prompt Pre-filling (ํต์ฌ ๊ธฐ๋ฒ)
Qwen3-VL์ ๋ด์ฅ๋ Tool-Calling ๊ธฐ๋ฅ ๋๋ฌธ์ ์ผ๋ฐ System Prompt๋ง์ผ๋ก๋ ํ
์คํธ ์ถ๋ก ์ ๊ฐ์ ํ ์ ์์์ต๋๋ค.
Prompt Pre-filling ๊ธฐ๋ฒ์ผ๋ก ์ด ๋ฌธ์ ๋ฅผ ์์ ํ ํด๊ฒฐํ์ต๋๋ค.
# โ Before (์คํจ): tool_call ํ๊ทธ ์์ฑ
full_prompt = "<|im_start|>assistant\n"
# โ
After (์ฑ๊ณต): think ํ๊ทธ๋ก CoT ๊ฐ์
full_prompt = "<|im_start|>assistant\n<think>\n"
| ์ํ | ์ ๋ต ์ถ์ถ๋ฅ |
|---|---|
| Pre-filling ์ ์ฉ ์ | 0% (<tool_call> ์์ฑ) |
| Pre-filling ์ ์ฉ ํ | 100% (<think> CoT ์ถ๋ก ) |
3. GPTQ ์์ํ
โ ๏ธ ์คํ ๊ฒฐ๊ณผ ๋ฐ ์ฃผ์์ฌํญ
32B ์ด์ ๋ํ ๋ชจ๋ธ์์ 3 epoch ํ์ต ํ GPTQ ์์ํ๋ฅผ ์ ์ฉํ๋ฉด -3% ์ฑ๋ฅ ์ ํ๊ฐ ๋ฐ์ํ ์ ์์ต๋๋ค.
์์ธ: ๊ณ ๋ฐ๋ CoT ๋ฐ์ดํฐ๋ก ์ธํ ๊ณผ์ ํฉ ํจํด์ด ์์ํ ์ ๋ถ๊ดด๋ฉ๋๋ค.๊ถ์ฅ ํ์ต ์ค์ (32B ์ด์):
num_train_epochs = 1 # 3 epoch โ 1 epoch learning_rate = 1e-5 # ๊ธฐ๋ณธ๊ฐ ์ ๋ฐ
์ฌ์ฉ ๋ฐฉ๋ฒ
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("xeker/qwen3-vl-32b-distilled-gptq")
model = AutoModelForCausalLM.from_pretrained(
"xeker/qwen3-vl-32b-distilled-gptq",
device_map="auto"
)
messages = [
{"role": "system", "content": "๋น์ ์ ํ๊ตญ์ด ํ์ ์ง๋ฌธ์ ๋ถ์ํ๊ณ ์ถ๋ก ํ๋ ์ ๋ฌธ๊ฐ์
๋๋ค."},
{"role": "user", "content": "๋ค์ ์ง๋ฌธ์ ์ฝ๊ณ ์ง๋ฌธ์ ๋ตํ์ธ์.\n\n[์ง๋ฌธ ๋ด์ฉ]"}
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
text += "<think>\n" # โญ Prompt Pre-filling: Tool Call ๋ฐฉ์ง, CoT ์ถ๋ก ๊ฐ์
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=4096, temperature=0.7)
print(tokenizer.decode(outputs[0], skip_special_tokens=False))
์ฃผ์:
<think>\npre-filling ์์ด ์ฌ์ฉํ๋ฉด<tool_call>ํ๊ทธ๊ฐ ์์ฑ๋์ด ๋ต๋ณ ์ถ์ถ์ ์คํจํ ์ ์์ต๋๋ค.
๊ธฐ์ ์คํ
Python PyTorch Transformers vLLM GPTQ Knowledge Distillation OpenRouter API
ํ๋ก์ ํธ ๋ฐฐ๊ฒฝ
๋ค์ด๋ฒ ๋ถ์คํธ์บ ํ AI Tech 8๊ธฐ ํ ํ๋ก์ ํธ์ ์ผํ์ผ๋ก ์งํ๋ ์๋ฅ ํ์ด ํนํ LLM ๊ฐ๋ฐ ํ๋ก์ ํธ์์ ํ์๋ ๋ชจ๋ธ์ ๋๋ค.
- GitHub: boostcampaitech8/pro-nlp-mrc-nlp-01
- ๊ด๋ จ ๋ชจ๋ธ: xeker/qwen3-14b-distilled-gptq
- Downloads last month
- 17
Model tree for xeker/qwen3-vl-32b-distilled-gptq
Base model
Qwen/Qwen3-VL-32B-Instruct