YAML Metadata
Warning:
empty or missing yaml metadata in repo card
(https://huggingface.co/docs/hub/model-cards#model-card-metadata)
๋ชจ๋ธ ์นด๋: Qwen2.5-0.5B-schoolmath_v2
์์ฑ์: Seongeon Kim ๋ ์ง: 2025-05-27 ํ๋ธ ๋งํฌ: https://huggingface.co/SeongeonKim/Qwen2.5-0.5B-schoolmath_v2
1. ๋ชจ๋ธ ๊ฐ์
- ๋ฒ ์ด์ค ๋ชจ๋ธ:
unsloth/Qwen2-0.5B
- ํ์ธํ๋: PEFT LoRA ์ด๋ํฐ + TRL SFTTrainer
- ๋ชฉํ: GSM8K(Grade-School Math) ๋ฐ์ดํฐ์ ์ ์ด์ค๋ฑ ์์ค ์๋ฆฌ ๋ฌธ์ ์ ๋ํ ์ ํ๋ ํฅ์
2. ํ์ธํ๋ ์ค์
LoRA ๊ตฌ์ฑ
- ๋ญํฌ r = 16
- ฮฑ (alpha) = 16
- dropout = 0
- ํ๊น ๋ชจ๋:
q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
ํ์ต ํ๋ ์์ํฌ
- Transformers 4.51.0.dev0
- TRL SFTTrainer v0.4.8
- Unsloth FastLanguageModel (4๋นํธ ์์ํ ์ถ๋ก )
ํ์ต ๋ฐ์ดํฐ
GSM8K train split (7,473๋ฌธ์ )
ํ๋กฌํํธ ํ ํ๋ฆฟ:
Please solve the following math problem according to these instructions: 1. Whenever you perform a calculation, display it in the form <<expression=result>>. 2. Alternate between a brief explanatory sentence and the corresponding calculation, step by step. 3. On the very last line, output only the final numeric answer in the format #### {{answer}}. ### Problem: {} ### Solution: {}
ํ์ดํผํ๋ผ๋ฏธํฐ
- ์ํญ(epoch) = 3
- ๋ฐฐ์น ์ฌ์ด์ฆ = 2 (per_device_train_batch_size)
- gradient_accumulation_steps = 8
- ํ์ต๋ฅ = 5e-5
- warmup_ratio = 0.05
- optimizer =
adamw_8bit
- scheduler =
linear
์ปดํจํธ ํ๊ฒฝ
- ํ๋กํ ํ์ : 1รTesla T4 (Colab)
- ํ๊ฐ: 4รRTX3090 (vLLM ๋ฐฑ์๋)
3. ๋ฒค์น๋งํฌ ๊ฒฐ๊ณผ ๋น๊ต
๋ชจ๋ธ | strict-match (5-shot) | flexible-extract (5-shot) |
---|---|---|
ํ์ธํ๋ ๋ชจ๋ธ Qwen2.5-0.5B-schoolmath_v1 |
24.56 ยฑ 1.19 % | 24.56 ยฑ 1.19 % |
๋ฒ ์ด์ง ๋ชจ๋ธ unsloth/Qwen2.5-0.5B |
34.34 ยฑ 1.31 % | 35.18 ยฑ 1.32 % |
ํด์ค
- ์๊ฒฉ ๋งค์นญ(strict-match):
#### <๋ต์>
ํจํด์ผ๋ก ์ ํํ ์ผ์นํด์ผ ์ฑ๊ณต์ผ๋ก ๊ฐ์ฃผ- ์ ์ฐ ์ถ์ถ(flexible-extract): ์ซ์๋ง ์ถ์ถํด ๋งค์นญ(์ผํยท๋ฌ๋ฌ ๊ธฐํธ ์ ์ธ)
4. ์ฌ์ฉ ์์
(1) vLLM CLI ํ๊ฐ
pip install lm-evaluation-harness[vllm] vllm transformers
lm_eval \
--model vllm \
--model_args pretrained=SeongeonKim/Qwen2.5-0.5B-schoolmath_v1 \
--tasks gsm8k \
--device cuda:0 \
--batch_size auto
(2) Transformers + PEFT ๋ก๋
from transformers import AutoTokenizer
from peft import PeftModel
import torch
# ํ ํฌ๋์ด์ ๋ฐ LoRA ์ด๋ํฐ ๋ก๋
tokenizer = AutoTokenizer.from_pretrained("SeongeonKim/Qwen2.5-0.5B-schoolmath_v1")
base_model = torch.load("unsloth/Qwen2-0.5B") # ๋๋ FastLanguageModel ๋ก๋
model = PeftModel.from_pretrained(base_model, "SeongeonKim/Qwen2.5-0.5B-schoolmath_v1")
model.eval().to("cuda")
prompt = "Question: If you have 3 apples and buy 2 more, how many apples? Answer:"
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=16)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
5. Intended Use & Limitations
์ฉ๋: ์ฐ๊ตฌยท๊ต์ก์ฉ์ผ๋ก GSM8K์ ๊ฐ์ ๋ค๋จ๊ณ ์๋ฆฌ ๋ฌธ์ ์คํ
์ ํ์ฌํญ
- 5-shot exact-match โ 23 %๋ก ์ธ๊ฐ(โ 90 %+) ๋๋น ๋ฎ์
- ์ค๋ตยทํ์ ๊ณ์ฐ(hallucination) ์ํ
- ํ์ ๊ณผ์ ์๋ ์ฑ์ ๋ฑ ํ๋ก๋์ ์ฉ๋ ๊ถ์ฅ๋์ง ์์
6. ์ค๋ฆฌ ๋ฐ ๋ผ์ด์ ์ค
๋ผ์ด์ ์ค: Apache 2.0
์ค๋ฆฌ์ ๊ณ ๋ ค์ฌํญ
- ์๋ ์ฑ์ ๋๊ตฌ๋ก ์ฌ์ฉ ์ง์
- ๊ฒฐ๊ณผ ๊ฒ์ฆ ์์ด ์์ฌ๊ฒฐ์ ์ ์ฌ์ฉ ๊ธ์ง
7. ์ธ์ฉ
@misc{SeongeonKim2025QwenSchoolMath,
title = {Qwen2.5-0.5B-schoolmath\_v1: LoRA-tuned Qwen2.5-0.5B on GSM8K},
author = {Seongeon Kim},
year = {2025},
howpublished = {\url{https://huggingface.co/SeongeonKim/Qwen2.5-0.5B-schoolmath_v1}},
}
- Downloads last month
- 28
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
๐
Ask for provider support