Skip to content
ModelListedExternal
Download

Gemma4 Style LoRA Step3000

Purpose: This adapter is a style evaluator / judge, not a fiction writer.

KindOtherBase modelgoogle/gemma-4-26B-A4B-itVersionRevision ae756a5

Model source

Kind
Other
File size
1.84 GB
Base model
google/gemma-4-26B-A4B-it
Version
vRevision ae756a5
Updated
Sep 22, 2026
Downloads
8
Tasks
Text generation
Source
Hugging Face

Source description

Gemma 4 Style LoRA (step 3000) — prose style evaluator

Purpose: This adapter is a style evaluator / judge, not a fiction writer.

It classifies and scores English prose against a 14-metric Leech & Short–derived rubric and emits structured JSON style_profiles (plus short natural-language judgments). Those judgments power a bake-off and later steering cards used to train / score a stylish fiction writer and assemble long-form novels that stay on voice, style, and tone.

RoleThis modelNot this model
JudgeYes — classify / score passages—
SteerProvides signal for steering cardsDoes not write novels itself
WriterUsed later to train / score a writerDo not treat this LoRA as a story generator

Companion GGUFs (merged + quantized for LM Studio / llama.cpp): alexokita/gemma4-style-step3000-GGUF.

Intended use

  • Produce a full style_profile JSON for a prose passage
  • Answer single-dimension questions (tone, POV, figurative density, FID, ...) with a short rationale
  • Score whether a draft matches a target steering card (voice / style / tone)
  • Run agreement bake-offs vs held-out labeled prose (and Style-in-Fiction exemplars)
  • After a successful bake-off: bulk re-label corpora and drive writer ↔ evaluator loops

Recommended inference settings (LM Studio / llama.cpp): temperature 1.0, top_p 0.95, top_k 64, thinking off for JSON / classification tasks. Prefer the Q4_K_M or Q5_K_M GGUF for day-to-day use on a 24 GB GPU.

Out of scope

  • Open-ended story generation or “write a novel”
  • Plot / character consistency (separate stack)
  • Overall literary quality preference ranking without a human agreement study

How it was trained

ItemValue
BaseGemma 4 26B-A4B instruct QAT weights (unsloth/gemma-4-26B-A4B-it-qat-q4_0-unquantized, HF parent of the QAT GGUF family)
MethodLoRA SFT via Unsloth + TRL on DGX Spark (spark-4f07, ~128 GB unified Blackwell + CUDA)
Configtrain/train_config.gemma4_spark.toml
LoRArank 16, alpha 16, text-only MoE targets (experts.gate_up_proj, experts.down_proj + attention/MLP projections)
Sequence2048 tokens
Batchmicrobatch 8 × grad accum 2 (effective 16)
Steps3000 (final checkpoint; best eval loss ≈ 2.378)
LR2e-4 with warmup
Chat templateNon-thinking gemma-4 (JSON-friendly)
HostSpark only — RTX 3090 is for quantized inference, not training

Training mix (Phase 3 instruction pairs from classified prose):

  • Classification (~25%) — “Provide a complete style profile...” → full JSON of the 14 metrics (+ related computables in the profile)
  • Judgment (~75%) — “What tone / POV / figurative density...?” → bold label + short explanation

Approx. 430k train / 48k validation pairs under train/style_training/.

Training data

Styled fiction chunks labeled with metadata.style_profile, then converted to instruction pairs. Corpora include (HF sources):

  • Literotica stories
  • Erotic / fantasy / general fiction book corpora (e.g. Korshuk BookRix sets)
  • Project Gutenberg fiction
  • Horror novel chunks

Labels were produced by the Phase 2 pipeline (tools/style_classification/run_pipeline.py): computable metrics (spaCy / textstat) plus LLM semantic metrics grounded in a Style-in-Fiction rubric and RAG knowledge base (source/style_rubric.json, source/extracted/style_knowledge.jsonl).

The 14 Style-in-Fiction rubric metrics

Derived from Leech & Short, Style in Fiction (2nd ed.), operationalized in source/style_rubric.json (stats.dimensions = 14).

#Metric IDCategoryHow generatedValues / type
1lexical_complexityLexicalLLM (Pass 1)simple_colloquial / neutral / complex_literary
2lexical_densityLexicalComputablecontinuous 0–1 (content-word ratio)
3registerLexicalLLM (Pass 1)formal_literary, formal_technical, neutral_narrative, colloquial, dialect, archaic
4sentence_complexityGrammaticalLLM (Pass 1)simple_paratactic / moderate / complex_hypotactic
5sentence_length_meanGrammaticalComputablemean words/sentence
6subordination_ratioGrammaticalComputablehypotaxis proxy
7figurative_densityFigurativeLLM (Pass 1)low / moderate / high
8cohesionCohesionLLM (Pass 1)loose / standard / tight
9dialogue_ratioGrammaticalComputablecontinuous 0–1 (direct speech share)
10povViewpointLLM (Pass 1)first_person, second_person, third_limited, third_omniscient, mixed
11mind_styleViewpointLLM (Pass 2)standard / distinct / deviant
12narrative_distanceViewpointLLM (Pass 2)intimate / moderate / distant
13free_indirect_discourseViewpointLLM (Pass 2)none / sparse / moderate / heavy
14toneContextLLM (Pass 2)neutral, lyrical, sardonic, melancholic, comedic, tense, contemplative

