Downloads · 30 days
4
15% of all-time downloads
lxxexxbxx/gemma3-4b-ko-rlaif-ppo
gemma3-4b-ko-rlaif-ppo is a text generation model from lxxexxbxx. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as gemma.
google/gemma-3-4b-it에 RLAIF(Reinforcement Learning from AI Feedback) 기반 PPO를 적용한 LoRA 어댑터
Downloads · 30 days
4
15% of all-time downloads
All-time downloads
26
Public
Repo size
165 MB
Likes
0
Public
Click a slice to open those files.
.safetensors131 MB · 80%
From the Hugging Face model README
google/gemma-3-4b-it에 RLAIF(Reinforcement Learning from AI Feedback) 기반 PPO를 적용한 LoRA 어댑터
TRL AutoModelForCausalLMWithValueHead는 정책 모델과 가치 헤드가 백본 공유 → 두 가중치가 본 저장소에 함께 저장
| 파일 | 역할 | 크기 |
|---|---|---|
adapter_model.safetensors | 정책 모델(Policy) LoRA 어댑터 | 131 MB |
pytorch_model.bin | 가치 헤드(Value head, v_head) 가중치 | 7 kB |
adapter_config.json | LoRA 설정 | 1 kB |
tokenizer.json / tokenizer_config.json / chat_template.jinja | 토크나이저 | 33 MB |
google/gemma-3-4b-it (4-bit 양자화, BitsAndBytes)r=16, lora_alpha=32, lora_dropout=0.1q_proj, k_proj, v_proj, o_projPPOTrainer + PEFTfrom transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base = AutoModelForCausalLM.from_pretrained(
"google/gemma-3-4b-it",
device_map="auto",
)
model = PeftModel.from_pretrained(base, "lxxexxbxx/gemma3-4b-ko-rlaif-ppo")
tokenizer = AutoTokenizer.from_pretrained("lxxexxbxx/gemma3-4b-ko-rlaif-ppo")
messages = [{"role": "user", "content": "질문을 입력하세요"}]
inputs = tokenizer.apply_chat_template(
messages, add_generation_prompt=True, return_tensors="pt"
).to(model.device)
outputs = model.generate(inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True))
trl.AutoModelForCausalLMWithValueHead 사용temperature=0 (학습 미사용 외부 LLM)| 구성 | Accuracy | Conciseness | Accuracy = 0 |
|---|---|---|---|
| Base Gemma3-4B | 1.10 | 1.68 | 44 / 50 |
| + PPO (본 모델) | 0.78 | 0.82 | 46 / 50 |
1. 보상 해킹(Reward hacking)
2. 평가 데이터 가공 결함
3. Base 모델의 낮은 점수(1.10)에 대하여
google/gemma-3-4b-it의 Gemma Terms of Use 적용