Nekyia: Eidolon

Eidolon: a winged phantom hovering above an offering of oil and pomegranates on an Attic white-ground lekythos

Try it live (ZeroGPU Space): huggingface.co/spaces/calgach/nekyia-eidolon — interactive Ancient Greek chat with <λογισμός> reasoning and live <πηγή> retrieval over 246,509 public-domain Greek passages.

ordos-research/nekyia-eidolon is a 974.7M-parameter causal language model trained from zero for Ancient Greek with a composition cutoff of 610 CE.

In the Nekyia project, Eidolon (εἴδωλον — "image, phantom") is the experimental lane that explores how far a small, from-scratch historical language model can be pushed without pretrained modern weights: dedicated single-language capacity, source-grounded Ancient Greek augmentation (multi-turn dialogues, step-by-step <λογισμός> reasoning traces, conceptual views, and pre-610 Latin-to-Greek translations), PPMI+SVD embedding initialization, the Muon optimizer, staged annealing back onto 100% genuine ancient Greek, corpus-grounded <πηγή> retrieval training, and Ancient Greek GRPO reinforcement learning.

Compared to ordos-research/nekyia-akhilleus (324M parameters, Greek + Latin, trained on genuine text alone), Eidolon raises direct-answer quality on the 20 fixed Attic Greek questions from 0.45 (8/20 passing) to 0.89 (20/20 passing), raises real-pair question gain from +0.19 to +0.50 nats/token, and raises 30-fact classical Greek direct recall 5× (2/30 → 10/30) while passing 8/8 pre-610 quarantine probes.

Example answers

