๐Ÿ”ท SPDP Inference Polytope

The Safe Region โ€” Where AI Reasoning Must Stay

The Big Picture

The three guards โ€” honesty, stability, and holonomy โ€” each define a constraint. The intersection of all three constraints creates a geometric shape in inference space: a polytope.

If the model's reasoning stays inside this polytope, it's safe. The distance from the boundary tells you the safety margin.

๐Ÿ›ก๏ธ
Honesty Face
Attribution positivity โ‰ฅ threshold
๐Ÿงฑ
Stability Face
Capability energy โ‰ค budget
๐Ÿ”„
Holonomy Face
Loop closure โ‰ค tolerance

What is SPDP?

Shifted Partial Derivative Projection. Given a polynomial encoding of a computational object, take all partial derivatives up to a fixed order, shift by bounded-degree monomials, then project through the observer's resource constraints.

The rank of the resulting matrix measures residual complexity:

SPDP Matrix Construction:
MSPDP[i,j] = coefficient of xi in โˆ‚j(f) ยท xshift

Rank as Safety Measure:
rank(MSPDP) โ‰ค r   โŸน   computation is r-tractable for the observer

Polytope Definition:
P = { s โˆˆ โ„n : honesty(s) โ‰ฅ hโ‚€, stability(s) โ‰ฅ tโ‚€, holonomy(s) โ‰ค ฮตโ‚€, rank(s) โ‰ค rโ‚€ }
The safe region is the intersection of all constraint half-spaces.

Visualising the Safe Region

In 2D, the polytope is a polygon. In 3D, a polyhedron. In higher dimensions, it's a convex body โ€” but the principle is the same.

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ โ— Safe โ— โ”‚ โ† Honesty face โ”‚ โ— โ— At risk โ”‚ โ”‚ โ— โ— โ”‚ โ”‚ โ— โ”‚ โ† Stability face โ”‚ โ— โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ†‘ Holonomy face โœ• Outside = unsafe โœ•

The model's state is a point. Safety = point inside the body. Risk = distance to nearest face. If it crosses a face, one of the three guards has failed.

Boundary Distance

How close to the edge of safety? If the model is deep inside the polytope, it has a large safety margin. If it's near a face, it's at risk. If it crosses a face, one of the three guards has failed.

The boundary distance is computed as the minimum distance from the current state to each constraint hyperplane. The smallest distance is the bottleneck โ€” the weakest safety guarantee.

Code Example

from mikoshi_safeguard.polytope import InferencePolytope import numpy as np # Define constraints (honesty, stability, holonomy bounds) constraints = np.array([ [1, 0, 0, 0.8], # honesty โ‰ฅ 0.8 [0, 1, 0, 0.5], # stability โ‰ฅ 0.5 [0, 0, 1, 0.9], # holonomy โ‰ฅ 0.9 ]) polytope = InferencePolytope(constraints) point = np.array([0.95, 0.7, 0.95]) # current state print(f"Inside: {polytope.contains(point)}") print(f"Boundary distance: {polytope.boundary_distance(point):.3f}")

Connection to Complexity Theory

The SPDP rank connects to algebraic complexity โ€” problems with low rank are computationally tractable for the observer, problems with high rank are beyond reach.

This is the mathematical foundation for why certain AI behaviours are verifiable and others aren't. If a model's reasoning has low SPDP rank, an observer with bounded resources can check it. If the rank is high, the reasoning is opaque โ€” the observer literally cannot verify it with available computation.

The polytope boundary therefore represents the frontier of verifiability: inside, the observer can check safety; outside, they can't.