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:

  1. 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-chat Run 2), and quantized ONNX/WebGPU browser exports (plus reserved v10.1 slot).
  2. ancient-translator-granite-3b β€” FT1b LoRA adapter on ibm-granite/granite-4.2-3b (4e9c275e232f10211ec88644d106a1f6a1b60e06), plus variants/b3b-akkadian-cpt (B-3B rank-32 Akkadian CPT+SFT adapter) and reserved variants/t518-latin-bidirectional note.
  3. ancient-translator-granite-8b β€” FT2-G8 LoRA adapter on ibm-granite/granite-4.2-8b (a7042144125ce5ae64f89610e8289647fc000b9a).
  4. ancient-translator-gemma-12b β€” FT2-G12 LoRA adapter on google/gemma-4-12b-it (43c9d014b231474fa7212dbb48a762566c2b255d).
  5. 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.8M params) decoder from scratch strictly on rights-checked primary sources (r5), runnable locally in Python or natively in a browser via WebGPU (340 MB Q4).
  • 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: 24 layers, width = 768, ffn = 2048 (SwiGLU), GQA 12 Q / 4 KV heads (d_head = 64), RMSNorm (eps = 1e-5), tied input/output embeddings (32,768 x 768 = 25,165,824 params), trained context 2,048 with doc_ids isolating attention, RoPE, and conv boundaries between packed documents.
  • Hybrid Context: 18 local sliding-window layers (window = 1024, RoPE theta = 10,000) interleaved with 6 global layers at indices 3, 7, 11, 15, 19, 23 (RoPE theta = 1,000,000).
  • Engram Memory: Multi-order hashed n-gram memory (orders = (2, 3), 4 heads/order, d_head = 64, prime buckets (32771, 65537)) injected after block 0 via sigmoid context gating and causal conv_kernel = 4 ShortConv (25,570,056 params, of which 25,166,848 are table weights).
  • Exact Parameter Budget: 201,768,456 total (151,031,808 block + 25,165,824 tied embedding + 25,570,056 Engram + 768 final norm).

