Native Multimodality: How MeeDoo-OnE Sees, Hears, and Speaks

A technical deep dive into MeeDoo-OnE native multimodal capabilities: SigLIP vision encoder, Whisper audio encoder, EnCodec-based speech generation, and unified token-level integration.

Abstract

MeeDoo-OnE is not a text-only language model with multimodal adapters bolted on. It is a natively multimodal model that processes text, images, and audio as first-class input modalities and generates speech as a first-class output modality. The vision encoder (SigLIP ViT-L/14), audio encoder (Whisper-style), and speech decoder (EnCodec + transformer) are integrated at the token level, sharing the same embedding space and transformer backbone as text. This article provides a complete technical description of each modality pipeline, the special tokens that govern multimodal processing, and the training strategy that produces a truly unified model.

Vision: SigLIP ViT-L/14

The vision encoder is a SigLIP (Sigmoid Loss for Language Image Pre-training) ViT-L/14 model. SigLIP differs from CLIP in using a sigmoid loss instead of a contrastive softmax, which scales better to large batch sizes and produces stronger image-text representations. The architectural details are:

Specification Value
Image resolution224 x 224 pixels
Patch size14 x 14 pixels
Patches per image16 x 16 = 256 patch tokens
Transformer layers24
Attention heads16
Hidden dimension1024

Key architectural choices in the SigLIP vision encoder:

  • Fused QKV projection: the query, key, and value projections are fused into a single linear layer, reducing kernel launch overhead and improving throughput.
  • SDPA (Scaled Dot Product Attention): uses PyTorch native SDPA, which dispatches to Flash Attention or memory-efficient attention as appropriate.
  • No CLS token: following SigLIP design, there is no classification token. All 256 patch embeddings are output directly. This is important because in a multimodal LLM, every patch contributes semantic information, and a CLS token would be redundant with the LLM own aggregation.
  • Pure patch embeddings: the input image is divided into 14x14 patches, each flattened and projected to the hidden dimension (1024) via a linear layer, then processed through 24 transformer layers.

The vision pipeline is:

# Vision pipeline
image = load_image(path)           # [3, 224, 224]
patches = patch_embed(image)       # [256, 1024] (no CLS token)
features = vit_encoder(patches)    # [256, 1024] after 24 layers
projected = mlp_projector(features) # [256, 7168] (1024 -> 7168 -> 7168, GELU)
# Insert into LLM token sequence at <image> placeholder positions

The MLP projector is a two-layer feed-forward network with GELU activation that maps the 1024-dimensional SigLIP features to the 7168-dimensional LLM embedding space:

class MLPProjector(nn.Module):
    def __init__(self, in_dim=1024, out_dim=7168):
        super().__init__()
        self.fc1 = nn.Linear(in_dim, out_dim)
        self.act = nn.GELU()
        self.fc2 = nn.Linear(out_dim, out_dim)

    def forward(self, x):
        return self.fc2(self.act(self.fc1(x)))

Using an MLP projector rather than a single linear layer (as in the original LLaVA) provides more capacity for aligning the vision and language spaces. The intermediate GELU activation allows the projector to learn non-linear transformations, which is important because the vision and language manifolds have different geometric structures.

Audio: Whisper-Style Encoder

The audio encoder follows the Whisper architecture, processing log-mel spectrograms through a 2-layer convolutional downsampler followed by 24 transformer blocks.

Specification Value
Mel bins128
Sample rate16 kHz
Max audio length30 seconds
Conv layers2 (downsample 2x each = 4x total)
Transformer blocks24
Attention heads16
Hidden dimension1024
Attention typeBidirectional (no causal mask)

The audio processing pipeline is:

# Audio pipeline
waveform = load_audio(path)            # [samples] at 16kHz
mel = log_mel_spectrogram(waveform)    # [128, time_frames]
x = conv1(mel).gelu()                  # downsample 2x
x = conv2(x).gelu()                    # downsample 2x more
features = audio_encoder(x)            # [frames/4, 1024] after 24 blocks
projected = audio_projector(features)  # [frames/4, 7168] (1024 -> 7168)
# Insert into LLM token sequence at <audio> placeholder positions

