language:
- ko
- en
license: llama3
library_name: transformers
tags:
- llama
- llama-3
datasets:
- MarkrAI/KoCommercial-Dataset
Waktaverse-Llama-3-KO-8B-Instruct Model Card
Model Details
Waktaverse-Llama-3-KO-8B-Instruct is a Korean language model developed by Waktaverse AI team. This large language model is a specialized version of the Meta-Llama-3-8B-Instruct, tailored for Korean natural language processing tasks. It is designed to handle a variety of complex instructions and generate coherent, contextually appropriate responses.
- Developed by: Waktaverse AI
- Model type: Large Language Model
- Language(s) (NLP): Korean, English
- License: Llama3
- Finetuned from model: meta-llama/Meta-Llama-3-8B-Instruct
- Tokenizer Soucrce: saltlux/Ko-Llama3-Luxia-8B
Model Sources
- Repository: GitHub
- Paper : [More Information Needed]
Uses
Direct Use
The model can be utilized directly for tasks such as text completion, summarization, and question answering without any fine-tuning.
Out-of-Scope Use
This model is not intended for use in scenarios that involve high-stakes decision-making including medical, legal, or safety-critical areas due to the potential risks of relying on automated decision-making. Moreover, any attempt to deploy the model in a manner that infringes upon privacy rights or facilitates biased decision-making is strongly discouraged.
Bias, Risks, and Limitations
While Waktaverse Llama 3 is a robust model, it shares common limitations associated with machine learning models including potential biases in training data, vulnerability to adversarial attacks, and unpredictable behavior under edge cases. There is also a risk of cultural and contextual misunderstanding, particularly when the model is applied to languages and contexts it was not specifically trained on.
How to Get Started with the Model
You can run conversational inference using the Transformers Auto classes. We highly recommend that you add Korean system prompt for better output. Adjust the hyperparameters as you need.
Example Usage
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
device = (
"cuda:0" if torch.cuda.is_available() else # Nvidia GPU
"mps" if torch.backends.mps.is_available() else # Apple Silicon GPU
"cpu"
)
model_id = "PathFinderKR/Waktaverse-Llama-3-KO-8B-Instruct"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map=device,
)
################################################################################
# Generation parameters
################################################################################
num_return_sequences=1
max_new_tokens=1024
temperature=0.9
top_k=0 # not recommended
top_p=0.9
repetition_penalty=1.1
def generate_response(system ,user):
messages = [
{"role": "system", "content": system},
{"role": "user", "content": user}
]
prompt = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=False
)
input_ids = tokenizer.encode(
prompt,
add_special_tokens=False,
return_tensors="pt"
).to(device)
outputs = model.generate(
input_ids=input_ids,
pad_token_id=tokenizer.eos_token_id,
num_return_sequences=num_return_sequences,
max_new_tokens=max_new_tokens,
do_sample=True,
temperature=temperature,
top_k=top_k,
top_p=top_p,
repetition_penalty=repetition_penalty
)
return tokenizer.decode(outputs[0], skip_special_tokens=False)
system_prompt = "λ€μ μ§μμ¬νμ λν μλ΅μ μμ±ν΄μ£ΌμΈμ."
user_prompt = "νΌλ³΄λμΉ μμ΄μ λν΄ μ€λͺ
ν΄μ£ΌμΈμ."
response = generate_response(system_prompt, user_prompt)
print(response)
Example Output
<|begin_of_text|><|start_header_id|>system<|end_header_id|>
λ€μ μ§μμ¬νμ λν μλ΅μ μμ±ν΄μ£ΌμΈμ.<|eot_id|><|start_header_id|>user<|end_header_id|>
νΌλ³΄λμΉ μμ΄μ λν΄ μ€λͺ
ν΄μ£ΌμΈμ.<|eot_id|><|start_header_id|>assistant<|end_header_id|>
νΌλ³΄λμΉ μμ΄μ 0κ³Ό 1λ‘ μμνλ©°, κ° νμ΄ μ΄μ λ νμ ν©μΌλ‘ κ³μ°λλ μμ΄μ
λλ€. μ΄ μμ΄μλ 무νν λ§μ μ«μκ° ν¬ν¨λμ΄ μμΌλ©°, 첫 λ²μ§Έ λͺ κ°μ νμ λ€μκ³Ό κ°μ΅λλ€:
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 985, 1597, 2584, 4181, 6765, 10946, 17711, 28657, 46368, 75025, 121393, 196418,...
νΌλ³΄λμΉ μμ΄μ μνμ ꡬ쑰μ μ¬κ· κ΄κ³λ₯Ό κ°μ§κ³ μμ΅λλ€. μλ₯Ό λ€μ΄, νΌλ³΄λμΉ μμ΄μ nλ²μ§Έ νμ (n-1)λ²μ§Έμ (n-2)λ²μ§Έ νμ ν©μ
λλ€.
νΌλ³΄λμΉ μμ΄μ μ¬λ¬ λΆμΌμμ μ¬μ©λ©λλ€. μλ₯Ό λ€μ΄, ννμ λ°°μΉ λ¬Έμ μμλ νΌλ³΄λμΉ μμ΄μ΄ μ¬μ©λ μ μμ΅λλ€. λν, κΈ°ννμμ νΌλ³΄λμΉ μμ΄μ μ μ λ°°μ΄μ μ¬μ©λ μ μμ΅λλ€.
νΌλ³΄λμΉ μμ΄μ μνμ λ μ¨μλ₯΄λ νΌλ³΄λμΉμ μ΄λ¦μ λ°μ λͺ
λͺ
λμμ΅λλ€. κ·Έλ μ΄ μμ΄μ μ²μ λ°κ²¬νκ³ κΈ°λ‘νμ΅λλ€. νΌλ³΄λμΉ μμ΄μ μ λ½μμ μΈκΈ°λ₯Ό λμμΌλ©°, λ€λ₯Έ λ¬Ένμμλ λ
νΉν ννλ‘ λνλ©λλ€.
νΌλ³΄λμΉ μμ΄μ μ»΄ν¨ν° νλ‘κ·Έλ¨κ³Ό μκ³ λ¦¬μ¦μλ μ μ©λ μ μμ΅λλ€. μλ₯Ό λ€μ΄, νΌλ³΄λμΉ μμ΄μ κ³μ°νλ μκ³ λ¦¬μ¦μ΄ μμ΅λλ€. μ΄λ¬ν μκ³ λ¦¬μ¦μ νμ¬κΉμ§ λ§€μ° ν¨μ¨μ μ΄λ©°, λκ·λͺ¨ κ³μ°μ μ¬μ©λ©λλ€. νΌλ³΄λμΉ μμ΄μ μνμ ꡬ쑰μ μ¬κ· κ΄κ³λ₯Ό κ°μ§κ³ μκΈ° λλ¬Έμ νλ‘κ·Έλλ° μΈμ΄μμλ μμ£Ό μ¬μ©λ©λλ€.
μμ½νλ©΄, νΌλ³΄λμΉ μμ΄μ μνμ ꡬ쑰μ μ¬κ· κ΄κ³λ₯Ό κ°μ§ μμ΄λ‘, λ€μν λΆμΌμμ μ¬μ©λκ³ μμ΅λλ€. μ΄ μμ΄μ μ»΄ν¨ν° νλ‘κ·Έλ¨κ³Ό μκ³ λ¦¬μ¦μλ μ μ©λ μ μμΌλ©°, λκ·λͺ¨ κ³μ°μ μ¬μ©λ©λλ€. νΌλ³΄λμΉ μμ΄μ μνμ λ μ¨μλ₯΄λ νΌλ³΄λμΉμ μ΄λ¦μ λ°μ λͺ
λͺ
λμμΌλ©°, κ·Έμ μ
μ μΌλ‘ μ λͺ
ν©λλ€.<|eot_id|>
Training Details
Training Data
The model is trained on the MarkrAI/KoCommercial-Dataset, which consists of various commercial texts in Korean.
Training Procedure
The model training used LoRA for computational efficiency. 0.04 billion parameters(0.51% of total parameters) were trained.
Training Hyperparameters
################################################################################
# bitsandbytes parameters
################################################################################
load_in_4bit=True
bnb_4bit_compute_dtype=torch_dtype
bnb_4bit_quant_type="nf4"
bnb_4bit_use_double_quant=False
################################################################################
# LoRA parameters
################################################################################
task_type="CAUSAL_LM"
target_modules=["q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj"]
r=16
lora_alpha=32
lora_dropout=0.1
bias="none"
################################################################################
# TrainingArguments parameters
################################################################################
num_train_epochs=2
per_device_train_batch_size=1
gradient_accumulation_steps=1
gradient_checkpointing=True
learning_rate=2e-5
lr_scheduler_type="cosine"
warmup_ratio=0.1
optim = "adamw_torch"
weight_decay=0.01
################################################################################
# SFT parameters
################################################################################
max_seq_length=1024
packing=True
Evaluation
Metrics
- Ko-HellaSwag:
- Ko-MMLU:
- Ko-Arc:
- Ko-Truthful QA:
- Ko-CommonGen V2:
Results
Benchmark | Waktaverse Llama 3 8B | Llama 3 8B |
Ko-HellaSwag: | 0 | 0 |
Ko-MMLU: | 0 | 0 |
Ko-Arc: | 0 | 0 |
Ko-Truthful QA: | 0 | 0 |
Ko-CommonGen V2: | 0 | 0 |
Technical Specifications
Compute Infrastructure
Hardware
- GPU: NVIDIA GeForce RTX 4080 SUPER
Software
- Operating System: Linux
- Deep Learning Framework: Hugging Face Transformers, PyTorch
Training Details
- Training time: 32 hours
- VRAM usage: 12.8 GB
- GPU power usage: 300 W
Citation
Waktaverse-Llama-3
@article{waktaversellama3modelcard,
title={Waktaverse Llama 3 Model Card},
author={AI@Waktaverse},
year={2024},
url = {https://huggingface.co/PathFinderKR/Waktaverse-Llama-3-KO-8B-Instruct}
Llama-3
@article{llama3modelcard,
title={Llama 3 Model Card},
author={AI@Meta},
year={2024},
url = {https://github.com/meta-llama/llama3/blob/main/MODEL_CARD.md}
}
Ko-Llama3-Luxia-8B
@article{kollama3luxiamodelcard,
title={Ko Llama 3 Luxia Model Card},
author={AILabs@Saltux},
year={2024},
url={https://huggingface.co/saltlux/Ko-Llama3-Luxia-8B/blob/main/README.md}
}
Model Card Authors
[More Information Needed]
Model Card Contact
[More Information Needed]