Skip to content
Shadow Theory

Certified Target-Sufficient Readout Design and Exact Finite-Model Reduction

Exact rational weighted contraction and target-dependent precision

Jeremy RodgersSection 8 of 11Original PDF ↗Publication DOI ↗

Exact rational weighted contraction and target-dependent precision

The supplied OpenAI preprint’s Appendix D.1[7] contracts Boolean-wire networks over a truncated polynomial ring modulo a power of two. Rational signed weights are not an automatic instance of that coefficient ring. We give an explicit transfer, including signed recovery and all precision costs, and a sharp improvement when the target supplies an independently justified interval. The resulting source-likelihood interface is useful without implementing the paper’s asymptotic contraction algorithm. Weighted sum–product and variable elimination are established methods. Scott–Sorkin[13], Sections 1–2 and 6, treat polynomial and ring-valued constraint satisfaction; Kschischang–Frey–Loeliger [4], Sections II–III, explain factorized marginalization and its relation to forward/backward algorithms. We do not claim weighted contraction, denominator clearing, modular reconstruction or dynamic programming as newly discovered techniques. The contribution here is their precise transfer to the supplied ETH theorem and a checked, typed interface for the nominated source–readout tasks.

A rational factor model with explicit arithmetic costs

Let x ∈{0, 1}N, and let Tv(x|Sv) ∈Q be explicitly supplied tables, with |Sv| ≤a. Negative entries are permitted for algebraic contraction, though they are not probabilities. Write

F
∏︂
Z =
∑︂
v=1
Tv(x|Sv),
I =
∑︂
v
|Sv|.
x∈{0,1}N
Source page 11.
Searchable transcription
F
∏︂
Z =
∑︂
v=1
Tv(x|Sv),
I =
∑︂
v
|Sv|.
x∈{0,1}N
The table index convention, scope order and declared unused variables are part of the input. Let L be
the total binary description length and let b bound numerator and positive-denominator bit length of
each rational entry. For each tensor take the positive least common denominator qv of its entries, and
set
Wv = qvTv ∈Z2|Sv|,
Q =
∏︂
v
qv,
Av = max |Wv|,
B = 2N ∏︂
v
Av.
Technical passage, source page 11.
Searchable transcription
The table index convention, scope order and declared unused variables are part of the input. Let L be
the total binary description length and let b bound numerator and positive-denominator bit length of
each rational entry. For each tensor take the positive least common denominator qv of its entries, and
set
Wv = qvTv ∈Z2|Sv|,
Q =
∏︂
v
qv,
Av = max |Wv|,
B = 2N ∏︂
v
Av.

Then Z = Zint/Q for an integer Zint satisfying |Zint| ≤B. For fixed a, each qv and each integer entry has Oa(b) bits, so log2(B + 1) = O(N + Fb). Zero tensors, isolated scalar tensors and unused source variables can be handled directly. In particular, u unused variables multiply the contraction by 2u; they are not silently omitted. In the theorem below all scalar entries and these factors of two remain in the same modular integer contraction. The interval therefore refers to the original Zint, with no further restoration multiplier after decoding. An implementation may multiply known integer scalar factors modulo 2P before decoding. If it instead decodes a smaller residual contraction, it must derive a new interval and denominator for that residual problem. Scalar products require their actual input/output-bit costs in either case.

Theorem A.1 (Exact rational transfer of OpenAI Appendix D.1). Given a justified integer bound L0 ≤Zint ≤U0, choose P ≥1 with 2P > U0 −L0. The factor model can be transformed into a bipartite Boolean-wire tensor network with at most 4I wires and maximum degree ∆≤max{a, 3}, retaining scalar vertices as described above. Its integer entries reduced modulo 2P are instances of Appendix D.1 with truncation order one. Let E′ and V ′ be the actual transformed wire and vertex counts and put

s = 2 + E′ + V ′ + P + ∆2.
Source page 11.
Searchable transcription
s = 2 + E′ + V ′ + P + ∆2.
Conditional on the supplied OpenAI preprint’s Theorem D.1, the contraction has deterministic bit
complexity
poly(s + L + N) 2O(s/√log s)
Technical passage, source page 11.
Searchable transcription
Conditional on the supplied OpenAI preprint’s Theorem D.1, the contraction has deterministic bit
complexity
poly(s + L + N) 2O(s/√log s)

