MR-JEPA: Multimodal Reasoning via Joint-Embedding Predictive Architecture
A world model for multimodal reasoning that refines a latent belief state over K=3 steps using JEPA-style prediction, evidence gating, and dense visual backbones.
Key Idea
Traditional multimodal models produce answers in a single forward pass. MR-JEPA instead models the evolution of a belief state as the system reasons about a question:
zβ (initial evidence) β zβ (first refinement) β zβ (deeper reasoning) β zβ (answer)
This trajectory is supervised by a JEPA objective: a target encoder (EMA) generates target latent states, and the online predictor learns to predict them. The JEPA loss encourages the model to learn meaningful intermediate reasoning states β not just the final answer.
Architecture
ββββββββββββββββ ββββββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββ
β DINOv3-L/16 ββββββΆβ Evidence Memory ββββββΆβ Latent Rollout ββββββΆβ Disc. Head β
β (frozen) β β (Perceiver Resampl)β β zββzββzββzβ β β (MC scoring) β
ββββββββββββββββ ββββββββββ¬ββββββββββββ β (shared block) β βββββββββββββββββ
β ββββββββββ¬ββββββββββ βββββββββββββββββ
ββββββββββββββββ β β βββββΆβ Gen. Decoder β
β Qwen3-Embed ββββββββββββββββ βββββββββ΄βββββββββ β (Qwen3.5-4B) β
β 0.6B β β Target Encoder β βββββββββββββββββ
β (frozen) β β (EMA copy) β
ββββββββββββββββ ββββββββββββββββββ
β
ββββββββββββββββ JEPA Loss:
β Phase 3 opt: ββββββββββββ SmoothL1/Cosine
β PaddleOCR-VL β + SIGReg (purist)
β SAM 3.1 β / VICReg (hybrid)
ββββββββββββββββ
Component Stack
| Module | Primary Choice | Alternative | Notes |
|---|---|---|---|
| Visual backbone | timm/vit_large_patch16_dinov3.lvd1689m β DINOv3-L/16, 1024-dim, 300M |
DINOv3-B/16 (purist); DINOv2-L/14 (ablation) | Frozen Phase 1; last 6 layers unfrozen Phase 2 |
| Text encoder | Qwen/Qwen3-Embedding-0.6B β 1024-dim, 596M |
Qwen3-Embedding-4B (heavier); EmbeddingGemma-300M (lighter) | Frozen Phase 1; last 4 layers unfrozen Phase 2 |
| Evidence memory | Perceiver Resampler, 64 queries, 4 cross-attn layers | Q-Former as baseline | Modality-typed tokens (visual/text/OCR/layout/chart/SAM) |
| OCR / doc / charts | PaddlePaddle/PaddleOCR-VL-1.5 β 958M |
MinerU2.5 for heavy PDF parsing | Phase 3 only, offline token extraction |
| Segmentation | jetjodh/sam3.1 β SAM 3.1, non-gated mirror |
SAM 2.1-Large (stable) | Phase 3 optional, offline mask extraction |
| Latent rollout | Shared transformer predictor, 6 layers, K=3 | Per-step unshared blocks (ablation) | Weight-tied across steps; sigmoid evidence gates |
| Target encoder | EMA copy (cosine 0.996β1.0) of evidence+rollout | Frozen target (ablation baseline) | From I-JEPA |
| JEPA loss | SmoothL1 + VICReg (hybrid); Cosine + SIGReg (purist) | MSE (ablation) | SIGReg emphasis in purist branch |
| Disc. head | MLP/bilinear scorer | Cross-encoder scorer (ablation) | Attention-pooled z_K Γ option embeddings |
| Gen. decoder | Qwen/Qwen3.5-4B β 4.7B, multimodal |
HuggingFaceTB/SmolLM3-3B (cheaper); Gemma3-4B |
Phase 3+, cross-attends to z_K + evidence |
| Teacher/baseline | InternVL3.5 / Qwen3-VL | External comparison only | NOT used as internal module |
Training Protocol
Phase 1: Reasoning Core (15β20 epochs)
- Freeze all perception (DINOv3 + Qwen3-Embedding)
- Train evidence memory + latent rollout + discriminative head
- Full JEPA loss + task loss
- LR: 3e-4, effective batch: 64
Phase 2: Perception Fine-tuning (10 epochs)
- Unfreeze last 6 DINOv3 layers + last 4 Qwen3-Embedding layers (1e-5)
- Continue training reasoning core (1e-4)
Phase 3: Enriched Evidence + Generative Decoder (10 epochs)
- Enable PaddleOCR-VL tokens, SAM 3.1 masks, layout/chart tokens
- Attach Qwen3.5-4B generative decoder for open-ended answers
- End-to-end fine-tuning, LR: 5e-5
Target Benchmarks (9)
| Benchmark | Type | Metric | Key Challenge |
|---|---|---|---|
| MMMU | MC (multi-image) | Accuracy | Multi-discipline, up to 7 images |
| MathVista | Mixed MC/Open | Accuracy | Mathematical reasoning |
| ScienceQA | MC | Accuracy | Scientific diagrams, nullable images |
| AI2D | MC | Accuracy | Science diagram comprehension |
| MMBench | MC | CircularEval Acc | General visual understanding |
| MMStar | MC | Accuracy | Vision-dependent questions |
| DocVQA | Open | ANLS | Document text extraction |
| TextVQA | Open | VQA Accuracy | Scene text reading |
| ChartQA | Open | Relaxed Accuracy | Chart data extraction |
Experimental Branches
Hybrid-main (competitive)
- DINOv3-L backbone, SmoothL1 + VICReg, K=3
- Full enriched evidence in Phase 3
- Target: state-of-the-art on all benchmarks
Purist-side (scientific validation)
- DINOv3-B backbone, Cosine + SIGReg, K=5
- No enriched evidence, pure JEPA reasoning
- Target: demonstrate JEPA contributes beyond perception
Ablation Experiments
Each experiment maps 1:1 to a CLI flag in train_mrjepa.py.
| Experiment | CLI flag | Modification | Purpose |
|---|---|---|---|
hybrid_main |
(default) | Full model | Baseline |
no_jepa |
--no_jepa |
Remove L_JEPA, task loss only | Validate JEPA objective |
no_rollout |
--no_rollout |
K=0, use zβ directly | Validate iterative refinement |
no_gate |
--no_evidence_gate |
Remove evidence gating | Validate adaptive evidence flow |
K1 / K5 / K7 |
--K 1/5/7 |
Vary rollout depth | Find optimal depth |
dinov2_ablation |
--backbone dinov2 |
DINOv2-L/14 backbone | DINOv3 vs DINOv2 |
mse_loss |
--loss_fn mse |
MSE (L2) JEPA loss | Original I-JEPA loss |
cosine_loss |
--loss_fn cosine |
Cosine similarity JEPA loss | Purist-style loss |
no_sigreg |
--no_sigreg |
Disable SIGReg anti-collapse | Test regularization |
vicreg_only |
--no_sigreg --use_vicreg |
VICReg only | Alternative anti-collapse |
purist |
--purist |
DINOv3-B, K=5, Cosine+SIGReg | Isolate JEPA contribution |
Project Structure
MR-JEPA/
βββ README.md # This file
βββ train_mrjepa.py # Complete training script (CLI, all ablations)
βββ test_architecture.py # Architecture validation tests (synthetic data)
β
βββ mr_jepa/
β βββ __init__.py
β βββ ARCHITECTURE.md # Detailed architecture specification
β β
β βββ configs/
β β βββ __init__.py
β β βββ model_config.py # All hyperparameter dataclasses
β β
β βββ models/
β β βββ __init__.py
β β βββ mr_jepa.py # Main model (integrates all components)
β β βββ backbones.py # Visual (DINOv3/v2) + Text (Qwen3-Embedding)
β β βββ evidence_memory.py # Perceiver Resampler multimodal fusion
β β βββ latent_rollout.py # K-step shared predictor + evidence gates
β β βββ target_encoder.py # EMA encoder + JEPA/SIGReg/VICReg losses
β β βββ answer_heads.py # Discriminative (MC) + Generative (open-ended)
β β
β βββ data/
β β βββ __init__.py
β β βββ unified_dataset.py # 9-benchmark unified loader with format quirks
β β βββ data_utils.py # Collator, dataloader factory, benchmark configs
β β
β βββ training/
β β βββ __init__.py
β β βββ trainer.py # 3-phase training loop
β β βββ phase_scheduler.py # Phase transitions, LR scheduling
β β
β βββ evaluation/
β β βββ __init__.py
β β βββ metrics.py # Accuracy, ANLS, VQA Acc, Relaxed Acc
β β
β βββ utils/
β βββ __init__.py
β βββ visualization.py # Trajectory PCA, gate analysis
β βββ ablation.py # Systematic ablation runner
β
βββ results/ # Training results (auto-pushed)
β βββ hybrid_main.json
β βββ no_jepa.json
β βββ no_rollout.json
β βββ ...
β
βββ checkpoints/ # Best model checkpoints (auto-pushed)
βββ hybrid_main_best.pt
βββ ...
Paper Contribution
A world model for multimodal reasoning: We demonstrate that modeling the evolution of a latent belief state via JEPA-style prediction improves performance on static multimodal benchmarks compared to single-pass baselines. The evidence-gated rollout with K=3 steps learns meaningful intermediate reasoning states, validated through ablation studies across 9 benchmarks. The JEPA objective (not human chain-of-thought) supervises a latent trajectory generated by an EMA target encoder, showing that self-supervised dynamics training transfers to discriminative reasoning tasks.
Key References
- I-JEPA (Assran et al., 2023) β arxiv:2301.08243: JEPA architecture, EMA target encoder, L2 prediction loss, narrow predictor
- LeWorldModel (Maes et al., 2025) β arxiv:2603.19312: SIGReg anti-collapse, end-to-end JEPA
- Coconut (Yu et al., 2024) β arxiv:2412.06769: Chain of Continuous Thought, latent reasoning
- DINOv3 (Meta, 2025) β arxiv:2508.10104: Dense SSL with RoPE + Gram anchoring
- SoftCoT++ (Xu et al., 2025) β arxiv:2505.11484: Soft chain-of-thought with contrastive learning
License
Apache-2.0