Repository navigation
Generator verification: equations are necessary only; exact word-process check - #56
Merged
Merged
Conversation
generator_kernel and the generative-models page said violation 0 means the channel's variable is a generator state. Future-side consistency only constrains R_w through its one-step average, so a zero-violation kernel can emit the wrong words: on survey process ((1,.),(2,0),(1,0)) an 11-state example matches words up to length 3 and is off by 0.024 at length 8. A positive violation still rules a variable out; pipeline results are already word-verified. Co-authored-by: Cursor <cursoragent@cursor.com>
…s are necessary only _reproduction_error now also runs a difference-automaton equivalence test (_equivalence_error): BFS over words whose difference vectors are independent (at most n1 + n2, Schutzenberger / Tzeng), returning the largest word-probability deviation over visited words. The fixed-length check (at most length 8) could accept a candidate that drifts after the cutoff. GenerativeModelResult documents that n_g_optima_generating, separating_variables_generate and cg_exceeds_g report the kernel LP, whose equations are necessary but not sufficient. Co-authored-by: Cursor <cursoragent@cursor.com>
5 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The one-step generator equations used throughout (edge law, forward stationarity, summed future-side consistency) are necessary but not sufficient. This PR makes sofic say so and closes the verification gap that follows from it.
generator_kerneland the generative-models page now say: a positive kernel-LP violation rules a variable out as a generator state; a violation of 0 does not prove it is one. TheGenerativeModelResultdocstring explains whatn_g_optima_generating,separating_variables_generateandcg_exceeds_gactually report._reproduction_error, used by every search that returns a generator, now takes the maximum of the old fixed-length check and a new_equivalence_error. That function runs a difference-automaton equivalence test (Schützenberger / Tzeng): a breadth-first search over words, keeping those whose difference vectors are linearly independent (at most (n_1 + n_2)), and returning the largest word-probability deviation over the visited words. The old cutoff (at most length 8) could accept a candidate that matched short words and drifted later; two HMMs are only guaranteed equal once they agree up to length (n_1 + n_2 - 1).Why
Future-side consistency constrains a state's belief (R_w) only through its one-step average. Nothing forces (R_w) to be the generated future's actual conditional distribution of (S^-).
Counterexample on survey process
((1,·),(2,0),(1,0))(cpfciatom_generator_case1.npz): an 11-state ((\pi, Q, R, K)) with kernel-LP violation 0 matches the process's words up to length 3, then drifts (0.0078 at length 4, 0.024 at length 8)._equivalence_errorreports 0.023 for it. On three word-verified survey generators it reports (5 \times 10^{-9}) to (6 \times 10^{-8}).Impact
Test plan
tests/test_reproduction_check.py: a fair coin and an alternating process, which agree on single symbols, are told apart even withmax_length=1; two presentations of the golden mean (one non-unifilar) agree to (10^{-12}).ruff check,ruff format --check,ty check(no errors),sphinx-build -W