# Chameleon: Early-fusion token modeling for images and text

> Chameleon trains one Transformer from scratch over discrete image and text tokens. Its 7B and 34B models handle interleaved multimodal input and output instead of attaching vision to a frozen LLM.

- URL: https://dmxsf.com/en/blog/chameleon-mixed-modal-early-fusion-foundation-models/
- [DMXSF](https://dmxsf.com/en/about/)
- Published: 2024-05-26
- Updated: 2026-11-13
- Paper notes
- Paper: [Chameleon: Mixed-Modal Early-Fusion Foundation Models](https://arxiv.org/abs/2405.09818) ( Chameleon Team · arXiv, 2024)

Meta’s Chameleon tokenizes images and places them in the same sequence as text, learning a joint mixed-modal distribution with one Transformer.

## How it works

An image tokenizer, mixed-modal RoPE and unified cross-entropy support early fusion. Joint optimization becomes unstable at scale, addressed with QK-Norm and z-loss, followed by mixed-modal instruction tuning.

## What the evidence shows

The report evaluates captioning, VQA, text tasks and mixed-modal generation. Image tokenizer codebooks and resolution limit visual detail, and a unified model need not dominate specialized systems everywhere.

## A reproducible check

This snippet checks a public formula or configuration; it does not reproduce full training.

```python
vocab_text, vocab_image = 65536, 8192
sequence = ["text"]*200 + ["image"]*256 + ["text"]*50
print("combined token vocabulary =", vocab_text+vocab_image)
print("mixed sequence length =", len(sequence))
```

```text
combined token vocabulary = 73728
mixed sequence length = 506
```

The arithmetic is reproducible, but model quality still depends on the full experiments in the paper.

## Limitations and common misreadings

Discrete image tokens lose information and image quality depends on the decoder. Capabilities depend on data mixture and safety filtering, so architectural elegance is not universal superiority.

## The key takeaway

Chameleon establishes all-modalities-as-tokens as a viable foundation-model route while exposing optimization and representation bottlenecks.

## Further reading

- [Chameleon: Mixed-Modal Early-Fusion Foundation Models](https://arxiv.org/abs/2405.09818)
- [ViT](https://dmxsf.com/en/blog/vit-an-image-is-worth-16x16-words/)
- [CLIP](https://dmxsf.com/en/blog/clip-learning-transferable-visual-models/)

## FAQ

### How is early fusion different from LLaVA?

Chameleon trains one model over image and text tokens from scratch rather than attaching vision to an existing LLM.

### How do images enter the model?

An image tokenizer converts them into discrete tokens mixed with text.

### What makes training difficult?

Modalities interact through losses and gradients; QK-Norm and z-loss help stabilize optimization.
