Miko Mistral 7B V3
Art by Nahraya (commissioned by me!)
This is the third iteration of the Miko model. This time, I'm revisiting Mistral 7B.
Compared to V1, it's already a lot better. Maybe even slightly better than V2 despite this training on less data than before (I'm guessing the other datasets I collected weren't entirely clean).
Feel free to provide feedback!
Dataset
I kept it pretty lean this time. V2 had around like 35,000 rows. This time, I'm just using Stheno v1.1 filtered dataset + My anonymized discord chat logs.
| Dataset | Rows |
|---|---|
| Stheno v1.1 Filtered Dataset | 26,765 |
| Anonymized Discord Chat Logs Dataset | 2,576 |
Dataset HF Links
anthracite-org/stheno-filtered-v1.1
Training Details
The entire training took 12 hours on my RTX 3090, which was underclocked and operating at a steady temp (60 degrees celsius).
Axolotl Config
base_model: mistralai/Mistral-7B-v0.1
model_type: MistralForCausalLM
tokenizer_type: AutoTokenizer
chat_template: jinja
chat_template_jinja: |
{{- bos_token }}
{%- for message in messages %}
{%- if message['role'] == 'system' %}
{{- message['content'] + '\n\n' }}
{%- elif message['role'] == 'user' %}
{{- '### Instruction:\n' + message['content'] + '\n\n' }}
{%- elif message['role'] == 'assistant' %}
{{- '### Response:\n' + message['content'] | trim + eos_token + '\n\n' }}
{%- endif %}
{%- endfor %}
{%- if add_generation_prompt %}
{{- '### Response:\n' }}
{%- endif %}
load_in_4bit: true
adapter: qlora
# Training settings
micro_batch_size: 1
gradient_accumulation_steps: 8
num_epochs: 1
lr_scheduler: cosine
learning_rate: 0.0002
optimizer: adamw_bnb_8bit
bf16: true
tf32: true
gradient_checkpointing: true
gradient_checkpointing_kwargs:
use_reentrant: false
output_dir: ./outputs/mistral-7b
dataset_prepared_path: ./last_run_prepared/mistral-7b
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
evals_per_epoch: 1
save_steps: 100
weight_decay: 0.01
special_tokens:
pad_token: "<unk>"
eot_tokens:
- "</s>"
train_on_eot: turn
sequence_len: 8192
sample_packing: true
lora_r: 32
lora_alpha: 32
lora_dropout: 0
lora_target_linear: true
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/stheno/stheno_data_filtered_v1.1.jsonl
ds_type: json
type: chat_template
field_messages: messages
- path: datasets/openai/miko_v1/miko_v1_data.jsonl
ds_type: json
type: chat_template
field_messages: messages
Template
The model was trained on Alpaca-style instruct formatting. You can use it the instruct way:
{system_prompt}
### Instruction:
{input}
### Response:
{output}
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:
### Instruction:
{system_prompt}
[The following is a lengthy and interesting chat message log between RiceRoll and KoboldGPT.]
### Response:
User: Hello!
KoboldGPT:
You can also still use the same prompting style recommended and talked about in v1.