YEJI 4B rsLoRA v7 - 한국어 운세 생성 모델

Qwen3-4B 기반의 한국어 운세 생성 전문 모델입니다. rsLoRA 기법을 사용하여 사주, 타로, 별자리 등 다양한 운세 도메인에 대해 파인튜닝되었습니다.

모델 설명

이 모델은 SSAFY 14기 YEJI 팀에서 개발한 AI 기반 운세 서비스를 위해 제작되었습니다. 33,000건 이상의 한국어 운세 데이터셋으로 학습되었으며, 동양 운세(사주), 서양 운세(타로, 별자리), 티키타카 대화 형식을 지원합니다.

주요 특징

  • Base Model: Qwen/Qwen3-4B
  • Fine-tuning Method: rsLoRA (Rank-Stabilized LoRA)
  • Training Data: 33,528개의 한국어 운세 대화 샘플
  • System Prompt: /no_think 포함 (Qwen3 thinking mode 비활성화)
  • Model Size: ~8GB
  • vLLM Support: ✅ 완전 호환

지원 운세 유형

  1. 동양 운세 (Eastern Fortune)

    • 사주팔자 기반 운세
    • 오행, 천간지지 분석
    • 12운성, 신살 해석
  2. 서양 운세 (Western Fortune)

    • 타로 카드 리딩
    • 별자리 운세
    • 행성 배치 분석
  3. 티키타카 대화 (Chat)

    • 자연스러운 대화형 운세
    • 맥락 기반 응답
    • 사용자 맞춤형 조언

학습 세부사항

항목
Base Model Qwen/Qwen3-4B
Fine-tuning Method rsLoRA (Rank-Stabilized LoRA)
LoRA Rank (r) 64
LoRA Alpha 128
Target Modules q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
Dataset tellang/yeji-fortune-telling-ko-v3
Dataset Size 33,528 samples
Training Epochs 5
Learning Rate 5e-5
Batch Size 8 (per device)
Gradient Accumulation Steps 4
Effective Batch Size 32
Max Sequence Length 4096
Optimizer AdamW
LR Scheduler Cosine with warmup
Warmup Ratio 0.1
Weight Decay 0.01

사용 방법

vLLM을 사용한 추론 (권장)

from vllm import LLM, SamplingParams

# 모델 로드
llm = LLM(
    model="tellang/yeji-4b-rslora-v7",
    trust_remote_code=True,
    max_model_len=4096,
    dtype="auto"
)

# 샘플링 파라미터
sampling_params = SamplingParams(
    temperature=0.7,
    top_p=0.9,
    max_tokens=2048,
    repetition_penalty=1.1
)

# 프롬프트 구성
system_prompt = "/no_think\n당신은 전문 운세 상담가입니다."
user_message = "오늘의 연애운을 알려주세요."

messages = [
    {"role": "system", "content": system_prompt},
    {"role": "user", "content": user_message}
]

# 추론 실행
outputs = llm.chat(
    messages=messages,
    sampling_params=sampling_params
)

print(outputs[0].outputs[0].text)

Transformers를 사용한 추론

from transformers import AutoTokenizer, AutoModelForCausalLM
import torch

# 모델 및 토크나이저 로드
model_name = "tellang/yeji-4b-rslora-v7"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype=torch.float16,
    device_map="auto"
)

# 프롬프트 구성
system_prompt = "/no_think\n당신은 전문 운세 상담가입니다."
user_message = "오늘의 연애운을 알려주세요."

messages = [
    {"role": "system", "content": system_prompt},
    {"role": "user", "content": user_message}
]

# 토크나이징
text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True
)
inputs = tokenizer(text, return_tensors="pt").to(model.device)

# 생성
outputs = model.generate(
    **inputs,
    max_new_tokens=2048,
    temperature=0.7,
    top_p=0.9,
    repetition_penalty=1.1,
    do_sample=True
)

response = tokenizer.decode(outputs[0][len(inputs.input_ids[0]):], skip_special_tokens=True)
print(response)

프롬프트 가이드

시스템 프롬프트

/no_think
당신은 전문 운세 상담가입니다. 사용자의 생년월일, 시간, 질문 유형을 바탕으로 정확하고 공감적인 운세를 제공합니다.

출력 형식:
- JSON 구조화 출력 (Pydantic 스키마 준수)
- 키워드 3개 (긍정/부정/중립)
- 상세 해석
- 조언 및 주의사항

동양 운세 예시

messages = [
    {"role": "system", "content": "/no_think\n당신은 전문 운세 상담가입니다."},
    {"role": "user", "content": """
사용자 정보:
- 생년월일: 1990년 5월 15일
- 생시: 14시 30분
- 성별: 여성
- 질문 유형: 연애운

사주 정보:
- 일주: 갑인일주
- 오행: 목(3), 화(2), 토(1), 금(1), 수(1)
- 신살: 도화살

오늘의 연애운을 JSON 형식으로 알려주세요.
"""}
]

서양 운세 예시

messages = [
    {"role": "system", "content": "/no_think\n당신은 전문 타로 리더입니다."},
    {"role": "user", "content": """
타로 스프레드:
1. 과거: 컵 에이스 (정방향)
2. 현재: 검 5 (역방향)
3. 미래: 별 (정방향)

질문: 이번 달 사랑운은 어떤가요?
JSON 형식으로 해석해주세요.
"""}
]

모델 성능

평가 지표
Training Loss 0.2547 (epoch 5)
Validation Loss 0.3124
BLEU Score 42.3
ROUGE-L 0.58
JSON Validity 98.2%

버전 히스토리

  • v7 (현재): Qwen3-4B Base + rsLoRA + /no_think 시스템 프롬프트
  • v8 (차기): Qwen3-4B-Instruct-2507 (Non-thinking Only) 기반 개선

제한사항

  1. Thinking Mode: 베이스 모델의 <think> 태그 출력 경향 → /no_think 프롬프트로 완화
  2. Context Length: 최대 4096 토큰
  3. Domain Specificity: 운세 도메인 외 범용 성능은 제한적
  4. Hallucination: 사주/타로 전문 지식 검증 필요

라이선스

Apache License 2.0

인용

@misc{yeji-4b-rslora-v7,
  author = {SSAFY 14th YEJI Team},
  title = {YEJI 4B rsLoRA v7: Korean Fortune-Telling Language Model},
  year = {2025},
  publisher = {HuggingFace},
  url = {https://huggingface.co/tellang/yeji-4b-rslora-v7}
}

관련 리소스

문의

질문이나 문제 발생 시 GitHub Issues를 통해 문의해주세요.

Downloads last month
4
Safetensors
Model size
4B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for tellang/yeji-4b-rslora-v7

Base model

Qwen/Qwen3-4B-Base
Finetuned
Qwen/Qwen3-4B
Finetuned
(483)
this model

Dataset used to train tellang/yeji-4b-rslora-v7