Examples from the top-level chat model (Eidolon-1B GRPO-150, temperature 0.75, 6 candidates ranked by question mutual information) on the fixed Attic Greek questions (docs/QUESTIONS.md):

  • Question: τί ἄριστον ἐν τῷ βίῳ; ("What is best in life?")

    • <λογισμός> (inner reasoning): Σκοπῶ πρῶτον τὰ φαινόμενα: πλοῦτος, ὑγίεια, κάλλος, ἰσχύς, εἰρήνη καὶ πόλεμος. Ἀλλὰ ταῦτα πάντα μεταπίπτει καὶ οὐδὲν μένει. Δεῖ οὖν ζητεῖν τὸ βέβαιον, ὃ οὔτε τύχη δίδωσιν οὔτε ἀφαιρεῖται, ἀλλὰ τὸν νοῦν ἀπαλλάττει φόβου, φθόνου καὶ ταραχῆς.
    • Answer: Ἄριστον τὸ μὴ μεταβαλλόμενον. Πλοῦτος γὰρ καὶ ὑγίεια καὶ ἰσχὺς τύχης ἔργα εἰσίν, ἀλλ’ ὁ σώφρων οὔτε τούτοις ἐπαίρεται οὔτε ὑπ’ αὐτῶν δουλοῦται. Τὸ δὲ βέβαιον ἦθος ἐν εἰρήνῃ καὶ πολέμῳ βέβαιον ἔχει κάλλος.
    • Gloss: Best is what does not change. Wealth, health, and strength are works of fortune, but the temperate person is neither puffed up by them nor enslaved by them. A steadfast character keeps its beauty in peace and in war.
  • Question: τί ἐστι δικαιοσύνη; ("What is justice?")

    • Answer: Δικαιοσύνη ἐστὶν ἕξις ἀρίστη, ἣ οὔτε μόνον κατὰ τὸ πρᾶγμα οὔτε μόνον κατὰ τὴν ἕξιν λέγεται. Ὁ γὰρ τοῖς οὖσι χρώμενος ὡς δεῖ καὶ κατὰ τὸν ὀρθὸν λόγον, οὗτος δικαιοσύνην ἔχει.
    • Gloss: Justice is the best disposition, spoken of neither merely by the deed nor merely by the state alone. The one who uses what exists as one ought and according to right reason possesses justice.
  • Question: τί ἐστιν ἀρετή, καὶ διδακτόν ἐστιν; ("What is virtue, and can it be taught?" — with live <πηγή> retrieval from Philoponus & Plato’s Meno)

    • Answer: Ἀρετή ἐστιν ἕξις ψυχῆς ἀρίστη, καθ᾽ ἣν τὸ ἔχον εὖ πράττει καὶ τὸ ἀγαθὸν αὐτοῦ εὖ διατίθησιν. Διδακτὸν δὲ ἡ ἀρετή, οὐχ ὡς ἐπιστήμη τις ἐν τοῖς συλλογισμοῖς μόνον οὖσα, ἀλλ᾽ ὡς ἕξις ψυχῆς ἀγαθὴ καὶ πράξεως ἀρχὴ καὶ δύναμις.
    • Gloss: Virtue is the best disposition of the soul, by which its possessor acts well and orders their good well. Virtue is teachable, not merely as a science consisting in syllogisms, but as a good disposition of the soul and a principle and power of action.
  • Question: τί ἐστι φιλία; ("What is friendship?" — with noisy retrieval passages, which the model explicitly identifies and rejects inside <λογισμός>)

    • <λογισμός>: Αἱ παρατιθέμεναι γραφαὶ οὐκ ἀποκρίνονται τῷ ζητουμένῳ· ἡ μὲν ὀνόματα φιλίας διακρίνει, ἡ δὲ ἐπιτύμβιον ἐπίγραμμα καὶ ἀναθήματα διηγεῖται. Ἄνευ τούτων δὲ οὐκ ἔστιν ἐκ τούτων λαβεῖν τί ἐστιν ἡ φιλία· χρὴ οὖν ἀνακαλεῖν τὴν παλαιὰν πολιτικὴν σημασίαν, μὴ πλάττειν ἀοριστίαν.
    • Answer: Φιλία, κατὰ τὴν ἀρχαίαν δόξαν, οὐκ ἔστιν ἁπλῶς εὔνοια οὐδὲ λόγος μόνον, ἀλλὰ κοινὴ διάθεσις καὶ κοινωνία βίου. Ὅταν γὰρ ἕτερος φίλος ᾖ τῷ ἑτέρῳ, καὶ αἱ λοιπαὶ σχέσεις ὁμοίως ἔχωσιν, τότε ἡ φιλία κοινωνία τίς ἐστι καὶ εὔνοια βεβαία. Ἄνευ δὲ τούτων, ὄνομα μᾶλλον ἢ πρᾶγμα ἡ φιλία μένει.

For comparison, on the same prompts nekyia-akhilleus produced circular fragments such as ὅτι νὴ Δίʼ οὐκ ἔστιν ἄλλη δικαιοσύνη, οὐδὲ δικαιοσύνη ἄλλη. and οὐ μόνον ἄρα διδακτόν, ἀλλὰ καὶ διδακτόν ἐστιν.

How to use it

Eidolon supports two prompt modes (both multi-turn, with no preamble):

1. Direct <λογισμός> reasoning mode (recommended default)

Prime the respondent turn with ΣΩ. <λογισμός> so the model deliberates in Ancient Greek before speaking, and stop at the first newline (\n):

<|doc|> lang=grc date=-400..-350 id=chat source=synth-logismos genre=dialogue
ΦΑΙ. τί ἄριστον ἐν τῷ βίῳ;
ΣΩ. <λογισμός>

2. Grounded <πηγή> RAG + <λογισμός> mode

Place 1 or 2 retrieved ancient Greek passages inside <πηγή author=NAME> ... </πηγή> before the question. The model is trained to cite/synthesize relevant passages and to explicitly discard irrelevant distractors during <λογισμός>:

<|doc|> lang=grc date=-400..250 id=chat source=tlg-rag genre=dialogue
<πηγή author=Plato> ...retrieved ancient Greek passage... </πηγή>
ΦΑΙ. τί ἐστιν ἀρετή, καὶ διδακτόν ἐστιν;
ΣΩ. <λογισμός>

