This document separates the mathematics implemented in the repository from the broader formal DRM program. Equations describe the current code unless a section is explicitly marked as proposed or future work.
Let
denote the causal latent state and
the embedding of token DRMStateInitializer learns
The vector
DirectionField predicts
The engineering effective dimension is
The directions may be non-orthogonal. Optional normalization controls their Euclidean norm but does not construct an orthonormal frame.
dimD measures gate activity. It is not the exact rank of the implemented
metric and not yet the formal
DRMFlow predicts token- and state-dependent coefficients:
The raw velocity is
Consequently,
up to the soft-gate interpretation.
J_NO_DIRECTION does not use this decomposition. It replaces the directional
field and constrained flow with a direct causal neural transition
RelationalMetric predicts
where
For nonzero
The metric energy of velocity
The coupling between learned directions is
Because
in exact arithmetic. metric_rank configures the width of the low-rank update
A thresholded spectral or numerical effective rank may be useful as a diagnostic, but it must be labeled as an approximation. It is not the formal rank of a degenerate metric.
The code can precondition the raw velocity:
where
With naturalization strength
The inverse is evaluated through the Woodbury identity for diagonal plus low-rank structure:
This is metric-aware first-order preconditioning. It is not equivalent to solving the geodesic boundary-value problem.
J_NO_NATURALIZATION retains J_NO_METRIC removes the metric module and uses
The original recurrent path uses an Euler-like update:
When bounded_state is enabled, the implementation additionally applies norm
clipping and a coordinate-wise tanh projection. This stabilizes optimization
but changes the unconstrained dynamics.
For a causal block beginning at state
The final state of one block initializes the next:
This preserves causal block ordering and prefix causality. It does not exactly equal the nonlinear recurrent rollout because geometry is not recomputed after every within-block state update.
A causal depthwise convolutional mixer can produce a residual correction
Only left padding is used, so future positions do not alter prefix outputs.
The D-and-later ablations can add a direct lexical path:
This prevents all token information from being forced exclusively through directional coefficients and block geometry.
Variant J predicts forget, write, and candidate vectors from the previous causal base state and current token:
The memory recurrence is
The state receives a scaled correction:
Each step is an element-wise affine map
Affine maps compose associatively:
The implementation uses this associative composition for a parallel scan. It does not use the numerically unstable identity that divides by a cumulative product of forget gates.
This recurrence is SSM-like selective memory, but it is not an implementation of Mamba's complete selective SSM parameterization or block architecture.
LanguageEmitter maps the causal state to vocabulary logits:
The next-token distribution is
The primary objective is
The historical GPT-2 double-shift bug did not change this DRM equation; it made the old cross-family benchmark invalid by training GPT-2 against the wrong target offset.
The discrete action proxy is
A general configured loss may be written as
The regularizers can include gate activity, dimension variance, metric conditioning/diversity, recurrence, stability, risk, and consistency proxies.
Variant J and its current component ablations set these geometric auxiliary
weights to zero. Their reported 5M-token results optimize CE only. Metric
parameters in J_NO_NATURALIZATION therefore have no CE gradient path.
For a causal model, if two inputs share a prefix through position
The recurrent, causal-convolution, selective-scan, and component-ablation paths have automated prefix-causality tests. Causality does not imply that blockwise states equal exact recurrent states.
The geometry-free control retains:
It removes direction, metric, flow, and risk. Its selective-memory hidden width is increased to approximately match J's parameter count. This makes it a parameter control, not a compute control and not a Mamba baseline.
A formal geodesic would be a stationary or minimizing curve of an action functional under appropriate boundary conditions and admissibility constraints. The current implementation provides:
- a learned SPD metric;
- direction-constrained velocities;
- an action proxy;
- optional local candidate and solver approximations.
It does not prove:
- global or local action optimality;
- satisfaction of the geodesic equation;
- uniqueness;
- completeness;
- convergence of the numerical path to a geodesic.
Low measured action must therefore be reported as a diagnostic, not as proof of geodesic emergence.
The following belong to the roadmap or paper program and are not yet complete in the runtime:
- a degenerate metric with a nontrivial formal kernel;
- effective fibers and rank-based strata;
- anchor maps and relational transport;
- connection and holonomy diagnostics;
- Fisher-Rao or decoder-distribution pullback metrics;
- formal variational boundary-value solvers;
- validated topological invariants.
Future metrics may be defined as pullbacks of a distribution-space metric:
where
The optional toroidal coordinate utility represents angles by
This guarantees a circular coordinate representation only when explicitly used. It does not demonstrate spontaneous toroidal topology, recurrence, or structural stability of learned trajectories.