This repository provides a multimodal Vision-Language Model (VLM) derived from llava-hf/llava-interleave-qwen-0.5b-hf (SigLIP vision encoder + MLP projector + 24-layer Qwen2 decoder, D=1024, H=16) where 18 / 24 decoder attention blocks (hybrid_3_1) have been replaced with adasplash_attention (AdaSplashAttention) and distilled on image-bearing questions from derek-thomas/ScienceQA.
AdaSplashAttention: AdaSplash Attention Layer with α-Entmax and Local Splash Radius.
| Property | Specification |
|---|---|
Registry Key (ATTENTION_REGISTRY) |
adasplash_attention |
| NeuralOps Class & Family | AdaSplashAttention (fast_kernels) |
| Source Implementation | neuralops/layers/fast_kernels/adasplash_attention.py |
| Vision Tower (Frozen) | SigLIP Vision Encoder + 2-layer Multimodal MLP Projector |
| Language Decoder Geometry | 24 layers, D=1024, H=16, d_h=64 (exact power-of-2 widths) |
In LlavaForConditionalGeneration, visual patch tokens extracted by the frozen SigLIP vision tower are interleaved with text tokens inside language_model.model.layers. Keeping vision_tower and multi_modal_projector completely frozen isolates how well subquadratic mechanism adasplash_attention handles dense visual-to-text cross-modal routing under hybrid_3_1 surgery (18 transplanted layers + 6 quadratic anchor layers [3, 7, 11, 15, 19, 23]).
derek-thomas/ScienceQA)| Metric | Teacher Baseline (llava-interleave-qwen-0.5b) |
Pre-KD Zero-Shot (adasplash_attention) |
Post-KD Distilled (adasplash_attention) |
Delta ($\Delta$) |
|---|---|---|---|---|
| ScienceQA Visual Accuracy (%) | 63.75% |
35.62% |
53.12% |
+17.50% |
| Image-Conditioned Answer PPL | 2.45 |
3.87 |
2.62 |
-1.26 |
190 (Stage 1: 69 | Stage 2: 121)120.7s | 20180 MB on NVIDIA RTX 3090 24GB2026-11-11T04:51:10.773312Zattention_weights.safetensors (682.17 MB): Transplanted decoder attention & layernorm parameters (FP16; loads directly onto frozen base llava-hf/llava-interleave-qwen-0.5b-hf)processor & tokenizer configs + training_metrics.jsonimport torch
from huggingface_hub import hf_hub_download
from safetensors.torch import load_file
from transformers import AutoProcessor, LlavaForConditionalGeneration
from scripts.benchmarks.qwen_zoo_train_mix import apply_qwen_attention_surgery
repo_id = "tahamajs/llava-qwen-0.5b-adasplash-attention-scienceqa"
processor = AutoProcessor.from_pretrained(repo_id)
model = LlavaForConditionalGeneration.from_pretrained("llava-hf/llava-interleave-qwen-0.5b-hf", torch_dtype=torch.float16)
model.language_model = apply_qwen_attention_surgery(model.language_model, attn_key="adasplash_attention", pattern="hybrid_3_1")
ckpt_path = hf_hub_download(repo_id=repo_id, filename="attention_weights.safetensors")
model.load_state_dict(load_file(ckpt_path), strict=False)
model.eval()
import torch
from neuralops.hub import load_surgeried_model
# Load model and tokenizer/processor in one line directly from Hugging Face Hub
model, tokenizer = load_surgeried_model("tahamajs/llava-qwen-0.5b-adasplash-attention-scienceqa")
model.eval()
print(f"Successfully loaded tahamajs/llava-qwen-0.5b-adasplash-attention-scienceqa with NeuralOps modular surgical weights!")
@software{neuralops2026vlmzoo,
title = {NeuralOps: Multimodal Vision-Language Subquadratic Attention Surgery Zoo (LLaVA-ScienceQA)},
author = {Majlesi, Taha},
year = {2026},
url = {https://github.com/tahamajs/NeuralOps},
note = {Hub Repository: tahamajs/llava-qwen-0.5b-adasplash-attention-scienceqa}
}