File size: 4,379 Bytes
2972ebe
 
 
 
 
 
 
 
 
 
 
 
78b2b8c
 
 
2972ebe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78b2b8c
 
 
 
2972ebe
 
 
 
 
78b2b8c
 
 
 
 
 
 
 
 
 
 
 
 
 
799d253
 
78b2b8c
 
 
2972ebe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
---
license: apache-2.0
language:
- ko
base_model:
- Qwen/Qwen2.5-14B-Instruct
---

# Announcing OLAFv2: The Next Step in Korean Language Understanding πŸš€

We are thrilled to announce the release of **OLAFv2**, our state-of-the-art Korean language model, now available on Hugging Face! πŸŽ‰ Designed to excel in complex reasoning, mathematical problem-solving, and general language understanding, OLAFv2 represents a significant leap forward in NLP capabilities for the Korean language.


![image/png](https://cdn-uploads.huggingface.co/production/uploads/650c0029987b1ae4e51fa2d4/KxAsxe10pZkaqC6x82qH3.png)

## Key Features of OLAFv2 🌟

### **Two Model Sizes for Flexibility**
OLAFv2 is available in two parameter sizes:
- **14B (Billion) Parameters**: For maximum performance. πŸ‹οΈβ€β™‚οΈ
- **1.5B (Billion) Parameters**: For lightweight applications and hardware-constrained environments. πŸͺΆ

### **Reasoning Mode for Complex Tasks** πŸ€”
One of OLAFv2's standout features is its **Reasoning Mode**, specifically designed for:
- Complex mathematical problem-solving. βœ–οΈβž—
- STEM (Science, Technology, Engineering, Mathematics) applications. πŸ”¬πŸ“
- Tasks requiring detailed step-by-step reasoning. 🧠

This mode can be effectively utilized for **Test-Time Scaling**, enabling the model to harness additional computational resources during inference. This approach enhances output detail and accuracy, achieving performance levels that surpass GPT-4o. πŸ“ˆ


![image/png](https://cdn-uploads.huggingface.co/production/uploads/650c0029987b1ae4e51fa2d4/aZlD94ZAqxePTaGdb4TQ8.png)


### **Long Context Support** πŸ“œ
With support for up to **32K tokens**, OLAFv2 is perfect for:
- Retrieval-Augmented Generation (RAG). πŸ› οΈ
- Tasks requiring long-context understanding and reasoning. 🧡

## Benchmarks and Performance πŸ“Š

We share evaluation results across three benchmarks, KMMLU, HRM8K and LogicKor.

<div style="text-align: center;">
    <img src="https://cdn-uploads.huggingface.co/production/uploads/650c0029987b1ae4e51fa2d4/rCloMEgq16D8-UuCkM8Pa.png" width="700px" height="450px" title="polyglot_budget" alt="polyglot_budget"/>
</div>


We also share results with inference-time scaling. For more details have a look into our [blog](https://www.onelineai.com/blog/test-time-scaling).

<!-- ![alt-text-1](https://cdn-uploads.huggingface.co/production/uploads/650c0029987b1ae4e51fa2d4/Qa2-91s0nvwIsx0cjRM-W.png "title-1") ![alt-text-2](https://cdn-uploads.huggingface.co/production/uploads/650c0029987b1ae4e51fa2d4/8eATw4sMb-OrgqhRujR0z.png "title-2") -->

<div style="display: flex; justify-content: space-between; align-items: center;">
  <img src="https://cdn-uploads.huggingface.co/production/uploads/650c0029987b1ae4e51fa2d4/Qa2-91s0nvwIsx0cjRM-W.png" alt="alt-text-1" title="title-1" style="width: 48%;"/>
  <img src="https://cdn-uploads.huggingface.co/production/uploads/650c0029987b1ae4e51fa2d4/8eATw4sMb-OrgqhRujR0z.png" alt="alt-text-2" title="title-2" style="width: 48%;"/>
</div>


## Getting Started πŸš€
OLAFv2 is now available on Hugging Face! You can start using it by accessing our repository:

```python
# pip install transformers
from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "OLAResearch/OLAF2-14B"

model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype="auto",
    device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)

prompt = "introduce yourself!"
messages = [
    {"role": "system", "content": "You're name is OLAF. A large language model made by OneLineAI, specializing in Korean culture and finance."},
    # for reasoning mode
    #{"role": "system", "content": "You're name is OLAF. A large language model made by OneLineAI, specializing in Korean culture and finance.Perform two-step reasoning. Return your answers in \\boxed{N} format."},
    {"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)

generated_ids = model.generate(
    **model_inputs,
    max_new_tokens=512
)
generated_ids = [
    output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]

response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
```