and polynomial space. The recovered value is the exact signed rational Z. For bounded arity, fixed entry bit length and no isolated scalar factors or unused source variables, s = O(E′) with the crude bound above; thus the time is subexponential in wires. Growing precision must remain in s. Retaining many scalar vertices or unused-variable multipliers can increase V ′ or P without increasing E′; merely preprocessing those factors does not remove their cost from the full-integer formulation above.

Proof. Replace every occurrence of a variable by a port of its factor. Enforce agreement of its ports by a tree of equality tensors of degree at most three. A variable appearing once uses the unary tensor (1, 1), twice uses a binary equality tensor, and d ≥3 occurrences use d −2 trivalent equality vertices. Every assignment of the original bit extends uniquely to the tree; inconsistent leaf values give zero. There are at most 2I edges before bipartization. Subdivide each edge with a binary equality tensor, placing all original vertices on one side and all subdivision vertices on the other. This at most doubles the number of edges and preserves the contraction, because the two new edge bits must agree. The transformed maximum degree is at most max{a, 3}. Reduce the integer tables Wv modulo 2P , leaving equality entries zero or one. Reduction is a ring homomorphism, so contraction gives Zint mod 2P . Exact table access and reduction cost polynomial time in the description and precision; this meets the entry-evaluator hypothesis of Theorem D.1. Our conservative s makes all its edge, vertex, degree and precision conditions hold, with fixed absolute constants. The theorem gives the displayed time and space. There is exactly one integer in [L0, U0] with the returned residue, since two distinct such integers would differ by at least 2P > U0 −L0. Divide the recovered full integer by Q to obtain Z. For fixed arity and entry bits, the crude interval [−B, B] needs P = O(N + F). Under the stated absence of isolated scalar factors and unused source variables, N, F = O(I) = O(E′) for a nonempty constructed network; its vertex and degree bounds have the same order. This proves the last assertion. Bounded exceptional sizes are handled directly as in Theorem D.1.

The generic transfer is not uniformly subexponential in the original source bits if an encoding introduces many wires or if P grows much faster than the wire count. For example, an O(E′ log E′) padding parameter does not give a subexponential-in-E′ bound from the displayed formula. Direct enumeration, low-treewidth elimination or a small transfer matrix may already be faster. The implementation reports these distinctions rather than promising a practical asymptotic speedup.

A sharp target-relative arithmetic interface

Theorem A.2 (Interval-assisted reconstruction and target descent). For all integers in a nonempty interval [L0, U0], reduction modulo M = 2P is injective if and only if M > U0 −L0. Given a residue r and this promise, the unique answer is

z = r + M
⌈︃L0 −r
⌉︃
,
r ∈{0, . . . , M −1},
M
Source page 12.
Searchable transcription
z = r + M
⌈︃L0 −r
⌉︃
,
r ∈{0, . . . , M −1},
M

provided z ≤U0; otherwise the residue contradicts the interval. For a nominated target f on an admitted integer set S, knowing only z mod M determines f(z) exactly if and only if f is constant on each residue class intersected with S.

Proof. An interval of width smaller than M contains no distinct pair differing by a nonzero multiple of M. If its width is at least M, the two integers L0, L0 + M both belong to it and have the same residue. The formula chooses the least integer in the residue class not below L0, proving recovery and its exact failure test. For the target statement, a residue-only answer must take one value on each class. Constancy makes that value well defined and sufficient, while two unequal target values in one class preclude it.

Thus it is the width of a justified interval, not its distance from zero, that determines full-value precision. A coarse target can need still fewer bits: parity needs P = 1 on any interval. Conversely the target f(z) = 1{z = 0} on {0, . . . , U0} needs 2P > U0 whenever U0 ≥1. Otherwise zero and 2P have identical residues and different answers. A generic decision-only contraction therefore cannot drop this precision merely because it returns one bit. If the admitted interval already excludes zero, that particular decision is immediate. The residue criterion is an instance of Rodgers’s target-relative descent principle. It supplies a sharp arithmetic adapter, not a new source of information. The interval must be justified independently; it cannot be inferred from the single modular residue. The code deliberately labels a caller-supplied interval as a premise. An incorrect narrow interval can silently select the wrong congruent integer, which no residue-only algorithm can prevent.