How those labels were generated:

  1. Phase 1 — Rubric from Style in Fiction — Vision-transcribe Style in Fiction PDF → markdown; chunk into RAG style_knowledge.jsonl; distill checklist + 14 operational dimensions into style_rubric.json.
  2. Phase 2 — Classify prose — Chunk fiction (~sentence-aware); compute spaCy/textstat fields for the four computable metrics; run multi-pass LLM classification with rubric + retrieved SiF excerpts (--pass both: Pass 1 lexical/syntax/discourse + POV; Pass 2 tone / mind style / narrative distance / FID).
  3. Phase 3 — SFT pairs — Turn each styled row into classification + judgment instruction pairs for this LoRA.

Additional textual principles in the rubric (end_focus, segmentation, prose_rhythm, climax, ...) may appear in full profiles from the classifier pipeline; the 14 rows above are the core training/eval dimensions for this adapter.

Example prompts

Full profile:

Provide a complete style profile for this passage as JSON.

Passage:
...

Single dimension:

What tone does the author strike in this passage?

Passage:
...

Steering-card check (post–Phase 5B):

Does this passage match the following steering card?
List mismatches only (field: expected vs observed).

Card: { "pov": "first_person", "register": "colloquial", "tone": "tense", ... }
Passage:
...

Files in this release

ArtifactDescription
adapter_model.safetensors + adapter_config.jsonPEFT LoRA @ step 3000 (~1.9 GB)
Tokenizer / chat templateGemma 4 non-thinking template
GGUFsSee alexokita/gemma4-style-step3000-GGUF (Q5_K_M ~18 GB, Q4_K_M ~16 GB)

Limitations

  • Optimized for analytic JSON / short judgments, not creative generation
  • Label noise follows the Phase 2 teacher models; bake-off against held-out gold (and SiF exemplars) before trusting bulk re-label
  • Multimodal / vision paths of base Gemma 4 are unused (text-only LoRA)

Citation / acknowledgements

  • Leech, G. & Short, M. Style in Fiction (2nd ed.) — theoretical source of the rubric
  • Unsloth, TRL, Hugging Face PEFT
  • Base: google/gemma-4-26B-A4B-it / Unsloth QAT training weights
@software{gemma4_style_lora_step3000,
  title  = {Gemma 4 Style LoRA — prose style evaluator},
  author = {Okita, Alex},
  year   = {2026},
  url    = {https://huggingface.co/alexokita/gemma4-style-lora-step3000}
}

License

Use of the base Gemma 4 weights is subject to the Gemma license. This adapter inherits those terms for combined use.

Sources

1 source
Hugging FacePrimaryVersion ae756a519f594e30b2630655adc0140ea2a347d4
huggingface.co/alexokita/gemma4-style-lora-step3000/tree/ae756a519f594e30b2630655adc0140ea2a347d4

Verified Sep 22

Model artifacts

1 artifact

adapter_model.safetensors

safetensors · 1.84 GB · SHA-256 fb42fd355b8b…e1df · Hugging Face

Download

Source excerpts

2 excerpts

--- library_name: peft base_model: google/gemma-4-26B-A4B-it base_model_relation: adapter tags: - lora - sft - style-classification - prose-evaluator - stylistics - unsloth - trl - gemma4 license: gemma language: - en pipeline_tag: text-generation --- # Gemma 4 Style LoRA (step 3000) — prose style evaluator **Purpose:** This adapter is a **style evaluator / judge**, not a fiction writer. It classifies and scores English prose against a **14-metric Leech & Short–derived rubric** and emits structured JSON `style_profile`s (plus short natural-language judgments). Those judgments power a bake-off and later **steering cards** used to train / score a stylish fiction writer and assemble long-form novels that stay on voice, style, and tone. | Role | This model | Not this model | |---|---|---| | **Judge** | Yes — classify / score passages | — | | **Steer** | Provides signal for steering cards | Does not write novels itself | | **Writer** | Used later to train / score a writer | Do not treat this LoRA as a story generator | Companion GGUFs (merged + quantized for LM Studio / llama.cpp): [`alexokita/gemma4-style-step3000-GGUF`](https://huggingface.co/alexokita/gemma4-style-step3000-GGUF). ## Intended use - Produce a full `style_profile` JSON for a prose passage - Answer single-dimension questions (tone, POV, figurative density, FID, …) with a short rationale - Score whether a draft matches a target **steering card** (voice / style / tone) - Run agreement bake-offs vs held-out labeled prose (and Style-in-Fiction exemplars) - After a successful bake-off: bulk re-label corpora and drive writer ↔ evaluator loops **Recommended inference settings (LM Studio / llama.cpp):** temperature `1.0`, top_p `0.95`, top_k `64`, **thinking off** for JSON / classification tasks. Prefer the Q4_K_M or Q5_K_M GGUF for day-to-day use on a 24 GB GPU. ## Out of scope - Open-ended story generation or “write a novel” - Plot / character consistency (separate stack) - Overall literary quality preference ranking without a human agreement study ## How it was trained | Item | Value | |---|---| | **Base** | Gemma 4 26B-A4B instruct QAT weights (`unsloth/gemma-4-26B-A4B-it-qat-q4_0-unquantized`, HF parent of the QAT GGUF family) | | **Method** | LoRA SFT via Unsloth + TRL on **DGX Spark** (`spark-4f07`, ~128 GB unified Blackwell + CUDA) | | **Config** | `tr...

Source context: 8 downloads · 0 likes · Pipeline text-generation · Library peft · Repo alexokita/gemma4-style-lora-step3000