- Ancient Corpus & Translator Collection β Technical Report
- 1. Two Research Tracks & Collection Rationale
- 2. Part I β From-Scratch V10 Decoder (
ancient-corpus-v10) - 3. Part II β Clean Translator Suite (
T402,T510) - 4. Part III β Continued Pretraining (
CPT) Scaling Study (T499vsT459) - 5. Part IV β Parameter & Storage Breakdown
- 6. Part V β Complete Attribution & Licensing Summary
- 1. Two Research Tracks & Collection Rationale
Ancient Corpus & Translator Collection β Technical Report
This report consolidates the architecture, data curation, training recipes, rights governance, and benchmark findings across the Ancient Corpus Collection:
ancient-corpus-v10β A 201.8M-parameter decoder trained from scratch on ancient primary texts (r5, 46.2M words / 91.2M tokens) with Engram hashed n-gram memory, chat SFT (v10-chatRun 2), and quantized ONNX/WebGPU browser exports (plus reservedv10.1slot).ancient-translator-granite-3bβFT1bLoRA adapter onibm-granite/granite-4.2-3b(4e9c275e232f10211ec88644d106a1f6a1b60e06), plusvariants/b3b-akkadian-cpt(B-3Brank-32 Akkadian CPT+SFT adapter) and reservedvariants/t518-latin-bidirectionalnote.ancient-translator-granite-8bβFT2-G8LoRA adapter onibm-granite/granite-4.2-8b(a7042144125ce5ae64f89610e8289647fc000b9a).ancient-translator-gemma-12bβFT2-G12LoRA adapter ongoogle/gemma-4-12b-it(43c9d014b231474fa7212dbb48a762566c2b255d).ancient-translator-evalβ Standalone, zero-path evaluation harness (CE1/CE1b/Bible/hits_excluded/compare_kshot), deterministic dataset rebuilders, Public Domain Bible items, and sanitized JSON result logs.
1. Two Research Tracks & Collection Rationale
Ancient-language modeling faces an acute split between two tasks:
- In-language historical modeling & client-side demonstration (
ancient-corpus-v10): Building a clean-room, small-footprint (201.8Mparams) decoder from scratch strictly on rights-checked primary sources (r5), runnable locally in Python or natively in a browser via WebGPU (340 MBQ4). - Modern translation (
ancient-translator-*): Translating ancient Egyptian, Akkadian, Ancient Greek, Latin, Coptic, and Syriac into English or German requires broad modern-target fluency and instruction following. Rather than scaling a from-scratch corpus into modern English/German pretraining, we screened open-weights instruction models under identical evaluation rules (CE1/CE1b) and fine-tuned Apache-2.0 LoRA adapters (3B,8B,12B) on curated parallel data (mix-v5).
2. Part I β From-Scratch V10 Decoder (ancient-corpus-v10)
Architecture (QualityDecoder + Engram)
- Geometry:
24layers,width = 768,ffn = 2048(SwiGLU), GQA12Q /4KV heads (d_head = 64), RMSNorm (eps = 1e-5), tied input/output embeddings (32,768 x 768=25,165,824params), trained context2,048withdoc_idsisolating attention, RoPE, and conv boundaries between packed documents. - Hybrid Context:
18local sliding-window layers (window = 1024, RoPEtheta = 10,000) interleaved with6global layers at indices3, 7, 11, 15, 19, 23(RoPEtheta = 1,000,000). - Engram Memory: Multi-order hashed n-gram memory (
orders = (2, 3),4heads/order,d_head = 64, prime buckets(32771, 65537)) injected after block0via sigmoid context gating and causalconv_kernel = 4ShortConv (25,570,056params, of which25,166,848are table weights). - Exact Parameter Budget:
201,768,456total (151,031,808block +25,165,824tied embedding +25,570,056Engram +768final norm).
Pretraining (r5), Chat SFT (Run 2), and Safety Checks
- Pretraining (
r5, frozen 2026-11-19):481,670rows /46,224,122words /91,189,888BPE tokens (ancient-v10-bpe-32768, zero NC/ND or internal-only V9 sources).v10-r5-base-202machieves1.4979BPC[1.4479, 1.5669]pooled across6,827held-out test documents (akk 1.0822,lat 1.3566,grc 1.5172,egy 2.4897,cop 2.6246,syr 2.6578,non 2.7915,san 3.4197). - Run-2 Chat SFT (
v10-chat): Trained 3 epochs (519steps,lr = 5e-5, Engram tables frozen bit-for-bit,20%r5target replay) on2,284encoded conversations (880,282supervised tokens across Track A227+T281reverse-SFT1,900+T293Project Gutenberg Latin173) using theA_anglebyte-level template (@@\n/>>\n/<<\n, explicitEOS_ID = 0). Macro retention shift ondevwas+0.0258BPC[0.0249, 0.0267]. - Decoding & Measured Limits: Greedy decoding fails (
17/27verbatim loops). Shippingsample_rp(temperature=0.7, top_p=0.9, rep_penalty=1.15, no_repeat_ngram=4, max_new=256) yields74/75prompt-language script fidelity (29/30Greek,45/45Latin) and only3/75rows with word-repeat> 0.5, while49/75stop on EOS (26/75hit the256-token cap). Crucially,v10-chatis not a question-answering modelβit generates fluent register-matched Latin/Greek prose rather than factual QA. - Verbatim Reproduction (
T345): VerdictNO_FLAG(longestsample_rpexact match tor5train text73tokens vs200threshold;<= +0.7pp seenβunseen>= 50-token share; SFT own-target recall0 / 1,900). - Browser ONNX / WebGPU (
onnx-webgpu/):q4_b16_asym(339.9MB) decodes at6.4β6.8 tok/s(27/27parity vs Node CPU) on R9700 WebGPU and4.2β4.6 tok/s(12/27parity) on RTX 4060 Ti WebGPU;q8(400.6MB) achieves0/27CPU divergence vs FP32 (q4_b16_asym:8/27). - Reserved
v10.1/slot: Tracked forT524(v10-1-cpt-pilot-v1), testing CPT ofv10-r5-base-202mwithT523DeepSeek-translated Latin shards prior to Run-2 + Phase 0b /T334chat fine-tuning.
3. Part II β Clean Translator Suite (T402, T510)
Training Data (mix-v5, 74,952 Rows)
mix-v5 keeps the exact 60,000 expanded rows of merged-v4 (41,737 unique IDs) and appends 14,952 Public Domain eBible verses (19.95% share pre-drop, uniformly sampled across 77 non-held-out books from grcbyz, grcbrent, and latVUC paired with engbsb, eng_web, and eng_Brenton):
- By direction (
74,952pre-drop rows):grc-en25,109(6,041papyri +1,093CTS +7,476Bible +10,499silver),akk-en17,634(SAAO),egy-de17,633(AED/TLA),lat-en13,624(7,476Bible +6,148silver),cop-en944(Coptic Scriptorium),syr-en8(Digital Syriac Corpus). - Teachers for the
4,311unique silver rows (16,647expanded rows): Apache-2.0 outputs fromgemma-4-31b-it(Q4_K_M) andqwen-3.8-27b(UD-Q5_K_M) overFirst1KGreek,canonical-greekLit, andcanonical-latinLit. - Tokenizer encoding (
<= 2048, never truncated): Granite (FT1b,FT2-G8):74,772surviving examples (180dropped,21.59Mprocessed /5.22Msupervised tokens). Gemma 4 (FT2-G12):74,946surviving examples (6dropped,15.08Mprocessed /5.12Msupervised tokens).
Main Benchmark Comparison (chrF2, Greedy, 2,000-Resample Cluster Bootstrap)
| Model | Settings | CE1 akk-en (300) |
CE1 egy-de (300) |
CE1 grc-en* (44) |
CE1b grc-en (50) |
CE1b lat-en (52) |
Hits-Excl akk-en (258) |
Hits-Excl egy-de (292) |
|---|---|---|---|---|---|---|---|---|
Stock Gemma 4 31B |
k=0 GGUF |
24.5 (24.66β ) | 25.3 (25.23β ) | 49.4 | 44.0 | 33.0 | 24.66 | 25.23 |
Stock Gemma 4 31B |
k=3 (lat k=0) |
28.29 | 27.23 | 49.94 | 43.82 | 33.01 | 28.35 | 27.18 |
Stock Granite 4.2 8B |
k=0 HF BF16 (S0) |
12.6 | 9.6 | 34.9 | 36.6 | 28.7 | β | β |
FT1 (Granite 3B) |
k=0 BF16+LoRA |
42.64 | 33.60 | 48.53 | 39.23 | 29.21 | 40.47 | 33.28 |
FT1b (Granite 3B) |
k=0 BF16+LoRA |
42.66 | 35.06 | 49.96 | 39.16 | 29.35 | 40.46 | 34.81 |
B-3B (Granite 3B Akk CPT) |
k=0 BF16+LoRA |
44.68 | 34.61 | 50.76 | β | β | 42.14 | β |
FT2-G8 (Granite 8B) |
k=0 BF16+LoRA |
46.26 | 37.52 | 53.59 | 41.04 | 30.79 | 43.77 | 37.36 |
FT2-G12 (Gemma 4 12B) |
k=0 BF16+LoRA |
45.73 | 35.03 | 54.55 | 42.72 | 32.15 | 43.98 | 34.89 |
*CE1 grc-en (44 papyri) is below the 50-item gate and descriptive only. β On the hits-excluded subset.
Key Empirical Findings (T402 + T510)
- Low-resource adaptation is dramatic (
+18to+22chrF2 over stockGemma 4 31B k=0): On Akkadian and Egyptian,FT2-G8leads stock 31B (k=0) by+21.7 [+17.9, +25.7](akk-en) and+12.2 [+9.5, +15.2](egy-de). - Model specialization (
G8vsG12):FT2-G8is the clear leader on Egyptian (37.52vsFT2-G1235.03, paired+2.49 [+0.42, +4.89]) and tiesG12on Akkadian (46.26vs45.73full;43.77vs43.98hits-excluded).FT2-G12leads Ancient Greek & classical literary Latin (+1.69 [+0.68, +2.59]CE1b grc-enand+1.36 [+0.82, +1.97]CE1b lat-enoverG8), though all fine-tunes still trailGemma 4 31Bslightly on classicalCE1b(-1.09grc,-0.86latforG12). - Overlap sensitivity (
hits_excluded_t402.py): Removing all50base-overlap CE1 items (42 akk-en,8 egy-de) leaves every fine-tune15β19chrF ahead onakk-enand8β12chrF ahead onegy-de. - Zero-shot (
k=0) vs 3-shot (k=3) (T510): While few-shot exemplars help stockGemma 4 31B(+3.7akk-en,+1.9egy-de), they hurt fine-tuned models (FT1b k=3 β k=0:-1.7akk-en,-2.5egy-de,-4.8CE1 grc-en). Deploy the fine-tunes atk=0withenable_thinking=False. - Bible augmentation (
FT1bvsFT1): Adding14,952PD Bible rows improved held-out BiblechrF2(+3.27grc_nt,+8.75lat) without introducing archaism leakage (<= 4%Bible-style rate onCE1b), while showing no significant movement onCE1/CE1b.
4. Part III β Continued Pretraining (CPT) Scaling Study (T499 vs T459)
| Study | Base Size | CPT Mix & Scale | Effect on Held-Out Ancient BPC (CPT-only) | Post-SFT Translation Delta (B β A chrF2) |
English BPC Delta (B β A) |
Outcome |
|---|---|---|---|---|---|---|
T499 (B-3B) |
Granite 3B (r=16) |
4.5M akk (r5) + 0.5M oasst2 replay (5.0M tot) |
akk: 2.880 -> 1.337 |
CE1 akk-en: +2.02 [+0.58, +3.50] (+1.68 [+0.29, +3.16] hits-excluded) |
-0.013 |
CPT_HELPS (B-3B staged as rank-32 variant) |
T459 (B-8B) |
Granite 8B (r=16) |
13.5M 8 langs (r5) + 1.5M oasst2 replay (15.0M tot) |
Pooled 8 langs: 2.745 -> 1.792 (lower in all 8) |
Pooled 4 gated dirs: +0.30 [-0.29, +0.86] (akk +0.43, egy +0.65, CE1b grc -0.09, lat +0.20) |
-0.042 |
CPT_NO_GAIN (FT2-G8 kept without CPT) |
T518 (reserved) |
Granite 3B (r=64 CPT) |
25.0M lat (r5) + 2.78M oasst2 replay (27.8M tot) |
Reserved | Bidirectional lat<->en (64,438 PD Bible rows) |
Reserved | Reserved under granite-3b/variants/ |
Mechanism & Packaging takeaway:
- On Granite
3B,5.0Mfocused Akkadian CPT genuinely lowered Akkadian perplexity (2.880 -> 1.337BPC) and transferred to+2.02chrF2 after SFT. BecauseB-cpt-3B(r=16, alpha=32) andB-3BSFT (r=16, alpha=32) target the exact same 7 linear module types per layer, concatenatingAalongdim=0andBalongdim=1produces a singler=32, lora_alpha=64adapter (variants/b3b-akkadian-cpt/, algebraic delta2.79e-09vsW_0 + dW_cpt + dW_sft,1.46e-03FP32 /1.95e-03[1 ULP] BF16 vs intermediate BF16-mergedW_m) directly usable on stock Granite 3B. - On Granite
8B,15.0Mmulti-language CPT (~1.6MAkkadian) similarly lowered raw BPC across all 8 languages (2.745 -> 1.792), yetFT2-G8SFT (21.6Mprocessed tokens) already supplied enough signal that post-SFT CE1/CE1b scores showed no significant difference (+0.30 [-0.29, +0.86]).
5. Part IV β Parameter & Storage Breakdown
Translator LoRA Adapters (FP32 Safetensors on Disk)
| Repo / Variant | Base Model (Pinned Commit) | LoRA Shape | Modules | Trainable Params | FP32 Size (Bytes / MB) | BF16 Equiv. |
|---|---|---|---|---|---|---|
ancient-translator-granite-3b (FT1b) |
ibm-granite/granite-4.2-3b (4e9c275eβ¦) |
r=16, alpha=32 |
280 (560 tensors) |
31,129,600 | 124,593,064 (118.8 MiB) |
~62.3 MB |
ancient-translator-granite-8b (FT2-G8) |
ibm-granite/granite-4.2-8b (a7042144β¦) |
r=16, alpha=32 |
280 (560 tensors) |
49,479,680 | 197,993,952 (188.8 MiB) |
~99.0 MB |
ancient-translator-gemma-12b (FT2-G12) |
google/gemma-4-12b-it (43c9d014β¦) |
r=16, alpha=32 |
328 (656 tensors) |
65,568,768 | 262,373,216 (250.2 MiB) |
~131.1 MB |
| Sum of 3 Primary Adapters | β | β | 888 | 146,178,048 | 584,960,232 (557.9 MiB / 585.0 MB) |
~292.4 MB |
granite-3b/variants/b3b-akkadian-cpt |
ibm-granite/granite-4.2-3b (4e9c275eβ¦) |
r=32, alpha=64 |
280 (560 tensors) |
62,259,200 | 249,111,936 (237.6 MiB) |
~124.5 MB |
V10 Model Artifacts (ancient-corpus-v10)
model.safetensors(v10-chatRun 2, FP32):807,094,440bytes (769.7 MiB,201,768,456params).v10-r5-base-202m/model.safetensors(FP32):807,094,440bytes (769.7 MiB,201,768,456params).onnx-webgpu/models/q4_b16_asym/:339,928,958bytes (.onnx+.onnx.data).onnx-webgpu/models/q8/:400,592,000bytes (.onnx+.onnx.data).
6. Part V β Complete Attribution & Licensing Summary
See PROVENANCE_AND_LICENSING.md for the exhaustive file-level provenance, commit pins, dataset/edition citations, and redistribution rules, and COLLECTION_MANIFEST.json for verified SHA-256 checksums and exact byte counts across all staged artifacts.