How to convert from base to instruct

How do I convert a base model to an instruct model? so far I tried unsloth and ms-swift and it didn’t work.

llama3.1 8b base → instruct

I know some instruct fine tuning is involved but then the model that is produced won’t have <|eot_id|> as eos or correct chat template in the tokenizer_config.json… I manually edited the files but it doesn’t seem to work.

I achieved proper answers but it doesn’t seem to end with <|eot_id|>. Do I have to fine tune for days and days to see it properly end?

1 Like

Hi, I wanted to ask—when converting a base language model into an instruction-tuned model, is it possible to do so without causing catastrophic forgetting? Specifically, I’m concerned about whether the model retains the knowledge it acquired during continued pretraining, or if that information is lost during the instruction tuning process.

and also can i know the data format you used for instruction tuning.

1 Like

If LoRA alone is insufficient for that purpose, there seems to be a method called FIP

https://www.nature.com/articles/s42256-024-00902-x

The model isn’t ending responses with <|eot_id|> because it wasn’t trained to do so. Just editing the config files afterward doesn’t teach the model when to stop.

Simple Solution:

  1. Make sure every example in your training data ends with <|eot_id|> so the model learns to generate it

  2. Don’t mask out <|eot_id|> during training - let the model learn to predict it

  3. Train with the full chat template format from the start

Instead of starting from base model, try fine-tuning an existing Llama 3.1 instruct model with your specific data. This way the chat format is already learned.

1 Like