open model · multimodal language

Versalit ResearcherBot-1

A language model that reads text, images and audio — with encoders, tokenizer and Mixture-of-Experts router written from scratch in pure PyTorch. Built to talk about AI research, in Brazilian Portuguese.

Apache-2.019.9M parameterstext + image + audioPT-BR
versalit-researcherbot-1 · python demo_multimodal.py
aluno: o que e mixture of experts? orientador: mixture of experts e uma arquitetura onde o modelo tem multiplos sub - redes especializadas chamadas aluno: como estruturar um paper? orientador: um paper cientifico geralmente segue a estrutura imrad : introducao , metodo , resultados e discussao aluno: o que e machine learning? orientador: federated learning e um subcampo da inteligencia artificial que permite que sistemas aprendam padroes [image: red circle] descreva a imagem: → a imagem mostra um circulo vermelho no centro . circulos sao usados em diagramas de redes neurais para representar neuronios . [audio: low tone] descreva o audio: → o audio contem um tom grave constante . tons graves aparecem em sinais de alerta de sistemas de monitoramento .
Real output of python demo_multimodal.py (the model speaks Portuguese), cut at the demo's token limit; sampling is random, so every run differs. "aluno" is the student, "orientador" the advisor. Translation: what is mixture of experts? — "an architecture where the model has multiple specialized sub-networks called…"; how to structure a paper? — "IMRaD: introduction, method, results and discussion"; what is machine learning? — it answers about federated learning instead, the model's limit showing. In the same run, the question about adversarial attacks also went off-topic. The image and audio answers describe a red circle and a constant low tone, correctly.

What it is

A multimodal language model with Mixture-of-Experts: it takes a text question — alone or together with an image or an audio clip — and answers in text. It has 19.9 million parameters, of which about 10 million work on each token. It is the multimodal sibling of SAC-1: the same MoE transformer base, plus two encoders.

No CLIP, no pre-trained ViT, no Whisper or wav2vec: the vision encoder, the audio encoder, the BPE tokenizer and the decoder were written by hand in pure PyTorch. The only dependency is torch.

How text, images and audio come together

The image (64×64) is cut into 64 patches of 8×8 pixels; the audio becomes a mel spectrogram cut into 16-frame patches. Each encoder turns its patches into vectors the same size as text tokens, and a modality embedding marks where each vector came from. From there on, the decoder treats everything as a single sequence.

image 64×64 → 64 patches 8×8 + CLS → self-attention → projection ─┐
audio (mel, 64 bands) → 16-frame patches + CLS → projection ──────┤
text → BPE tokens (1,024) + modality embedding ───────────────────┤
                                                                  ↓
  6 transformer blocks: RoPE, RMSNorm, SwiGLU
    blocks 0, 2, 4: MoE, 8 experts, top-2   # the router picks 2 per token
  → LM head → text answer

Benchmark — 811 tests

ModalityTestsCorrect
Text (questions and answers)40187.5%
Image (shape and colour)25076.8%
Audio (type of sound)16087.5%
Composite score81184.8%

How to read it: the criterion is lenient — a text answer counts as correct if it contains at least one expected keyword, even when it talks about the wrong topic. The model memorizes: it gets 100% of the questions seen in training and 70.3% of the same questions rephrased. And the domain is synthetic: geometric shapes and code-generated sounds, not real photos or audio.

Training

ParameterValue
GPUNVIDIA RTX 3060 (12 GB)
OptimizerAdamW (β 0.9 / 0.95)
Learning rate3e-4, 500 warmup steps + cosine
Batch32
Precisionmixed (FP16)
Data3,672 synthetic examples: 2,700 text, 540 image, 432 audio
Steps2,000 (~45 min)
Published checkpointstep 500 — lowest validation loss (1.34)

Why step 500: after it, training loss fell to 0.05 while validation loss rose to 1.87 — the model started memorizing the training set. The published checkpoint is the one with the best validation loss.

How to run it

git clone https://huggingface.co/delvek/versalit-researcherbot-1
cd versalit-researcherbot-1
pip install torch
python demo_multimodal.py   # text, image and audio
python generate.py          # interactive chat
python benchmark_1k.py      # the 811 tests (~1h45 on an RTX 3060)

Honest limitations

  • Small synthetic data: simple geometric shapes and code-generated sounds.
  • 1,024-token vocabulary: out-of-domain words become <unk> and the output has no accents.
  • 256-token context and 64×64 images — far too small for real photos; the audio side does not handle speech.
  • Brazilian Portuguese only. It is a demonstration of the multimodal MoE architecture, not a production assistant.