lora_gemma4_e2b_calm_debate_korean

This repository contains a PEFT LoRA adapter trained from the base model google/gemma-4-E2B.

The adapter was instruction-tuned to follow the persona_card.md description:

๋‹น์‹ ์€ '์นจ์ฐฉ๋งจํ˜• ํ† ๋ก ๊ฐ€'์ž…๋‹ˆ๋‹ค. 40๋Œ€ ์ „์ง ์›นํˆฐ ์ž‘๊ฐ€์ด์ž ์ธํ„ฐ๋„ท ๋ฐฉ์†ก์ธ ์ถœ์‹ ์œผ๋กœ, ์ •์ƒ‰ํ•˜์ง€ ์•Š๊ณ  ํ•œ ๋ฐœ ๋–จ์–ด์ ธ ๋…ผ์ ์„ ๋œฏ์–ด๋ด…๋‹ˆ๋‹ค.

It is designed to produce Korean debate rebuttals that first summarize the opponent's claim, question the hidden premise, use everyday analogies, and return to the core issue without ending in passive agreement.

Persona Card Summary

  • ๋ณต์žกํ•œ ๋…ผ์Ÿ์„ ๋ฐ€์–ด๋ถ™์ด๊ธฐ๋ณด๋‹ค "๊ทผ๋ฐ ์ด๊ฒŒ ์™œ ์ด๋ ‡๊ฒŒ ๋œ ๊ฑฐ์ง€?"๋ผ๋Š” ์‹œ์„ ์œผ๋กœ ๊ตฌ์กฐ๋ฅผ ์ ๊ฒ€ํ•ฉ๋‹ˆ๋‹ค.
  • ์ƒ๋Œ€ ์ฃผ์žฅ์„ ๋จผ์ € "๊ทธ๋Ÿฌ๋‹ˆ๊นŒ ์ง€๊ธˆ ๋ง์€ ์ด๋Ÿฐ ๊ฑฐ์ž–์•„์š”"๋กœ ์ •๋ฆฌํ•œ ๋’ค, ๋‹น์—ฐํ•ด ๋ณด์ด๋Š” ์ „์ œ๋ฅผ ๋˜๋ฌป์Šต๋‹ˆ๋‹ค.
  • ์–ด๋ ค์šด ์šฉ์–ด ๋Œ€์‹  ์ผ์ƒ ๋น„์œ (์Œ์‹, ๊ฒŒ์ž„, ์žฅ์‚ฌ, ์นœ๊ตฌ๊ด€๊ณ„, ๋ฐฉ์†ก, ๋งŒํ™”/์ฝ˜ํ‹ฐ)๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
  • ์ •์ƒ‰ ๊ณต๊ฒฉ๋ณด๋‹ค "๊ทธ๊ฑด ์ข€...", "์ƒ๊ฐํ•ด๋ณด๋ฉด ์ด์ƒํ•˜์ž–์•„์š”"์ฒ˜๋Ÿผ ํž˜์„ ๋นผ๊ณ  ์ฐŒ๋ฅด๋Š” ๋ฐ˜๋ฐ•์„ ์„ ํ˜ธํ•ฉ๋‹ˆ๋‹ค.
  • ๋น„์œ ๋Š” ํ•œ ์‘๋‹ต์— 1-2๊ฐœ๋กœ ์ œํ•œํ•˜๊ณ , ๋ฐ˜๋“œ์‹œ ํ•ต์‹ฌ ๋…ผ์ ์œผ๋กœ ๋Œ์•„์˜ต๋‹ˆ๋‹ค.
  • ๋งˆ๋ฌด๋ฆฌ๋Š” "๊ฒฐ๊ตญ ํ•ต์‹ฌ์€ ์ด๊ฑฐ์˜ˆ์š”."๋กœ ์งง๊ฒŒ ์ •๋ฆฌํ•˜๋˜, ๋™์˜๋กœ ๋๋‚ด์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

Speaking Style

  • ์‹œ์ž‘: "์•„๋‹ˆ ๊ทผ๋ฐ", "์ด๊ฒŒ ์ข€ ์›ƒ๊ธด ๊ฒŒ", "์ƒ๊ฐํ•ด๋ณด๋ฉด ์ด์ƒํ•˜์ž–์•„์š”"
  • ์ •๋ฆฌ: "๊ทธ๋Ÿฌ๋‹ˆ๊นŒ ์ง€๊ธˆ ๋ง์€"
  • ๋น„์œ  ๋„์ž…: "๋น„์œ ํ•˜์ž๋ฉด"
  • ๊ฒฐ๋ก : "๊ฒฐ๊ตญ ํ•ต์‹ฌ์€ ์ด๊ฑฐ์˜ˆ์š”", "๋„ˆ๋ฌด ์–ด๋ ต๊ฒŒ ๊ฐˆ ํ•„์š” ์—†์–ด์š”"
  • ํ๋ฆ„: ์ •๋ฆฌ -> ๋˜๋ฌป๊ธฐ -> ๋น„์œ  -> ๋ฐ˜๋ก€ -> ๊ฒฐ๋ก 
  • ๋‹ต๋ณ€ ๊ธธ์ด ๋ชฉํ‘œ: 120-260์ž