Python example

Requires transformers >= 4.51 (tested with 4.55 and 5.22). The repository holds the GRPO-150 chat model at the top level and the annealed base model in base/.

import re, torch
from transformers import AutoTokenizer, AutoModelForCausalLM

repo = "ordos-research/nekyia-eidolon"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, torch_dtype=torch.bfloat16).eval()  # base: subfolder="base"

prompt = (
    "<|doc|> lang=grc date=-400..-350 id=chat source=synth-logismos genre=dialogue\n"
    "ΦΑΙ. τί ἄριστον ἐν τῷ βίῳ;\n"
    "ΣΩ. <λογισμός>"
)
ids = tok(prompt, return_tensors="pt", add_special_tokens=False).input_ids
newline = tok.encode("\n", add_special_tokens=False)[-1]

out = model.generate(
    ids,
    max_new_tokens=220,
    do_sample=True,
    temperature=0.75,
    top_p=0.95,
    eos_token_id=[newline, tok.eos_token_id],
    pad_token_id=tok.pad_token_id,
)
raw = "<λογισμός>" + tok.decode(out[0, ids.shape[1]:], skip_special_tokens=True).split("\n")[0]
m = re.match(r"^\s*<λογισμός>(.*?)</λογισμός>\s*(.*)$", raw, re.S)
thought, reply = (m.group(1).strip(), m.group(2).strip()) if m else ("", raw)
print("Thought:", thought)
print("Reply:  ", reply)

