A 24.7M-parameter vision encoder trained from scratch — no pretrained backbone, no CLIP weights. Structured tokens that plug into any LLM.
MKD
Status
Params
From scratch
Dim
ATB
PyTorch
Hardware
Where the Keural encoder sits in the VLM pipeline
The encoder (CNN Stem → ATB → Spatial Transformer) feeds the LevelAware Projector → Mistral-7B in the full Keural VLM.
✨ Key Innovations
🎯 Adaptive Token Budget (ATB) Tokenization — token count is a runtime parameter. Tokens are allocated to information-dense regions: a blank wall gets fewer, a dense document gets more.
🪜 Hierarchical Concept Tokenization (HCT) — every token carries a semantic level tag: global (whole-image), region (object-scale), or detail (fine-grained).
python
1out = encoder(image)2print(out.level_ids)# tensor of {0=global, 1=region, 2=detail}
The ATB tokenizer concentrates tokens on salient regions. Left → right: original · saliency heatmap · token placement (global / region / detail).
Saliency and token placement
🧪 Training
Phase 1 — Vision Encoder Pretraining ✅ COMPLETE. Trained from scratch for
~75,000 steps on CC3M + CC12M (~6.9M image–text pairs), SigLIP-style contrastive
objective, 1× RTX 5090. The frozen encoder is then integrated into the full VLM via
LevelAwareProjector (384 → 2048 → 4096) → Mistral-7B-Instruct-v0.3 (4-bit NF4
QLoRA), fine-tuned with SFT (LLaVA-Instruct-150K, 30K steps).
Training loss curves
📊 Benchmark Results — SFT-30K
Downstream VLM benchmarks using this encoder (frozen) + projector + Mistral-7B at the
SFT-30K checkpoint (supervised fine-tuning, 30,000 steps; before DPO).
Evaluated on 1,000 samples each where applicable. The Keural encoder is 12.4×
smaller than LLaVA's CLIP encoder (307M).
Benchmark
Keural SFT-30K
LLaVA 1.5 (307M enc)
LLaVA 1.6 (307M enc)
VQAv2 Accuracy
12.9%
78.5%
81.8%
POPE F1
66.9%
85.9%
86.5%
MME Total Score
704.3
1510.7
1519.3
TextVQA Accuracy
0.8%
58.2%
64.9%
ScienceQA Accuracy (img)
39.7%
66.8%
70.6%
These are the SFT-30K numbers (measured from outputs/eval/sft_30k/). Applying
DPO alignment (RLHF-V, 3K steps) improves every metric — e.g. VQAv2 → 43.6%,
ScienceQA → 53.7%, MME → 838.8. Full SFT+DPO results, the comparison chart, and
the complete VLM live on mkd-hika/keural-vlm-poc.
⚡ Adaptive Token Budget — latency vs budget
Encode latency vs token budget — trade visual detail for speed at runtime, no retraining.
The mid-level model will use knowledge distillation from SigLIP-400M (natural images) and InternViT-300M (documents/OCR). Teachers are discarded after training — not part of the final model.
📝 Citation
bibtex
1@misc{keural_vision_encoder_2026,
2 title = {Keural Vision Encoder: Content-Adaptive Vision Encoding via Saliency-Guided Token Budgets},
3 author = {Barki, Hika and MKD Co., Ltd.},
4 year = {2026},
5 note = {V0.1 — Phase 1 complete},
6}
📄 License
Code: MIT. Model weights trained on CC3M + CC12M — data licenses apply.