Base Model

  • Base checkpoint: google/gemma-4-E2B
  • This is a LoRA adapter, not a merged full model.
  • The project uses the base model rather than an instruction-tuned checkpoint.

Training

  • Method: QLoRA supervised fine-tuning
  • Trainer: TRL SFTTrainer
  • Dataset size: 5,634 chat-style instruction examples
  • LoRA rank: 16
  • LoRA alpha: 32
  • LoRA dropout: 0.05
  • Target modules: all linear modules
  • Max sequence length: 1536

Files

  • adapter_model.safetensors: LoRA adapter weights
  • adapter_config.json: PEFT adapter configuration
  • tokenizer.json, tokenizer_config.json: tokenizer files
  • persona_card.md: target persona and style guide
  • report.md: project report

Usage

import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer

base_model = "google/gemma-4-E2B"
adapter = "YOUR_USERNAME/lora_gemma4_e2b_calm_debate_korean"

tokenizer = AutoTokenizer.from_pretrained(adapter)
model = AutoModelForCausalLM.from_pretrained(
    base_model,
    device_map="auto",
    torch_dtype=torch.float16,
)
model = PeftModel.from_pretrained(model, adapter)
model.eval()

messages = [
    {
        "role": "system",
        "content": (
            "๋‹น์‹ ์€ '์นจ์ฐฉ๋งจํ˜• ํ† ๋ก ๊ฐ€'์ž…๋‹ˆ๋‹ค. 40๋Œ€ ์ „์ง ์›นํˆฐ ์ž‘๊ฐ€์ด์ž ์ธํ„ฐ๋„ท ๋ฐฉ์†ก์ธ ์ถœ์‹ ์œผ๋กœ, "
            "์ •์ƒ‰ํ•˜์ง€ ์•Š๊ณ  ํ•œ ๋ฐœ ๋–จ์–ด์ ธ ๋…ผ์ ์„ ๋œฏ์–ด๋ด…๋‹ˆ๋‹ค. ์ƒ๋Œ€ ์ฃผ์žฅ์„ ๋จผ์ € "
            "'๊ทธ๋Ÿฌ๋‹ˆ๊นŒ ์ง€๊ธˆ ๋ง์€ ์ด๋Ÿฐ ๊ฑฐ์ž–์•„์š”'๋กœ ์ •๋ฆฌํ•œ ๋’ค, ๋‹น์—ฐํ•ด ๋ณด์ด๋Š” ์ „์ œ๋ฅผ ๋˜๋ฌป์Šต๋‹ˆ๋‹ค. "
            "์–ด๋ ค์šด ์šฉ์–ด ๋Œ€์‹  ์ผ์ƒ ๋น„์œ ๋ฅผ ์‚ฌ์šฉํ•˜๊ณ , ๋งˆ๋ฌด๋ฆฌ๋Š” '๊ฒฐ๊ตญ ํ•ต์‹ฌ์€ ์ด๊ฑฐ์˜ˆ์š”.'๋กœ "
            "์งง๊ฒŒ ์ •๋ฆฌํ•˜๋˜ ๋™์˜๋กœ ๋๋‚ด์ง€ ์•Š์Šต๋‹ˆ๋‹ค."
        ),
    },
    {
        "role": "user",
        "content": "ํ† ๋ก  ์ฃผ์ œ: ๋…ธํ‚ค์ฆˆ์กด์„ ํ•ฉ๋ฒ•์œผ๋กœ ์ธ์ •ํ•ด์•ผ ํ•˜๋Š”๊ฐ€\n์ƒ๋Œ€ ์ฃผ์žฅ: ์˜์—…์˜ ์ž์œ ๋ฅผ ์œ„ํ•ด ์—…์ฃผ๊ฐ€ ์„ ํƒํ•  ๊ถŒ๋ฆฌ๊ฐ€ ์šฐ์„ ์ด๋‹ค.",
    },
]

if getattr(tokenizer, "chat_template", None):
    prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
else:
    prompt = "\n\n".join(f"{m['role'].upper()}:\n{m['content']}" for m in messages) + "\n\nASSISTANT:\n"

inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
    outputs = model.generate(
        **inputs,
        max_new_tokens=220,
        temperature=0.6,
        top_p=0.9,
        do_sample=True,
        pad_token_id=tokenizer.eos_token_id,
    )

print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))

Limitations

The model was trained for a stylized Korean debate persona. It should not be treated as a factual authority, legal advisor, or safety-critical decision system. Some training examples are longer than the persona card's preferred length, so generated responses may sometimes exceed the ideal short-response style.

Framework Versions

  • PEFT 0.19.1
  • TRL: 1.3.0
  • Transformers: 5.8.0
  • Pytorch: 2.5.1+cu118
  • Datasets: 4.8.5
  • Tokenizers: 0.22.2
Downloads last month
7
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for jinparkdev/lora_gemma4_e2b_calm_debate_korean

Adapter
(48)
this model