Views
No views yet
google/gemma-3-4b-pt was trained at 8K with batch size 4 gradient accumulation 2, so each step was 65,536 tokens (including any padding tokens). It was trained for 120 steps, adding up to a total of 7,864,320 unique tokens seen.1# - Get latest commit of axolotl (currently c0a0c75)
2# - Download these to axolotl/src/axolotl/prompt_formatters
3# - https://github.com/xzuyn/axolotl/blob/came-plus-formatters/src/axolotl/prompt_strategies/formatter_regex.py
4# - https://github.com/xzuyn/axolotl/blob/came-plus-formatters/src/axolotl/prompt_strategies/customcompletion-regex.py
5# - pip install ftfy
6# - pip install git+https://github.com/xzuyn/CAME.git@sr-grams-cautious-8bit
7
8# Weights and Biases logging config
9wandb_project: Gemma-3-4B
10wandb_entity:
11wandb_watch:
12wandb_name: Gemma-3-Earthen-Completion-v0.1-4B-QLoRA-run9
13wandb_log_model:
14
15# Model checkpointing config
16output_dir: ./Outputs/Gemma-3-Earthen-Completion-v0.1-4B-QLoRA-run9
17save_steps: 10
18save_safetensors: true
19save_total_limit: 2
20save_only_model: true
21
22# Model architecture config
23base_model: google/gemma-3-4b-pt
24model_type: AutoModelForCausalLM
25tokenizer_type: AutoTokenizer
26
27# Mixed precision training config
28bf16: true
29fp16: false
30tf32: false
31
32# Model loading config
33load_in_8bit: false
34load_in_4bit: true
35strict: false
36
37# Sequence config
38sequence_len: 8192
39min_sample_len: 512
40sample_packing: true
41eval_sample_packing: true
42pad_to_sequence_len: true
43train_on_inputs: false
44group_by_length: false
45
46# LoRA adapter config
47adapter: qlora
48lora_model_dir:
49lora_r: 256
50lora_alpha: 256
51lora_dropout: 0.125
52lora_target_modules: 'language_model.model.layers.[\d]+.(mlp|cross_attn|self_attn).(up|down|gate|q|k|v|o)_proj'
53embeddings_skip_upcast: true
54
55# Dataset config
56datasets:
57# Completion
58 # Story-like Data
59 - path: BeaverAI/REDACTED1
60 split: train[:1000]
61 type: customcompletion-regex
62 - path: PJMixers-Dev/Lit-axo-Shuffled
63 split: train[:1000]
64 type: customcompletion-regex
65 - path: PJMixers-Dev/Mielikki_Erebus-87k-axo
66 split: train[:1000]
67 type: customcompletion-regex
68 - path: PJMixers/RyokoAI_Honeyfeed3600-Cleanish
69 split: train[:1000]
70 type: customcompletion-regex
71 - path: BeaverAI/REDACTED2
72 split: train[:1000]
73 type: customcompletion-regex
74 - path: PJMixers-Dev/allura-org_fujin-cleaned-stage-2-axo
75 split: train[:1000]
76 type: customcompletion-regex
77 - path: Nelathan/synthetic-sugar-quill
78 split: train[:1000]
79 type: customcompletion-regex
80 - path: BeaverAI/REDACTED3
81 split: train[:1000]
82 type: customcompletion-regex
83 - path: PJMixers-Dev/recursal_SCP-RECURSAL-Cleaned
84 split: train[:1000]
85 type: customcompletion-regex
86 # Subtitle Data
87 - path: PJMixers-Dev/Subtitles
88 split: train[:1000]
89 type: customcompletion-regex
90 - path: PJMixers-Dev/KaraKaraWitch_AnimeSubtitle-axo
91 split: train[:1000]
92 type: customcompletion-regex
93 # News Data
94 - path: PJMixers-Dev/Fundus-105K-Formatted
95 split: train[:1000]
96 type: customcompletion-regex
97 - path: PJMixers-Dev/Fundus-AP-News-Formatted
98 split: train[:1000]
99 type: customcompletion-regex
100 - path: PJMixers/AP-News-2024
101 split: train[:1000]
102 type: customcompletion-regex
103 # Misc Data
104 - path: PJMixers-Dev/goodwiki-2024-12-04-axo
105 split: train[:1000]
106 type: customcompletion-regex
107 - path: epfl-llm/guidelines
108 split: train[:1000]
109 field: clean_text
110 type: customcompletion-regex
111test_datasets:
112val_set_size: 128
113eval_strategy: steps
114eval_steps: 10
115dataset_prepared_path: ./00-Tokenized-Datasets/Gemma-3-Earthen-Completion-v0.1-4B-LoRA-seed42
116shuffle_merged_datasets: true
117dataset_processes:
118
119# Training hyperparameters
120num_epochs: 1
121gradient_accumulation_steps: 2
122micro_batch_size: 4
123eval_batch_size: 4
124warmup_steps: 0
125optimizer: came_pytorch
126optim_args:
127 enable_stochastic_rounding: true
128 enable_cautious: true
129 enable_8bit: true
130lr_scheduler: rex
131learning_rate: 5e-7
132cosine_min_lr_ratio: 0.05
133weight_decay: 0.01
134max_grad_norm: 0.5
135logging_steps: 1
136
137# Model optimization
138gradient_checkpointing: offload
139sdp_attention: true
140plugins:
141 - axolotl.integrations.liger.LigerPlugin
142 - axolotl.integrations.cut_cross_entropy.CutCrossEntropyPlugin
143cut_cross_entropy: true
144liger_rope: true
145liger_rms_norm: true
146liger_layer_norm: true
147liger_glu_activation: true
148liger_cross_entropy: false
149liger_fused_linear_cross_entropy: false
150lora_mlp_kernel: false
151lora_qkv_kernel: false
152lora_o_kernel: false
153
154# DeepSpeed
155deepspeed:
156
157# Garbage Collection
158gc_steps:
159
160# Debug config
161debug: true
162seed: 42
163
164# Token config
165special_tokens:
166 bos_token: "<bos>"
167 eos_token: "<eos>"
168 pad_token: "<pad>"
169tokens: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{chen2023meditron70bscalingmedicalpretraining,
119 title={MEDITRON-70B: Scaling Medical Pretraining for Large Language Models},
120 author={Zeming Chen and Alejandro Hernández Cano and Angelika Romanou and Antoine Bonnet and Kyle Matoba and Francesco Salvi and Matteo Pagliardini and Simin Fan and Andreas Köpf and Amirkeivan Mohtashami and Alexandre Sallinen and Alireza Sakhaeirad and Vinitra Swamy and Igor Krawczuk and Deniz Bayazit and Axel Marmet and Syrielle Montariol and Mary-Anne Hartley and Martin Jaggi and Antoine Bosselut},
121 year={2023},
122 eprint={2311.16079},
123 archivePrefix={arXiv},
124 primaryClass={cs.CL},
125 url={https://arxiv.org/abs/2311.16079},
126}