Spiking Multimodal Large Language Model (SpikeMLLM) via Modality-Adaptive Transformer. Bridges gap between SNN and continuous neural networks for efficient multimodal AI. 10x energy reduction, 5x speedup on neuromorphic hardware. Applications: edge AI, neuromorphic vision-language, low-power multimodal systems.
Scanned 9/11/2026
Install to Claude Code
npx -y skills add hiyenwong/ai_collection --skill spiking-mllm-multimodal-neuromorphic --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Spiking Mllm Multimodal Neuromorphic?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/hiyenwong-spiking-mllm-multimodal-neuromorphic-ai-collection)More formats (shields.io, HTML) on the badges page.
---
name: spiking-mllm-multimodal-neuromorphic
description: "Spiking Multimodal Large Language Model (SpikeMLLM) via Modality-Adaptive Transformer. Bridges gap between SNN and continuous neural networks for efficient multimodal AI. 10x energy reduction, 5x speedup on neuromorphic hardware. Applications: edge AI, neuromorphic vision-language, low-power multimodal systems."
category: ai_collection
tags: [spiking-neural-network, multimodal-llm, modality-adaptive, neuromorphic-computing, edge-ai, vision-language, energy-efficient-ai]
paper:
arxiv_id: "2604.18610"
title: "SpikeMLLM: Spike-based Multimodal Large Language Models via Modality-Adaptive Transformer"
authors: ["Yang Liu", "Zhenyu Wang", "Yonghao Xu", "Jianqiao Liu", "Shuai Liu", "Hao Chen", "Zhe Wang", "Yixuan Yuan"]
date: "2026-04-13"
category: "cs.CV"
---
# SpikeMLLM: Spike-based Multimodal Large Language Models via Modality-Adaptive Transformer
## Overview
**SpikeMLLM** is the first spike-based multimodal large language model that bridges the modality gap between Spiking Neural Networks (SNN) and continuous neural networks through a **Modality-Adaptive Transformer (MA-Transformer)**.
**Key Achievement:**
- **10x lower energy** vs continuous ANN
- **5x faster inference** on neuromorphic hardware
- **<10% neuron activation** (sparse computation)
- Maintains competitive accuracy on VQA, captioning, retrieval tasks
## Core Innovation: Modality-Adaptive Transformer
### Problem
Traditional SNNs struggle with multimodal tasks because:
1. Visual features (continuous) and text features (discrete) have different characteristics
2. Direct spike encoding loses fine-grained information
3. Fixed encoding strategies don't adapt to input modality
### Solution: MA-Transformer
```
┌─────────────────────────────────────────────────────────────┐
│ Modality-Adaptive Transformer │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────────┐ ┌──────────────────┐ │
│ │ Visual Input │ │ Text Input │ │
│ │ (Continuous) │ │ (Discrete) │ │
│ └────────┬─────────┘ └────────┬─────────┘ │
│ ↓ ↓ │
│ ┌──────────────────┐ ┌──────────────────┐ │
│ │ Spike Encoder │ │ Spike Encoder │ │
│ │ - Rate coding │ │ - Temporal │ │
│ │ - Dynamic │ │ coding │ │
│ │ threshold │ │ - Adaptive │ │
│ │ - Modality │ │ window │ │
│ │ detection │ │ │ │
│ └────────┬─────────┘ └────────┬─────────┘ │
│ │ │ │
│ └────────────┬───────────────┘ │
│ ↓ │
│ ┌──────────────────────┐ │
│ │ Modality-Aware │ │
│ │ Attention (MA-Attn)│ │
│ │ │ │
│ │ - Modality gate │ │
│ │ - Dynamic fusion │ │
│ │ - Cross-modal │ │
│ │ alignment │ │
│ └──────────┬───────────┘ │
│ ↓ │
│ ┌──────────────────────┐ │
│ │ Spike MLP │ │
│ └──────────┬───────────┘ │
│ ↓ │
│ ┌──────────────────────┐ │
│ │ Output (Spike/ │ │
│ │ Continuous) │ │
│ └──────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
```
## Architecture Components
### 1. Spike Tokenizer
```python
class SpikeTokenizer(nn.Module):
"""Convert continuous features to spike trains."""
def __init__(self, input_dim, spike_dim, time_steps=4, coding='adaptive'):
super().__init__()
self.time_steps = time_steps
self.coding = coding # 'rate', 'temporal', or 'adaptive'
self.proj = nn.Linear(input_dim, spike_dim)
self.lif = neuron.LIFNode(tau=2.0) # Leaky Integrate-and-Fire
# Modality-aware parameters
self.modality_detector = nn.Sequential(
nn.Linear(input_dim, input_dim // 4),
nn.ReLU(),
nn.Linear(input_dim // 4, 2), # binary: visual/text
nn.Softmax(dim=-1)
)
def forward(self, x):
# Detect modality
modality = self.modality_detector(x.mean(dim=1)) # [B, 2]
# Modality-adaptive encoding
if self.coding == 'adaptive':
# Visual: rate coding
# Text: temporal coding
visual_weight = modality[:, 0]
text_weight = modality[:, 1]
v_spikes = self.rate_coding(x) * visual_weight.view(-1, 1, 1)
t_spikes = self.temporal_coding(x) * text_weight.view(-1, 1, 1)
return v_spikes + t_spikes
elif self.coding == 'rate':
return self.rate_coding(x)
else:
return self.temporal_coding(x)
def rate_coding(self, x):
"""Rate coding for visual features."""
x = self.proj(x) # [B, spike_dim]
spikes = []
for t in range(self.time_steps):
spike = self.lif(x) # Generate spike
spikes.append(spike)
return torch.stack(spikes, dim=1) # [B, T, D]
def temporal_coding(self, x):
"""First-spike-time coding for text features."""
x = self.proj(x)
# Encode magnitude as spike time (earlier = larger)
thresholds = torch.linspace(1.0, 0.0, self.time_steps, device=x.device)
# Spike occurs when accumulated signal crosses threshold
x_norm = torch.sigmoid(x) # Normalize to [0, 1]
spikes = []
for t, th in enumerate(thresholds):
spike = (x_norm > th).float()
spikes.append(spike)
return torch.stack(spikes, dim=1) # [B, T, D]
```
### 2. Modality-Adaptive Attention
```python
class ModalityAdaptiveAttention(nn.Module):
"""Cross-modal attention with modality-aware gating."""
def __init__(self, dim, num_heads=8, time_steps=4):
super().__init__()
self.num_heads = num_heads
self.time_steps = time_steps
self.scale = (dim // num_heads) ** -0.5
self.qkv = nn.Linear(dim, dim * 3)
self.proj = nn.Linear(dim, dim)
# Modality fusion gate
self.modality_gate = nn.Sequential(
nn.Linear(dim, dim // 4),
nn.ReLU(),
nn.Linear(dim // 4, 3), # visual, text, multimodal
nn.Softmax(dim=-1)
)
# Spike-compatible attention
self.spike_attention = SpikeSelfAttention(dim, num_heads)
def forward(self, x, modality_type='multimodal'):
B, T, D = x.shape
# Compute modality weights
if modality_type == 'multimodal':
gate = self.modality_gate(x.mean(dim=1)) # [B, 3]
else:
# Fixed modality
gate = torch.zeros(B, 3, device=x.device)
if modality_type == 'image':
gate[:, 0] = 1.0
elif modality_type == 'text':
gate[:, 1] = 1.0
else:
gate[:, 2] = 1.0
# QKV projection
qkv = self.qkv(x).reshape(B, T, 3, self.num_heads, D // self.num_heads)
qkv = qkv.permute(2, 0, 3, 1, 4) # [3, B, H, T, D/H]
q, k, v = qkv[0], qkv[1], qkv[2]
# Spike-compatible attention (time-averaged over spike dimension)
attn = self.spike_compatible_attention(q, k, v, gate)
# Output projection
x = attn.transpose(1, 2).reshape(B, T, D)
return self.proj(x)
def spike_compatible_attention(self, q, k, v, gate):
"""Attention computation compatible with spike trains."""
# Time-average over spike dimension
q_avg = q.mean(dim=-1) # Average over spike time
k_avg = k.mean(dim=-1)
v_avg = v.mean(dim=-1)
# Standard attention on averaged representations
attn = (q_avg @ k_avg.transpose(-2, -1)) * self.scale
attn = attn.softmax(dim=-1)
# Apply modality-specific scaling
if gate.shape[1] == 3:
# Multimodal: blend attention patterns
attn_v = attn * gate[:, 0].view(-1, 1, 1, 1)
attn_t = attn * gate[:, 1].view(-1, 1, 1, 1)
attn_m = attn * gate[:, 2].view(-1, 1, 1, 1)
attn = attn_v + attn_t + attn_m
return attn @ v_avg
```
### 3. Spike MLP
```python
class SpikeMLP(nn.Module):
"""MLP designed for spike train processing."""
def __init__(self, dim, mlp_ratio=4.0, time_steps=4):
super().__init__()
hidden_dim = int(dim * mlp_ratio)
self.fc1 = nn.Linear(dim, hidden_dim)
self.fc2 = nn.Linear(hidden_dim, dim)
# SNN activation (LIF neuron)
self.lif1 = neuron.LIFNode(tau=2.0)
self.lif2 = neuron.LIFNode(tau=2.0)
self.time_steps = time_steps
def forward(self, x):
"""
x: [B, T, D] - spike train
"""
# Temporal aggregation for MLP
x = x.mean(dim=1) # [B, D] - average over time
# MLP forward
x = self.fc1(x)
x = self.lif1(x) # Spike activation
x = self.fc2(x)
x = self.lif2(x)
# Expand back to temporal dimension
x = x.unsqueeze(1).repeat(1, self.time_steps, 1) # [B, T, D]
return x
```
## Complete Model Architecture
```python
class SpikeMLLM(nn.Module):
"""Complete SpikeMLLM model."""
def __init__(self,
vision_encoder='clip-vit-base',
text_encoder='gpt2',
spike_dim=512,
num_layers=12,
time_steps=4):
super().__init__()
# Pretrained continuous encoders (frozen)
self.vision_backbone = CLIPVisionModel.from_pretrained(vision_encoder)
self.text_backbone = GPT2Model.from_pretrained(text_encoder)
# Spike tokenizers
self.vision_spike = SpikeTokenizer(512, spike_dim, time_steps)
self.text_spike = SpikeTokenizer(768, spike_dim, time_steps)
# MA-Transformer layers
self.layers = nn.ModuleList([
nn.ModuleDict({
'attn': ModalityAdaptiveAttention(spike_dim, time_steps=time_steps),
'mlp': SpikeMLP(spike_dim, time_steps=time_steps),
'norm1': nn.LayerNorm(spike_dim),
'norm2': nn.LayerNorm(spike_dim)
})
for _ in range(num_layers)
])
# Task heads
self.vqa_head = nn.Linear(spike_dim, 3129) # VQA answer vocab
self.caption_head = nn.Linear(spike_dim, 50257) # GPT-2 vocab
self.retrieval_head = nn.Linear(spike_dim, 256) # Embedding for retrieval
def forward(self, images, text, task='vqa'):
"""
images: [B, 3, 224, 224]
text: [B, L] token ids
task: 'vqa', 'caption', 'retrieval'
"""
# Extract continuous features
with torch.no_grad():
vision_features = self.vision_backbone(images).last_hidden_state # [B, N, 512]
text_features = self.text_backbone(text).last_hidden_state # [B, L, 768]
# Convert to spikes
v_spikes = self.vision_spike(vision_features) # [B, T, D]
t_spikes = self.text_spike(text_features) # [B, T, D]
# Modality fusion
x = torch.cat([v_spikes, t_spikes], dim=1) # [B, 2T, D]
# MA-Transformer processing
for layer in self.layers:
# Attention with residual
attn_out = layer['attn'](layer['norm1'](x), modality_type='multimodal')
x = x + attn_out
# MLP with residual
mlp_out = layer['mlp'](layer['norm2'](x))
x = x + mlp_out
# Task-specific output
if task == 'vqa':
# Pool and predict
pooled = x.mean(dim=1) # [B, D]
return self.vqa_head(pooled)
elif task == 'caption':
# Autoregressive generation
return self.caption_head(x)
else: # retrieval
pooled = x.mean(dim=1)
return self.retrieval_head(pooled)
```
## Training Strategy
### Three-Stage Training
```python
def train_spikemllm():
"""Three-stage training pipeline."""
model = SpikeMLLM()
# Stage 1: Single-Modal Pretraining
print("Stage 1: Single-Modal Pretraining")
for epoch in range(10):
# Vision-only SNN pretraining
for images in vision_loader:
spikes = model.vision_spike(images)
loss = reconstruction_loss(spikes, images)
loss.backward()
optimizer.step()
# Text-only SNN pretraining
for text in text_loader:
spikes = model.text_spike(text)
loss = language_modeling_loss(spikes, text)
loss.backward()
optimizer.step()
# Stage 2: Modality Alignment
print("Stage 2: Modality Alignment")
for epoch in range(5):
for images, text in paired_loader:
v_spikes = model.vision_spike(images)
t_spikes = model.text_spike(text)
# Cross-modal contrastive learning
v_emb = v_spikes.mean(dim=1)
t_emb = t_spikes.mean(dim=1)
loss = contrastive_loss(v_emb, t_emb)
loss.backward()
optimizer.step()
# Stage 3: Multi-Modal Fine-tuning
print("Stage 3: Multi-Modal Fine-tuning")
for epoch in range(20):
for images, text, answers in vqa_loader:
# Forward pass
logits = model(images, text, task='vqa')
# Task loss
loss = F.cross_entropy(logits, answers)
# Multi-modal disentanglement loss
disentangle_loss = compute_disentanglement_loss(model)
total_loss = loss + 0.1 * disentangle_loss
total_loss.backward()
optimizer.step()
```
## Performance
### Benchmark Results
| Task | Dataset | Accuracy | Energy (mJ) |
|------|---------|----------|-------------|
| VQA | VQAv2 | 68.5% | 2.3 |
| Captioning | COCO | BLEU-4: 35.2 | 1.8 |
| Retrieval | Flickr30k | R@1: 58.3% | 1.5 |
### Efficiency Gains
- **Energy**: 10x reduction vs ANN
- **Speed**: 5x faster on neuromorphic hardware
- **Sparsity**: <10% neuron activation
- **Scalability**: Linear complexity with sequence length
## Deployment
### Neuromorphic Hardware
```python
class LoihiDeployment:
"""Deploy SpikeMLLM on Intel Loihi."""
def __init__(self, model, chip_id=0):
self.model = model
self.chip = LoihiChip(chip_id)
def compile(self):
"""Compile model to Loihi-compatible network."""
from lava.lib.dl import slayer
# Convert PyTorch SNN to Lava
self.loihi_net = slayer.block.cuba.Block(
self.model.layers,
synapse=slayer.synapse.Delta(),
neuron=slayer.neuron.Cuba()
)
# Map to hardware
self.loihi_net.compile(self.chip)
def inference(self, images, text):
"""Run inference on Loihi."""
# Encode inputs
v_spikes = encode_vision_loihi(images)
t_spikes = encode_text_loihi(text)
# Run on chip
output = self.loihi_net.run(
input_spikes=torch.cat([v_spikes, t_spikes], dim=0),
time_steps=4
)
return decode_output(output)
```
## Applications
1. **Edge AI Devices**
- Smart glasses with visual QA
- Mobile multimodal assistants
- IoT sensors with language understanding
2. **Autonomous Systems**
- Real-time perception-decision
- Low-latency sensor fusion
- Energy-efficient robotics
3. **Wearable Computing**
- Continuous health monitoring
- Context-aware assistance
- Extended reality interfaces
## Challenges & Solutions
| Challenge | Solution |
|-----------|----------|
| Dead neurons | Adaptive threshold adjustment |
| Gradient vanishing | SpikingJelly surrogate gradients |
| Modality imbalance | Cross-modal contrastive learning |
| Hardware limits | Hybrid GPU/neuromorphic deployment |
## Related Skills
- `adaptive-spiking-neuron-multimodal` - Adaptive neuron mechanisms
- `spiking-transformer-effective-dimension` - SNN transformer theory
- `event2vec-neuromorphic-representation` - Event-based vision
## Citation
```bibtex
@article{liu2026spikemllm,
title={SpikeMLLM: Spike-based Multimodal Large Language Models via Modality-Adaptive Transformer},
author={Liu, Yang and Wang, Zhenyu and Xu, Yonghao and Liu, Jianqiao and Liu, Shuai and Chen, Hao and Wang, Zhe and Yuan, Yixuan},
journal={arXiv preprint arXiv:2604.18610},
year={2026}
}
```
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!