Skip to content

ε-machines of asymptotically synchronizing processes - #57

Merged
Autoplectic merged 1 commit into
mainfrom
near-limit-state-merge
Nov 15, 2026
Merged

Autoplectic merged 1 commit into
mainfrom
near-limit-state-merge

Conversation

@Autoplectic

Copy link
Copy Markdown
Member

Summary

EpsilonMachine.from_hmm (and so infer_reverse_epsilon_machine and the bidirectional preflight) failed on processes whose hidden state no finite word reveals, such as a period-2 process whose phase stays uncertain. Their beliefs converge to the causal states without reaching them, and:

  • either rounding closed the mixed-state presentation on hundreds of beliefs within round-off of the simplex boundary (rounding acts as a reflecting barrier for the posterior's log-odds random walk, so a transient walk became a recurrent class with geometrically decaying mass), giving e.g. 255 "causal states" instead of 3;
  • or the presentation exceeded max_states and raised MixedStateExplosionError, so the process was classified as having an infinite reverse machine.

Now build_epsilon_machine seeds a second mixed-state presentation from a limit belief (the heaviest recurrent belief when the recurrent beliefs have entries below 1e-8, or the belief after Bayes-filtering a 4096-symbol sample when the first presentation explodes), with sub-1e-8 entries set to zero. It minimizes the result and accepts it only if it generates the source process (_equivalence_error at most 1e-9). A finite unifilar presentation of the process minimizes to its ε-machine, so an accepted result is correct; otherwise the old behaviour is unchanged.

Evidence

  • Period-2 example (A, B0, B1, flip probability e): 3 reverse states with C_mu = 1.5 at e = 0.4 (was 255 states), 0.1 and 0.45 (were explosions); equivalence errors around 1e-16.
  • All 142 binary 3-state survey topologies: explosions 35 → 26; the 9 rescued are 3-state reverse ε-machines with equivalence errors at most 6e-13. Finite/infinite now agrees with reverse_epsilon_machine_is_finite on all 138 minimal topologies. One topology the criterion calls infinite returns 827 states instead of 893; both are finite approximations, and the existing truncation warning still fires.

Test plan

  • tests/test_asymptotic_synchronization.py: both failure modes (e = 0.4 closure, e = 0.1 explosion)
  • Full suite: 2290 passed, 19 skipped
  • ruff check, ruff format --check, ty check

Made with Cursor

…states from a limit belief

Mixed-state presentations of processes whose hidden state no finite word reveals either closed on
hundreds of near-boundary beliefs (rounding reflects the posterior's random walk) or exceeded
max_states. Seed from a limit belief instead and accept the result only if it generates the source
process exactly.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Autoplectic
Autoplectic merged commit f9ec640 into main Nov 15, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant