turtle0001 commited on
Commit
8d86f00
·
verified ·
1 Parent(s): 6f436a1

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +183 -0
README.md ADDED
@@ -0,0 +1,183 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: google/gemma-4-12B
3
+ library_name: transformers
4
+ pipeline_tag: text-generation
5
+ tags:
6
+ - base_model:google/gemma-4-12B
7
+ - cpt
8
+ - continued-pretraining
9
+ - storytelling
10
+ - creative-writing
11
+ - unsloth
12
+ language:
13
+ - en
14
+ license: gemma
15
+ ---
16
+
17
+ # Model Card for Marekoth-Story-Base
18
+
19
+ Marekoth-Story-Base is a continued pre-training (CPT) adaptation of Google Gemma 4 12B, specialized in first-person narrative storytelling. The model has been adapted on a curated corpus of long-form English story transcripts to internalize direct, punchy, conversational narrative patterns while preserving the base model’s general language capabilities. This checkpoint serves as the foundation for downstream supervised fine-tuning (SFT) and is not intended for direct instruction-following or general-purpose chat.
20
+
21
+ ## Model Details
22
+
23
+ ### Model Description
24
+
25
+ This model adapts the Gemma 4 12B base architecture to a specific narrative domain through continued pre-training. Unlike standard SFT, CPT exposes the model to raw narrative text without instruction formatting, allowing it to absorb stylistic and structural patterns at the token-distribution level. The resulting checkpoint retains Gemma 4’s core language understanding while shifting its generative prior toward immersive, first-person storytelling with immediate hooks, rhythmic sentence structure, and embedded dialogue.
26
+
27
+ - **Developed by:** marekoth
28
+ - **Model type:** Causal Language Model (Continued Pre-Training)
29
+ - **Language(s):** English
30
+ - **License:** Gemma Terms of Use
31
+ - **Finetuned from model:** [google/gemma-4-12B](https://huggingface.co/google/gemma-4-12B)
32
+
33
+ ### Model Sources
34
+
35
+ - **Repository:** [Link to this model's repository]
36
+ - **Base Model:** [google/gemma-4-12B](https://huggingface.co/google/gemma-4-12B)
37
+
38
+ ## Uses
39
+
40
+ ### Direct Use
41
+
42
+ This model is designed as a base checkpoint for further fine-tuning. It can be used for zero-shot or few-shot narrative generation when paired with an appropriate system prompt or prefix, but it does not follow instructions natively. Best suited as a foundation for style-specific SFT adapters.
43
+
44
+ ### Downstream Use
45
+
46
+ Intended as the base model for supervised fine-tuning into instruction-following storytelling assistants, scriptwriting tools, or interactive narrative applications. A compatible SFT LoRA adapter (`Marekoth-Story-SFT-LoRA`) is available separately.
47
+
48
+ ### Out-of-Scope Use
49
+
50
+ - ❌ General-purpose instruction following or chatbot use (no SFT applied)
51
+ - ❌ Factual question answering, reasoning, or coding tasks
52
+ - ❌ Formal, academic, or professional writing
53
+ - ❌ Safety-aligned deployments (no RLHF or safety tuning applied)
54
+ - ❌ Direct production deployment without additional evaluation and alignment
55
+
56
+ ## Bias, Risks, and Limitations
57
+
58
+ This model inherits all biases and limitations of the Gemma 4 12B base model. The CPT corpus consists exclusively of narrative fiction; no factual grounding, safety alignment, or conversational training was performed. Generated content may reflect themes, tones, or perspectives present in the training corpus without moderation. The model has not been evaluated for harmful content generation, factual accuracy, or demographic bias. Users deploying this model downstream are responsible for implementing appropriate safety measures, content filtering, and evaluation protocols. Human review of generated content is strongly recommended before any public or commercial use.
59
+
60
+ ## How to Get Started with the Model
61
+
62
+ ```python
63
+ from transformers import AutoModelForCausalLM, AutoTokenizer
64
+
65
+ model_id = "marekoth/Marekoth-Story-Base"
66
+
67
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
68
+ model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="auto", device_map="auto")
69
+
70
+ prompt = "My phone buzzed at 3 AM with a text from my own number."
71
+ input_ids = tokenizer(prompt, return_tensors="pt").to(model.device)
72
+ output = model.generate(input_ids, max_new_tokens=512, temperature=0.8, do_sample=True)
73
+ print(tokenizer.decode(output[0], skip_special_tokens=True))
74
+ ```
75
+
76
+ > ⚠️ This is a base model. For instruction-following storytelling, use the SFT adapter instead.
77
+
78
+ ## Training Details
79
+
80
+ ### Training Data
81
+
82
+ The model was adapted on a curated corpus of approximately 40,000 long-form English narrative transcripts. All examples exceed 600 words and consist of first-person fictional stories with consistent structural patterns including immediate narrative hooks, embedded unquoted dialogue, and emotional payoff arcs. The dataset was deduplicated and filtered for minimum length, language consistency, and narrative coherence prior to training.
83
+
84
+ ### Training Procedure
85
+
86
+ #### Preprocessing
87
+
88
+ - Minimum length filter: 600+ words per example
89
+ - Language detection and non-English removal
90
+ - Near-duplicate deduplication via MinHash
91
+ - Whitespace normalization and encoding validation
92
+ - Packed sequences enabled for efficient token utilization
93
+
94
+ #### Training Hyperparameters
95
+
96
+ - **Training regime:** bf16 mixed precision
97
+ - **Learning Rate:** 5e-5 (embedding layers: 1e-5)
98
+ - **Total Steps:** 500
99
+ - **Batch Size:** 4 per device × 2 gradient accumulation = 8 effective
100
+ - **Max Sequence Length:** 4096 tokens
101
+ - **Packing:** Enabled
102
+ - **Optimizer:** AdamW 8-bit
103
+ - **LR Scheduler:** Cosine with 10 warmup steps
104
+ - **LoRA Rank:** r=128, alpha=128
105
+ - **Target Modules:** q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
106
+ - **Modules Saved:** embed_tokens, lm_head (full weights)
107
+ - **Trainable Parameters:** 2.54B (17.51% of base model)
108
+ - **Framework:** Unsloth + UnslothTrainer
109
+
110
+ #### Speeds, Sizes, Times
111
+
112
+ - **Total Training Time:** 4 hours
113
+ - **Hardware:** NVIDIA RTX PRO 6000
114
+ - **Final Training Loss:** 1.7–2.2 (stabilized)
115
+ - **Checkpoint Format:** bf16 safetensors
116
+
117
+ ## Environmental Impact
118
+
119
+ Carbon emissions estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
120
+
121
+ - **Hardware Type:** NVIDIA RTX PRO 6000
122
+ - **Hours Used:** 4
123
+ - **TDP:** 300W
124
+ - **Estimated Carbon Emitted:** ~1.2 kgCO₂eq
125
+
126
+ > Note: Actual emissions depend on local energy grid carbon intensity. This estimate assumes average global carbon efficiency. No carbon offset information is available for this training run.
127
+
128
+ ## Technical Specifications
129
+
130
+ ### Model Architecture and Objective
131
+
132
+ - **Architecture:** Gemma 4 Unified (12B parameters)
133
+ - **Objective:** Causal Language Modeling (Continued Pre-Training)
134
+ - **Context Length:** 4096 tokens (training), up to 262K supported by architecture
135
+ - **Vocabulary:** 262,144 tokens
136
+ - **Precision:** bfloat16
137
+
138
+ ### Compute Infrastructure
139
+
140
+ #### Hardware
141
+
142
+ - 1× NVIDIA RTX PRO 6000
143
+ - Training accelerated with Unsloth 2× faster finetuning
144
+
145
+ #### Software
146
+
147
+ - Transformers ≥4.46.0
148
+ - PEFT 0.19.1
149
+ - Unsloth 2026.7.2
150
+ - PyTorch 2.x (bf16)
151
+ - AdamW 8-bit optimizer
152
+
153
+ ## Citation
154
+
155
+ If you use this model, please cite the base model and the carbon emissions methodology:
156
+
157
+ **BibTeX:**
158
+
159
+ ```bibtex
160
+ @misc{marekoth-story-base,
161
+ title={Marekoth-Story-Base: Continued Pre-Training Adaptation of Gemma 4 12B for Narrative Storytelling},
162
+ author={marekoth},
163
+ year={2026},
164
+ url={https://huggingface.co/marekoth/Marekoth-Story-Base}
165
+ }
166
+
167
+ @article{lacoste2019quantifying,
168
+ title={Quantifying the Carbon Emissions of Machine Learning},
169
+ author={Lacoste, Alexandre and Luccioni, Alexandra and Schmidt, Victor and Dandres, Thomas},
170
+ journal={arXiv preprint arXiv:1910.09700},
171
+ year={2019}
172
+ }
173
+ ```
174
+
175
+ ## Framework Versions
176
+
177
+ - Unsloth: 2026.7.2
178
+ - PEFT: 0.19.1
179
+ - Transformers: ≥4.46.0
180
+
181
+ ## Model Card Authors
182
+
183
+ marekoth