EXAONE-3.5-2.4B-ERP-SQL πŸš€

이 λͺ¨λΈμ€ LGAI-EXAONE/EXAONE-3.5-2.4B-Instructλ₯Ό 기반으둜 ν•œκ΅­μ–΄ ERP λ„λ©”μΈμ˜ Text-to-SQL μž‘μ—…μ„ μˆ˜ν–‰ν•˜κΈ° μœ„ν•΄ νŒŒμΈνŠœλ‹(Fine-tuning)된 λͺ¨λΈμž…λ‹ˆλ‹€.

자체 κ΅¬μΆ•ν•œ ERP 데이터셋을 ν™œμš©ν•˜μ—¬ ν•™μŠ΅ν•˜μ˜€μœΌλ©°, 베이슀 λͺ¨λΈ λŒ€λΉ„ μ•½ 2λ°° κ°€κΉŒμš΄ μ„±λŠ₯ ν–₯상을 λ‹¬μ„±ν–ˆμŠ΅λ‹ˆλ‹€. 특히 λ³΅μž‘ν•œ λΉ„μ¦ˆλ‹ˆμŠ€ 둜직(쑰인, μ„œλΈŒμΏΌλ¦¬ λ“±)을 μ²˜λ¦¬ν•˜λŠ” λŠ₯λ ₯이 크게 κ°•ν™”λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

πŸ“Š λͺ¨λΈ μ„±λŠ₯ (Performance Improvement)

자체 평가 데이터셋(Custom Evaluation Set)을 κΈ°μ€€μœΌλ‘œ μΈ‘μ •ν•œ κ²°κ³Όμž…λ‹ˆλ‹€. 베이슀 λͺ¨λΈμ΄ μ–΄λ €μ›Œν•˜λ˜ κ³ λ‚œμ΄λ„(Lv 5) μΏΌλ¦¬μ—μ„œ 3λ°° μ΄μƒμ˜ μ„±λŠ₯ ν–₯상을 λ³΄μ˜€μŠ΅λ‹ˆλ‹€.

λͺ¨λΈ (Model) ν•™μŠ΅ μƒνƒœ 전체 정확도 Lv 1 (쉬움) Lv 5 (맀우 어렀움)
EXAONE 2.4B Baseline (μˆœμ •) 37.5% 72.5% 20.0%
EXAONE 2.4B Fine-tuned (Ours) 68.5% 92.5% 60.0%

핡심 μš”μ•½: LoRA νŒŒμΈνŠœλ‹μ„ 톡해 ν•œκ΅­μ–΄ μ§ˆμ˜μ— λŒ€ν•œ SQL λ³€ν™˜ 정확도λ₯Ό 37.5%μ—μ„œ 68.5%둜 λŒ€ν­ λŒμ–΄μ˜¬λ ΈμœΌλ©°, 2.4B의 μž‘μ€ νŒŒλΌλ―Έν„° 크기에도 λΆˆκ΅¬ν•˜κ³  λ³΅μž‘ν•œ 좔둠이 κ°€λŠ₯함을 μž…μ¦ν–ˆμŠ΅λ‹ˆλ‹€.

πŸ”§ ν•™μŠ΅ 정보 (Training Details)

  • 베이슀 λͺ¨λΈ: LGAI-EXAONE/EXAONE-3.5-2.4B-Instruct
  • ν•™μŠ΅ 방법: LoRA (Low-Rank Adaptation)
  • 졜적 에폭(Epoch): 4 (μΌλ°˜ν™” μ„±λŠ₯이 κ°€μž₯ λ›°μ–΄λ‚œ 체크포인트 μ„ μ •)
  • 데이터셋: μŠ€ν‚€λ§ˆκ°€ 반영된 ν•©μ„±(Synthetic) ν•œκ΅­μ–΄ ERP 질문-쿼리 쌍
  • ν•˜λ“œμ›¨μ–΄: NVIDIA RTX 4060 Ti (16GB) x 2ea (μƒμš© GPU ν™˜κ²½μ—μ„œμ˜ νš¨μœ¨μ„± μž…μ¦)

πŸ’» μ‚¬μš© κ°€μ΄λ“œ (How to Use)

1. 라이브러리 μ„€μΉ˜

pip install torch transformers peft accelerate

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

# 1. 베이슀 λͺ¨λΈ 및 ν† ν¬λ‚˜μ΄μ € λ‘œλ“œ
base_model_id = "LGAI-EXAONE/EXAONE-3.5-2.4B-Instruct"
adapter_id = "yeongseok11/exaone-2.4b-erp-nl2sql"  # λ³Έ λͺ¨λΈ ID

tokenizer = AutoTokenizer.from_pretrained(base_model_id, trust_remote_code=True)
base_model = AutoModelForCausalLM.from_pretrained(
    base_model_id,
    torch_dtype=torch.bfloat16,
    device_map="auto",
    trust_remote_code=True
)

# 2. νŒŒμΈνŠœλ‹λœ LoRA μ–΄λŒ‘ν„° 병합
model = PeftModel.from_pretrained(base_model, adapter_id)
model.eval()

# 3. ν”„λ‘¬ν”„νŠΈ μ •μ˜ (Alpaca 포맷 ꢌμž₯)
schema_context = """
[Tables]
employees(emp_id, name, dept_id, hire_date, salary)
departments(dept_id, dept_name, location)
"""
question = "IT λΆ€μ„œ μ§μ›λ“€μ˜ 평균 연봉을 κ΅¬ν•΄μ€˜."

prompt = f"""Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.

### Instruction:
μ•„λž˜ μŠ€ν‚€λ§ˆλ₯Ό μ°Έκ³ ν•˜μ—¬ μ§ˆλ¬Έμ„ SQL둜 λ³€ν™˜ν•˜μ„Έμš”.

### Input:
### 질문:
{question}

### μŠ€ν‚€λ§ˆ:
{schema_context}

### Response:
"""

# 4. SQL 생성
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)

with torch.no_grad():
    outputs = model.generate(
        **inputs,
        max_new_tokens=256,
        do_sample=False,
        eos_token_id=tokenizer.eos_token_id
    )

generated_sql = tokenizer.decode(outputs[0], skip_special_tokens=True).split("### Response:")[-1].strip()
print(f"πŸ”Ή μƒμ„±λœ SQL:\n{generated_sql}")
Downloads last month
28
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for yeongseok11/exaone-2.4b-erp-nl2sql

Adapter
(22)
this model