Commit c7eaf29
Add LatentReasoningEngine for multi-step latent-space reasoning
Implements the core reasoning loop that chains VL-JEPA's
LatentDynamicsPredictor to reason in embedding space without
generating intermediate tokens.
Components:
- LatentReasoningConfig: all hyperparameters with research-backed defaults
- ReasoningStep: per-step snapshot with quality metrics for Gate 2 curves
- CollapseDetector: four-signal collapse monitoring (variance drop, spread
collapse, cosine stagnation, spectral rank collapse) — addresses Risk #1
from the feasibility position paper (score 20/25)
- ReplanningStrategy: "plan short, replan often" with scheduled, collapse,
and quality-floor triggers; supports token-space re-anchoring via replan_fn
- LatentReasoningEngine: stateless main loop producing a ReasoningTrace
- ReasoningTrace: full chain record with degradation_curves() accessor for
Gate 2 validation and summary() for logging
- make_reasoning_engine(): convenience factory for the common case
Integrates directly with VLJEPA.dynamics_predictor (LatentDynamicsPredictor).
Token-space fallback is a first-class feature via fallback_on_collapse flag.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 190a448 commit c7eaf29
1 file changed
Lines changed: 892 additions & 0 deletions
0 commit comments