neural: grounding refinement + all five Layer-1.5 figures
Grounding refinement (18 reps): forward-KL is the operative neural
collapse metric, not H or tail-survival. The RNN's smoothing keeps
spurious tail modes alive, so tail_truth_mass_alive is flat/non-monotone
in g and H stays ~0.8 of H*; only forward-KL falls monotonically (dry
2.08 -> g=0.2: 0.75, paired t up to 3.3). The sharp g* << 1 is an
exact-operator feature carried by the histogram bridge (0.047); the
trained RNN confirms the SIGN and softens the sharpness (half the KL gap
closes by g~0.04, but full recovery needs g~0.19). Blueprint 3.5's
directional claim holds; the pre-registered 95%-of-H*/tail falsifier is
not met because those are the wrong metrics for a smoothing model.
Robustness: a fully-degenerate RNN can emit only invalid codewords, so
measure_distribution now returns a terminal-collapse sentinel (fixation
on the dominant mode) instead of crashing a long sweep. Edge test added
(94 tests green).
Figures: plot_{bridge,collapse,grounding,architectures,recombination}.py,
each a pure function of its committed bundle, wired into `make figures`
(glob plot_*.py minus plot_E[1-6]/_*). bridge sits on the exact H_eq
curve (g*=0.047); recombination shows max-merge rising while mean-distill
stays flat; architectures shows the collapse/rescue signs across
histogram/GRU/MLP.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
d22dd9d535
commit
b8da418034
23 changed files with 680 additions and 26 deletions
|
|
@ -81,6 +81,19 @@ def test_measure_distribution_recovers_frequencies():
|
|||
assert abs(p_hat[0] - 0.5) < 0.01
|
||||
|
||||
|
||||
def test_measure_distribution_all_invalid_is_terminal_collapse():
|
||||
# A degenerate neural model can emit only invalid codewords (decoded index >= K). That
|
||||
# must not crash a long sweep: measure_distribution returns the terminal-collapse
|
||||
# sentinel (fixation on the dominant mode) — H=0, single-mode support — not an error.
|
||||
syn = _syn(K=16)
|
||||
oracle = ExactOracle(syn)
|
||||
X_bad = np.full((100, syn.seq_len), syn.vocab - 1, dtype=np.int64) # max-token everywhere
|
||||
assert (oracle.classify(X_bad) >= syn.K).all() # all off-manifold
|
||||
p_hat = measure_distribution(X_bad, oracle, syn.K)
|
||||
assert p_hat.shape == (syn.K,) and np.isclose(p_hat.sum(), 1.0)
|
||||
assert p_hat[0] == 1.0 and int((p_hat > 0).sum()) == 1 # collapsed to one mode
|
||||
|
||||
|
||||
# --- histogram model --------------------------------------------------------------------
|
||||
|
||||
def test_histogram_initialise_is_exact():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue