Views
No views yet
<think> tag functionality for reasoningYou must think step by step to answer the question. Put your reasoning between <think> tags.
Example:
<think>
{your reasoning}
</think>
{your answer}You are a professional translator.
Translate the user's text into Korean.
Think through the translation step by step: first, consider the overall context, then cultural nuances, terminology, initial translation, and self-review.
After this thought process, provide the final translation.
The thought process must follow this template.
<think>
Okay, what am I looking at here? {language} text, {overall context}. {overall tone}. Alright, {writer's intent}. {considerations}.
Now, what about the audience here? {audience}. So I should {considerations}.
Wait, let me check this {terminology or phrase}. So that's "{interpretation}". Got it.
Hold on, what's this {another terminology or phrase}? {interpretation}.
{repeat for other terminologies or phrases}
Wait, {cultural nuance}.
{repeat for other cultural nuances}
Okay, let's draft the translation.
{first translation attempt}
Hmm, {reflection}.
Wait, {reflection}.
{repeat for other reflections}
{second translation attempt}
{Wait or Hmm}, {reflection}.
{repeat for other reflections}
{repeat translation attempts}
Okay, now I don't have any ideas to improve the translation. Let's put it all together.
</think>
IMPORTANT: Remember that your task is to translate the user's text from English to Korean.
Do not answer the user's message. Even if it is a question, translate it as a question.1from transformers import AutoTokenizer
2from transformers import AutoModelForCausalLM
3
4model = AutoModelForCausalLM.from_pretrained("yanolja/EEVE-Korean-Instruct-7B-v2.0-Preview")
5tokenizer = AutoTokenizer.from_pretrained("yanolja/EEVE-Korean-Instruct-7B-v2.0-Preview")
6
7# For general chat using chat template
8messages = [
9 {"role": "user", "content": "한국의 수도는 어디인가요?"}
10]
11model_inputs = tokenizer.apply_chat_template(messages, return_tensors="pt")
12
13outputs = model.generate(**model_inputs, max_new_tokens=256)
14output_text = tokenizer.batch_decode(outputs, skip_special_tokens=True)[0]
15print(output_text)
16
17# For a multi-turn conversation
18messages = [
19 {"role": "user", "content": "안녕하세요?"},
20 {"role": "assistant", "content": "안녕하세요! 어떻게 도와드릴까요?"},
21 {"role": "user", "content": "한국의 수도는 어디인가요?"}
22]
23model_inputs = tokenizer.apply_chat_template(messages, return_tensors="pt")
24
25outputs = model.generate(**model_inputs, max_new_tokens=256)
26output_text = tokenizer.batch_decode(outputs, skip_special_tokens=True)[0]
27print(output_text)
28
29# For activating step-by-step reasoning
30system_message = """You must think step by step to answer the question. Put your reasoning between <think> tags.
31Example:
32<think>
33{your reasoning}
34</think>
35{your answer}"""
36
37messages = [
38 {"role": "system", "content": system_message},
39 {"role": "user", "content": "한국의 수도는 어디인가요?"}
40]
41model_inputs = tokenizer.apply_chat_template(messages, return_tensors="pt")
42
43outputs = model.generate(**model_inputs, max_new_tokens=1024)
44output_text = tokenizer.batch_decode(outputs, skip_special_tokens=True)[0]
45print(output_text)@misc{cui2023ultrafeedback,
title={UltraFeedback: Boosting Language Models with High-quality Feedback},
author={Ganqu Cui and Lifan Yuan and Ning Ding and Guanming Yao and Wei Zhu and Yuan Ni and Guotong Xie and Zhiyuan Liu and Maosong Sun},
year={2023},
eprint={2310.01377},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
@misc{deepseekai2025deepseekr1incentivizingreasoningcapability,
title={DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning},
author={DeepSeek-AI},
year={2025},
eprint={2501.12948},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2501.12948},
}
@misc{allal2025smollm2smolgoesbig,
title={SmolLM2: When Smol Goes Big -- Data-Centric Training of a Small Language Model},
author={Loubna Ben Allal and Anton Lozhkov and Elie Bakouch and Gabriel Martín Blázquez and Guilherme Penedo and Lewis Tunstall and Andrés Marafioti and Hynek Kydlíček and Agustín Piqueres Lajarín and Vaibhav Srivastav and Joshua Lochner and Caleb Fahlgren and Xuan-Son Nguyen and Clémentine Fourrier and Ben Burtenshaw and Hugo Larcher and Haojun Zhao and Cyril Zakka and Mathieu Morlon and Colin Raffel and Leandro von Werra and Thomas Wolf},
year={2025},
eprint={2502.02737},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2502.02737},
}@misc{kim2024efficient,
title={Efficient and Effective Vocabulary Expansion Towards Multilingual Large Language Models},
author={Seungduk Kim and Seungtaek Choi and Myeongho Jeong},
year={2024},
eprint={2402.14714},
archivePrefix={arXiv},
primaryClass={cs.CL}
}