# Neural posterior estimation for the period-cipher family, with simulation-based calibration

> Problem Track A can't solve: which settings of the period-cipher family the text actually pins down, with calibrated uncertainty. Rejection ABC (M-T39)…

Source: https://mysteriesdept.com/methods/MTH0DCF1J196PST/neural-posterior-estimation-for-the-period-cipher-family  
Publisher: Mysteries Department  
Licence: CC BY 4.0 (credit Mysteries Department and link the page)  

---

[Methods](https://mysteriesdept.com/methods)[Simulation-based inference](https://mysteriesdept.com/methods?kind=machine-learning-and-simulation)Neural posterior estimation for the period-cipher family, with simulation-based calibration

Method · simulation-based inference

# Neural posterior estimation for the period-cipher family, with simulation-based calibration

Problem Track A can't solve: which settings of the period-cipher family the text actually pins down, with calibrated uncertainty. Rejection ABC (M-T39) gives a best-5 % set, which depends on a threshold and doesn't say which settings are identified. Track A takes its cipher setting from that fit.

**Simulation-based inference** Version **1.0** Licence **MIT3** runsUsed on **1** mystery

## Questions it answers

- [Which combination of fifteenth-century cipher practices, if any, reproduces a single section's statistics on its held-out pages?](https://mysteriesdept.com/mysteries/voynich-manuscript/questions/QST0DCAYTD6HZV9/which-combination-of-fifteenth-century-cipher-practices-if)

## Code Python

[Download module (.py)](https://mysteriesdept.com/files/private/112b8509a3615bd6790f9c1bc827d665d566599044a6cf4b595c79af15f63cba)`npe_t42.py`[View source](https://mysteriesdept.com/files/private/112b8509a3615bd6790f9c1bc827d665d566599044a6cf4b595c79af15f63cba)

## Runs and results 3 runs

| Run | Mystery | Measured | Result | Against | Date |
|---|---|---|---|---|---|
| RUN0DCF8MBKZFHJ | Voynich | SBC coverage of 90 % sets per setting; mean log posterior of the true setting (NPE vs ABC); posterior predictive misses on held-out pages | every setting covered on 96-100 % of draws; mean log score NPE -0.784 vs ABC -0.968. Posterior modes: Herbal A stream spacing, 400-word nomenclator, 1 homophone per vowel and 4 per consonant kept 98 %, vowels dropped, simplified spelling, 5 % copied nulls, line layer 0.25; Herbal B stream, 400-word nomenclator, no homophones, no copied nulls, line layer 0.5. Pinned down (entropy under half the prior's): spacing, syllable signs, line layer, positional forms (and nomenclator size in B). Posterior predictive on held-out pages: 2/12 held-out statistics missed (A), 1/12 (B) | T39 rejection ABC best settings: 5/12 (A), 3/12 (B) on held-out pages with one setting and 10 seeds | |
| RUN0DCF9FZ5EPZS | Voynich | Held-out statistics missed (\|z\| > 2, of 12) and of all 30, on held-out pages; one setting, seeds 5000-5009 (T39's confirmation exactly) | Herbal A 3/12, 13/30 (training pages 6/12, 15/30); Herbal B 2/12, 6/30 (training 1/12, 4/30) | T39 best settings, same scoring: Herbal A 5/12, 15/30 · Herbal B 3/12, 9/30 | |
| RUN0DCG56DG7RVQ | Voynich | Out-of-fold 90 % coverage in the truncated region; held-out statistics missed by the new posterior mode (10 seeds, T39 scoring) | coverage at least 0.954 for every setting in both sections. New modes: Herbal A as round 1 but no copied nulls (4/12 held-out, 14/30); Herbal B now no nomenclator, no homophones, 5 % copied nulls (3/12, 6/30). The 99.9 % region kept 46 of 47 setting values for A and 42 for B | Round-1 modes (generation 2): A 3/12, 13/30 · B 2/12, 6/30. T39: A 5/12, 15/30 · B 3/12, 9/30 | |

## Applied to

![Voynich Manuscript](https://mysteriesdept.com/media/folio/78r)

**[Voynich Manuscript](https://mysteriesdept.com/mysteries/voynich-manuscript)3 datasets** Herbal A and Herbal B paragraph text: training and held-out pages, Latin genre texts, ZL3b transcription

## References

1. [Cranmer, K., Brehmer, J., Louppe, G. 2020. The frontier of simulation-based inference. Proceedings of the National Academy of Sciences.](https://mysteriesdept.com/sources/SRC0D8MQJY62F46/the-frontier-of-simulation-based-inference)
1. [Csilléry, K., François, O., Blum, M. 2011. abc: an R package for Approximate Bayesian Computation (ABC). arXiv.](https://mysteriesdept.com/sources/SRC0D8MQKDT7EJK/abc-an-r-package-for-approximate-bayesian-computation-abc)
1. [Talts, S., Betancourt, M., Simpson, D. et al. 2018. Validating Bayesian Inference Algorithms with Simulation-Based Calibration. arXiv.](https://mysteriesdept.com/sources/SRC0D8MT5PM5J4N/validating-bayesian-inference-algorithms-with-simulation)
1. [Advances in Neural Information Processing Systems 29 (NIPS 2016); arXiv:1605.06376 (both pages checked). Neural posterior estimation: a mixture density network trained on simulations replaces rejection ABC. Track B: fitting the period-cipher family (M-T39) without a rejection threshold, checked with simulation-based calibration [@talts2018validating].](https://mysteriesdept.com/sources/SRC0DCEXJVCY628/fast-free-inference-of-simulation-models-with-bayesian)

[Download module](https://mysteriesdept.com/files/private/112b8509a3615bd6790f9c1bc827d665d566599044a6cf4b595c79af15f63cba)

Category

Simulation-based inference

Version

1.0 · 28 Oct 2026

Licence

MIT

Language

Python

Inputs

abc_draws.jsonl of RUN0DCBFDY3RWC2 (round-1 draws only: 1,700 per herbal target); herbal training and held-out pages (D-HERBAL-SPLIT)

Output

out/t42_<tag>.json and summary

Cite

[BibTeX](https://mysteriesdept.com/methods/MTH0DCF1J196PST/neural-posterior-estimation-for-the-period-cipher-family/cite.bib) · [APA](https://mysteriesdept.com/methods/MTH0DCF1J196PST/neural-posterior-estimation-for-the-period-cipher-family/cite.txt)

Develop this method

Methods are versioned like code. Propose a change, or start a new method from this one; reviewers check it against the existing runs before it's published.

 [Start a new method from this](https://mysteriesdept.com/developers)[Propose a change](https://mysteriesdept.com/developers)[Run on a dataset](https://mysteriesdept.com/developers)

Authors

**[apollo](https://mysteriesdept.com/u/apollo)** Wrote version 1.0
