- Ergo-Vision: MoonViT-3d Projector for Frozen Amazon Ergo (Research PoC)
- Held-Out Multimodal Benchmarks (14,474 Items, Greedy SGLang TP4/EP4)
- Key Empirical Finding: Frozen Hyperspherical Residual Highway (
v1vsv2) - Transparent Image-Overlap Audit (
pv_tensor_sha1) - Architecture, Training & SGLang Parity
- Quick Usage (Zero-IPC SGLang Mmap Splice)
- Honest Limitations
- Files Included
- Held-Out Multimodal Benchmarks (14,474 Items, Greedy SGLang TP4/EP4)
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% frozenAmazon-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?
- Hyperspherical residual dynamics in Ergo:
Amazon-FMR/Ergonormalizesinput_embeds(tok_embeddings_rms = 1.0) at Layer 0 (attention_norm), then updates across 64 layers using variance-preserving gated residuals (ErgoResidualinergo_vision/ergo_backbone.py):residual_stream = branch_coefficient * normed_branch + residual_coefficient * residual_stream. - Signal survival vs overwrite: Because all 64 LLM layers stay frozen (
branchoutputs unit-scale text priors), unconstrainedv1(weight_decay=0.0,rms_reg_weight=0.0) drove output scale toproj_rms = 60.88soresidual_coefficient^L * visionremains competitive deep in the network. - Unit-RMS clamping hurt (
v2): Enforcingproj_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), andAI2Dregressed-5.63pts below Blind-Ergo as multiple-choice predictions shifted heavily toward'A'(641Blind /678v1->929v2). - Confounders to note:
v2also trained for fewer steps (1,300vs1,839), lower peak LR (3e-4vs5e-4), and fewer direct single-turn ChartQA/DocVQA rows (~2.8kvs6.5keach inv1).
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.jsonoriginally reportedoverlap_images: 0due to a hash-domain mismatch (comparing raw PNG SHA-1 in eval againstpv_tensor_sha1intrain_manifest.jsonl). Running exactpv_tensor_sha1intersection surfaces thewaveui/ScreenSpotcontamination cleanly ineval/overlap_audit.json.
Architecture, Training & SGLang Parity
- Vision Tower:
MoonViT-3d(27layers,hidden_size=1152,patch_size=14,2x2spatial merge ->4608,in_patch_limit=1296,patch_limit_on_one_side=512, max380merged visual tokens; weights fromwebbrain-one/DeepSeek-V4-Flash-Vision-BF16/vision_tower.safetensors). - Projector (
ErgoPatchMerger):LayerNorm(1152, eps=1e-5)β2x2concat (4608) βLinear(4608, 4608)βGELUβLinear(4608, 8192). Exactly58,997,504BF16 parameters undermm_projector.*SGLang-compatible tensor keys (projector.safetensorsSHA-256:715d33d0e8d3a829...;ablation_v2/projector.safetensorsSHA-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 GBVRAM), verified against SGLang TP4/EP4 (top1_match=True,max_top1_abs_diff=0.00113). v1Recipe:1,839steps (1.5ep,BS=64),max_seq_len=1024, AdamWlr=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.v2Recipe:1,300steps (500align +800mix,BS=64),max_seq_len=640,init_output_scale=2.5, AdamWlr=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's1.1Tparameters leavesChartQA=22.9%andDocVQA=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<=380to 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 GBVRAM (4ΓB300or8Γ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