Ergo-Vision: MoonViT-3d Projector for Frozen Amazon Ergo (Research PoC)

Research Proof-of-Concept & Negative Ablation β€” NOT a competitive general-purpose VLM.
Only a 59.0M-parameter (0.005% of total weights) MLP projector (ErgoPatchMerger) was trained on top of a 100% frozen Amazon-FMR/Ergo (1.1T total / 55B active MXFP4 MoE) backbone. Text-only capabilities are preserved with zero regression by construction, and vision clearly transfers (4.3Γ— blind on ChartQA, 3.6Γ— blind on DocVQA), but freezing the 64-layer LLM backbone caps dense OCR and UI grounding far below native VLMs.

We release both the primary unconstrained checkpoint (v1) and the clean unit-RMS negative ablation (v2), alongside all 43,422 raw greedy evaluation predictions, exact pv_tensor_sha1 overlap audit, custom 4Γ—B300 PP4 MXFP4 trainer, and zero-IPC SGLang mmap serving patch.

Held-Out Multimodal Benchmarks (14,474 Items, Greedy SGLang TP4/EP4)

Benchmark Split N Metric Blind-Ergo (text) v1 (RMS 60.88, Primary) v2 (RMS 1.00, Ablation) v1 vs Blind v2 vs v1
ChartQA test 2,500 Relaxed Acc (Β±5%) 5.32% 22.88% (H 17.76 / A 28.00) 14.76% (H 15.76 / A 13.76) +17.56 (4.3Γ—) -8.12
AI2D test 3,088 Exact MC Acc 65.51% 66.35% 59.88% +0.84 -6.47
MMStar val 1,500 Exact MC Acc 28.73% 30.13% 29.73% +1.40 -0.40
RealWorldQA test 765 Norm. Exact Acc 38.95% 43.92% 43.14% +4.97 -0.78
DocVQA validation 5,349 ANLS (β‰₯0.5) 3.00% 10.90% 8.60% +7.90 (3.6Γ—) -2.30
ScreenSpot test 1,272 Point-in-BBox 3.14% 4.40% (overlap note) 3.38% +1.26 -1.02

Paired win/loss (v1 vs Blind): ChartQA +454 / -15, DocVQA +743 / -154, AI2D +250 / -224, RealWorldQA +165 / -127, MMStar +225 / -204, ScreenSpot +45 / -29.

Key Empirical Finding: Frozen Hyperspherical Residual Highway (v1 vs v2)

Why did v2 (trained on 58,929 zero-overlap images with dense captions and 2-stage alignment) lose 0/6 benchmarks against v1?

  1. Hyperspherical residual dynamics in Ergo: Amazon-FMR/Ergo normalizes input_embeds (tok_embeddings_rms = 1.0) at Layer 0 (attention_norm), then updates across 64 layers using variance-preserving gated residuals (ErgoResidual in ergo_vision/ergo_backbone.py):
    residual_stream = branch_coefficient * normed_branch + residual_coefficient * residual_stream.
  2. Signal survival vs overwrite: Because all 64 LLM layers stay frozen (branch outputs unit-scale text priors), unconstrained v1 (weight_decay=0.0, rms_reg_weight=0.0) drove output scale to proj_rms = 60.88 so residual_coefficient^L * vision remains competitive deep in the network.
  3. Unit-RMS clamping hurt (v2): Enforcing proj_rms = 1.002 (rms_reg_weight=0.25, weight_decay=0.05) allowed frozen text-layer updates to overwrite visual tokens. Fine-grained OCR/chart extraction collapsed (ChartQA -8.12, DocVQA -2.30), and AI2D regressed -5.63 pts below Blind-Ergo as multiple-choice predictions shifted heavily toward 'A' (641 Blind / 678 v1 -> 929 v2).
  4. Confounders to note: v2 also trained for fewer steps (1,300 vs 1,839), lower peak LR (3e-4 vs 5e-4), and fewer direct single-turn ChartQA/DocVQA rows (~2.8k vs 6.5k each in v1).

Transparent Image-Overlap Audit (pv_tensor_sha1)

We audited both training manifests against all 6,406 unique evaluation images (14,474 total benchmark rows) using exact pv_tensor_sha1 (SHA-1 of the preprocessed MoonViT pixel_values tensor bytes):

Run Train Rows (Unique Imgs) Overlap Images Overlap Train Rows Per-Benchmark Breakdown
v2 61,742 (58,929) 0 0 0 across all 6 benchmarks (33 held-out matches actively dropped during precompute)
v1 78,475 (39,883) 226 274 (0.35%) 0 on AI2D, MMStar, RealWorldQA; 6 on cauldron_chartqa (0.24% of ChartQA); 2 on cauldron_docvqa (0.04% of DocVQA); 266 waveui rows overlapping ScreenSpot

Audit correction note: eval/v1_eval_report.json originally reported overlap_images: 0 due to a hash-domain mismatch (comparing raw PNG SHA-1 in eval against pv_tensor_sha1 in train_manifest.jsonl). Running exact pv_tensor_sha1 intersection surfaces the waveui/ScreenSpot contamination cleanly in eval/overlap_audit.json.

