axolotl version: 0.10.0
base_model: Qwen/Qwen3-8B
model_type: Qwen3ForCausalLM
tokenizer_type: AutoTokenizer
load_in_8bit: false
load_in_4bit: false
# ============================================================================
# Qwen3-8B port of fullft-othello-snake-8b-multi-format-replay.yaml (originally
# Llama-3.1-8B-Instruct; see also the Qwen2.5-7B variant). Same recipe: full FT
# of the Othello-snake task WITH a chat-data replay mix to fight catastrophic
# forgetting of instruction-following. Two data sources are mixed:
# 1. The game, as a raw `input_output` continuation document (masked prefix),
# MULTI-FORMAT variant (~70% space-separated moves + ~5% each of several
# alternative notations).
# 2. A general chat replay set (Tulu-3 subset) as `type: chat_template`.
#
# QWEN3-SPECIFIC NOTES (differ from the Llama / Qwen2.5 configs):
# * model_type Qwen3ForCausalLM, model_type "qwen3". REQUIRES a transformers /
# axolotl new enough to know Qwen3 (older releases raise "does not recognize
# architecture qwen3"). Verify on the cluster before launching.
# * Qwen3 shares Qwen2.5's vocab: NO BOS token; base document terminator is
# <|endoftext|> (151643). The post-trained Qwen3-8B chat eos is <|im_end|>
# (151645); pad is <|endoftext|>.
# * The game dataset MUST be the Qwen-tokenized rebuild (no BOS, <|endoftext|>
# terminator), NOT the llama3 dataset. Build it with:
# python data/push_input_output_dataset.py --model-family qwen3 \
# --repo cfierro/othello-snake-qwen3-multi-format
# (Qwen3 base terminator confirmed from Qwen/Qwen3-8B-Base config.json:
# eos_token_id 151643 == <|endoftext|>.)
# * Chat replay uses tokenizer_default -> Qwen3's built-in chat template. Qwen3
# is a THINKING model: its template supports <think>...</think> blocks. The
# Tulu-3 replay has no thinking content, so it trains as plain (non-thinking)
# assistant turns. CONFIRM with `axolotl preprocess ... --debug` that the
# replay rows don't get spurious empty <think></think> spans trained; if they
# do, switch this to `chat_template: chatml` or a custom jinja template.
# ============================================================================
chat_template: tokenizer_default # Qwen3's built-in ChatML(+thinking) template
datasets:
# --- Game shards (template-free, loss-masked continuation, multi-format) ---
# QWEN-tokenized rebuild (--model-family qwen3), NOT the llama3 dataset. The
# first shard is sliced to hold out its last 500 games for a game-ONLY
# validation set (see test_datasets below). The other three shards are full.
- path: cfierro/othello-snake-qwen3-multi-format
type: input_output
split: games_0_5k[:-500]
- path: cfierro/othello-snake-qwen3-multi-format
type: input_output
split: games_5k_10k
- path: cfierro/othello-snake-qwen3-multi-format
type: input_output
split: games_10k_25k
- path: cfierro/othello-snake-qwen3-multi-format
type: input_output
split: games_25k_50k
# --- Replay: general chat data (re-tokenized with Qwen3's chat template) ---
- path: cfierro/tulu3-sft-replay
type: chat_template
field_messages: messages
split: train
train_on_inputs: false # game: segment labels apply; chat: mask user, train assistant
dataset_prepared_path: /scratch/project/eu-26-55/knowledge-ft/axolotl/datasets/qwen3-8b/othello-snake-multi-format-replay
output_dir: /scratch/project/eu-26-55/knowledge-ft/axolotl/models/qwen3-8b-fft-othello-snake-multi-format-replay-1e-5
sequence_len: 1024 # games are short; replay was filtered to <=1024 tokens
sample_packing: true # pack many short docs per sequence (block-diagonal attn)
eval_sample_packing: false
# --- Validation loss on GAME DATA ONLY ---
# val_set_size: 0 disables the default carve (which would mix game + chat into the
# val set). test_datasets points eval exclusively at a held-out slice of game data,
# so eval_loss == game performance and drives load_best_model_at_end below.
# NOTE: the split-slicing syntax (`[:-500]` / `[-500:]`) requires your Axolotl to
# forward `split` to load_dataset (verify once with `axolotl preprocess ... --debug`).
val_set_size: 0
test_datasets:
- path: cfierro/othello-snake-qwen3-multi-format
type: input_output
split: games_0_5k[-500:]
wandb_project: othello-snake-ft
wandb_entity: cfierro
wandb_watch:
wandb_name: qwen3-8b-fft-othello-snake-multi-format-replay-1e-5
wandb_log_model: "false"
# --- Multi-GPU: 4x A40 (48GB) per node ---
# Full FT of an 8B model needs ZeRO-3 to shard weights+grads+optimizer.
# Effective batch = 4 GPUs * micro 4 * grad_accum 1 = 16 packed sequences.
# Qwen3-8B (~8.2B) is about the size of Llama-8B, so the Llama batch dims should
# fit; recompute exact steps with `axolotl preprocess`.
gradient_accumulation_steps: 1
micro_batch_size: 4
num_epochs: 2 # lowered from 3: replay + fewer epochs both reduce forgetting
save_strategy: epoch
eval_strategy: epoch # must match save_strategy for load_best_model_at_end
# --- Auto-upload the BEST (lowest game eval_loss) checkpoint to the Hub ---
# eval_loss here is GAME-ONLY (see test_datasets), so "best" is selected on game
# performance, not on how chatty the model is. Needs a write-scoped HF token on the
# cluster (HF_TOKEN or `huggingface-cli login`).
load_best_model_at_end: true
metric_for_best_model: eval_loss
greater_is_better: false
hub_model_id: cfierro/qwen3-8b-fft-othello-snake-multi-format-replay-1e-5
hub_strategy: end
hub_private_repo: false
optimizer: adamw_bnb_8bit
lr_scheduler: cosine
learning_rate: 1e-5 # lowered from 2e-5 to reduce drift away from the base model
bf16: auto
tf32: false
gradient_checkpointing: true
resume_from_checkpoint:
logging_steps: 1
flash_attention: true
warmup_ratio: 0.03
save_total_limit: 3 # keep all per-epoch checkpoints; best is always retained
weight_decay: 0.0
special_tokens:
pad_token: "<|endoftext|>" # Qwen3 pad/document terminator (NOT <|end_of_text|>)
# DeepSpeed ZeRO Stage 3 — shards weights, gradients, and optimizer across GPUs
deepspeed: deepspeed_configs/zero3.json
# Verify the data mix + loss mask before training:
# axolotl preprocess axolotl_configs/fullft-othello-snake-qwen3-8b-multi-format-replay.yaml --debug
# Confirm: game rows show the masked prefix (-100) + trained moves ending in a
# SINGLE <|endoftext|> token (id 151643), NOT a shattered <|end_of_text|>; chat
# rows show masked user/system turns (ChatML) + trained assistant turns with no
# spurious <think></think> spans.
qwen3-8b-fft-othello-snake-multi-format-replay-1e-5
This model is a fine-tuned version of Qwen/Qwen3-8B on the cfierro/othello-snake-qwen3-multi-format, the cfierro/othello-snake-qwen3-multi-format, the cfierro/othello-snake-qwen3-multi-format, the cfierro/othello-snake-qwen3-multi-format and the cfierro/tulu3-sft-replay datasets. It achieves the following results on the evaluation set:
- Loss: 0.2137
Model description
More information needed
Intended uses & limitations
More information needed
Training and evaluation data
More information needed
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 1e-05
- train_batch_size: 4
- eval_batch_size: 4
- seed: 42
- distributed_type: multi-GPU
- num_devices: 4
- total_train_batch_size: 16
- total_eval_batch_size: 16
- optimizer: Use OptimizerNames.ADAMW_BNB with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
- lr_scheduler_type: cosine
- lr_scheduler_warmup_steps: 54
- training_steps: 1828
Training results
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| No log | 0 | 0 | 1.1383 |
| 0.4772 | 1.0 | 914 | 0.2170 |
| 0.3519 | 2.0 | 1828 | 0.2137 |
Framework versions
- Transformers 4.57.3
- Pytorch 2.9.0+cu128
- Datasets 3.5.0
- Tokenizers 0.22.2