JLeeV commited on
Commit
3ba5007
·
verified ·
1 Parent(s): 5570082

Add Titulus_E8 model card

Browse files
Files changed (1) hide show
  1. README.md +200 -1
README.md CHANGED
@@ -1,3 +1,202 @@
1
  ---
2
- license: apache-2.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ language:
3
+ - hbo # Ancient Hebrew
4
+ - grc # Ancient Greek (Koine)
5
+ - la # Latin
6
+ library_name: peft
7
+ base_model: Qwen/Qwen2.5-0.5B-Instruct
8
+ tags:
9
+ - lora
10
+ - peft
11
+ - geometric-ai
12
+ - biblical-hebrew
13
+ - koine-greek
14
+ - latin-vulgate
15
+ - e8-lattice
16
+ - hallucination-reduction
17
+ - sovereign-engine
18
+ license: other
19
+ license_name: sectl-1.0
20
+ license_link: https://github.com/JLeeV/sovereign-engine/blob/main/LICENSE
21
  ---
22
+
23
+ # Titulus_E8 — Geometric LoRA Adapter
24
+
25
+ **Titulus_E8** is a LoRA fine-tuning adapter for causal language models, trained on the trilingual Biblical corpus
26
+ (Hebrew Tanakh · Koine Greek NT/LXX · Latin Vulgate) with a **Topological Coherence Loss** that anchors the
27
+ model's embedding space to the [E8 lattice](https://en.wikipedia.org/wiki/E8_lattice).
28
+
29
+ The adapter is part of the **Sovereign Geometric Model (SGM)** architecture from
30
+ [Sovereign Engine](https://github.com/JLeeV/sovereign-engine), a distributed geometric AI system that uses
31
+ discrete lattice mathematics to eliminate LLM hallucinations by construction.
32
+
33
+ ---
34
+
35
+ ## The Name
36
+
37
+ The *Titulus Crucis* — the inscription nailed above the cross — was written in three languages: Hebrew, Latin,
38
+ and Greek (John 19:20). It is one of the most historically significant trilingual documents in existence and the
39
+ conceptual anchor for this system. The trilingual structure mirrors the three corpus languages exactly.
40
+
41
+ ---
42
+
43
+ ## Architecture
44
+
45
+ ```
46
+ Base Model (Qwen2.5-0.5B-Instruct)
47
+ │
48
+ ├── LoRA Adapter ← Titulus_E8
49
+ │ rank=32, alpha=64
50
+ │ target: q_proj, v_proj
51
+ │
52
+ └── E8 Logit Mask (inference-time geometric constraint)
53
+ - every vocabulary token → 8D IPA phonetic coordinate
54
+ - coordinate snapped to nearest of 240 E8 roots (Babai CVP)
55
+ - logits attenuated for tokens that drift beyond geodesic radius
56
+ ```
57
+
58
+ ### Training Objective
59
+
60
+ The adapter is trained with a **dual loss**:
61
+
62
+ ```
63
+ L = λ_lm · CE_loss + λ_topo · TopologicalCoherenceLoss
64
+
65
+ TopologicalCoherenceLoss = mean( min_j ||h_i - e8_root_j||² )
66
+ ```
67
+
68
+ Where `h_i` are the final hidden-state vectors and `e8_root_j` are the 240 roots of the E8 lattice,
69
+ projected into the model's hidden dimension. This forces semantically related embeddings to cluster
70
+ near valid lattice coordinates — making hallucination geometrically costly rather than just statistically
71
+ unlikely.
72
+
73
+ ---
74
+
75
+ ## Training Data
76
+
77
+ | Language | Corpus | Source |
78
+ |---|---|---|
79
+ | **Biblical Hebrew** | Westminster Leningrad Codex (Masoretic Text) | `christos-c/bible-corpus` |
80
+ | **Koine Greek** | Nestle-Aland NT + Septuagint (LXX) | `christos-c/bible-corpus` |
81
+ | **Latin** | Clementine Vulgate | `christos-c/bible-corpus` |
82
+
83
+ Each training sample interleaves all three translations of a canonical verse:
84
+
85
+ ```
86
+ [HE] בְּרֵאשִׁית בָּרָא אֱלֹהִים אֵת הַשָּׁמַיִם וְאֵת הָאָרֶץ
87
+ [GR] Ἐν ἀρχῇ ἐποίησεν ὁ θεὸς τὸν οὐρανὸν καὶ τὴν γῆν
88
+ [LA] In principio creavit Deus caelum et terram
89
+ ```
90
+
91
+ The model learns to associate semantically equivalent expressions across three typologically distinct
92
+ language families — forcing its latent space to develop representations that are stable across linguistic
93
+ surface variation.
94
+
95
+ ---
96
+
97
+ ## Usage
98
+
99
+ ### As a standard PEFT adapter
100
+
101
+ ```python
102
+ from transformers import AutoTokenizer, AutoModelForCausalLM
103
+ from peft import PeftModel
104
+
105
+ base_model_id = "Qwen/Qwen2.5-0.5B-Instruct"
106
+ adapter_id = "JLeeV/Titulus_E8"
107
+
108
+ tokenizer = AutoTokenizer.from_pretrained(base_model_id)
109
+ model = AutoModelForCausalLM.from_pretrained(base_model_id)
110
+ model = PeftModel.from_pretrained(model, adapter_id)
111
+
112
+ inputs = tokenizer("In the beginning", return_tensors="pt")
113
+ output = model.generate(**inputs, max_new_tokens=50)
114
+ print(tokenizer.decode(output[0]))
115
+ ```
116
+
117
+ ### With Geometric Logit Mask (full SGM pipeline)
118
+
119
+ ```python
120
+ from transformers import AutoTokenizer, AutoModelForCausalLM, LogitsProcessorList
121
+ from peft import PeftModel
122
+ from sov_heart.logit import GeometricLogitMask
123
+
124
+ base_model_id = "Qwen/Qwen2.5-0.5B-Instruct"
125
+ tokenizer = AutoTokenizer.from_pretrained(base_model_id)
126
+ model = PeftModel.from_pretrained(
127
+ AutoModelForCausalLM.from_pretrained(base_model_id),
128
+ "JLeeV/Titulus_E8"
129
+ )
130
+
131
+ # Build geometric constraint interceptor
132
+ processor = GeometricLogitMask.as_logits_processor(
133
+ tokenizer,
134
+ radius=3.0, # geodesic tolerance (tighter = stricter)
135
+ soft_mask=True, # Gaussian attenuation vs hard zeroing
136
+ cache_path="/tmp/titulus_token_coords.npy", # cache for fast reload
137
+ )
138
+
139
+ inputs = tokenizer("Explain the concept of logos", return_tensors="pt")
140
+ output = model.generate(
141
+ **inputs,
142
+ max_new_tokens=200,
143
+ logits_processor=LogitsProcessorList([processor]),
144
+ )
145
+ print(tokenizer.decode(output[0]))
146
+ ```
147
+
148
+ ---
149
+
150
+ ## Installation
151
+
152
+ ```bash
153
+ pip install peft transformers torch
154
+
155
+ # For the full SGM geometric constraint system:
156
+ git clone https://github.com/JLeeV/sovereign-engine
157
+ cd sovereign-engine && pip install -e .
158
+ ```
159
+
160
+ ---
161
+
162
+ ## Geometric Coordinate Mapping
163
+
164
+ Each token in the vocabulary is mapped to an **8-dimensional E8 coordinate** using IPA phonetic features:
165
+
166
+ | Dimension | Feature |
167
+ |---|---|
168
+ | 0 | Stop consonant ratio (p, b, t, d, k, g, q) |
169
+ | 1 | Fricative ratio (s, z, v, ʃ, ħ, θ, f, x) |
170
+ | 2 | Nasal ratio (m, n) |
171
+ | 3 | Vowel ratio (a, e, i, o, u, y) |
172
+ | 4 | Liquid ratio (r, l) |
173
+ | 5 | Mean Unicode codepoint (normalised to Hebrew range) |
174
+ | 6 | Script class (0=Latin, 0.5=Greek, 1.0=Hebrew/Semitic) |
175
+ | 7 | Syllable density (syllables per character) |
176
+
177
+ The raw 8D vector is then snapped to the nearest of the **240 roots of the E8 lattice** using Babai's
178
+ Closest Vector Problem (CVP) algorithm — guaranteeing all token coordinates are valid lattice points.
179
+
180
+ ---
181
+
182
+ ## License
183
+
184
+ This adapter is released under the **Sovereign Engine Cooperative and Topological License (SECTL) v1.0**.
185
+ See [LICENSE](https://github.com/JLeeV/sovereign-engine/blob/main/LICENSE) for full terms.
186
+
187
+ The training corpus texts (Westminster Leningrad Codex, NA28, Clementine Vulgate) are in the public domain.
188
+
189
+ ---
190
+
191
+ ## Citation
192
+
193
+ ```bibtex
194
+ @misc{titulus_e8_2026,
195
+ author = {JLeeV},
196
+ title = {Titulus\_E8: A Geometric LoRA Adapter Anchored to the E8 Lattice},
197
+ year = {2026},
198
+ publisher = {HuggingFace},
199
+ howpublished = {\url{https://huggingface.co/JLeeV/Titulus_E8}},
200
+ note = {Part of the Sovereign Engine geometric AI architecture}
201
+ }
202
+ ```