Architecture, Training & SGLang Parity

  • Vision Tower: MoonViT-3d (27 layers, hidden_size=1152, patch_size=14, 2x2 spatial merge -> 4608, in_patch_limit=1296, patch_limit_on_one_side=512, max 380 merged visual tokens; weights from webbrain-one/DeepSeek-V4-Flash-Vision-BF16/vision_tower.safetensors).
  • Projector (ErgoPatchMerger): LayerNorm(1152, eps=1e-5) β†’ 2x2 concat (4608) β†’ Linear(4608, 4608) β†’ GELU β†’ Linear(4608, 8192). Exactly 58,997,504 BF16 parameters under mm_projector.* SGLang-compatible tensor keys (projector.safetensors SHA-256: 715d33d0e8d3a829...; ablation_v2/projector.safetensors SHA-256: fad2fb9f6e16731c...).
  • Custom 4Γ—B300 PP4 MXFP4 Trainer (ergo_vision/ergo_backbone.py): Exact dequantized MXFP4 MoE forward/backward across 4 pipeline-parallel GPUs (peak_vram β‰ˆ 226–230 GB/GPU, total ~888–912 GB VRAM), verified against SGLang TP4/EP4 (top1_match=True, max_top1_abs_diff=0.00113).
  • v1 Recipe: 1,839 steps (1.5 ep, BS=64), max_seq_len=1024, AdamW lr=5e-4 -> 2e-5, warmup=90, wd=0.0, rms_reg=0.0, init_val_loss=3.68052 -> best_val_loss=1.16262, 19.15s/step.
  • v2 Recipe: 1,300 steps (500 align + 800 mix, BS=64), max_seq_len=640, init_output_scale=2.5, AdamW lr=3e-4 -> 1e-5, warmup=80, wd=0.05, rms_reg=0.25 (target=1.0), init_val_loss=1.78356 -> best_val_loss=1.24239 (align=1.21204, qa=1.34269), 22.04s/step.

Quick Usage (Zero-IPC SGLang Mmap Splice)

Because upstream SGLang does not natively expose ErgoForCausalLM multimodal embedding injection, ergo_vision/sglang_vision_patch.py + ergo_vision/sitecustomize_hook/sitecustomize.py splice pre-encoded [N_vis, 8192] BF16 visual embeddings from shared copy-on-write mmap using placeholder IDs >= VIS_ROW_BASE (1_000_000):

import torch
from ergo_vision.projector import ErgoPatchMerger, load_projector
from ergo_vision.moonvit import MoonViT3dTower, preprocess_image

# 1. Load frozen MoonViT-3d tower & 59M BF16 projector
vision_tower = MoonViT3dTower.from_safetensors("vision_tower.safetensors", device="cuda")
proj = ErgoPatchMerger(dtype=torch.bfloat16).cuda().eval()
load_projector(proj, "projector.safetensors")

# 2. Extract MoonViT grouped patches `(N_merged, 4, 1152)` -> project `(N_merged, 8192)`
pv, grid_thw = preprocess_image(pil_image)
with torch.inference_mode():
    feats = vision_tower(pv.cuda().bfloat16(), grid_thw.unsqueeze(0).cuda())[0]
    vis_embeds = proj(feats)  # (N_merged, 8192) bf16

To serve with SGLang TP4/EP4, point PYTHONPATH at ergo_vision/sitecustomize_hook, set ERGO_VISION_MMAP_META to the JSON metadata written by write_vision_mmap(...), and construct token IDs with ErgoEvalPromptBuilder.build_vision_ids(...) (see ergo_vision/modal_app.py).

Honest Limitations

  • Frozen LLM ceiling: Native VLMs (e.g., DeepSeek-V4-Flash-Vision / Qwen2.5-VL) reach ~85% ChartQA and ~91% DocVQA by unfreezing LLM attention/MLP/router weights over billions of multimodal tokens. Freezing 100% of Ergo's 1.1T parameters leaves ChartQA=22.9% and DocVQA=10.9% strictly as a proof of multimodal signal transfer, not production OCR/GUI capability.
  • Resolution cap (in_patch_limit=1296): Capping merged image tokens to <=380 to fit Ergo's 512-token sliding-window attention blurs tiny UI icons (ScreenSpot=4.40%) and small dense table text.
  • Hardware requirement for retraining: Although only 59M (113 MB) weights update, exact gradient backprop across Ergo's 64 layers requires ~888 GB VRAM (4Γ—B300 or 8Γ—H200).

Files Included

β”œβ”€β”€ README.md
β”œβ”€β”€ config.json
β”œβ”€β”€ projector.safetensors                 # v1 primary projector (58,997,504 params, BF16)
β”œβ”€β”€ ablation_v2/
β”‚   └── projector.safetensors             # v2 unit-RMS negative ablation (58,997,504 params, BF16)
β”œβ”€β”€ ergo_vision/                          # Trainer, MoonViT/Ergo PP4 backbone, SGLang patch, eval harness
β”œβ”€β”€ tests/                                # 31 unit/parity tests (pytest)
└── eval/
    β”œβ”€β”€ overlap_audit.json                # Exact pv_tensor_sha1 overlap audit for v1 & v2
    β”œβ”€β”€ v1_eval_report.json / v2_eval_report.json
    β”œβ”€β”€ stage3_v1_report.json / stage3_v2_report.json
    β”œβ”€β”€ gate2_report.json
    β”œβ”€β”€ manifest_v1_stats.json / manifest_v2_stats.json
    β”œβ”€β”€ train_metrics_v1.jsonl / train_metrics_v2.jsonl
    └── predictions/{blind,v1,v2}/*.jsonl # All 43,422 raw greedy predictions across 6 benchmarks
Downloads last month
24
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for PixelML/Ergo-Vision-MoonViT-Projector

Quantized
Amazon-FMR/Ergo
Adapter
(2)
this model