Views
No views yet


transformers v4.43.1 or later.1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
3from threading import Thread
4
5model_name = "LGAI-EXAONE/EXAONE-Deep-2.4B"
6streaming = True # choose the streaming option
7
8model = AutoModelForCausalLM.from_pretrained(
9 model_name,
10 torch_dtype=torch.bfloat16,
11 trust_remote_code=True,
12 device_map="auto"
13)
14tokenizer = AutoTokenizer.from_pretrained(model_name)
15
16# Choose your prompt:
17# Math example (AIME 2024)
18prompt = r"""Let $x,y$ and $z$ be positive real numbers that satisfy the following system of equations:
19\[\log_2\left({x \over yz}\right) = {1 \over 2}\]\[\log_2\left({y \over xz}\right) = {1 \over 3}\]\[\log_2\left({z \over xy}\right) = {1 \over 4}\]
20Then the value of $\left|\log_2(x^4y^3z^2)\right|$ is $\tfrac{m}{n}$ where $m$ and $n$ are relatively prime positive integers. Find $m+n$.
21
22Please reason step by step, and put your final answer within \boxed{}."""
23# Korean MCQA example (CSAT Math 2025)
24prompt = r"""Question : $a_1 = 2$인 수열 $\{a_n\}$과 $b_1 = 2$인 등차수열 $\{b_n\}$이 모든 자연수 $n$에 대하여\[\sum_{k=1}^{n} \frac{a_k}{b_{k+1}} = \frac{1}{2} n^2\]을 만족시킬 때, $\sum_{k=1}^{5} a_k$의 값을 구하여라.
25
26Options :
27A) 120
28B) 125
29C) 130
30D) 135
31E) 140
32
33Please reason step by step, and you should write the correct option alphabet (A, B, C, D or E) within \\boxed{}."""
34
35messages = [
36 {"role": "user", "content": prompt}
37]
38input_ids = tokenizer.apply_chat_template(
39 messages,
40 tokenize=True,
41 add_generation_prompt=True,
42 return_tensors="pt"
43)
44
45if streaming:
46 streamer = TextIteratorStreamer(tokenizer)
47 thread = Thread(target=model.generate, kwargs=dict(
48 input_ids=input_ids.to("cuda"),
49 eos_token_id=tokenizer.eos_token_id,
50 max_new_tokens=32768,
51 do_sample=True,
52 temperature=0.6,
53 top_p=0.95,
54 streamer=streamer
55 ))
56 thread.start()
57
58 for text in streamer:
59 print(text, end="", flush=True)
60else:
61 output = model.generate(
62 input_ids.to("cuda"),
63 eos_token_id=tokenizer.eos_token_id,
64 max_new_tokens=32768,
65 do_sample=True,
66 temperature=0.6,
67 top_p=0.95,
68 )
69 print(tokenizer.decode(output[0]))Note
The EXAONE Deep models are trained with an optimized configuration, so we recommend following the Usage Guideline section to achieve optimal performance.
| Models | MATH-500 (pass@1) | AIME 2024 (pass@1 / cons@64) | AIME 2025 (pass@1 / cons@64) | CSAT Math 2025 (pass@1) | GPQA Diamond (pass@1) | Live Code Bench (pass@1) |
|---|---|---|---|---|---|---|
| EXAONE Deep 32B | 95.7 | 72.1 / 90.0 | 65.8 / 80.0 | 94.5 | 66.1 | 59.5 |
| DeepSeek-R1-Distill-Qwen-32B | 94.3 | 72.6 / 83.3 | 55.2 / 73.3 | 84.1 | 62.1 | 57.2 |
| QwQ-32B | 95.5 | 79.5 / 86.7 | 67.1 / 76.7 | 94.4 | 63.3 | 63.4 |
| DeepSeek-R1-Distill-Llama-70B | 94.5 | 70.0 / 86.7 | 53.9 / 66.7 | 88.8 | 65.2 | 57.5 |
| DeepSeek-R1 (671B) | 97.3 | 79.8 / 86.7 | 66.8 / 80.0 | 89.9 | 71.5 | 65.9 |
| EXAONE Deep 7.8B | 94.8 | 70.0 / 83.3 | 59.6 / 76.7 | 89.9 | 62.6 | 55.2 |
| DeepSeek-R1-Distill-Qwen-7B | 92.8 | 55.5 / 83.3 | 38.5 / 56.7 | 79.7 | 49.1 | 37.6 |
| DeepSeek-R1-Distill-Llama-8B | 89.1 | 50.4 / 80.0 | 33.6 / 53.3 | 74.1 | 49.0 | 39.6 |
| OpenAI o1-mini | 90.0 | 63.6 / 80.0 | 54.8 / 66.7 | 84.4 | 60.0 | 53.8 |
| EXAONE Deep 2.4B | 92.3 | 52.5 / 76.7 | 47.9 / 73.3 | 79.2 | 54.3 | 46.6 |
| DeepSeek-R1-Distill-Qwen-1.5B | 83.9 | 28.9 / 52.7 | 23.9 / 36.7 | 65.6 | 33.8 | 16.9 |
TensorRT-LLMvLLMSGLangllama.cppOllamaLM-Studio<thought>\n for reasoning steps. The model's output quality may be degraded when you omit it. You can easily apply this feature by using tokenizer.apply_chat_template() with add_generation_prompt=True. Please check the example code on Quickstart section.<thought>\n...\n</thought> usually have lots of tokens, so previous reasoning steps may be necessary to be removed in multi-turn situation. The provided tokenizer handles this automatically.temperature=0.6 and top_p=0.95 for generation.@article{exaone-deep,
title={EXAONE Deep: Reasoning Enhanced Language Models},
author={{LG AI Research}},
journal={arXiv preprint arXiv:2503.12524},
year={2025}
}