# Question about llama fine tuning dataset token string

**URL:** <https://discuss.huggingface.co/t/question-about-llama-fine-tuning-dataset-token-string/155584>\
**Category:** Beginners\
**Created:** [May 16, 2025, 9:00pm UTC](https://discuss.huggingface.co/t/question-about-llama-fine-tuning-dataset-token-string/155584 "2025-05-16T21:00:22Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [May 17, 2025, 6:38am UTC](https://discuss.huggingface.co/t/question-about-llama-fine-tuning-dataset-token-string/155584/2 "2025-05-17T06:38:50Z")

</div>

Not limited to \<\>, special characters that have no meaning in themselves should not be passed unless there is a specific intention to do so. Generally, it is better to have as little noise as possible in data. For chat or writing models, it is better not to pass non-conversational character strings. (This does not apply when \<\> has a specific meaning, such as the emoticon \>\_\<.)

However, when training a model, Chat Templates or special tokens are important, but their assignment should be automated to some extent by the Tokenizer. (This is the default behavior unless explicitly specified.)

> [@SFT Trainer and chat templates](https://discuss.huggingface.co/t/sft-trainer-and-chat-templates/147205):
>
> Hello I’m implementing a framework for fine-tuning various LLMs using the TRL library’s SFTTrainer. I have a question about how chat templates work: When using SFTTrainer with datasets in the standard formats (with “messages” array or “prompt”/“completion” fields), does the trainer automatically apply the tokenizer’s chat\_template? The documentation suggests it does. For models whose tokenizers don’t have a chat\_template attribute set (or it’s empty), what template does SFTTrainer apply by def…

> **[Templates](https://huggingface.co/docs/transformers/main/en/chat_templating)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

> **[Train a Llama model from scratch](https://huggingface.co/blog/nroggendorff/train-with-llama-architecture)**
>
> A Blog post by Noa Roggendorff on Hugging Face

> **[Introduction - Hugging Face LLM Course](https://huggingface.co/learn/llm-course/chapter1/1)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

---

_[View the full topic](https://discuss.huggingface.co/t/question-about-llama-fine-tuning-dataset-token-string/155584)._
