imagining syntax

Text set in serif type with a dotted bar in the margin was drafted by an LLM (claude-opus-5) and sometimes reviewed by the author. The rest is the author's own. How to read this site

Sampling regimes

Explanation: About this page \@{sampling-regimes-about}

The grammar imsyn trains on is small enough that its output is finite and very unevenly distributed, and that decides more than the flag names suggest. The companion page on the paper's own corpus works out what that inventory did to the one regime this project inherited: asking for a pool of distinct sentences moves two marginals away from the distribution the sentences were drawn from, the form class mix by more than the subject offset mix, and it moves them further the larger the pool gets.

This page is about what can be built instead. It sets out the ceiling on what any sampler can deliver at a realistic budget, names the regimes that are available or nearly available, and says what each one costs.

The ceiling

Definition: joint-fidelity capacity bound \@{joint-fidelity-ceiling}

the continuous-quota upper bound on the size of a dataset that can be simultaneously free of repeated sentences and target the grammar's subject offset and form class marginals. It is where the most probable offset's requested share of bare sentences exhausts the finite bare inventory. Actual finite corpora also require integer quota rounding, so the bound is not a claim that both empirical marginals can be represented exactly. At --vocab-size 40 it is 9,600 sentences at α = 0, 2,085 at α = 0.7, 790 at α = 1.4 and 384 at α = 3.0; at --vocab-size 160 it is 3,544 at α = 1.4. A 1,200-step run needs 38,400. The bound is why uniqueness and fidelity are not two goals to balance but two goals that exclude each other at any budget this project uses.

The regimes

Definition: corpus-faithful \@{corpus-faithful}

of a dataset, drawn with replacement so that every marginal matches in expectation the grammar it was asked for. A corpus-faithful pool sized to its own demand is a single pass: nothing is recycled, and a sentence recurs only at the rate the grammar assigns it. It is the regime the schedule-optimization campaign has used since v4. Its duplicate-slot fraction is 0.291 at α = 1.4, against 0.750 for the paper's regime.

Definition: duplicate-slot fraction (also: novel-slot fraction) \@{duplicate-slot-fraction}

the share of a run's training slots that are a repeat of a sentence already presented, one minus the expected distinct count divided by the number of slots. It is the honest measure of how repetitive a data regime is, and it is not the number of colliding draws, which effective support governs and which is far larger: drawing 38,400 sentences with replacement at α = 1.4 collides about 122,000 pairs of draws while only 0.291 of the slots hold a repeat, because a sentence drawn five times makes ten colliding pairs but only four repeated slots. In the paper's regime it is 0.750 at every α: three of every four presentations are a repeat. Under with replacement at the same budget it is 0.205 at α = 0, 0.291 at α = 1.4 and 0.460 at α = 3.0.

Referenced by (2 direct, 253 transitive)

Transitive (depth 1):

Transitive (depth 2):

Transitive (depth 3):

Transitive (depth 4):

Transitive (depth 5):

Transitive (depth 6):

Transitive (depth 7):

Transitive (depth 8):

Transitive (depth 9):

Transitive (depth 10):

Definition: globally unique \@{globally-unique}

of a dataset, containing no repeated sentence, achieved by drawing without replacement into a pool as large as the run's budget. Within one pool the property holds exactly. Across the stages of a schedule it does not, because each stage deduplicates independently. It is not a control: see joint-fidelity capacity bound and deduplication saturation.

Referenced by (1 direct, 2 transitive)

Direct references:

Definition: offset-stratified \@{offset-stratified}

of a sampler, allocating a fixed quota of sentences to each subject offset in proportion to its zipfian probability, then drawing within each offset block. With replacement inside the blocks it delivers the offset marginal up to integer quota rounding and leaves the form class marginal exact in expectation, which no unstratified sampler does for the offset. Exact empirical control of both would require joint offset-by-form quotas. Without replacement inside the blocks it delivers the offset marginal up to rounding and relocates all of deduplication's error onto the form axis, where it is at least reportable as one number. Neither variant is implemented.

Referenced by (1 direct, 2 transitive)

Direct references:

Which marginal to give up

Explanation: Which marginal to give up \@{uniqueness-menu}

