Mova0.6 pre-release

roundtrip — the autoencoder and the anti-autoencoder

roundtrip sends a text down Mova's layers and back up: words → tokens → UD tree → frames → world, then world → frames → tree → tokens → words. At every layer boundary it records what does not come back, puts every loss in a class, and counts what would have to be stored beside the layer's representation for the round trip to be lossless (the layer's residual). The idea, the exact and normal modes, the residual classes, the bit rules, blocks and the gates are explained in docs/english.md, «The round trip»; this README holds the crate's own detail: its decoders, commands, inputs and outputs.

The extended pipeline: autoencoder and anti-autoencoder

Two round trips train and check Mova's language layers against each other. The autoencoder starts from a text and must give the same text back; the anti-autoencoder starts from meaning and must give the same meaning back. Each has two pairs that should match; a mismatch names the layer that lost or invented something. This crate measures both round trips (see «Status»).

The layers

layerfromto
parsertexttrees (UD) + pragmatics
metatrees + pragmaticsthe language-independent meta form (frames, roles, world events; the metalanguage)
generatormeta formneutral trees of a language (a plain standard rendering)
stylizer (a plugin of the generator)the meta form + a stylethe generator's choices in that style: the author's, a dialect, a register
realizerstyled treestext

The stylizer carries a style, which is a delta over the standard (variety as a delta): an author's style, a dialect, a register. A style belongs to an author, a dialect or a register, never to a single document — one document is too little to define a style, and a style learned from one document would only memorize it.

The autoencoder: text → parse → meta → generator with stylizer → text

text₀ ─parser→ trees₀ ─meta→ M ─generator+stylizer(style of text₀)→ trees₁ ─realizer→ text₁

Two pairs ideally match:

  1. text₀ = text₁ — the text comes back.
  2. trees₀ = trees₁ — the trees before the meta step equal the trees the styled generator builds.

Where they differ, the difference is located: a loss between trees₀ and M is the meta layer's; between M and trees₁ the generator's or the stylizer's; between trees₁ and text₁ the realizer's. The residual of each layer (what must be stored to give the input back exactly) is measured as in the existing round trip.

The anti-autoencoder: meta → generator with stylizer → text → parse → meta

M₀ ─generator+stylizer(a style)→ trees₀ ─realizer→ text ─parser→ trees₁ ─meta→ M₁

Two pairs here too:

  1. trees₀ = trees₁ — the trees the styled generator builds equal the trees the parser reads from the produced text. This pair is a goal of its own: it checks that what the generator and stylizer build is what the parser reads, for every style.
  2. M₀ = M₁ — the meaning comes back. This step is optional: the anti-autoencoder runs and counts with the first pair alone (meta → … → parse), and adds the second when the meta layer is in the loop.

The anti-autoencoder needs no corpus: any meta form (from the world, the school's facts, a frame bank, or a meta form read from a real text) can be sent down and must come back. It tests the generator and the stylizer as the autoencoder tests the parser, and it can produce training pairs (text, trees) for the parser in styles and dialects that are rare in the corpora — checked by the parser's own reading, never trusted blindly.

What each pair trains and measures

pairtrains / checks
autoencoder text₀ = text₁the whole chain; the residual per layer
autoencoder trees₀ = trees₁meta + generator + stylizer against the parser's reading
anti-autoencoder trees₀ = trees₁generator + stylizer + realizer against the parser
anti-autoencoder M₀ = M₁ (optional)the whole chain from meaning back to meaning

Measured on held-out blocks, by layer and by class of difference, with two identical runs before a gain is claimed; the stylizer is measured per style (author, dialect, register), on documents not used to learn that style.

Notes and corrections to the design

Status

Built (2026-11-07), in this crate:

Not built: the meta form as a separate language-independent layer between trees and the generator (the world is the meta form today: English frames); any style but the neutral one, so no per-style measurement (the stylizer measured per style, on documents not used to learn the style, waits for the first learned style); generators for other languages (the French rounds stay wiki-round); a learned generator (the realizer is rules; only en's order generator learns, so the autoencoder's trees pair cannot change with a candidate today).

Measurements (2026-11-07, en.bin 2483516a, dev samples of the Wikipedia corpus, tables of the ae state)

150 dev sentences, roundtrip pairs ae, two identical runs. The autoencoder's trees pair, LAS F1 percent:

from the framesfrom the world
neutral, no fault76.1571.86
generator rule rt-function off65.6261.50
generator relation nsubj → obj69.5466.88
generator relation det → amod67.2863.36
parser relation nmod → obl70.5466.30
parser relation det → amod67.3364.17

Every fault lowers the pair (the one fault that did not, relabel:case>mark in the parser, is not used: it moves the frames and the trees together). The step from the frames to the world, 4.3 points, is what the meta layer loses. The anti-autoencoder reads back far less of what the generator builds: 42.8 LAS F1 on 400 meta forms (300 Wikipedia sentences of the anti slice, 100 school sentences), meta pair F1 45.9. The gold anchor of the same model: LAS 80.83, UPOS 94.93 on EWT dev (2 001 sentences, all tokens, relations without subtypes).

First rounds of the Eel with these kinds (2026-11-07, campaign-v6, state from en.bin, dev 1 000 sentences, window 2 000, anti: 1 000 Wikipedia and 300 school meta forms, --meta):

roundmetric, current → candidateguards, current → candidatecontrol, real against brokenoutcome
ae2 9text-pair bits 190 761 → 190 580trees pair 71.03 → 71.03; gold LAS 80.83 → 80.83; gold UPOS 94.93 → 94.9371.41 against 67.10installed
anti 19trees pair 43.99 → 44.26gold LAS and UPOS unchanged; meta F1 45.15 → 45.2339.36 against 37.00installed

The same two rounds run in a scratch Eel gave the same numbers, and two runs of the commands gave the same round.json (but for seconds) and the same candidate bytes. The gain is small: only the order generator learns.

Subcommands:

How it works

The layers, and what goes up and down

boundaryup (encoder)down (decoder)residual of the exact mode
text ↔ tokensen::tok on each block (a paragraph, a line, a treebank sentence); the literal before every token is kept as a gap; blocks are cut into sentences at . ! ? (with closing quotes) before a space and a capital or an opening quotethe forms joined by their space bit, one space between sentencesthe layout pieces (blank lines, line ids, lesson keys), every gap that is not "" or " ", a block's tail
tokens ↔ treethe en annotator (en.bin): lemma, PTB tag, head, relationen's generator: lin.rs gives the order, morph.rs the form from lemma, tag and the FEATS agreement reads from the tree (tree_feats: pronoun case, the person and number of «be», these/those; ROUNDTRIP_OFF=feats: lemma and tag alone), positional rules a/an and the first capital, the spacing rules of en::text::detokthe local order of each head the generator gets wrong (the whole order of a non-projective tree), a case beyond the rules, a form lemma and tag do not give back, a space bit the rules miss
tree ↔ framesprag::frames::frames_of_tree, the discourse carried through the volumea realizer in this crate (below), then the tree decoderan edit script from the realized tree to the parsed one: words to insert, lemma, tag, head or relation of a realized word to patch, realized words to drop
frames ↔ worldthe story's state: entities by id (number, name or not, every modifier said of them, the pronoun class the text uses for them) and the line of events, statements and phrases without a predicate (headings, titles, noun phrases; ROUNDTRIP_OFF=world-bare drops them) with roles as ids (each mention with what it says beside the entity: determiner, preposition, possessor, modifiers), the clause's own words, and the links «what was said», «because» and where each clause hangsone frame per event, modifiers at the first mention, a new sentence at an event not linked to the current one; an entity by name, or by its pronoun where the referring-expression generator says so (below)the frames the world dropped (a statement said again), field patches (the pronoun of a mention, a modifier said at this mention, the number of this mention, quotation, the «next» links), the sentence boundaries that differ

The realizer (frames → tree) says what the frames keep, and nothing it guesses. Every frame becomes a clause with the verb group of its tam (tense, aspect, voice, modality: the modal or «will» or «do», «have», «be» of the progressive, «be» of the passive, «to» of an infinitive; a passive says the patient as subject and the agent with its «by», an imperative no «you»); a frame without tam (a nominal event, PRAG_OFF=tam) gets past tense for events and speech, present for general statements, «do not» for a negation, «can» for Fact(can). The agent is the subject unless the frame marks it unsaid (shared with the clause above, an imperative's «you», the noun of a relative clause), and a conjunct does not repeat the noun subject of the clause before; the patient is the object, the recipient and the place take the mention's own preposition (a recipient without one is an indirect object), the obliques theirs; then the role-less noun phrases, the clause's adverbs and discourse words, its markers and conjunction. A copula with an adjective, a noun or a place makes a copular clause. A frame without a predicate (Bare: a heading, a title, a noun phrase, an answer option) is headed by its own word when it has one (the word with the relation root: an adjective, an adverb, an interjection), else by its entity (the patient, the place or the first oblique, with the mention's preposition); its other obliques, words and noun phrases hang on that head, and the clauses that link to it too; its attributes and negation sum up its words for the readers and are not said again. The event a noun names (a nominal frame, By::Nominal: «the arrival of the Queen») is said by the noun's mention, not as a clause of its own (PRAG_OFF=rt-nominal says it again), unless the sentence has no other frame; a role-less noun phrase takes its mention's preposition. An entity is its pronoun if the frame kept one, the relative word that stands for it, or its head with the mention's determiner or possessor, its adjectives and other one-word modifiers, its prepositional modifiers, appositions and coordinated phrases with their conjunctions. A clause hangs where its link says, with its relation, under the noun of a relative clause; a frame without a link is a conjunct of the first. Punctuation comes from the clause structure (en::lin::punctuate: the full stop; a comma before a coordinated clause with its own subject and in lists of three or more, on a parataxis, a vocative, a discourse word, an apposition). Each step has a switch that turns it off: PRAG_OFF=rt-shared-subject, rt-unsaid, rt-function (fixed «a» then «the», «to», «in», «and», «because», «if»), rt-links (all conjuncts of the first, what was said a ccomp, a cause an advcl), rt-punct (the full stop only), rt-prt-once, rt-when. It reads only the frame's content (frames::F): never Ent::text, the phrase as written.

The referring-expression generator (world → frames, world::refer) says an entity as its pronoun (its class he, she, it or they from the registry, nominative as the subject and capitalized as the first subject of a sentence, accusative elsewhere) when it was mentioned in this sentence or the one before, it fills no other role of the frame, it has no modifier to say, and prag::frames::Ctx — the reader's own resolver, salience by role, halved at every sentence — would take the pronoun back to it; an unresolved «it» stays a pronoun. ROUNDTRIP_OFF=refgen switches it off (every entity by name).

The world is what prag's discourse and roles::world_docs keep of a text, with every role and link. The worlds written by the large model in world's change language (world — worlds, schools and students) are not used here.

Classes

The class names used in the reports: meta (ids, lesson keys: not language), layout (line wraps, blank lines), spacing, punct, case, form (another form of the same lemma), lemma→form (a known word that is not what lemma and tag give: a tag or lemma error), src-spelling (no known word: archaic, dialect, misspelt), typography (’ “ ” for ' "), order, function (determiners, prepositions, conjunctions, markers, particles), pron/name, tense/mod (auxiliaries, modals, the copula, verb tense), negation, quantity (numbers, quantifiers, grammatical number), dropped (content words), lexical (another content word in the same place), attachment (same words, another head or relation), sentence (boundaries), links (next, cause, what was said), quote (direct or reported speech), repetition. The Hebrew route adds accent and unparsed; the site's pages add markup, repeat, conllu and frames-table.

The normal mode aligns the decoded words with the original in steps: the longest common subsequence of forms, then the same form elsewhere (order), typography, case, the same lemma (tense for verbs, form otherwise), a pronoun and a name in the same relation, content words of the same part of speech in the same relation (lexical). What is left is missing or added, each in the class of its word.

Bits

The fixed bit rules are in The English layer. A dictionary lemma costs 17 bits, a word outside the dictionary its string. A patch item is one field: a word whose lemma and tag both change is two items.

Gates and controls

The exact gate, the damage, drop and shuffle controls and determinism are described in docs/english.md, «Gates and controls». The crate's tests carry the negative controls of the decoders: a script without its inserts, a world residual without its patches or boundary toggles, a tree residual with a wrong form; tam_is_read_and_realized (no tam gives the tense items back), en::morph pronoun_case_and_be_agreement_from_the_tree (lemma and tag alone give they, was, this), pronouns_by_salience (the plain world decoder says no pronoun). In run, --drop <class> makes a decoder drop that class. Volumes run in parallel and merge in their order.

How to run

cargo build --release -p roundtrip
B=target/release/roundtrip
$B probe "The dog didn't bark. 'Let there be light,' said God."      # every layer of a text, both ways: tokens, tree, frames, the world (entities, events, its residual), back
C=$MOVA_DATA/runs/corpus-0.4
$B run --threads 8 --out $MOVA_DATA/runs/roundtrip-<date>/run \
  lessons=lessons:$MOVA_DATA/school/courses \
  school-gold=conllu:$C/corpus-0.4/treebanks/mova-school-agreed-en.conllu \
  tales03=conllu:$C/corpus-0.3/treebanks/mova-tales-silver-en.conllu \
  torah=tsv:<torah.tsv> \
  alice=txt:$C/corpus-0.4/books/pg11.txt
$B run --normal --drop negation --out <dir> tales03=conllu:…          # a negative control
$B compare <before dir> <after dir>                                   # two runs side by side: what changed
cargo test --release -p roundtrip                                     # the model tests need $MOVA_DATA/en/models/en.bin

A set is <name>=<kind>:<path>[@<stride>]: txt (a book, paragraphs are blocks), tsv (id<TAB>text lines), lessons (a school directory; title, explain, fact, exercise values are text, every stride-th lesson), conllu (a treebank: its # text, its trees as gold, one volume per document, every stride-th document). In the normal mode a treebank's gold tree, with its frames and world, is a start too. The run writes report.md (every class at every layer and start, for every set), examples.md (up to four examples of every class at every layer and start), residual.tsv and normal.tsv. The model is en.bin unless --model says otherwise.

Limits

The meta layer test: roundtrip mixed

Texts mix languages and styles: a commentary quotes Hebrew and Aramaic inside English, a lesson puts slang next to an exam question. roundtrip mixed feeds such mixtures to the skeleton and asks it to see that the pieces are different languages, read each with its own parser, keep one world for all of them, and give everything back byte for byte — comma for comma, error for error, each piece in its own language.

How it works

The sample (seed 20261018, at most --n sentences a variety, 3–40 words):

varietysourceroute
en-plain, en-slang, en-formalthe school: explain/fact sentences, the slang tests' questions, the formal exams' questionsEnglish
en-talethe 0.3 tales treebank's textEnglish
en-jpsJPS 1917, Ruth and Jonah (with the verse of each sentence)English
en-talmudthe Yerushalmi in Guggenheimer's EnglishEnglish
en-shkShakespeare (corpora/emode)English
hbo-accented, hbo-pointed, hbo-unpointedWLC Ruth and Jonah (the Hebrew parser's dev books), each verse in one of three pointings: as written, accents off, letters onlyHebrew
hbo-x-mishnaic, jpathe Yerushalmi's Hebrew and Palestinian Aramaic segments (langseg talmud's labels)Hebrew / text
arc-x-targumTargum Onkelostext
arcWLC Biblical Aramaic (Daniel, Ezra, Jeremiah 10:11)text
he-wiki, he-htbUD IAHLTwiki dev (CC BY-SA) and UD HTB dev (CC BY-NC): read for measuring only, never shippedHebrew

The streams. mono-<variety>: one variety, a sentence a line. lines: every sentence of every variety shuffled, a sentence a line (the same items as the mono streams together). docs: documents (--docs, 300 by default) of an English carrier sentence with one or two quotes of Hebrew or Aramaic — cut by the quote (A «Q» B), followed by it (A «Q»), or by two (A «Q1» (Q2)) — and the verse pairs of Ruth and Jonah (the JPS sentences of a verse, then « the Hebrew verse »). A stream is cut into volumes of 25 lines (--volume); a volume is one world. The streams, their gold spans and the items are written to <out>/streams/.

The meta layer, text ↔ pieces. langseg segments each line. A segment is cut where a document's quote marks or brackets (« » “ ” ( ) [ ]) stand between its words: langseg reads a Hebrew-script run whole, so two quotes side by side come out as one segment otherwise. Neighbouring segments of one route make one piece (English always; Hebrew and Aramaic unless quote marks part them). The gap between two pieces is cut at its last run of whitespace: what comes before it ends the piece before, the whitespace is the joint, opening marks start the next piece. Down, the pieces are joined with one space; another joint is residual.

The routes.

One world. The frames of all English and Hebrew sentences of a volume, in order, make one world (world::encode_by, each residual item counted for its sentence's item). An entity named in Hebrew and one named in English are one entity only if linked: by the verse — a Hebrew piece found in an index of the WLC's verses and an English piece of the same volume found in an index of JPS 1917's sentences, joined when the English id is among the English words (and their lemmas) of the Hebrew lemma in tanakh-en.tsv (MACULA's commonest glosses and the OpenScriptures definition) — or by the name, a Hebrew and an English name anywhere in the volume, by the same dictionary. A Hebrew lemma joins at most one English id and the reverse. Down, the decoder gives a Hebrew sentence its Hebrew names back. Links are checked against MACULA's gloss of the word in that verse (the gold trees' Gloss=, read in context).

Bits. As in the single-language round trip; a character of the Hebrew script (a letter, a point, an accent) is 8 bits, as an English letter, not the 16 of its two UTF-8 bytes; a Hebrew lemma of the parser's training trees is log2 of their number.

Runs. Every mono stream with langseg and with the gold routing (oracle); lines and docs with langseg, the oracle, and two negative controls: everything to English (all-en), and langseg's languages shuffled over the segments of a volume (shuffle); the linking control link-any (the gloss alone, any Hebrew piece with any English piece, no verse); the ablation of the cut at quote marks. --damage is the gate's negative control: the exact decode drops the Hebrew tree residual and the joints, and the gate must show red.

Run

cargo build --release -p roundtrip
roundtrip mixed --out $MOVA_DATA/runs/roundtrip-mixed-<date>/run --threads 8 \
  --school $MOVA_DATA/school/courses --tales <mova-tales-silver-en.conllu> --judaism $MOVA_DATA/corpora/judaism \
  --shakespeare $MOVA_DATA/corpora/emode/text/shakespeare.tsv --ud <ud-2.18> --hbo $MOVA_DATA/models/hbo \
  --langseg $MOVA_DATA/langseg/model.tsv --gparse <gparse binary>      # [--n 120] [--docs 300] [--seed N] [--volume 25] [--damage]

It writes report.md (routing, residual by variety and layer, the cost of mixing, links, controls, where the meta layer leaks), residual.tsv (run, mode, variety, layer, class, bits), items.tsv (every item's bits by layer in every run), links.tsv (every link of docs), the parses (hbo-pointed.conllu, hbo-unpointed.conllu) and streams/. The outputs hold Modern Hebrew under CC BY-SA and CC BY-NC: they stay in $MOVA_DATA. hbo and macula are libraries as well as commands for this (hbo::{segment_line, annotate}, macula::prag::read_sentence).

Limits

The block gate: roundtrip blocks

In training every lesson of the corpus mix must unfold back into itself bit for bit, as whole blocks, not sentence by sentence. A block is a whole lesson, a book chapter, or a run of whole chapters up to 2,500 words (--max-words), cut only at chapter or lesson boundaries; a single chapter longer than that stays whole. This is a hard training target, not a claim that the layers keep every word and meaning: the residual says what they lose. Why blocks: docs/english.md, «Blocks, not sentences».

How it works

Block makers (roundtrip::blocks, a library for tools/translate too). Each corpus is read into chapters in its own order; blocks(corpus, &chapters, max_words) groups them greedily into runs that stay inside a chapter's group.

corpuschaptera run stays insidelayout of a chapter
schoola lesson (courses, <course>/*.lesson)the lesson (a block each)the lesson file: keys and other lines are metadata
talesa chapter of the 0.3 tales books and Just So Storiesthe bookthe file itself
alicea chapter of Alice's Adventures in Wonderlandthe bookthe file itself
tanakha JPS 1917 chapter (dict/tanakh-jps1917.tsv, a sentence goes to the chapter of its first verse)the Bible bookheading GEN 1 (metadata), the sentences as one paragraph
talmuda halakhah of the Yerushalmi in Guggenheimer's Englishthe tractate's chapterheading Berakhot 1.1, a paragraph a segment
shakespearea scene (corpora/emode/text/shakespeare.tsv with .speakers)the playheading 1H4 1.1, a speech a paragraph under its speaker (metadata)
grammarsa manual file (corpora/grammars-*/text/manual/**.md), a chapter of an English grammar book (text/books-en/*.txt)the manual, the bookthe file itself
hboa WLC chapter (dict/wlc-trees, a verse a line, accents and points as written)the JPS blocks (like)the verses

A book is cut at lines starting with CHAPTER, PART, BOOK, LECTURE, STORY or SECTION after a blank line, and in the tales and Alice also at a title line in capitals alone between blank lines; the text before the first heading is a chapter too. A "chapter" longer than 10,000 words means the maker sees no chapter structure (a dictionary, a handbook numbered by sections only, OCR without headings): it is cut at blank lines into runs of at most 2,500 words and the block says so (para_cut). The chapters of a file together are the file byte for byte (tests).

Whole-block encoding. A block is one volume: the reader's discourse (prag::frames::Ctx), the realizer and the world are one for the whole block; headings, speakers and ids are metadata pieces, paragraphs and blank lines layout pieces, and sentence boundaries a class of the world's residual — all of it must come back. Exact mode: every block is decoded from its world down with every residual and compared byte for byte. Normal mode: the whole block decoded from each start (tokens, tree, frames, world) against the block's sentences on one line, exact % and chrF, and sentence by sentence. Hebrew goes through the Hebrew route of roundtrip mixed (one volume a block).

Units (pipeline::Unit): block (the gate); sentence (the discourse, the realizer and the world reset at every sentence: the frames themselves change, a pronoun the reader cannot resolve stays a pronoun); world (the frames read with the block's discourse, the realizer and the world reset at every sentence: the same frames as block, so the bits compare). Hebrew has block and the verse alone.

Controls, on every 10th block of each corpus (--controls): damage-<layer> loses the first residual item of a layer in the exact decode (Hebrew: the whole tree residual) and the block must be red; flat (the block's sentences joined by a space) against shuffle (the same sentences shuffled inside the block). A block that fails to go up or come down (an error or a panic) is a red block with its reason, not the end of the run.

Run

cargo build --release -p roundtrip -p jobs
jobs run --name rt-blocks --mem-gb 8 -- roundtrip blocks --out $MOVA_DATA/runs/roundtrip-blocks-<date>/run --threads 8 \
  --model <en.bin> --school $MOVA_DATA/school/courses --hbo $MOVA_DATA/models/hbo --langseg <langseg model> --gparse <gparse>
  # defaults: --judaism, --shakespeare, --corpora under $MOVA_DATA/corpora; tales and books under $MOVA_DATA/runs/corpus-0.4
  # [--only school,tales,alice,tanakh,talmud,shakespeare,grammars,hbo] [--stride N (lessons)] [--controls N] [--max-words 2500] [--hbo-books GEN,EXO,…]
  # [--school <dir>] [--tales <dir>] [--justso <txt>] [--alice <txt>]: the sources of those corpora (Just So Stories joins the tales)
  # [--site-punct <punct.tsv>]: the punctuation table of `site-learn` for the frames' realizer
  # MOVA_RT_LEMMA=0: a Hebrew stem's lemma is unknown (`_`) instead of guessed from its letters (an A/B switch)

It writes report.md (blocks per corpus, the gate and its controls, residual by layer and class, normal mode, the units compared, shuffle, the classes ranked by share of the total and by bits per sentence with the changes they ask for), the training signal residual-blocks.tsv (block unit: corpus, block, layer, class, items, bits — what the trainers and the agents read), blocks.tsv (a row per block and unit: chapters, words, sentences, tokens, exact, bits per layer, metadata bits, total), total.tsv (per run and corpus: blocks, exact, total bits per block, sentence and token), and per unit block/, sentence/, world/ with residual.tsv, normal.tsv, examples.md in the format of roundtrip run (roundtrip compare reads them). The outputs stay in $MOVA_DATA.

API for other tools: blocks::{school, book, books_dir, jps, wlc, talmud_en, shakespeare, grammars} → Vec<Chapter> (id, group, vol, para_cut); blocks::blocks(corpus, &chapters, max) → Vec<Block> (corpus, id, chapters, words, para_cut, vol; text() is the block byte for byte); blocks::like(corpus, &chapters, &blocks) cuts another text of the same chapters as blocks (the WLC in the JPS blocks: the two sides of a translation are the same block); blocks::run::flat(a, &volume, shuffle); pipeline::Opts { unit, damage, .. }.

Limits

The site's Markdown as blocks: blocks::site_md

The Markdown twin of mova.elamur.ai (free/en/**.md: the docs, the corpora pages with their ```conllu trees and frames tables, the dictionaries, the school runs) is a corpus of the block gate. A page is a chapter; a block is a page or a run of sibling pages (one folder, one Bible book) up to 2,500 words of prose, cut only at page boundaries.

How it works

What the train pages teach: roundtrip site-learn

On the train split (the same sample, the Tanakh pages of tools/translate's dev and test books left out whatever their split): the markup dictionary (markup.tsv: per section the literals repeated at least 3 times, at most 4,096, the most bytes saved first), the Hebrew trees' lexicon (hebrew.tsv), en's order generator adapted (en-lin.bin: lin.rs trained again on its own trees and on en's parses of the train pages' prose sentences, Model::adapt; the tagger and the parser are the same, so every parse is too), the punctuation table (punct.tsv), and every fourth of those sentences for tools/translate's standard encoder (english.tsv). Negative controls: --lin-shuffle (each sentence's words shuffled before it is learned from) and --shuffle-tables (each section gets the next section's dictionary, each Hebrew token another token's analysis).

Run

cargo build --release -p roundtrip -p jobs
S=<a frozen copy of the md twin>/free/en          # the live tree is rebuilt in place: measure on a copy
roundtrip site-learn --site-md $S --site-target 1000 --out $L --model <en.bin> --threads 8 --lin-every 2
jobs run --name site --mem-gb 8 -- roundtrip blocks --only site --site-md $S --site-target 1000 --site-split dev \
  --out <dir> --threads 8 --model $L/en-lin.bin --site-dict $L/markup.tsv --site-heb $L/hebrew.tsv
  # [--site-sections corpora/torah,docs] [--units block,sentence,world,controls] [--site-split train|dev|test|all]
  # site-learn: [--lin-weight W] repeats the train pages' sentences W times when the order generator is adapted (default 1);
  #   [--no-lin] stops after the tables (no en-lin.bin); [--punct-only] stops after punct.tsv; [--lin-shuffle] is the negative control

The report adds the site's tables: bits per block and per 1,000 words of prose with markup, CoNLL-U, frames tables and the prose layers apart; for each kind of derived piece how many there are, how many need nothing stored, and the bits of storing them whole against their code; what the codes store by kind. The test split is measured once, as the held-out check of a change.

Limits

Learning rounds on Wikipedia: roundtrip wiki-round

The Eel's autoencoder round (tools/eel, «Autoencoder rounds»). One run samples, measures, learns and measures again; the Eel decides and installs.

How it works

Run

roundtrip wiki-round --corpus $MOVA_DATA/corpus/wikipedia-en --round K --out <fresh dir> --model <base en.bin> \
  [--current <dir with en-lin.bin, domain.tsv>] [--shards 10] [--train 2000] [--dev 500] [--per-article 20] \
  [--domain-max 20000] [--threads 4] [--lin-shuffle | --lin-reverse]

It writes train.tsv, dev.tsv, test.tsv (wiki:<title>:<k>\t<sentence>), candidate/en-lin.bin, candidate/domain.tsv and round.json (sizes, pool, window, the bits by layer and the exact volumes of dev and test with the current tables and the candidate, seconds, peak memory). Everything holds Wikipedia text or is learned from it (CC BY-SA 4.0): it stays in $MOVA_DATA, never in git or a release.

Limits

Pair rounds: roundtrip ae2-round and roundtrip anti-round

The Eel's ae2 and anti kinds (tools/eel, «Pair rounds»). One run samples, measures the tables in use and a candidate, and writes the report the Eel checks; the Eel decides and installs.

How it works

roundtrip ae2-round  --corpus $MOVA_DATA/corpus/wikipedia-en --round K --out <fresh dir> --base <en.bin> [--current <dir>] \
  [--gold <UD dev .conllu> [--gold-max N]] [--shards 10] [--train 2000] [--dev 500] [--per-article 20] [--domain-max 20000] \
  [--threads 4] [--control-sentences 300] [--gen-fault F] [--parser-fault F]
roundtrip anti-round --corpus … (the same) [--meta] [--school <tsv> --school-n N]
roundtrip pairs ae|anti [--model en.bin] [--threads N] [--meta] [--gen-fault F] [--parser-fault F] <id<TAB>text file>

A fault F is rule:<rt-step> or relabel:<rel>><rel>.

Limits

Sources

Library ids are folders of the paper library (docs/usage.tsv lists the works outside it).

This page in Markdown https://md.mova.elamur.ai/free/en/docs/tools/roundtrip/