The 2-layer convolutional downsampler reduces the temporal resolution by 4x before the transformer blocks, which is essential for efficiency: a 30-second audio clip at 16 kHz produces 480 mel frames after the spectrogram, and the conv layers reduce this to 120 frames, keeping the sequence length manageable for the 24 transformer blocks.

The audio encoder uses bidirectional attention (no causal mask), unlike the LLM decoder which is causal. This is appropriate because audio input is complete when provided — the model sees the entire audio clip and needs to understand it holistically, not generate it token-by-token.

The audio projector is a single linear layer (1024 to 7168), simpler than the vision MLP projector. This is because audio features are more linearly related to language concepts (phonemes to text) than vision features (pixels to concepts), so a simpler projection suffices.

Speech Generation: EnCodec + Transformer Decoder

Speech generation is the most complex multimodal component, involving both a transformer decoder that generates discrete codec tokens and an EnCodec decoder that converts tokens back to waveforms.

EnCodec Configuration

Parameter Value
Residual codebooks8
Codebook entries1024 per codebook
Stride320 samples
Output sample rate24 kHz
Frame rate75 Hz (24000 / 320)

EnCodec encodes audio into 8 hierarchical residual codebooks, each with 1024 entries. At a stride of 320 samples and 24 kHz output, the frame rate is 75 Hz, meaning each second of audio is represented by 75 frames, each with 8 codec tokens (one per codebook). This gives a token rate of 600 tokens/second, which is much lower than raw audio samples (24,000/second) and amenable to autoregressive generation.

CodecDecoder Transformer

The CodecDecoder is a 12-layer transformer that generates the 8 codec tokens autoregressively for each frame:

  • Layers: 12
  • Attention heads: 16
  • Hidden dimension: 1024
  • Conditioning: LLM hidden states (7168 to 1024 projection)
  • Output heads: 8 separate linear heads (one per codebook)

The speech generation pipeline is:

# Speech generation pipeline
llm_hidden = llm_forward(text_input)     # [seq, 7168]
condition = condition_proj(llm_hidden)   # [seq, 1024] (7168 -> 1024)

# Autoregressive codec token generation
codec_tokens = codec_decoder.generate(
    condition=condition,
    max_frames=750,  # 10 seconds at 75 Hz
)  # [frames, 8] (8 codebooks per frame)

# Each frame: 8 output heads, one per codebook
for frame in range(num_frames):
    for codebook in range(8):
        token = output_heads[codebook](hidden[frame])
        codec_tokens[frame, codebook] = token.argmax(dim=-1)

# Decode codec tokens to waveform
waveform = encodec_decoder(codec_tokens)  # [samples] at 24kHz

The CodecDecoder is conditioned on the LLM hidden states through a projection from 7168 to 1024 dimensions. This conditioning provides the semantic content (what to say) and prosodic information (how to say it) from the LLM, while the CodecDecoder handles the acoustic rendering (converting semantic content to codec tokens).

The 8 separate output heads (one per codebook) generate the codec tokens in a specific order: the first codebook captures the coarsest acoustic information (phonemes, prosody), while subsequent codebooks add progressively finer details (timbre, noise). This hierarchical structure means the first codebook is the most important for intelligibility, while the later codebooks improve naturalness.

Special Tokens

MeeDoo-OnE extends its vocabulary with special tokens that control multimodal processing, conversation structure, and code generation. These tokens are inserted into the input sequence and govern how the model interprets subsequent tokens.

