--- base_model: google/gemma-4-31B-it library_name: peft tags: - qlora - stiefel-manifold - continuous-reasoning - float32-precision - cag-truth-gate - pmtp-zero-token - polydim-einsof pipeline_tag: text-generation --- # einsof2-gemma4-31b-stiefel-adapter **POLYDIM-EINSOF QLoRA 2027.4.0 Certified Adapter (float32 Precision)** This repository hosts an authentic GPU-trained PEFT LoRA adapter for `google/gemma-4-31B-it`, upgraded to **`torch.float32`** precision with **FP64 Order-4 Stiefel Polar Retraction** to eliminate the discrete `bfloat16` roundoff floor. ## Empirical Silicon Invariants (Exit Code 0) - **Base Architecture:** `google/gemma-4-31B-it` (Family: `gemma4`) - **PEFT Type:** `LORA` (Rank: 16, Alpha: 32) - **Storage Dtype:** `torch.float32` (100% of adapter tensors) - **Trainable Tensors:** 820 total (410 `lora_B` projection factors) - **Max Stiefel Isometry Defect (FP32):** `8.33e-08` (Bound: <= 1.0e-5) - **Horner Polar Projection Defect (FP64):** `8.88e-16` (Bound: <= 1.0e-15) - **Frobenius Adaptation Energy Drift:** < 0.01% (Preserved: s = ||B||_F / sqrt(r)) - **Closed-World Gate:** 1-Token `<|cag_truth|>` (`token_id: 151667`) ## Usage via Hugging Face PEFT ```python import torch from transformers import AutoModelForCausalLM, AutoTokenizer from peft import PeftModel base_model_id = "google/gemma-4-31B-it" adapter_id = "Polydim-Einsof/einsof2-gemma4-31b-stiefel-adapter" tokenizer = AutoTokenizer.from_pretrained(adapter_id) model = AutoModelForCausalLM.from_pretrained( base_model_id, torch_dtype=torch.float16, device_map="auto" ) model = PeftModel.from_pretrained(model, adapter_id) print(f"Loaded {adapter_id} successfully!") ``` ## Integrated Core This repository includes the complete `qlora_2027_core/` Python package featuring: - `core/stiefel_riemannian.py`: Order-4 Polar Retraction & Theorem 32 Riemannian Weight Decay - `core/procrustes_splice.py`: Procrustes Impedance Projector & Layer L-2 Splice - `core/cag_activation_hook.py`: Native Chat Template Preservation & -inf Logits Processor - `training/einsof_qlora_2027_trainer.py`: Turing sm_75 safe Trainer