Pretraining (r5), Chat SFT (Run 2), and Safety Checks

  • Pretraining (r5, frozen 2026-11-19): 481,670 rows / 46,224,122 words / 91,189,888 BPE tokens (ancient-v10-bpe-32768, zero NC/ND or internal-only V9 sources). v10-r5-base-202m achieves 1.4979 BPC [1.4479, 1.5669] pooled across 6,827 held-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 (519 steps, lr = 5e-5, Engram tables frozen bit-for-bit, 20% r5 target replay) on 2,284 encoded conversations (880,282 supervised tokens across Track A 227 + T281 reverse-SFT 1,900 + T293 Project Gutenberg Latin 173) using the A_angle byte-level template (@@\n / >>\n / <<\n, explicit EOS_ID = 0). Macro retention shift on dev was +0.0258 BPC [0.0249, 0.0267].
  • Decoding & Measured Limits: Greedy decoding fails (17/27 verbatim loops). Shipping sample_rp (temperature=0.7, top_p=0.9, rep_penalty=1.15, no_repeat_ngram=4, max_new=256) yields 74/75 prompt-language script fidelity (29/30 Greek, 45/45 Latin) and only 3/75 rows with word-repeat > 0.5, while 49/75 stop on EOS (26/75 hit the 256-token cap). Crucially, v10-chat is not a question-answering modelβ€”it generates fluent register-matched Latin/Greek prose rather than factual QA.
  • Verbatim Reproduction (T345): Verdict NO_FLAG (longest sample_rp exact match to r5 train text 73 tokens vs 200 threshold; <= +0.7 pp seenβˆ’unseen >= 50-token share; SFT own-target recall 0 / 1,900).
  • Browser ONNX / WebGPU (onnx-webgpu/): q4_b16_asym (339.9 MB) decodes at 6.4–6.8 tok/s (27/27 parity vs Node CPU) on R9700 WebGPU and 4.2–4.6 tok/s (12/27 parity) on RTX 4060 Ti WebGPU; q8 (400.6 MB) achieves 0/27 CPU divergence vs FP32 (q4_b16_asym: 8/27).
  • Reserved v10.1/ slot: Tracked for T524 (v10-1-cpt-pilot-v1), testing CPT of v10-r5-base-202m with T523 DeepSeek-translated Latin shards prior to Run-2 + Phase 0b / T334 chat 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,952 pre-drop rows): grc-en 25,109 (6,041 papyri + 1,093 CTS + 7,476 Bible + 10,499 silver), akk-en 17,634 (SAAO), egy-de 17,633 (AED/TLA), lat-en 13,624 (7,476 Bible + 6,148 silver), cop-en 944 (Coptic Scriptorium), syr-en 8 (Digital Syriac Corpus).
  • Teachers for the 4,311 unique silver rows (16,647 expanded rows): Apache-2.0 outputs from gemma-4-31b-it (Q4_K_M) and qwen-3.8-27b (UD-Q5_K_M) over First1KGreek, canonical-greekLit, and canonical-latinLit.
  • Tokenizer encoding (<= 2048, never truncated): Granite (FT1b, FT2-G8): 74,772 surviving examples (180 dropped, 21.59M processed / 5.22M supervised tokens). Gemma 4 (FT2-G12): 74,946 surviving examples (6 dropped, 15.08M processed / 5.12M supervised 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)

  1. Low-resource adaptation is dramatic (+18 to +22 chrF2 over stock Gemma 4 31B k=0): On Akkadian and Egyptian, FT2-G8 leads stock 31B (k=0) by +21.7 [+17.9, +25.7] (akk-en) and +12.2 [+9.5, +15.2] (egy-de).
  2. Model specialization (G8 vs G12): FT2-G8 is the clear leader on Egyptian (37.52 vs FT2-G12 35.03, paired +2.49 [+0.42, +4.89]) and ties G12 on Akkadian (46.26 vs 45.73 full; 43.77 vs 43.98 hits-excluded). FT2-G12 leads Ancient Greek & classical literary Latin (+1.69 [+0.68, +2.59] CE1b grc-en and +1.36 [+0.82, +1.97] CE1b lat-en over G8), though all fine-tunes still trail Gemma 4 31B slightly on classical CE1b (-1.09 grc, -0.86 lat for G12).
  3. Overlap sensitivity (hits_excluded_t402.py): Removing all 50 base-overlap CE1 items (42 akk-en, 8 egy-de) leaves every fine-tune 15–19 chrF ahead on akk-en and 8–12 chrF ahead on egy-de.
  4. Zero-shot (k=0) vs 3-shot (k=3) (T510): While few-shot exemplars help stock Gemma 4 31B (+3.7 akk-en, +1.9 egy-de), they hurt fine-tuned models (FT1b k=3 βˆ’ k=0: -1.7 akk-en, -2.5 egy-de, -4.8 CE1 grc-en). Deploy the fine-tunes at k=0 with enable_thinking=False.
  5. Bible augmentation (FT1b vs FT1): Adding 14,952 PD Bible rows improved held-out Bible chrF2 (+3.27 grc_nt, +8.75 lat) without introducing archaism leakage (<= 4% Bible-style rate on CE1b), while showing no significant movement on CE1/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.0M focused Akkadian CPT genuinely lowered Akkadian perplexity (2.880 -> 1.337 BPC) and transferred to +2.02 chrF2 after SFT. Because B-cpt-3B (r=16, alpha=32) and B-3B SFT (r=16, alpha=32) target the exact same 7 linear module types per layer, concatenating A along dim=0 and B along dim=1 produces a single r=32, lora_alpha=64 adapter (variants/b3b-akkadian-cpt/, algebraic delta 2.79e-09 vs W_0 + dW_cpt + dW_sft, 1.46e-03 FP32 / 1.95e-03 [1 ULP] BF16 vs intermediate BF16-merged W_m) directly usable on stock Granite 3B.
  • On Granite 8B, 15.0M multi-language CPT (~1.6M Akkadian) similarly lowered raw BPC across all 8 languages (2.745 -> 1.792), yet FT2-G8 SFT (21.6M processed 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-chat Run 2, FP32): 807,094,440 bytes (769.7 MiB, 201,768,456 params).
  • v10-r5-base-202m/model.safetensors (FP32): 807,094,440 bytes (769.7 MiB, 201,768,456 params).
  • onnx-webgpu/models/q4_b16_asym/: 339,928,958 bytes (.onnx + .onnx.data).
  • onnx-webgpu/models/q8/: 400,592,000 bytes (.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.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Collection including bclownin/ancient-corpus-technical-report