Expand description
Kantorovich-certified encode atlas (issue #1010).
Encoding a row x ∈ ℝᵖ against a FROZEN SAE dictionary is, per atom k,
the coordinate-only Newton problem
min_t f_k(t) = ½‖x − z_k · B_kᵀ Φ_k(t)‖² + prior_k(t),with the amplitude z_k and decoder block B_k held fixed (the encode
freezes the dictionary; only the latent coordinate t moves). Newton on
F(t) = ∇f_k(t) converges quadratically from a start t₀ into the unique
root in a certified ball whenever the Newton–Kantorovich quantity
h = β · η · L ≤ ½, β = ‖F'(t₀)⁻¹‖, η = ‖F'(t₀)⁻¹ F(t₀)‖,where L is a Lipschitz constant of F' (the Hessian of f_k) on a region
containing the Newton iterates. h is CHECKABLE per row in O(q³)
(q = latent_dim, tiny), so each fast-path encode carries its own
exactness certificate.
§The closed-form Hessian-Lipschitz constant L
Write m(t) = z·BᵀΦ(t) ∈ ℝᵖ (the reconstruction) and r(t) = m(t) − x.
Then f = ½‖r‖² + prior and, differentiating three times,
∇³f = 3·sym(J_mᵀ : ∇²m) + ⟨r, ∇³m⟩ + ∇³prior,so an operator-norm bound on the chart is
L ≤ 3·‖J_m‖·‖∇²m‖ + ‖r‖·‖∇³m‖ + L_prior,with ‖∂^g m‖ ≤ |z|·(Σ_m ‖B_{m,:}‖)·B_g, where B_g = sup_chart max_m ‖∂^g Φ_m‖ is the per-column jet sup of the basis family — closed form per
family (BasisHessianLipschitz). ‖r‖ is bounded by ‖x‖ + |z|·(Σ_m‖B_{m,:}‖)·B_0. The ARD/von-Mises prior L_prior is a closed-form
constant from the prior strength. Every bound is conservative (an
over-estimate of L only SHRINKS the certified radius — it can never
certify a row that does not converge).
§Pipeline
- Offline, per atom (
EncodeAtlas::build): chart centerst_con the atom’s coordinate grid (the SHAPE_BAND grid idiom), each with a certified Newton radiusR_csolved from the Kantorovich inequality at the worst-case in-chart start. - Online, per row (
EncodeAtlas::certified_encode_row): route to the nearest chart, start from its distilled IFT predictor, take one or two Newton steps, then theh ≤ ½check AT the start point is the per-row certificate. - Uncertified tail: rows whose start fails
h ≤ ½are FLAGGED (counted inEncodeResult::encode_uncertified_count) and must be routed by the caller to the existing exact multi-start solve. No approximation enters silently.
Structs§
- Atlas
Config - Configuration for
EncodeAtlasconstruction and online encode. All fields are explicit; the atlas never reads global state and adds no CLI flags. - Atom
Encode Atlas - The per-atom encode atlas: a set of certified charts covering the atom’s coordinate domain, plus the decoder/amplitude scaling needed to recompute a per-row certificate online.
- Certified
Chart - One offline-certified chart: a center, its Kantorovich constants, and the
certified Newton-convergence radius
R_csolved fromh = β·η·L ≤ ½at the worst-case in-chart start. - Chart
Region - A chart region on an atom’s latent coordinate: a center
t_cplus a certified in-chart radius. Over the ball‖t − t_c‖ ≤ radiusthe jet sup bounds returned byBasisHessianLipschitzhold, so the Kantorovich constantLcomputed from them is valid for any start in the ball. - Encode
Atlas - The encode atlas: per-atom certified charts plus the online certified-encode driver (issue #1010).
- Encode
Result - Result of a certified encode over a batch of rows, carrying the honesty flag: how many rows could NOT be certified and were flagged for the exact multi-start fallback (issue #1010 — no approximation enters silently).
- RowCertificate
- Per-row Kantorovich certificate at a start
t₀for one atom encode.
Constants§
- KANTOROVICH_
THRESHOLD - The Kantorovich convergence threshold
h ≤ ½. Below this the Newton iteration is guaranteed to converge quadratically into the unique root in the certified ball; at or above it the start is uncertified.
Traits§
- Basis
Hessian Lipschitz - Per-column sup-norm bounds on the first three coordinate jets of a basis
family
Φ(t), valid over a statedChartRegion(issue #1010). These are the analytic ingredients of the Hessian-Lipschitz constantL— see the module docs for the assembly.value_supboundsmax_m |Φ_m|,jacobian_sup/hessian_sup/third_supboundmax_m ‖∂^g Φ_m‖.
Functions§
- row_
certificate - Compute the per-row Kantorovich certificate for encoding target row
xagainst atomatomat start coordinatet₀, with fixed amplitudezand the chart’s closed-form Lipschitz constantlipschitz. Returns the certificate AND the Newton stepδ = −H⁻¹ gso the caller can advance.