Completed record-law calculation

For a concrete nonnegative source, take hidden bits X0, . . . , X4, initial distribution (1/2, 1/2) and
transitions
(︄
4/5
1/5
1/5
4/5
)︄
Technical passage, source page 13.
Searchable transcription
For a concrete nonnegative source, take hidden bits X0, . . . , X4, initial distribution (1/2, 1/2) and
transitions
(︄
4/5
1/5
1/5
4/5
)︄
P =
.
Source page 13.
Searchable transcription
P =
.

At each tick emit Yt = Xt with probability 6/7 and its complement with probability 1/7, independently conditional on the hidden trajectory. These preparations and emission laws define a conventional finite stochastic source. They are not inferred from a readout or a Born-selection argument. For the retained word y = (1, 0, 1, 1, 0), factor contraction and an independently implemented forward recursion both give

Pr(Y = y) =
848
60025,
Pr(X0 = 0 | Y = y) = 1501
7420.
Source page 13.
Searchable transcription
Pr(Y = y) =
848
60025,
Pr(X0 = 0 | Y = y) = 1501
7420.

The second is a posterior under the nominated source measure, not an identification of the actual hidden initial bit. Clearing the ten factor denominators gives Q = 21 008 750 and scaled answer 296 800. The naive magnitude calculation supplies B = 63 700 992, so the symmetric integer interval requires P = 27. The initial distribution and transition rows sum to one, and each emitted word factor is at most 6/7. Consequently the event probability is between zero and (6/7)5, independently of computing its exact value. This yields the tighter scaled interval

0 ≤Zint ≤
⌊︂
Q(6/7)5⌋︂
= 9 720 000,
Source page 13.
Searchable transcription
0 ≤Zint ≤
⌊︂
Q(6/7)5⌋︂
= 9 720 000,

requiring only P = 24. Both modular evaluations reconstruct the same answer. This is a three-bit precision saving for a specified task; it is not an empirical speedup or a new general worst-case ETH bound. For arbitrary nonnegative source factors, the adapter also supports exact event indicators and supplied record likelihoods. It normalizes numerator and denominator separately and returns an explicit undefined status if the conditioning weight is zero. Signed tables are rejected by the probability interface even though the algebraic contraction backend accepts them. No probability is assigned to an impossible observation, and no arbitrary uniform prior is silently introduced.

Verification, backends and an easy-instance ceiling

The reusable weighted.py exposes exact rational factor evaluation, ordinary variable elimination, integer denominator clearing, modular enumeration, interval decoding, posterior queries and a Boolean-wire network converter. It uses Python’s exact integers and Fraction. Its backends are not an implementation of the ETH paper’s recursive contraction theorem.

verify_weighted.py checks 140 random signed rational factor models against independently organized enumeration, modular evaluation and variable elimination. It checks 3 400 signed interval decodings, the sharp lower-precision failures, parity-versus-zero target counterexamples, and explicit port-network conversions including high incidence, isolated scalars and unused variables. It also rejects signed probability measures and handles impossible conditioning. As a nontrivial signed cyclic example, use the same matrix on every edge,

(︄
1/2
−2/3
3/5
−7/11
)︄
,
Zn =
∑︂
∏︂
M =
i
Mxi,xi+1,
xn = x0.
x∈{0,1}n
Source page 14.
Searchable transcription
(︄
1/2
−2/3
3/5
−7/11
)︄
,
Zn =
∑︂
∏︂
M =
i
Mxi,xi+1,
xn = x0.
x∈{0,1}n

An independently computed matrix power gives Zn = Tr(Mn), which agrees with the adapter at n = 3, 5, 6, 40. The small cases also agree with exhaustive and modular enumeration. For n = 40, ordinary elimination uses 618 factor-entry evaluations with maximum bucket scope three, where exhaustive enumeration would inspect 240 assignments. This is a verified operation-count advantage of an established low-width method; the transfer-matrix solution is also polynomial. It is specifically evidence against replacing every easy source calculation with the general ETH algorithm. The universal claim is the conditional theorem transfer and the exact reconstruction proof. Finite diagnostics check the implementation, not the ETH paper’s whole proof. We do not establish continuous CP feasibility, a new trine-source resource bound, quantum outcome selection or a consciousness mechanism. Each would require its own additional interface.

Back to top ↑