Vary: Scaling up the Vision Vocabulary for Large Vision-Language Models

Haoran Wei, Lingyu Kong, Jinyue Chen, Liang Zhao, Zheng Ge, Jinrong Yang, Jianjian Sun, Chunrui Han, Xiangyu ZhangarXiv 2023 · DOI

Abstract

Large Vision-Language Models (LVLMs) typically rely on CLIP-style vision encoders, which excel at general object recognition but struggle with dense, fine-grained visual data such as documents and charts. This "out-of-vocabulary" problem limits their utility in specialized domains. We introduce Vary, a novel framework designed to scale the vision vocabulary of LVLMs. Vary employs a two-stage process: first, a "vocabulary network" is trained (Vary-tiny) to tokenize dense visual information using a Segment Anything Model (SAM) backbone; second, this new vocabulary is integrated into a larger LVLM (Vary-base) alongside the original CLIP encoder. This dual-branch approach allows the model to handle high-resolution document parsing and complex chart reasoning without compromising general multimodal performance. Experimental results demonstrate that Vary achieves significant improvements in OCR and ChartQA, outperforming existing models like LLaVA-1.5.

Introduction

Current state-of-the-art LVLMs, such as LLaVA or MiniGPT-4, almost exclusively utilize CLIP-style vision encoders. While CLIP is highly effective for recognizing general objects in natural scenes, it acts as a low-resolution "dictionary" when confronted with dense text, complex charts, or non-English documents. For these specialized tasks, CLIP encounters a fundamental "out-of-vocabulary" problem; it was not trained to tokenize the fine-grained details required for document-level OCR or markdown conversion.

Simply unfreezing CLIP during training often leads to catastrophic forgetting or inefficient learning. Vary addresses this by treating vision vocabulary expansion similarly to text vocabulary expansion: if a model needs to learn a "new language" (such as dense document structures), it requires new tokens.

Comparison of Vary's vision vocabulary expansion approach against traditional CLIP-based LVLM architectures.

Methodology

The authors propose a two-stage framework to "write" and then integrate a new vision vocabulary.

Stage 1: Vocabulary Generation (Vary-tiny)

To create the new vocabulary, the researchers utilize a "vocabulary network" based on the Segment Anything Model (SAM) ViT-base. Unlike CLIP, which focuses on global semantics, SAM is designed for localization, making it a superior candidate for fine-grained perception. This network is paired with a tiny decoder (OPT-125M) and trained via autoregression to "read" documents and charts. During this phase, the model learns to compress high-resolution (1024x1024) visual information into meaningful new tokens. To ensure the new vocabulary does not introduce noise into natural image processing, COCO images are included as "negative samples."

Stage 2: Vocabulary Integration (Vary-base)

Once the new vocabulary is established, it is integrated into a larger LVLM. Vary-base employs two parallel vision branches: the original CLIP-L (for general concepts) and the newly created Vary-tiny branch (for fine-grained details). The features from both branches are concatenated and fed into a large language model, such as Vicuna-7B or Qwen-7B. Crucially, the vision encoders remain frozen during this phase, forcing the LLM to learn how to utilize the expanded vocabulary without overwriting existing general knowledge.

Detailed two-stage pipeline: Vary-tiny for vocabulary generation and Vary-base for multi-branch integration.

Data Strategy

The success of Vary relies on a robust "data engine" to generate high-quality training samples:

  • Vary-tiny Training: Utilizes 1 million English and 1 million Chinese document image-text pairs extracted from PDFs, alongside 750k rendered charts (using matplotlib and pyecharts).
  • Vary-base Training: Incorporates synthetic LaTeX documents (0.9M total), 200k high-quality charts generated via GPT-4, and standard general-purpose datasets like LAION-COCO (4M) and LLaVA-SFT data.

Key Results

