Downloads · 30 days
11
18% of all-time downloads
cfierro/llama-3.1-8b-fft-othello-multi-format-replay-1e-5
llama-3.1-8b-fft-othello-multi-format-replay-1e-5 is a text generation model from cfierro. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as llama3.1.
should probably proofread and complete it, then remove this comment. --
Downloads · 30 days
11
18% of all-time downloads
All-time downloads
60
Public
Parameters
266K
16.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors16.1 GB · 100%
From the Hugging Face model README
axolotl version: 0.10.0
base_model: meta-llama/Llama-3.1-8B-Instruct
model_type: LlamaForCausalLM
tokenizer_type: AutoTokenizer
load_in_8bit: false
load_in_4bit: false
# ============================================================================
# Full FT on REAL Othello (Li et al.'s synthetic distribution), multi-format.
# The Othello twin of fullft-othello-snake-8b-multi-format-replay.yaml: same
# masked prefix, same seven move-notation formats, same `input_output` masking —
# only the game changes, so the two runs are directly comparable.
# Data: data/push_othello_dataset.py -> data/push_input_output_dataset.py --game othello
# ============================================================================
# --- Dataset: continued pre-training with a masked constant prefix ---
# `segments`: "<|begin_of_text|>Game of bjk\n\n" is label:false (context, not in
# the loss); the formatted moves + <|end_of_text|> are label:true (trained).
#
# SCALE — read before launching. The full train split is 20,000,000 games, i.e.
# the paper's scale, NOT Snake-Othello's 50k. Measured on the real dataset:
# * a game averages 186 Llama-3 tokens in the multi-format mix (127 for the
# ~70% fixed_prefix rows; the labelled formats run 2-3x longer)
# -> ~3.73B trained tokens over 20M games
# * effective batch = 4 GPUs * micro 4 * accum 1 = 16 packed sequences of 1024
# = 16,384 tokens/step -> ~227,000 steps per epoch (Snake-Othello 50k: ~320)
# * at ~3-5 s/step that is ~2 weeks game-only, ~4 weeks with the 1:1 chat replay
# So pick the scale deliberately by SLICING the split (never by editing the
# dataset), and keep the replay budget below in step with it:
# split: train[:50000] # ~1,137 steps w/ replay, ~1-2 h <- start here
# split: train[:200000] # ~4,550 steps w/ replay, ~4-6 h
# split: train[:500000] # ~11,374 steps w/ replay, ~10-16 h
# Starting at 50k also makes the game count identical to the Snake-Othello runs,
# so the first comparison is like-for-like; scale up only once the valid-move
# curve says more games would help.
# Keep num_epochs at 1: with 20M unique games there is no shortage of fresh data,
# so a second epoch is pure repetition — spend the budget on more games instead.
datasets:
- path: cfierro/othello-llama3-multi-format
type: input_output
split: train[:50000]
# --- Replay: general chat data (Llama-3 chat-template formatted) ---
# Reuses the EXISTING subset, exactly as the snake configs do — no rebuild
# needed to launch. Note the ratio it lands on, though: that subset was sized
# against the snake budget (5.35M trained tokens), while 50k Othello games are
# ~9.3M tokens (60 moves/game vs ~33), so this is ~0.6:1 chat:game rather than
# the 1:1 the snake full-FT run used. If instruction-following degrades, top it
# up to a true 1:1 (a few minutes) and point this entry at the new repo:
# python data/push_replay_subset.py --game_tokens 9300000 --ratio 1 \
# --repo cfierro/tulu3-sft-replay-othello
# Any change to the game slice above changes --game_tokens: 186 tokens/game.
- path: cfierro/tulu3-sft-replay
type: chat_template
field_messages: messages
split: train
chat_template: llama3
train_on_inputs: false # REQUIRED for input_output masking to take effect
dataset_prepared_path: /projects/nlp/data/constanzam/learning-facts/axolotl/datasets/llama-3.1-8b/othello-multi-format-replay
output_dir: /projects/nlp/data/constanzam/learning-facts/axolotl/models/llama-3.1-8b-fft-othello-multi-format-replay-1e-5
sequence_len: 1024 # games are ~127 tokens; long context is unused here
sample_packing: true # pack many short games per sequence (block-diagonal attn)
eval_sample_packing: false
# --- Validation on held-out GAMES ---
# NOT the `test` split: that one is reserved for the actual evaluation
# (data/prepare_othello_eval_dataset.py expands its first 5,000 games into the
# valid-move eval sets). load_best_model_at_end selects a checkpoint on whatever
# is named here, so pointing it at `test` would be selecting on the test set.
#
# Validation comes from the FAR END of the train split instead. Those games are
# unseen as long as the training slice above does not reach them, and a negative
# slice stays correct however far that slice is scaled up.
#
# 500 games, the same count the snake runs validate on — and already a sharper
# signal, since an Othello game is ~60 moves (~186 tokens) against snake's ~33
# (~150), so 500 games here is ~93k eval tokens vs ~50k there. eval_sample_packing
# is off, so each game is its own sequence: 500 games = ~31 eval passes/epoch.
# val_set_size: 0 disables the random carve, which would otherwise mix game +
# chat rows into the val set.
val_set_size: 0
test_datasets:
- path: cfierro/othello-llama3-multi-format
type: input_output
split: train[-500:]
wandb_project: othello-ft
wandb_entity: cfierro
wandb_watch:
wandb_name: llama-3.1-8b-fft-othello-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.
# Confirm the real step count with `axolotl preprocess ... --debug` before
# committing a multi-day run.
gradient_accumulation_steps: 1
micro_batch_size: 4
num_epochs: 2 # same as the snake multi-format+replay run
save_strategy: epoch
eval_strategy: epoch # must match save_strategy for load_best_model_at_end
# NOTE: epoch-granular save/eval only works while the run is short. If the game
# slice above is scaled to where an epoch is tens of thousands of steps, switch to
# save_strategy: steps / save_steps: N / eval_strategy: steps / eval_steps: N
# (N must divide evenly, and must be < total steps or nothing is ever saved and
# load_best_model_at_end has no checkpoint to restore), and drop num_epochs to 1 —
# with 20M unique games a second pass is pure repetition.
load_best_model_at_end: true
metric_for_best_model: eval_loss
greater_is_better: false
# Needs a write-scoped HF token on the cluster (HF_TOKEN or `huggingface-cli login`).
hub_model_id: cfierro/llama-3.1-8b-fft-othello-multi-format-replay-1e-5
hub_strategy: end
hub_private_repo: false
optimizer: adamw_bnb_8bit
lr_scheduler: cosine
learning_rate: 1e-5 # matches the snake multi-format run, for comparability
bf16: auto
tf32: false
gradient_checkpointing: true
resume_from_checkpoint:
logging_steps: 1
flash_attention: true
warmup_ratio: 0.03
save_total_limit: 3
weight_decay: 0.0
special_tokens:
pad_token: <|end_of_text|>
# DeepSpeed ZeRO Stage 3 — shards weights, gradients, and optimizer across GPUs
deepspeed: deepspeed_configs/zero3.json
# NOTE ON CHAT REPLAY. Chat data is NOT the binding constraint — compute is.
# allenai/tulu-3-sft-mixture has ~939k conversations, so a 1:1 replay is available
# well past any game scale that fits in a reasonable run; push_replay_subset.py
# sizes the subset by tokens (--game_tokens / --ratio), so it follows whatever
# slice is set above. What is NOT affordable is the full 20M games: at 1:1 that is
# ~7.5B tokens of training. Keep the slice and the --game_tokens budget in sync,
# or the replay ratio silently drifts and instruction-following degrades (the
# game-only snake run collapsed to emitting nothing but moves).
# Verify the data + loss mask before training:
# axolotl preprocess axolotl_configs/fullft-othello-8b-multi-format-replay.yaml --debug
# Confirm the prefix tokens show -100 (masked) and the move tokens + <|end_of_text|>
# are trained, and that the player-labelled formats show non-alternating colours on
# the ~34% of games that contain a pass.
</details><br>
This model is a fine-tuned version of meta-llama/Llama-3.1-8B-Instruct on the cfierro/othello-llama3-multi-format and the cfierro/tulu3-sft-replay datasets. It achieves the following results on the evaluation set:
More information needed
More information needed
More information needed
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| No log | 0 | 0 | 1.5235 |
| 0.7283 | 1.0 | 1061 | 0.8399 |
| 0.5345 | 2.0 | 2122 | 0.8234 |