iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🐕

Multimodal Model Using Model Merging as AI's Eyes [Paper Summary]

に公開

Introduction

Hello, I'm mita, an aspiring AI engineer!

This time, I'll summarize and discuss a study titled
VisCodex: Vision-Language–Code Models by Merging Architectures
which integrates a multimodal model × code generation model through “model merging” to achieve both visual understanding and code generation.

I hope this recap of what I've caught up on proves useful to you in some way!

https://arxiv.org/pdf/2508.09945v1

Paper Summary

  • VisCodex proposes a method that linearly injects task vectors from a code-specific LLM into a VLM's language backbone, enabling both capabilities without retraining.
  • The vision side is frozen; only the language backbone is merged → SFT. The key point is preserving visual grounding while adding code ability.
  • Main results: VisCodex-8B outperforms same-scale open-source models and even GPT-4o-mini with an average 68.8; VisCodex-33B averages 72.3, approaching GPT-4o (73.3). Particularly strong on UI/chart tasks.

Paper Details

Research Background

  • Typical MLLMs consist of a Vision Encoder/Projection/Language Backbone. Qwen2.5-VL uses 2D RoPE in its ViT, making it robust to arbitrary resolutions and adept at preserving spatial relationships. It is adopted as the foundation of VisCodex.
  • However, replacing the LLM backbone risks breaking previously learned visual grounding. To address this, model merging “adds” code ability while preserving visual understanding.

What is VisCodex?

VisCodex is designed in the following two steps.

1. Model Merging

  • A task vector is defined as τ_task = θ_ft − θ_base. Then, τ_vlm for VLM and τ_code for Code LLM are linearly combined on the language backbone (Vision/Projection are frozen).
  • Implementation: The VLM is Qwen2.5-VL, the code side primarily uses OpenCodeReasoning-Nemotron-1.1-7B/32B (also compared with Qwen2.5-Coder and OpenThinker2).
  • Coefficient λ: For 8B, λ is set to 0.7 based on MMCode; for 33B, 0.85 (due to resource constraints) is used.

2. Model Training (SFT)

  • After merging, SFT is performed on MCD. The Vision/Projection are frozen; only the language backbone is updated.

3. InfiBench-V (Evaluation Benchmark)

  • Real-world programming QA pairs where images are essential are carefully selected from StackOverflow. The pipeline: 1M → 40k → 10k image-mandatory → 322 questions refined by experts (13 languages, 5 categories). :contentReference[oaicite:19]{index=19}
  • Evaluation uses three pillars: Keyword Matching / Unit Test / GPT-4o Judge, scoring both accuracy and completeness. :contentReference[oaicite:20]{index=20}

Experimental Results

  • Main Results (Average): VisCodex-8B 68.8, VisCodex-33B 72.3, GPT-4o 73.3, GPT-4o-mini 65.7. Particularly strong on UI/Chart tasks (Design2Code: 90.1/90.9 (8B), 90.5/91.1 (33B)).
  • Merging Effectiveness (Ablation): For 8B, MMCode pass@1: 6.8→11.0, ChartMimic 73.4→74.8, etc., showing consistent improvements across all metrics.
  • Replacement vs. Merging: Replacing the LLM backbone tends to break visual grounding, while merging grants code ability while preserving visual understanding. :contentReference[oaicite:24]{index=24}
  • Superiority of MCD: In low/high-level evaluations on Design2Code, MCD surpasses Web2Code and WebCode2M (e.g., Block-Match 89.6).

What is Model Merging?

It is a technique that combines the weights (parameters) of multiple already-trained models to obtain a new model with combined capabilities. The goal is to “add” the strengths of existing models without additional large-scale retraining.


What are VLMs (Vision-Language Models)?

VLMs are a class of generative models that handle both images (“Vision”) and text (“Language”) simultaneously. They can understand images to generate text or reason about image content based on textual instructions.

Personal Impressions

Interpretation of the Paper

This study proposes VisCodex, a model that excels at reading images and generating code by merging Qwen2.5-VL, a multimodal model, with OpenCodeReasoning-Nemotron-1.1, a text-only unimodal model specialized for code generation.

Models like GPT-4o are also multimodal, and VisCodex is compared against them.
Since it outperforms the lightweight GPT-4o-mini, further research in this area could lead to even more powerful models.

Reflection (Thoughts)

The biggest takeaway from this paper is the effectiveness of model merging. This method boosts performance by combining the weights of existing trained models and is widely used in other research. Conceptually, it raises the expectation that combining several domain-specific models could bring us closer to AGI.

However, in reality, there are significant hurdles. Model merging practically assumes identical architectures; at least the following must match:

  • Number and order of layers, positions of residual connections and normalization
  • Shapes of each layer (d_model, number/dimension of heads, FFN intermediate dimension, presence of bias, etc.)
  • Attention mechanism (MHA/MQA/GQA), positional embeddings (RoPE/ALiBi) and their settings
  • Vocabulary size, the shapes of embeddings/LM Head, handling of special tokens
  • Parameter key names (state_dict), storage/parallelization format, dtype/quantization

In short, without conditions like "same number of layers," "same parameter shapes per layer," "same inter-layer connections," and "same vocabulary size", weights cannot be simply added together.

While these can be aligned by design (hyperparameters), doing so with models from different teams/companies requires detailed information sharing, which is impractical. Consequently, in practice, model merging often involves fine-tuned models derived from the same base model but for different tasks. This limits the speed and breadth of directly incorporating insights from novel models by others. My current feeling is that pursuing AGI solely through model merging is challenging.

Therefore, as a next option, I am focusing on distillation (transferring a teacher's behavior to a student even between different architectures). Going forward, I will read papers on distillation that enable integration across heterogeneous models.

Discussion