/ Модель

Характеристики

Контекст
128 000 токенов
Параметры
3,1 млрд
Лицензия
Apache 2.0
Архитектура
qwen2_5_vl_gp · dense
Библиотека
transformers
Опубликована
2 авг 2025

GlimpsePrune_Qwen2.5-VL-3B-Instruct

Изображение и текст → текст3 профессии

GlimpsePrune — модель Qwen2.5-VL для ответов на вопросы по изображениям с динамическим сокращением числа визуальных токенов.

130скачиваний за 30 дней2лайкавеса обновлены6 авг 2025

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Изображение → текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

GlimpsePrune — модель семейства Qwen2.5-VL, опубликованная ashun989, с методом динамического прореживания визуальных токенов GlimpsePrune. Она предназначена для ответов на вопросы по изображениям, включая свободные и короткие вопросы, и поддерживает одиночные и несколько изображений. Модель выбирает визуальные токены, относящиеся к запросу, и отбрасывает избыточные перед генерацией ответа; в README заявлено сокращение числа визуальных токенов в среднем более чем на 90% при сохранении близкого к исходной модели качества на VQA.

Модель содержит 3,1 млрд параметров, использует архитектуру Qwen2_5_VLForConditionalGeneration, принимает изображения и текстовый запрос и генерирует текстовый ответ. Заявлена поддержка контекста до 128 000 токенов. Для запуска README указывает библиотеку transformers_gp из репозитория проекта. Модель распространяется по лицензии Apache-2.0. README описывает результаты на VQA-бенчмарках, но не приводит их численные значения; заявленное сохранение качества следует считать результатом авторской оценки.

Сценарии применения

  • ответы на свободные вопросы по изображению
  • ответы на короткие вопросы по изображению
  • поиск визуальных областей, связанных с текстовым запросом
  • анализ нескольких изображений в одном запросе
  • снижение вычислительных затрат при визуальном вопросно-ответном поиске

Ограничения

README сообщает о сохранении близкого к базовой модели качества на VQA, но не приводит численные результаты. Поддерживаемые языки в карточке не указаны.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

GlimpsePrune: Dynamic Visual Token Pruning for Large Vision-Language Models

This repository contains the GlimpsePrune model, a dynamic visual token pruning framework for Large Vision-Language Models (LVLMs), as presented in the paper A Glimpse to Compress: Dynamic Visual Token Pruning for Large Vision-Language Models.

Abstract from the paper: Visual token compression is critical for Large Vision-Language Models (LVLMs) to efficiently process high-resolution inputs. Existing methods that typically adopt fixed compression ratios cannot adapt to scenes of varying complexity, often causing imprecise pruning that discards informative visual tokens and results in degraded model performance. To address this issue, we introduce a dynamic pruning framework, GlimpsePrune, inspired by human cognition. It takes a data-driven ''glimpse'' and prunes irrelevant visual tokens in a single forward pass before answer generation. This approach prunes 92.6% of visual tokens while on average fully retaining the baseline performance on free-form VQA tasks. The reduced computational cost also enables more effective fine-tuning: an enhanced GlimpsePrune+ achieves 110% of the baseline performance while maintaining a similarly high pruning rate. Our work paves a new way for building more powerful and efficient LVLMs.

Official Code: https://github.com/HVision-NKU/GlimpsePrune

✨ Key Features

  • High Pruning Rate: Prunes over 90% of visual tokens on average with almost no performance loss, effectively reducing computational and memory overhead.
  • Robust Performance: Stable performance when processing high-resolution images and handling complex free-form VQA tasks.
  • Lightweight Training: Only a few extra parameters (Glimpse token and VIP) need to be trained, completed in less than 1 hour on a single A100 GPU.
  • Broad Compatibility: Supports single and multi-image inputs, is compatible with KV-Cache and Flash Attention 2, and provides a fair comparison benchmark with other mainstream visual compression methods.

🖼️ Framework Overview

The core idea of GlimpsePrune is to introduce a glimpse token and a lightweight Visual tokens Important Predictor (VIP) that can quickly identify and retain the visual regions most relevant to the text prompt, pruning the remaining redundant information.

📊 Performance Results

GlimpsePrune was evaluated on multiple VQA benchmarks. The results demonstrate its ability to achieve a high pruning rate while maintaining performance on par with the original model, often outperforming other visual compression methods.

▶️ How to Use

You can use GlimpsePrune with the transformers_gp, which is located in the GitHub repository.

from transformers_gp.models.qwen2_5_vl import (
    Qwen2_5_VL_GP_ForConditionalGeneration,
    Qwen2_5_VL_GP_Processor
)
from qwen_vl_utils import process_vision_info
from PIL import Image
import torch
# Load the model and processor
base_model_name = "Qwen/Qwen2.5-VL-3B-Instruct"
new_model_name = "ashun989/GlimpsePrune_Qwen2.5-VL-3B-Instruct"
model = Qwen2_5_VL_GP_ForConditionalGeneration.from_pretrained(
    base_model,
    torch_dtype=torch.bfloat16,
    attn_implementation="flash_attention_2",
    device_map={"": "cuda:0"},
)
processor = Qwen2_5_VL_GP_Processor.from_pretrained(base_model)
model.load_new_modules(new_modules_dir)
model.eval()
# Prepare messages (image and text input)
messages = [
    {
        "role": "user",
        "content": [
            {
                "type": "image",
                "image": "../examples/people.png", # Placeholder: replace with your image path
            },
            {"type": "text", "text": "What kind of a tie is the groom wearing?"},
        ],
    }
]
# Preparation for inference
text = processor.apply_chat_template(
    messages, tokenize=False, add_generation_prompt=True
)
image_inputs, video_inputs = process_vision_info(messages)
inputs = processor(
    text=[text],
    images=image_inputs,
    videos=video_inputs,
    padding=True,
    return_tensors="pt",
)
inputs = inputs.to(model.device)
# Generate output
model.reset_image_tokens_cache()  # NOTE: reset the cache before inference
with torch.inference_mode():
  generated_ids = model.generate(**inputs, max_new_tokens=1024, do_selection=True)  # Enable glimpse prune by do_selection=True
# Decode and print the response
generated_ids_trimmed = [
    out_ids[len(in_ids):] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
]
output_text = processor.batch_decode(
    generated_ids_trimmed, skip_special_tokens=False, clean_up_tokenization_spaces=False
)
print(f"User: {question}
Assistant: {output_text[0]}")

For more detailed usage, including local Gradio demos, evaluation, and training, please refer to the official GitHub repository and its tutorial notebook.

🖊️ Citation

If you find our work helpful, please consider citing our paper:

@misc{zeng2025glimpseprune,
      title={A Glimpse to Compress: Dynamic Visual Token Pruning for Large Vision-Language Models}, 
      author={Quan-Sheng Zeng and Yunheng Li and Qilong Wang and Peng-Tao Jiang and Zuxuan Wu and Ming-Ming Cheng and Qibin Hou},
      year={2025},
      eprint={2508.01548},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2508.01548}, 
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Можно запустить

Подбираем GPU…

Класс архитектуры
Qwen2_5_VLForConditionalGeneration
Ревизия весов
1a8a506

0 моделей