Views
No views yet
google/gemma-3-4b-it was trained at 8K with batch size 4 gradient accumulation 4, so each step was 131,072 tokens (including any padding tokens). It was trained for 160 steps, adding up to a total of 20,971,520 unique tokens seen.1# Requirements before running
2# - Get latest commit of axolotl (currently c0a0c75)
3# - Download these to axolotl/src/axolotl/prompt_formatters
4# - https://github.com/xzuyn/axolotl/blob/came-plus-formatters/src/axolotl/prompt_strategies/formatter_regex.py
5# - https://github.com/xzuyn/axolotl/blob/came-plus-formatters/src/axolotl/prompt_strategies/customcompletion-regex.py
6# - https://github.com/xzuyn/axolotl/blob/came-plus-formatters/src/axolotl/prompt_strategies/customgemma3-regex.py
7# - pip install ftfy
8# - pip install git+https://github.com/xzuyn/CAME.git@sr-grams-cautious-8bit
9
10# Weights and Biases logging config
11wandb_project: Gemma-3-4B
12wandb_entity:
13wandb_watch:
14wandb_name: Gemma-3-Earthen-v0.2-4B-QLoRA-run1
15wandb_log_model:
16
17# Model checkpointing config
18output_dir: ./Outputs/Gemma-3-Earthen-v0.2-4B-QLoRA-run1
19save_steps: 10
20save_safetensors: true
21save_total_limit: 2
22save_only_model: true
23
24# Model architecture config
25base_model: google/gemma-3-4b-it
26model_type: AutoModelForCausalLM
27tokenizer_type: AutoTokenizer
28
29# Mixed precision training config
30bf16: true
31fp16: false
32tf32: false
33
34# Model loading config
35load_in_8bit: false
36load_in_4bit: true
37strict: false
38
39# Sequence config
40sequence_len: 8192
41min_sample_len: 256
42sample_packing: true
43eval_sample_packing: true
44pad_to_sequence_len: true
45train_on_inputs: false
46group_by_length: false
47
48# LoRA adapter config
49adapter: qlora
50lora_model_dir:
51lora_r: 256
52lora_alpha: 256
53lora_dropout: 0.125
54lora_target_modules: 'language_model.model.layers.[\d]+.(mlp|cross_attn|self_attn).(up|down|gate|q|k|v|o)_proj'
55embeddings_skip_upcast: true
56
57# Dataset config
58datasets:
59# Completion
60 # Story-like Data
61 - path: BeaverAI/REDACTED1
62 split: train[:1000]
63 type: customcompletion-regex
64 - path: PJMixers-Dev/Lit-axo-Shuffled
65 split: train[:1000]
66 type: customcompletion-regex
67 - path: PJMixers-Dev/Mielikki_Erebus-87k-axo
68 split: train[:1000]
69 type: customcompletion-regex
70 - path: PJMixers/RyokoAI_Honeyfeed3600-Cleanish
71 split: train[:1000]
72 type: customcompletion-regex
73 - path: BeaverAI/REDACTED2
74 split: train[:1000]
75 type: customcompletion-regex
76 - path: PJMixers-Dev/allura-org_fujin-cleaned-stage-2-axo
77 split: train[:1000]
78 type: customcompletion-regex
79 - path: Nelathan/synthetic-sugar-quill
80 split: train[:1000]
81 type: customcompletion-regex
82 - path: PJMixers-Dev/winglian_visual-novels-json-axo
83 split: train[:1000]
84 type: customcompletion-regex
85 - path: BeaverAI/REDACTED3
86 split: train[:1000]
87 type: customcompletion-regex
88 - path: PJMixers-Dev/recursal_SCP-RECURSAL-Cleaned
89 split: train[:1000]
90 type: customcompletion-regex
91 # Subtitle Data
92 - path: PJMixers-Dev/Subtitles
93 split: train[:1000]
94 type: customcompletion-regex
95 - path: PJMixers-Dev/KaraKaraWitch_AnimeSubtitle-axo
96 split: train[:1000]
97 type: customcompletion-regex
98 # News Data
99 - path: PJMixers-Dev/Fundus-105K-Formatted
100 split: train[:1000]
101 type: customcompletion-regex
102 - path: PJMixers-Dev/Fundus-AP-News-Formatted
103 split: train[:1000]
104 type: customcompletion-regex
105 - path: PJMixers/AP-News-2024
106 split: train[:1000]
107 type: customcompletion-regex
108 # Misc Data
109 - path: PJMixers-Dev/goodwiki-2024-12-04-axo
110 split: train[:1000]
111 type: customcompletion-regex
112 - path: epfl-llm/guidelines
113 split: train[:1000]
114 field: clean_text
115 type: customcompletion-regex
116# Gemma-3 Instruct
117 # RP Data
118 - path: PJMixers-Dev/Gryphe-Aesir-RPG-Charcards-Opus-Mixed
119 type: customgemma3-regex
120 - path: allura-org/gryphe-sonnet-3.5-charcards-names-added
121 type: customgemma3-regex
122 - path: anthracite-org/c2_logs_32k_llama3_qwen2_v1.3
123 type: customgemma3-regex
124 - path: BeaverAI/REDACTED4
125 type: customgemma3-regex
126 - path: PJMixers-Dev/MinervaAI_Aesir-Preview-Anon
127 type: customgemma3-regex
128 - path: PJMixers-Dev/lemonilia_LimaRP-Simple-CustomShareGPT-Shuffled
129 type: customgemma3-regex
130 - path: Epiculous/SynthRP-Gens-v1.1-Filtered-n-Cleaned
131 type: customgemma3-regex
132 - path: PJMixers-Dev/NyxKrage_chub-logs-sharegpt-longest-CustomShareGPT
133 type: customgemma3-regex
134 - path: PJMixers/OpenLeecher_Teatime_all_logs_longest-ShareGPT
135 type: customgemma3-regex
136 - path: grimulkan/aicg-logs-augmented
137 type: customgemma3-regex
138 - path: grimulkan/PIPPA-augmented-dedup
139 type: customgemma3-regex
140 - path: PJMixers/grimulkan_bluemoon_Karen_cleaned-carded-formatted
141 type: customgemma3-regex
142 # InstStory Data
143 - path: PJMixers/lodrick-the-lafted_OpusStories-ShareGPT
144 type: customgemma3-regex
145 - path: Gryphe/ChatGPT-4o-Writing-Prompts
146 type: customgemma3-regex
147 - path: Gryphe/Opus-WritingPrompts
148 type: customgemma3-regex
149 - path: anthracite-org/nopm_claude_writing_fixed
150 type: customgemma3-regex
151 - path: PJMixers-Dev/Tiefighter-13B-Fake-Distill-ShareGPT
152 type: customgemma3-regex
153 - path: allura-org/fujin-instruct-v2
154 type: customgemma3-regex
155 # Adventure Data
156 - path: PocketDoc/Dans-Prosemaxx-Adventure
157 type: customgemma3-regex
158 - path: PocketDoc/Dans-Failuremaxx-Adventure-3
159 type: customgemma3-regex
160test_datasets:
161val_set_size: 256
162eval_strategy: steps
163eval_steps: 10
164dataset_prepared_path: ./00-Tokenized-Datasets/Gemma-3-Earthen-v0.2-4B-LoRA-seed42
165shuffle_merged_datasets: true
166dataset_processes:
167
168# Training hyperparameters
169num_epochs: 1
170gradient_accumulation_steps: 4
171micro_batch_size: 4
172eval_batch_size: 4
173warmup_steps: 0
174optimizer: came_pytorch
175optim_args:
176 enable_stochastic_rounding: true
177 enable_cautious: true
178 enable_8bit: true
179lr_scheduler: rex
180learning_rate: 2.5e-7
181cosine_min_lr_ratio: 0.05
182weight_decay: 0.01
183max_grad_norm: 0.5
184logging_steps: 1
185
186# Model optimization
187gradient_checkpointing: offload
188sdp_attention: true
189plugins:
190 - axolotl.integrations.liger.LigerPlugin
191 - axolotl.integrations.cut_cross_entropy.CutCrossEntropyPlugin
192cut_cross_entropy: true
193liger_rope: true
194liger_rms_norm: true
195liger_layer_norm: true
196liger_glu_activation: true
197liger_cross_entropy: false
198liger_fused_linear_cross_entropy: false
199lora_mlp_kernel: false
200lora_qkv_kernel: false
201lora_o_kernel: false
202
203# DeepSpeed
204deepspeed:
205
206# Garbage Collection
207gc_steps:
208
209# Debug config
210debug: true
211seed: 42
212
213# Token config
214special_tokens:
215 bos_token: "<bos>"
216 eos_token: "<eos>"
217 pad_token: "<pad>"
218tokens:1@misc{wolf2020huggingfacestransformersstateoftheartnatural,
2 title={HuggingFace's Transformers: State-of-the-art Natural Language Processing},
3 author={Thomas Wolf and Lysandre Debut and Victor Sanh and Julien Chaumond and Clement Delangue and Anthony Moi and Pierric Cistac and Tim Rault and Rémi Louf and Morgan Funtowicz and Joe Davison and Sam Shleifer and Patrick von Platen and Clara Ma and Yacine Jernite and Julien Plu and Canwen Xu and Teven Le Scao and Sylvain Gugger and Mariama Drame and Quentin Lhoest and Alexander M. Rush},
4 year={2020},
5 eprint={1910.03771},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL},
8 url={https://arxiv.org/abs/1910.03771},
9}
10@misc{gemmateam2025gemma3technicalreport,
11 title={Gemma 3 Technical Report},
12 author={Gemma Team and Aishwarya Kamath and Johan Ferret and Shreya Pathak and Nino Vieillard and Ramona Merhej and Sarah Perrin and Tatiana Matejovicova and Alexandre Ramé and Morgane Rivière and Louis Rouillard and Thomas Mesnard and Geoffrey Cideron and Jean-bastien Grill and Sabela Ramos and Edouard Yvinec and Michelle Casbon and Etienne Pot and Ivo Penchev and Gaël Liu and Francesco Visin and Kathleen Kenealy and Lucas Beyer and Xiaohai Zhai and Anton Tsitsulin and Robert Busa-Fekete and Alex Feng and Noveen Sachdeva and Benjamin Coleman and Yi Gao and Basil Mustafa and Iain Barr and Emilio Parisotto and David Tian and Matan Eyal and Colin Cherry and Jan-Thorsten Peter and Danila Sinopalnikov and Surya Bhupatiraju and Rishabh Agarwal and Mehran Kazemi and Dan Malkin and Ravin Kumar and David Vilar and Idan Brusilovsky and Jiaming Luo and Andreas Steiner and Abe Friesen and Abhanshu Sharma and Abheesht Sharma and Adi Mayrav Gilady and Adrian Goedeckemeyer and Alaa Saade and Alex Feng and Alexander Kolesnikov and Alexei Bendebury and Alvin Abdagic and Amit Vadi and András György and André Susano Pinto and Anil Das and Ankur Bapna and Antoine Miech and Antoine Yang and Antonia Paterson and Ashish Shenoy and Ayan Chakrabarti and Bilal Piot and Bo Wu and Bobak Shahriari and Bryce Petrini and Charlie Chen and Charline Le Lan and Christopher A. Choquette-Choo and CJ Carey and Cormac Brick and Daniel Deutsch and Danielle Eisenbud and Dee Cattle and Derek Cheng and Dimitris Paparas and Divyashree Shivakumar Sreepathihalli and Doug Reid and Dustin Tran and Dustin Zelle and Eric Noland and Erwin Huizenga and Eugene Kharitonov and Frederick Liu and Gagik Amirkhanyan and Glenn Cameron and Hadi Hashemi and Hanna Klimczak-Plucińska and Harman Singh and Harsh Mehta and Harshal Tushar Lehri and Hussein Hazimeh and Ian Ballantyne and Idan Szpektor and Ivan Nardini and Jean Pouget-Abadie and Jetha Chan and Joe Stanton and John Wieting and Jonathan Lai and Jordi Orbay and Joseph Fernandez and Josh Newlan and Ju-yeong Ji and Jyotinder Singh and Kat Black and Kathy Yu and Kevin Hui and Kiran Vodrahalli and Klaus Greff and Linhai Qiu and Marcella Valentine and Marina Coelho and Marvin Ritter and Matt Hoffman and Matthew Watson and Mayank Chaturvedi and Michael Moynihan and Min Ma and Nabila Babar and Natasha Noy and Nathan Byrd and Nick Roy and Nikola Momchev and Nilay Chauhan and Noveen Sachdeva and Oskar Bunyan and Pankil Botarda and Paul Caron and Paul Kishan Rubenstein and Phil Culliton and Philipp Schmid and Pier Giuseppe Sessa and Pingmei Xu and Piotr Stanczyk and Pouya Tafti and Rakesh Shivanna and Renjie Wu and Renke Pan and Reza Rokni and Rob Willoughby and Rohith Vallu and Ryan Mullins and Sammy Jerome and Sara Smoot and Sertan Girgin and Shariq Iqbal and Shashir Reddy and Shruti Sheth and Siim Põder and Sijal Bhatnagar and Sindhu Raghuram Panyam and Sivan Eiger and Susan Zhang and Tianqi Liu and Trevor Yacovone and Tyler Liechty and Uday Kalra and Utku Evci and Vedant Misra and Vincent Roseberry and Vlad Feinberg and Vlad Kolesnikov and Woohyun Han and Woosuk Kwon and Xi Chen and Yinlam Chow and Yuvein Zhu and Zichuan Wei and Zoltan Egyed and Victor Cotruta and Minh Giang and Phoebe Kirk and Anand Rao and Kat Black and Nabila Babar and Jessica Lo and Erica Moreira and Luiz Gustavo Martins and Omar Sanseviero and Lucas Gonzalez and Zach Gleicher and Tris Warkentin and Vahab Mirrokni and Evan Senter and Eli Collins and Joelle Barral and Zoubin Ghahramani and Raia Hadsell and Yossi Matias and D. Sculley and Slav Petrov and Noah Fiedel and Noam Shazeer and Oriol Vinyals and Jeff Dean and Demis Hassabis and Koray Kavukcuoglu and Clement Farabet and Elena Buchatskaya and Jean-Baptiste Alayrac and Rohan Anil and Dmitry and Lepikhin and Sebastian Borgeaud and Olivier Bachem and Armand Joulin and Alek Andreev and Cassidy Hardin and Robert Dadashi and Léonard Hussenot},
13 year={2025},
14 eprint={2503.19786},
15 archivePrefix={arXiv},
16 primaryClass={cs.CL},
17 url={https://arxiv.org/abs/2503.19786},
18}
19@misc{hu2021loralowrankadaptationlarge,
20 title={LoRA: Low-Rank Adaptation of Large Language Models},
21 author={Edward J. Hu and Yelong Shen and Phillip Wallis and Zeyuan Allen-Zhu and Yuanzhi Li and Shean Wang and Lu Wang and Weizhu Chen},
22 year={2021},
23 eprint={2106.09685},
24 archivePrefix={arXiv},
25 primaryClass={cs.CL},
26 url={https://arxiv.org/abs/2106.09685},
27}
28@misc{dettmers2023qloraefficientfinetuningquantized,
29 title={QLoRA: Efficient Finetuning of Quantized LLMs},
30 author={Tim Dettmers and Artidoro Pagnoni and Ari Holtzman and Luke Zettlemoyer},
31 year={2023},
32 eprint={2305.14314},
33 archivePrefix={arXiv},
34 primaryClass={cs.LG},
35 url={https://arxiv.org/abs/2305.14314},
36}
37@misc{dao2023flashattention2fasterattentionbetter,
38 title={FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning},
39 author={Tri Dao},
40 year={2023},
41 eprint={2307.08691},
42 archivePrefix={arXiv},
43 primaryClass={cs.LG},
44 url={https://arxiv.org/abs/2307.08691},
45}
46@misc{hsu2024ligerkernelefficienttriton,
47 title={Liger Kernel: Efficient Triton Kernels for LLM Training},
48 author={Pin-Lun Hsu and Yun Dai and Vignesh Kothapalli and Qingquan Song and Shao Tang and Siyu Zhu and Steven Shimizu and Shivam Sahni and Haowen Ning and Yanning Chen},
49 year={2024},
50 eprint={2410.10989},
51 archivePrefix={arXiv},
52 primaryClass={cs.LG},
53 url={https://arxiv.org/abs/2410.10989},
54}
55@misc{wijmans2025cutlosseslargevocabularylanguage,
56 title={Cut Your Losses in Large-Vocabulary Language Models},
57 author={Erik Wijmans and Brody Huval and Alexander Hertzberg and Vladlen Koltun and Philipp Krähenbühl},
58 year={2025},
59 eprint={2411.09009},
60 archivePrefix={arXiv},
61 primaryClass={cs.LG},
62 url={https://arxiv.org/abs/2411.09009},
63}
64@misc{chen2021rexrevisitingbudgetedtraining,
65 title={REX: Revisiting Budgeted Training with an Improved Schedule},
66 author={John Chen and Cameron Wolfe and Anastasios Kyrillidis},
67 year={2021},
68 eprint={2107.04197},
69 archivePrefix={arXiv},
70 primaryClass={cs.LG},
71 url={https://arxiv.org/abs/2107.04197},
72}
73@misc{luo2023cameconfidenceguidedadaptivememory,
74 title={CAME: Confidence-guided Adaptive Memory Efficient Optimization},
75 author={Yang Luo and Xiaozhe Ren and Zangwei Zheng and Zhuo Jiang and Xin Jiang and Yang You},
76 year={2023},
77 eprint={2307.02047},
78 archivePrefix={arXiv},
79 primaryClass={cs.CL},
80 url={https://arxiv.org/abs/2307.02047},
81}
82@misc{zamirai2021revisitingbfloat16training,
83 title={Revisiting BFloat16 Training},
84 author={Pedram Zamirai and Jian Zhang and Christopher R. Aberger and Christopher De Sa},
85 year={2021},
86 eprint={2010.06192},
87 archivePrefix={arXiv},
88 primaryClass={cs.LG},
89 url={https://arxiv.org/abs/2010.06192},
90}
91@misc{liang2025cautiousoptimizersimprovingtraining,
92 title={Cautious Optimizers: Improving Training with One Line of Code},
93 author={Kaizhao Liang and Lizhang Chen and Bo Liu and Qiang Liu},
94 year={2025},
95 eprint={2411.16085},
96 archivePrefix={arXiv},
97 primaryClass={cs.LG},
98 url={https://arxiv.org/abs/2411.16085},
99}
100@misc{xie2025sana15efficientscaling,
101 title={SANA 1.5: Efficient Scaling of Training-Time and Inference-Time Compute in Linear Diffusion Transformer},
102 author={Enze Xie and Junsong Chen and Yuyang Zhao and Jincheng Yu and Ligeng Zhu and Chengyue Wu and Yujun Lin and Zhekai Zhang and Muyang Li and Junyu Chen and Han Cai and Bingchen Liu and Daquan Zhou and Song Han},
103 year={2025},
104 eprint={2501.18427},
105 archivePrefix={arXiv},
106 primaryClass={cs.CV},
107 url={https://arxiv.org/abs/2501.18427},
108}
109@misc{dallabetta2024fundussimpletousenewsscraper,
110 title={Fundus: A Simple-to-Use News Scraper Optimized for High Quality Extractions},
111 author={Max Dallabetta and Conrad Dobberstein and Adrian Breiding and Alan Akbik},
112 year={2024},
113 eprint={2403.15279},
114 archivePrefix={arXiv},
115 primaryClass={cs.CL},
116 url={https://arxiv.org/abs/2403.15279},
117}
118@misc{gosling2023pippapartiallysyntheticconversational,
119 title={PIPPA: A Partially Synthetic Conversational Dataset},
120 author={Tear Gosling and Alpin Dale and Yinhe Zheng},
121 year={2023},
122 eprint={2308.05884},
123 archivePrefix={arXiv},
124 primaryClass={cs.CL},
125 url={https://arxiv.org/abs/2308.05884},
126}