Downloads · 30 days
13
8% of all-time downloads
gyung/lfm2-1.2b-koen-mt-v8-rl-10k-adapter
lfm2-1.2b-koen-mt-v8-rl-10k-adapter is a text generation model from gyung. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as other.
GRPO + COMET/CHrF++ 강화학습으로 훈련된 한영/영한 양방향 번역 LoRA Adapter
Downloads · 30 days
13
8% of all-time downloads
All-time downloads
155
Public
Repo size
711 MB
Likes
2
Public
Click a slice to open those files.
.safetensors88.9 MB · 95%
From the Hugging Face model README
GRPO + COMET/CHrF++ 강화학습으로 훈련된 한영/영한 양방향 번역 LoRA Adapter
⚠️ 이 Adapter는 반드시 Base 모델과 함께 사용해야 합니다!
Base Model: gyung/lfm2-1.2b-koen-mt-v6.4-merged
| Rank | Model | CHrF++ | BLEU | Params |
|---|---|---|---|---|
| 1 | Google Translate | 39.27 | 18.18 | - (API) |
| 2 | 🏆 LFM2-v8-RL (Step 400) | 34.61 | 13.21 | 1.2B |
| 3 | Gemma-3-4B-it-GGUF | 32.83 | 11.36 | 4B |
| 4 | LFM2-1.2B (Base) | 27.23 | 6.43 | 1.2B |
| 5 | Qwen3-4B-GGUF (Base) | 25.62 | - | 4B |
✅ 1.2B 모델로 4B 모델들을 압도적으로 능가!
| Step | Epoch | CHrF++ | BLEU | 비고 |
|---|---|---|---|---|
| 0 | 0.00 | 33.53 | 12.63 | v6.4 Base |
| 200 | 0.39 | 34.10 | 12.93 | +0.57 향상 |
| 300 | 0.59 | 34.19 | 13.24 | Historic High |
| 400 | 0.78 | 34.61 | 13.21 | 🏆 SOTA |
💡 해결 방안: DPO를 통한 환각 교정 예정 (v9)
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
# Base 모델 로드
base_model = AutoModelForCausalLM.from_pretrained(
"gyung/lfm2-1.2b-koen-mt-v6.4-merged",
device_map="auto",
torch_dtype="auto"
)
tokenizer = AutoTokenizer.from_pretrained("gyung/lfm2-1.2b-koen-mt-v6.4-merged")
# Adapter 로드 및 병합
model = PeftModel.from_pretrained(base_model, "gyung/lfm2-1.2b-koen-mt-v8-rl-10k-adapter")
model = model.merge_and_unload() # 추론 속도 향상
# 영어 → 한국어
messages = [
{"role": "system", "content": "Translate to Korean."},
{"role": "user", "content": "The quick brown fox jumps over the lazy dog."}
]
# 한국어 → 영어
messages = [
{"role": "system", "content": "Translate to English."},
{"role": "user", "content": "빠른 갈색 여우가 게으른 개를 뛰어넘습니다."}
]
input_ids = tokenizer.apply_chat_template(
messages, return_tensors="pt", add_generation_prompt=True
).to(model.device)
outputs = model.generate(
input_ids,
max_new_tokens=256,
do_sample=True,
temperature=0.3,
min_p=0.15,
repetition_penalty=1.05
)
translation = tokenizer.decode(outputs[0][input_ids.shape[1]:], skip_special_tokens=True)
print(translation)
| 항목 | 값 |
|---|---|
| Base Model | gyung/lfm2-1.2b-koen-mt-v6.4-merged |
| Method | GRPO (Group Relative Policy Optimization) |
| Reward | COMET + CHrF++ |
| Dataset Size | 10,000 samples (양방향) |
| Training Steps | 400 |
| Effective Batch Size | 128 |
| LoRA Rank | 32 |
| LoRA Alpha | 64 |
| Target Modules | all-linear |
"Data-Centric + Progressive Learning" 파이프라인:
💡 핵심: 무작정 데이터를 늘리는 게 아니라, 약점을 분석하고 타겟팅된 데이터를 추가
@misc{lfm2-koen-v8-rl,
author = {gyung},
title = {LFM2-1.2B-KoEn-MT-v8-RL: GRPO-Enhanced Bidirectional Korean-English Translation Adapter},
year = {2024},
publisher = {Hugging Face},
url = {https://huggingface.co/gyung/lfm2-1.2b-koen-mt-v8-rl-10k-adapter}
}
This model inherits the LFM Open License v1.0 from the base LFM2 model.