Miko Llama 3 8B V2
Art by Nahraya (commisioned by me!)
This is the second iteration of the Miko model. This time, we are using Llama 3 8B as our base model. Overall, this is a huge improvement over Miko v1 (ricer0ll/Miko-v1-m7).
I notice significant improvements in terms of personality, roleplaying, characterizations, and storytelling. Not that this matters, but it can do NSFW stuff pretty well.
Feel free to provide feedback!
Dataset
In addition to the refined conversational dataset from my v1, I also introduced a ton of roleplaying and storytelling datasets.
| Dataset | Rows |
|---|---|
| PIPPA Smoll | 38,199 (only 5,000 rows selected) |
| Augmental | 7,831 |
| LimaRP | 31 (Small subset of the original) |
| Sonnet Charcard | 9,736 |
| Stheno v1.1 Dataset | 26,765 (only 10,000 rows selected) |
| Miko v1 Dataset | 2,576 |
Dataset HF Links
Xilabs/PIPPA-alpaca
Heralax/Augmental-Dataset
PJMixers/lemonilia_LimaRP-Only-NonSus-Simple-CustomShareGPT
Gryphe/Sonnet3.5-Charcard-Roleplay
anthracite-org/stheno-filtered-v1.1
Training Details
Unlike how I trained before, I am no longer fine-tuning an instruct model. Instead, I am training from the ground up with a base model. The entire training took ~1.5 days on my RTX 3090, which was underclocked and operating at a steady temp (60 degrees celsius).
Halfway through, I realized that a good portion of the training time was literally from the evaluation step, and I had accidentally set the evaluation size too large (10%). So whenever it performed evaluation, it took like 3 hours each (goddammit)...
So you will see a weird dip in the middle in my Eval Loss graph, since I stopped halfway to fix the axolotl config.
Axolotl Config
base_model: NousResearch/Meta-Llama-3-8B
model_type: LlamaForCausalLM
tokenizer_type: AutoTokenizer
load_in_4bit: true
adapter: qlora
micro_batch_size: 1
gradient_accumulation_steps: 8
num_epochs: 2
lr_scheduler: cosine
learning_rate: 0.00004
optimizer: adamw_bnb_8bit
bf16: auto
tf32: false
gradient_checkpointing: true
resume_from_checkpoint:
auto_resume_from_checkpoints: true
logging_steps: 1
attn_implementation: flash_attention_2
loss_watchdog_threshold: 5.0
loss_watchdog_patience: 3
warmup_ratio: 0.1
val_set_size: 0.01 # was 0.1
evals_per_epoch: 2
save_steps: 200
weight_decay: 0.0
special_tokens:
pad_token: "<|end_of_text|>"
sequence_len: 8192
excess_length_strategy: truncate
sample_packing: true
lora_r: 16
lora_alpha: 16
lora_dropout: 0.05
lora_target_modules:
- gate_proj
- down_proj
- up_proj
- q_proj
- v_proj
- k_proj
- o_proj
# All datasets were converted to OpenAI format
datasets:
- path: datasets/openai/pippa_smol/smol_pippa_named_users.jsonl
ds_type: json
type: chat_template
field_messages: messages
split: train[:5000]
- path: datasets/openai/augmental/final_dataset.jsonl
ds_type: json
type: chat_template
field_messages: messages
- path: datasets/openai/limarp/blackdahliaroleplaying-one-on-one-roleplays-short-Simple-CustomShareGPT.jsonl
ds_type: json
type: chat_template
field_messages: messages
- path: datasets/openai/limarp/darknestfantasy-short-Simple-CustomShareGPT.jsonl
ds_type: json
type: chat_template
field_messages: messages
- path: datasets/openai/limarp/innersanctum-fetishdungeon-long-Simple-CustomShareGPT.jsonl
ds_type: json
type: chat_template
field_messages: messages
- path: datasets/openai/limarp/theinnersanctum-torture-chamber-short-Simple-CustomShareGPT.jsonl
ds_type: json
type: chat_template
field_messages: messages
- path: datasets/openai/sonnet_charcard/sonnet35-charcard-roleplay-sharegpt.jsonl
ds_type: json
type: chat_template
field_messages: messages
- path: datasets/openai/stheno/stheno_data_filtered_v1.1.jsonl
ds_type: json
type: chat_template
field_messages: messages
split: train[:10000]
- path: datasets/openai/miko_v1/miko_v1_data.jsonl
ds_type: json
type: chat_template
field_messages: messages
chat_template: llama3

Merge Details
The Llama 3 8B base model was trained and then merged with a Llama 3 8B Instruct. This enables the model to perform general tasks and logical tasks as well!
In the future, I might play around and merge other models as well.
models:
- model: meta-llama/Meta-Llama-3-8B-Instruct
- model: Miko-V2-L3-8B-Base # My trained Llama 3 8B base model
parameters:
density: 0.7
weight: 0.5
merge_method: ties
base_model: meta-llama/Meta-Llama-3-8B-Instruct
parameters:
normalize: true
int8_mask: true
rescale: true
dtype: bfloat16
Template
The model was trained on Llama 3's instruct tokens. You can use it the instruct way:
<|begin_of_text|><|start_header_id|>system<|end_header_id|>
{system_prompt}<|eot_id|><|start_header_id|>user<|end_header_id|>
{input}<|eot_id|><|start_header_id|>assistant<|end_header_id|>
{output}<|eot_id|>
You can also use it the chatting/conversational way by providing a chat log style prompting. Here's an example from KoboldCPP's Chat Mode:
<|start_header_id|>user<|end_header_id|>
{system_prompt}
[The following is a lengthy and interesting chat message log between RiceRoll and KoboldGPT.]
<|eot_id|><|start_header_id|>assistant<|end_header_id|>
User: Hello!
KoboldGPT:
You can also still use the same prompting style recommended and talked about in v1.