Vary demonstrates significant leaps in specialized perception without sacrificing general intelligence:

  • Document Parsing: On a custom OCR test set, Vary-base achieved a 0.181 Edit Distance and 81.10% F1-score, outperforming specialized models like Nougat.
  • DocVQA: The model achieved 78.2% ANLS, showing a strong ability to reason over document images.
  • General Benchmarks: On MMVet, Vary scored 36.2%, outperforming LLaVA-1.5-7B (30.5%), proving that the added vision vocabulary enhances general multimodal reasoning.
  • Qualitative Performance: The model can convert complex documents directly into Markdown or LaTeX and transform charts into Python dictionaries with high fidelity.

Conclusion and Future Work

Vary proves that scaling the vision vocabulary is a viable path for improving LVLM performance on dense data. By choosing SAM for its localization strengths and using a dual-branch architecture, the model bridges the gap between general scene understanding and specialized document/chart parsing. Future work will explore more efficient ways to merge these vocabularies beyond simple concatenation and investigate other specialized "visual languages," such as medical or satellite imagery.

Summary updated

Abstract

Modern Large Vision-Language Models (LVLMs) enjoy the same vision vocabulary -- CLIP, which can cover most common vision tasks. However, for some special vision task that needs dense and fine-grained vision perception, e.g., document-level OCR or chart understanding, especially in non-English scenarios, the CLIP-style vocabulary may encounter low efficiency in tokenizing the vision knowledge and even suffer out-of-vocabulary problem. Accordingly, we propose Vary, an efficient and effective method to scale up the vision vocabulary of LVLMs. The procedures of Vary are naturally divided into two folds: the generation and integration of a new vision vocabulary. In the first phase, we devise a vocabulary network along with a tiny decoder-only transformer to produce the desired vocabulary via autoregression. In the next, we scale up the vanilla vision vocabulary by merging the new one with the original one (CLIP), enabling the LVLMs can quickly garner new features. Compared to the popular BLIP-2, MiniGPT4, and LLaVA, Vary can maintain its vanilla capabilities while enjoying more excellent fine-grained perception and understanding ability. Specifically, Vary is competent in new document parsing features (OCR or markdown conversion) while achieving 78.2% ANLS in DocVQA and 36.2% in MMVet. Our code will be publicly available on the homepage.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
DocVQAVary-base (80k)ANLS78.2%split: val · fine-tuned · params=7B · backbone=Qwen-7B · training-data=LLaVA-80k
Source quote
L135: Vary-base (80k) │ 78.2 │ 76.3 │ 43.2 │ 87.3 │ 65.3
DocVQAVary-base (80k)ANLS76.3%split: test · fine-tuned · params=7B · backbone=Qwen-7B · training-data=LLaVA-80k
Source quote
L135: Vary-base (80k) │ 78.2 │ 76.3 │ 43.2 │ 87.3 │ 65.3
ChartQAVary-base (665k)Average relaxed accuracy66.1%fine-tuned · training-data=LLaVA-CC665k · evaluation-splits=human and augmented
Source quote
L136: Vary-base (665k) │ 78.1 │ 76.3 │ 43.8 │ 88.3 │ 66.1
MM-VetVary-base (qwen7B) (80k)Total36.2%fine-tuned · params=7B · backbone=Qwen-7B · training-data=LLaVA-80k
Source quote
L158: Vary-base (qwen7B) (80k) │ 38.9 │ 30.1 │ 22.4 │ 21.7 │ 34.3 │ 7.7 │ 36.2
MM-VetVary-base (vicuna7B) (665k)Total32.9%fine-tuned · params=7B · backbone=Vicuna-7B · training-data=LLaVA-CC665k
Source quote
L157: Vary-base (vicuna7B) (665k) │ 38.7 │ 22.0 │ 23.6 │ 24.1 │ 29.6 │ 7.7 │ 32.9
BibTeX
@misc{wei2023vary,
  author = {Haoran Wei and Lingyu Kong and Jinyue Chen and Liang Zhao and Zheng Ge and Jinrong Yang and Jianjian Sun and Chunrui Han and Xiangyu Zhang},
  title = {{Vary: Scaling up the Vision Vocabulary for Large Vision-Language Models}},
  year = {2023},
  eprint = {2312.06109},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2312.06109},
}
Figure