Downloads · 30 days
53
8% of all-time downloads
shiyx1/URaG-3B
URaG-3B is a machine learning model from shiyx1. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
URaG: Unified Retrieval and Generation in Multimodal LLMs for Efficient Long Document Understanding<br Yongxin Shi, Jiapeng Wang, Zeyu Shan, Dezhi Peng, Zening Lin, Lianwen Jin <br
Downloads · 30 days
53
8% of all-time downloads
All-time downloads
636
Public
Parameters
3.8B
7.5 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors7.5 GB · 100%
From the Hugging Face model README
URaG: Unified Retrieval and Generation in Multimodal LLMs for Efficient Long Document Understanding<br> Yongxin Shi, Jiapeng Wang, Zeyu Shan, Dezhi Peng, Zening Lin, Lianwen Jin <br>
URaG (Unified Retrieval and Generation) is a simple-yet-effective unified framework that unifies retrieval and generation in a model for efficient long document understanding. Equipped with a lightweight cross-modal retrieval module, URaG explicitly leverages the inherent evidence localization capabilities of MLLMs to perform efficient and integrated retrieval.
URaG-3B is based on the Qwen2.5-VL-3B.
conda create -n urag python=3.10
conda activate urag
Install torch & flash-attn:
# Recommend version (not mandatory)
pip install torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/cu124
pip install -U flash-attn==2.7.3 --no-build-isolation
Install other dependencies:
git clone https://github.com/shi-yx/URaG.git
cd ./URaG
pip install -r requirements.txt
We provide an example of inference code in the Github repo.
The dataset format is as follows (Please refer to the Github repo for more details):
[
{
"id": "unique_id",
"image": ["image_path1", "image_path2", ...],
"conversations": [
{"from": "human", "value": "query"},
{"from": "gpt", "value": "answer"},
]
"retrieval_labels": [0, 1, 0, ...], # 1: evidence, 0: non-evidence
},
...
]
cd ./URaG/code
sh scripts/pretrain.sh
# extract the parameters of the proj_layer
sh scripts/extract_projlayer.sh
cd ./URaG/code
sh scripts/finetune.sh
# merge lora
sh scripts/merge_lora.sh
If you find our work helpful, feel free to give us a cite.
@inproceedings{shi2026urag,
title={URaG: Unified Retrieval and Generation in Multimodal LLMs for Efficient Long Document Understanding},
author={Shi, Yongxin and Wang, Jiapeng and Shan, Zeyu and Peng, Dezhi and Lin, Zening and Jin, Lianwen},
booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
year={2026}
}