Chameleon: Mixed-Modal Early-Fusion Foundation Models

Chameleon Team

2024 · arXiv

Chameleon: Mixed-Modal Early-Fusion Foundation Models

Problem

Framing

Late-fusion multimodal models still split text and images across separate encoders or decoders, which weakens arbitrary interleaved generation and cross-modal reasoning. Chameleon closes this by tokenizing images into the same autoregressive stream as text and training one transformer end-to-end on mixed-modal data.

Currently Used Methods

Foundational

Proposed Method

Architecture

Chameleon maps text and images into one discrete token stream, then runs a LLaMA-2-style autoregressive transformer over the joint sequence. Images are quantized into codebook tokens; the tokenizer uses a 65,536-word BPE vocabulary that includes 8,192 image tokens. Stability comes from QK-normalization and reordered residual norms.

Verified architecture diagram: mixed-modal pre-training and generation with one autoregressive transformer over text tokens in green and image tokens in blue.

Loss / Objective

Pre-training uses standard autoregressive next-token prediction over mixed text-image sequences.

LAR=t=1Tlogpθ(xtx<t)\mathcal{L}_{\mathrm{AR}} = - \sum_{t=1}^{T} \log p_{\theta}(x_t \mid x_{<t})

SFT masks prompt tokens and optimizes only answer tokens.

Algorithm

The main architectural update reorders normalization around the residual branches:

h=x+attention_norm(attention(x)),y=h+ffn_norm(feed_forward(h))\mathbf{h} = \mathbf{x} + \operatorname{attention\_norm}(\operatorname{attention}(\mathbf{x})), \qquad \mathbf{y} = \mathbf{h} + \operatorname{ffn\_norm}(\operatorname{feed\_forward}(\mathbf{h}))

Training Procedure

Evaluation

Datasets

Metrics

Headline results

Ablations

Results figure

Table 4: Training-loss ablation for norm reordering.

SettingOutcome
w/o norm reorderingLoss becomes unstable with sharp spikes and divergence.
w/ norm reorderingLoss decays smoothly and remains stable.

Method Strengths and Weaknesses

Strengths

Weaknesses

Suggestions from the authors

Links

Prior Papers

Further Papers