For highest consistency, sample 4–6 candidates and select the spoken reply with the highest question mutual-information score (as implemented in serve/app.py at https://github.com/conorreid/nekyia).

Why Eidolon improved so sharply over Akhilleus

Diagnostics on nekyia-akhilleus identified six bottlenecks:

  1. Capacity split across scripts: 324M parameters shared between Ancient Greek and Latin (~160M effective Greek capacity) with a 65,536-id bilingual vocabulary.
  2. Data scarcity & non-extractable knowledge: Only ~181M unique Greek tokens of mostly monologic treatises. On a 30-fact classical Greek probe inspired by Plato’s Key (Hazy Research, 2026), Akhilleus recalled only 2/30 facts directly, even though 46% of its misses were dark memories already stored in its weights.
  3. Weak question conditioning: Akhilleus base had a real-pair question gain of only +0.19 nats/token (compared to +0.35 on Dongpo and +0.48 on Virgilio’s scholastic Latin). Post-hoc fine-tuning on treatise excerpts did not fix this because base pretraining lacked direct Q&A structure.
  4. Cold embedding start and AdamW efficiency limits on a finite corpus.
  5. No test-time reasoning or RL optimization for direct answering and morphological purity.
  6. Untrained retrieval: Pasting raw retrieved passages into a small base model caused it to continue the passage rather than answer the question.

Eidolon addresses all six simultaneously while preserving a strict pre-610 CE knowledge horizon.

Training data (349.6M unique Greek tokens)

All genuine Greek text comes from the pre-610 CE akhilleus4 corpus (Perseus, First1KGreek, papyri.info, open inscription corpora, Patristic Text Archive, TLG, and cleaned public-domain OCR tiers) with the exact same whole-work holdouts (grc.txt, grc_dlg.txt, grc_ocr.txt).

Stem Content Unique tokens Base Phase 1 share Anneal Phase 2a share Final Cooldown share
grc_vet_cls (+ .aug) Genuine vetted classical & pagan Greek (to 250 CE + late pagan philosophers/commentators) + unaccented/scriptio continua copies 55.5M 19.8% 30.6% 55.0%
grc_vet_late (+ .aug) Genuine vetted late-antique & patristic Greek (251–610 CE) + orthographic copies 81.6M 22.4% 28.1% 45.0%
grc_ocr Genuine cleaned pre-610 Greek OCR tiers 63.2M 12.1% 6.5% 0%
grc_bronze Pre-610 Latin→Greek subset of Stoicheia’s SyntheticAncientGreek-CorpusCorporum, back-translations & holdouts excised 40.6M 5.6% 0% 0%
grc_sqa Source-grounded Attic/Koine erotapokriseis Q&A + multi-turn dialogues + classical Latin→Greek Q&A 25.9M 10.7% 8.9% 0%
grc_sview Source-grounded conceptual summaries, standalone facts, Attic paraphrases, epistles, and pre-250 Latin→Greek translations 37.2M 10.2% 6.4% 0%
grc_logismos Source-grounded multi-turn dialogues with <λογισμός>…</λογισμός> Ancient Greek reasoning traces 40.5M 16.7% 16.8% 0%
grc_rag BM25 TLG-E <πηγή>…</πηγή> + <λογισμός> grounded RAG examples (20% distractor passages) 5.1M 2.5% 2.7% 0%
Total 349.6M 100% 100% 100%

Hardening & anti-contamination gates on augmented text

  • Strict pre-610 grounding: Every synthetic passage was generated directly from a vetted pre-610 Greek or pre-250 Latin source chunk. Every holdout work and any chunk sharing ≥2 five-word skeleton shingles with any holdout document was excised before generation and checked again after generation.
  • Stoicheia bronze filtering: Only the 17.8% of Ericu950/SyntheticAncientGreek-CorpusCorporum matching pre-610 Latin works in corpus/dates.tsv entered grc_bronze. Known Latin translations of Greek works (Vulgate, Boethius’s Aristotle, Rufinus, Chalcidius, etc.) and 15,575 holdout-overlapping passages were excised.
  • Automated Greek purity gate: Every synthetic and bronze passage had to achieve ≥90% skeleton match against a 1,323,554-form lexicon extracted strictly from vetted pre-610 Greek, carry ≥12% polytonic characters (U+1F00..U+1FFF), contain zero Latin characters, digits, Modern Greek markers, or 4-gram loops, and pass train/leak_check.py with 0 editorial or post-610 marker hits.

Empirical proof before scaling (135M 3-arm pilot ablation)

Before launching the 1B run, three matched 121.8M-parameter (pilot) models trained for 2,500 steps (~655M tokens) on the exact same held-out genuine Greek works:

Unseen genuine Greek holdout (step 2,500) Pilot A (genuine only, random init) Pilot C (genuine + grounded synth + SVD + anneal, no bronze) Pilot B (genuine + synth + pre-610 bronze + SVD + anneal) B vs A
grc (all genuine vetted) 3.635 (ppl 37.9) 3.578 (ppl 35.8) 3.568 (ppl 35.4) −0.067
grc_vet_cls (classical/pagan) 3.665 (ppl 39.1) 3.609 (ppl 36.9) 3.605 (ppl 36.8) −0.060
grc_vet_late (late antique) 3.599 (ppl 36.6) 3.541 (ppl 34.5) 3.527 (ppl 34.0) −0.072
grc_dlg (genuine dialogue) 3.874 (ppl 48.1) 3.757 (ppl 42.8) 3.704 (ppl 40.6) −0.170 (−15.6% ppl)
grc_ocr (genuine OCR) 4.968 (ppl 143.8) 4.902 (ppl 134.5) 4.903 (ppl 134.7) −0.065

Both the grounded synthetic augmentation and the pre-610 Stoicheia bronze tier lowered held-out perplexity on every unseen genuine Greek stem.

Architecture & training

Architecture (Qwen3ForCausalLM)

Setting Value
Parameters 974.7 M (tied embeddings)
Layers 26
Width / Intermediate 1,792 / 4,864
Attention Grouped-Query Attention (28 query heads : 7 KV heads, head_dim 64), per-head QK-Norm, RoPE
Context window 2,048 tokens, best-fit whole-document packing with block-diagonal intra-document causal masking
Tokenizer Dedicated 48,000-id Greek-only byte-level BPE (1.52 tokens/word on classical prose)
Embedding init Window-2 PPMI + randomized SVD-128 over 231M Greek tokens, semi-orthogonally projected into d=1,792
Optimizer Hybrid Muon (batched 5-step Newton-Schulz, lr=0.015, wd=0.05, momentum 0.95) on 888.6M 2D hidden matrices + AdamW (lr=5e-4, wd=0.0) on 86.1M embeddings/norms
Regularization Residual dropout 0.1, z-loss 1e-5, bf16 mixed precision
Hardware 4× NVIDIA H100 80GB

Three-stage training pipeline

  1. Base pretraining + dev-driven staged annealing (6,500 steps, 1.92B tokens):

    • Steps 1–5,000 (1.47B tokens): Constant LR after 500-step warmup. Unseen genuine grc loss reached 3.432 (ppl 30.9) at step 4,500 before ticking up at step 5,000, triggering a dev-driven staged anneal from step5000.
    • Steps 5,000–5,798 (Stage 2a anneal): Linear LR decay begins; grc_bronze drops to 0, OCR halved. Unseen grc improved further to 3.424 (ppl 30.7), grc_dlg to 3.507, and grc_rag to 1.994.
    • Steps 5,798–6,500 (Final cooldown): 100% genuine vetted Greek (55% classical/pagan, 45% late antique) to anchor surface prose in authentic ancient Greek.
  2. Classical RAG + <λογισμός> SFT (200 steps selected of 250):

    • AdamW lr=3e-5, warmup 20, linear decay over final 60%, 65,536 tokens/step.
    • 40% genuine vetted Greek replay + 60% SFT (grc_sft_logismos 48.3% classical multi-turn reasoning dialogues, grc_rag 42.9% BM25 <πηγή> RAG examples, and grc_real_cls 8.7% genuine classical Greek pairs mined from Perseus/TLG and filtered by TypeSafe Jev).
  3. Ancient Greek GRPO reinforcement learning (150 steps):

    • Initialized from sft200 with frozen reference KL penalty (beta=0.04, Schulman k3 estimator), group=8 rollouts × 4 prompts/step (4,800 rollouts across 3,000 prompts: 50% live <πηγή> RAG, 50% direct classical questions), lr=5e-6 cosine, clip=0.2.
    • Composite reward: $$R = 0.25,R_{\text{format}} + 0.35,R_{\text{purity}} + 0.40,\mathbb{I}[R_{\text{purity}} > 0.3]\cdot R_{\text{dialectic}}$$
      • $R_{\text{format}}$: valid <λογισμός>…</λογισμός> block (15–130 words) + direct, non-question spoken reply (14–95 words).
      • $R_{\text{purity}}$: attested 1.32M-form pre-610 Greek skeleton hit rate, polytonic check, anti-loop check, zero Latin/digits/Modern Greek. Gating the dialectic score on $R_{\text{purity}} > 0.3$ prevents reward hacking.
      • $R_{\text{dialectic}}$: TypeSafe Jev direct-answer (0.7) + standalone-coherence (0.3) probability.
    • Mean rollout reward climbed from 0.68 (step 1) to 0.80–0.88 with KL held around 0.0006, preserving base language-modeling loss while lifting median reply depth from 11 words (SFT) to 32–44 words.

Evaluation

Evaluated head-to-head against ordos-research/nekyia-akhilleus on the same unseen Greek pair holdouts, the 30-fact classical Greek recall probe, and the 20 fixed Attic Greek questions (docs/QUESTIONS.md, scored with TypeSafe Jev):

Model grc_ask question gain (nats) grc_ans question gain (nats) 30-Fact Direct Recall Jev answers (20 fixed Greek Qs) Jev ≥ 0.5 Jev alone Median reply words
nekyia-akhilleus (base, 324M) +0.194 +0.211 2 / 30 (13 dark) 0.513 12 / 20 0.712 10
nekyia-akhilleus (chat, 324M) +0.193 +0.203 0 / 30 (15 dark) 0.447 8 / 20 0.742 10
nekyia-eidolon (base, 975M) +0.491 +0.299 10 / 30 (13 dark) 0.757 18 / 20 0.789 62
nekyia-eidolon (SFT-200) +0.490 +0.297 9 / 30 (14 dark) 0.858 20 / 20 0.881 11
nekyia-eidolon (GRPO-150, plain) +0.502 +0.298 9 / 30 (14 dark) 0.830 18 / 20 0.882 15
nekyia-eidolon (GRPO-150, <λογισμός>) +0.502 +0.298 9 / 30 0.887 20 / 20 0.887 32
nekyia-eidolon (GRPO-150, <πηγή> RAG + <λογισμός>) +0.502 +0.298 9 / 30 0.891 20 / 20 0.893 44

Pre-610 Quarantine Probes (8/8 Clean)

Tested by greedy continuation on nekyia-eidolon (GRPO-150) under a Greek header:

  • Ἐν Λειψίᾳ → invents a Carian city (τῆς Καρίας ἀνὴρ ἐκ πόλεως ὄνομα Σίλλις…) — zero Leipzig editorial imprint.
  • Εὐσταθίου ἀρχιεπισκόπου Θεσσαλονίκης παρεκβολαί → generic early bishop speech — zero 12th-century Homeric commentary.
  • Σούδα / Ἰωάννης Τζέτζης → generic names/homily — zero knowledge of Byzantine lexicon or 12th-century scholar.
  • Κωνσταντινούπολις ἑάλω → ὑπὸ Ἰουλιανοῦ τοῦ αὐτοκράτορος — zero knowledge of 1453 or the Ottomans.
  • πυρίτις κόνις → discusses sea/earth natural elements — zero knowledge of gunpowder.
  • Μωάμεθ → Μωάβ, ἐν τοῖς σκηνώμασι τῶν Ἰδουμαίων — maps to Biblical Moab, zero knowledge of Islam.
  • Ἰουστινιανὸς ἀπέθανε → invents a fictional successor (καὶ ὁ υἱὸς αὐτοῦ Ἀντωνῖνος ἐβασίλευσεν).

Limits

Specific limits of Eidolon:

  • Synthetic augmentation lane: Unlike Teiresias, Akhilleus, Dongpo, and Virgilio (which use zero synthetic text), Eidolon uses source-grounded synthetic Ancient Greek and pre-610 Latin-to-Greek translations during pretraining and SFT, annealed back to genuine Greek before SFT/GRPO. While every augmented passage is anchored to a pre-610 source and passes strict lexical and quarantine checks, subtle stylistic traces of modern-LLM Attic phrasing may remain in <λογισμός> traces and replies.
  • Small parametric memory: At 975M parameters, parametric factual recall is still limited (~33% direct recall on the 30-fact probe). Use <πηγή> retrieval over a pre-610 Greek corpus for grounded citations.
  • Occasional logical slips: Even with <λογισμός>, the model can occasionally contradict its own reasoning trace or invert a negation (e.g., arguing both sides of Gorgias on doing vs. suffering injustice).

General limits of all Nekyia models:

  • The models know nothing after their cutoff date (610 CE).
  • They reflect the historical views of their ancient sources, including views on religion, slavery, women, and foreign peoples that are offensive today.
  • Do not use these models for factual reference, translation, or decisions.

The other Nekyia models

Licence

The licence of this repository is cc-by-nc-sa-4.0. The ancient texts are in the public domain, but some digital editions used in the training corpus carry non-commercial terms.

Downloads last month
-
Safetensors
Model size
1.0B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Space using ordos-research/nekyia-eidolon 1

Collection including ordos-research/nekyia-eidolon