Token ID Purpose
<image>32000Placeholder for 256 vision patch embeddings
<audio>32001Placeholder for audio encoder embeddings
<speech>32002Begin speech generation
</speech>32003End speech generation
<|system|>32004System message boundary
<|user|>32005User message boundary
<|assistant|>32006Assistant message boundary
<fim_prefix>32007FIM: code before cursor
<fim_middle>32008FIM: code at cursor (to predict)
<fim_suffix>32009FIM: code after cursor
<fim_start>32010FIM: start of middle section
<code>32011Begin code region (triggers code expert bias)
</code>32012End code region
<repo>32013Begin repository context
</repo>32014End repository context

Multimodal Integration: embed_multimodal()

The integration of vision and audio into the LLM token stream is handled by the embed_multimodal() function. This function operates by finding placeholder tokens (<image> and <audio>) in the input sequence and replacing them in-place with the projected encoder embeddings.

def embed_multimodal(input_ids, embeddings, image_features, audio_features):
    """
    Replace <image> and <audio> placeholder tokens with
    projected encoder embeddings, in-place.
    """
    output = embeddings.clone()

    # Find all <image> placeholder positions
    image_positions = (input_ids == IMAGE_TOKEN_ID).nonzero()
    for pos in image_positions:
        # Each <image> placeholder expands to 256 patch embeddings
        output[pos:pos+256] = image_features  # [256, 7168]

    # Find all <audio> placeholder positions
    audio_positions = (input_ids == AUDIO_TOKEN_ID).nonzero()
    for pos in audio_positions:
        output[pos:pos+audio_features.shape[0]] = audio_features

    return output

The in-place replacement is critical: the model does not use cross-attention to attend to vision or audio features. Instead, the multimodal embeddings are inserted directly into the token sequence, and the standard causal self-attention attends to them as if they were text tokens. This is the key design principle of native multimodality: all modalities share the same attention mechanism, the same positional encoding, and the same transformer layers. There is no separate vision-language adapter or cross-attention bridge.

Training Data Composition

The training data for MeeDoo-OnE reflects its multimodal nature:

  • Code: 35% of training tokens, spanning 78+ programming languages, with 50% in FIM format
  • Text: web pages, books, scientific papers, mathematical content
  • Images: image-text pairs, multi-image documents, OCR data
  • Audio: speech transcription pairs, audio captioning, sound classification

The multimodal data is interleaved with text and code during training, so the model learns to process mixed-modality inputs naturally. For example, a training example might contain a code snippet, an image of its output, and a natural language explanation — all in the same sequence.

Modality Projector Comparison

Projector Type Parameters Quality Used For
Linear (single layer)1024 x 7168 = 7.3MGoodAudio (simpler mapping)
MLP (2-layer, LLaVA-style)1024 x 7168 + 7168 x 7168 = 59.1MBetterVision (non-linear mapping)

The choice of MLP for vision and linear for audio reflects the different natures of the modality gaps. Vision features (from SigLIP) exist in a high-dimensional space that is geometrically distant from language embeddings, requiring non-linear transformation. Audio features (from Whisper) are more linearly related to language (phonemes to text), so a simpler projection is sufficient and reduces overfitting risk.

Conclusion

MeeDoo-OnE multimodal architecture is defined by a single principle: all modalities are tokens. Vision patch embeddings, audio frame embeddings, and text token embeddings all share the same 7168-dimensional space, the same positional encoding, and the same 84-layer transformer backbone. There are no modality-specific attention mechanisms, no cross-attention bridges, and no modality-specific transformer layers. The only modality-specific components are the encoders (SigLIP, Whisper) that produce the embeddings and the decoder (EnCodec) that consumes the output.

This native integration means that the model can seamlessly reason across modalities: it can describe an image, answer questions about an audio clip, generate code from a screenshot, or produce speech from text. The code-specialized experts and the multimodal encoders coexist without interference, because the routing mechanism learns to direct visual tokens to visual-semantic experts and code tokens to code-specialized experts. The result is a truly unified model, not a collection of adapters.

#multimodal#vision#audio#speech#siglip#whisper#encodec#meedoo-one