Given the joint-fidelity capacity bound, any regime that insists on uniqueness at the project's training budgets must sacrifice marginal fidelity. Regimes that preserve the sampling law instead accept the repetition that law produces. The first two rows are what the project has actually used.

regime repetition offset marginal form marginal
the paper: dedup, recycled flat, 4× compressed collapsed
one faithful pass the grammar's exact in expectation exact in expectation
globally unique: dedup, one pass none within a pool compressed more collapsed more
faithful pool, recycled the grammar's, then 4× exact in expectation exact in expectation
offset-stratified, with replacement the grammar's quota-exact modulo rounding exact in expectation

corpus-faithful sampling is the default worth reaching for whenever α is the independent variable, because it is the only available regime in which the corpus the model reads is the corpus the manifest names. Its cost is repetition, and the repetition is not an artifact but the α signal itself.

globally unique sampling is the most distorted regime available, not the cleanest. Removing repetition by enlarging a deduplicated pool moves both marginals further from the grammar, because deduplication saturation worsens with size. A study that wants it should want it as a named treatment whose cost is measured, not as a control.

offset-stratified sampling is the one strict improvement on a plain faithful draw. It fills a quota per subject offset and draws with replacement inside each, which delivers the offset marginal up to integer rounding rather than multinomial sampling noise, and leaves the form marginal correct in expectation because nothing is filtered. Joint quotas would be needed to make the realized form marginal exact too. It removes multinomial noise on the axis a schedule campaign optimizes over. It does not exist in the code today and would take about sixty lines.

Three further options look attractive and are not. Stratifying on form class instead, so the 0.25 and 0.50 and 0.25 shares are held exactly while uniqueness floats, is dominated on every axis: it caps the pool at 9,600 sentences, costs more offset fidelity than plain deduplication at every size, and buys a property that one faithful pass already delivers for free. Excluding sentences across a schedule's stages, so no sentence recurs anywhere in a replicate, is worse than the problem: a four-stage deduplicated run repeats 0.176 of its slots across stages and 0.592 of its no-phrase slots, and the fix would drift each stage's distribution further from its own α as the exclusion set grows. Streaming a fresh batch every step with no materialized pool existed in this codebase as --continuous and was deleted in July 2026, because a demand-sized with replacement pool is the same regime and keeps the validation split, the dataset cache and the reproducibility that streaming gave up.

Two levers change the problem rather than the sampler. Enlarging the vocabulary raises every inventory and is the only grammar-side knob that moves the binding constraint, but it re-baselines the whole corpus and cannot be applied inside a running campaign; at --vocab-size 160 the α = 1.4 no-phrase share recovers only from 0.048 to 0.122, because the constraint binds per subject offset and a peaked α gives the new offsets almost no mass. Shortening the budget makes uniqueness reachable, but the budget moves measured outcomes further than the sampling regime does, so it substitutes a larger confound for a smaller one.

Reading a manifest

Explanation: Reading a manifest after this page \@{reading-a-manifest}

Three habits follow from the above and cost nothing.

A flag value is not a distribution. A manifest that says α = 1.4 without with replacement trains on a corpus whose realized exponent is about 1.28 and whose no-phrase share is 0.09 rather than 0.25. Recording effective α beside the nominal α is cheap and is recoverable after the fact from any run's saved sentences, and it is worth knowing what that recording does and does not buy: it corrects the offset marginal, which deduplication moves by about 0.05 in total-variation distance, and says nothing about the form class marginal, which it moves three times further. Quote it to two figures and name the estimator, since the three in common use disagree by 0.20 at α = 3.0, and do not quote it above α ≈ 1.8 at all. Reporting both realized quantities beside the nominal ones is what makes two arms in different regimes comparable at all.

Reuse and repetition are different questions. pool recycling is a choice and can be removed. Repetition is the grammar's, and removing it means overruling the grammar. An experiment that means to test the first should not manipulate the second.

Uniqueness is a treatment. Asking for it is a legitimate thing to want, and this page's arithmetic does not say do not do it. It says that the arm which gets it is not the control, and that whatever it shows has to be read against deduplication saturation rather than attributed to the absence of reuse.