Downloads · 30 days
8
8% of all-time downloads
doongyeon/gemma-4-E2B-chimchak-ko
gemma-4-E2B-chimchak-ko is a text generation model from doongyeon. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as gemma.
google/gemma-4-E2B (베이스, non-instruct) 위에 한국어 토론 페르소나를 입힌 SFT 모델입니다. 페르소나는 "40대 전직 웹툰 작가 / 인터넷 방송인" 풍 — 정색하지 않고 일상 비유로 핵심을 찌르며, "아니 근데", "이게 좀 웃긴 게", "비유하자면", "결국 핵심은 이거예요" 같은 시그니처 어휘로 느슨하게 시작해 짧은 결론으로 마무리합니다.
Downloads · 30 days
8
8% of all-time downloads
All-time downloads
102
Public
Parameters
5.5B
22.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors11 GB · 100%
From the Hugging Face model README
google/gemma-4-E2B (베이스, non-instruct) 위에 한국어 토론 페르소나를 입힌 SFT 모델입니다.
페르소나는 "40대 전직 웹툰 작가 / 인터넷 방송인" 풍 — 정색하지 않고 일상 비유로 핵심을 찌르며,
"아니 근데", "이게 좀 웃긴 게", "비유하자면", "결국 핵심은 이거예요" 같은 시그니처 어휘로
느슨하게 시작해 짧은 결론으로 마무리합니다.
이번 업데이트 (v3.5): 학습 데이터에서 over-baked conv (시그니처 박제·식당 비유 의존·formulaic opener/closer) 상위 25% + 모든 응답이 식당 비유인 conv 추가 제거 (1905 → 1403 conv). 직접 5턴 멀티턴 디베이트로 비교한 결과 v2 대비 상대 논리 reformulate가 더 정밀하고, 귀류법·개념 분해 같은 본격 논증 기법 사용이 더 자연스러워짐.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
MODEL_ID = "doongyeon/gemma-4-E2B-chimchak-ko"
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
model = AutoModelForCausalLM.from_pretrained(
MODEL_ID,
dtype=torch.bfloat16,
device_map="auto",
)
model.eval()
PERSONA_SYSTEM_PROMPT = (
"당신은 한국어 토론 배틀 어시스턴트입니다. 40대 전직 웹툰 작가/방송인 풍의 페르소나로, "
"정색하지 않고 일상 비유로 핵심을 찌르세요. \"아니 근데\", \"이게 좀 웃긴 게\", "
"\"비유하자면\", \"결국 핵심은 이거예요\" 같은 시그니처 어휘를 자연스럽게 사용하세요."
)
messages = [
{"role": "system", "content": PERSONA_SYSTEM_PROMPT},
{"role": "user", "content": "MBTI는 결국 16가지 박스에 사람을 가두는 미신이에요. 자기소개 도구로 쓰는 거 자체가 시대착오 아닌가요?"},
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
# Stop at end-of-turn (<turn|>, id=106) as well as <eos>
eot_id = tokenizer.encode("<turn|>", add_special_tokens=False)[0]
eos_ids = list({eot_id, tokenizer.eos_token_id})
with torch.no_grad():
out = model.generate(
**inputs,
do_sample=True,
temperature=0.7,
top_p=0.95,
max_new_tokens=320,
eos_token_id=eos_ids,
pad_token_id=tokenizer.pad_token_id or tokenizer.eos_token_id,
)
response = tokenizer.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=False)
for tail in ["<turn|>", "<eos>"]:
if response.endswith(tail):
response = response[: -len(tail)]
print(response.strip())
| 파라미터 | 값 | 비고 |
|---|---|---|
temperature | 0.7 | 0.5–0.9 권장 |
top_p | 0.95 | |
max_new_tokens | 280–400 | 한 turn 응답 기준 |
eos_token_id | [1, 106] | <eos> + `<turn |
do_sample | True | greedy decoding은 페르소나가 단조로워짐 |
google/gemma-4-E2B-it과 동일한 Gemma-4 채팅 포맷 사용:
<bos><|turn>system
{system}<turn|>
<|turn>user
{user}<turn|>
<|turn>model
{assistant}<turn|>
tokenizer.apply_chat_template이 자동으로 처리합니다.
| 항목 | 값 |
|---|---|
| Base model | google/gemma-4-E2B (≈ 5.1B params) |
| Precision | bf16 |
| Max seq len | 2,048 |
| Per-device batch | 8 |
| Grad accumulation | 1 |
| GPUs | 4 × NVIDIA H200 NVL |
| Effective batch | 32 |
| Optimizer | AdamW, weight_decay=0.01 |
| Learning rate | 1e-5 |
| LR schedule | cosine, warmup_ratio=0.1 |
| Epochs | 1 (early stop at best eval) |
| NEFTune α | 5 |
| Loss | Assistant-only (user/system tokens masked to -100) |
| Distributed | DeepSpeed Zero-2 |
| Setup | Train loss | Eval loss |
|---|---|---|
| Vanilla 3 epochs (overfits) | 1.18 | 1.80 (epoch 3) |
| v2 (full data, 1 epoch + NEFTune) | 1.50 | 1.51 |
| v3.5 (filtered, 1 epoch + NEFTune) | 1.67 | 1.66 |
v3.5의 절대 eval loss가 v2보다 살짝 높지만, val set 자체도 같은 룰로 필터되어 비교 직접 비교 불가. 실제 응답 품질은 5턴 멀티턴 토론 시연에서 v2보다 논리 결과 상대 주장 reformulate 정밀도가 더 우수.
google/gemma-4-E2B의 Gemma Terms of Use를
준수해야 합니다.