Upload folder using huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
base_model: Qwen/Qwen2.5-VL-7B-Instruct
|
| 6 |
+
tags:
|
| 7 |
+
- vision
|
| 8 |
+
- multimodal
|
| 9 |
+
- visual-question-answering
|
| 10 |
+
- memory-agent
|
| 11 |
+
- long-context
|
| 12 |
+
pipeline_tag: visual-question-answering
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# MemOCR: Layout-Aware Visual Memory for Efficient Long-Horizon Reasoning
|
| 16 |
+
|
| 17 |
+
<div align="center">
|
| 18 |
+
|
| 19 |
+
<p align="center">
|
| 20 |
+
<a href="https://arxiv.org/abs/2601.21468"><img src="https://img.shields.io/badge/arXiv-2601.21468-b31b1b.svg" alt="arXiv"></a>
|
| 21 |
+
<a href="https://huggingface.co/papers/2601.21468"><img src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging_Face-Paper-yellow" alt="HuggingFace Paper"></a>
|
| 22 |
+
<a href="https://meituan.github.io/MemOCR/"><img src="https://img.shields.io/badge/Project-Page-green" alt="Project Page"></a>
|
| 23 |
+
<a href="https://github.com/meituan/MemOCR"><img src="https://img.shields.io/badge/GitHub-Code-black?logo=github" alt="GitHub"></a>
|
| 24 |
+
<a href="./LICENSE"><img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" alt="License"></a>
|
| 25 |
+
</p>
|
| 26 |
+
</div>
|
| 27 |
+
|
| 28 |
+
## π Model Description
|
| 29 |
+
|
| 30 |
+
MemOCR is a visual memory agent that dynamically adapts information density during memory drafting and reading, and optimizes visual layouts to highlight key information.
|
| 31 |
+
This checkpoint is fine-tuned from `Qwen2.5-VL-7B-Instruct` with budget-aware training objectives.
|
| 32 |
+
|
| 33 |
+
### Key Capabilities
|
| 34 |
+
- **Adaptive Information Density**: Dynamically adjusts memory content richness based on task requirements
|
| 35 |
+
- **Budget-Aware Memory**: Optimizes memory usage with explicit token budget constraints
|
| 36 |
+
- **Dual-Domain Architecture**: Separate memory drafting (text domain) and reading (vision domain) processes
|
| 37 |
+
- **Multi-Hop Reasoning**: Superior performance on complex question answering tasks
|
| 38 |
+
|
| 39 |
+
## ποΈ Architecture
|
| 40 |
+
|
| 41 |
+
<div align="center">
|
| 42 |
+
<img src="https://raw.githubusercontent.com/meituan/MemOCR/main/docs/figs/memocr_method_architecture.png" width="95%" alt="MemOCR Architecture">
|
| 43 |
+
</div>
|
| 44 |
+
|
| 45 |
+
MemOCR consists of two main components:
|
| 46 |
+
|
| 47 |
+
1. **Memory Drafting in Text Domain**: An LLM agent iteratively refines rich-text memory content based on question-answering feedback
|
| 48 |
+
2. **Memory Reading in Vision Domain**: A vision-language model processes rendered visual memory with optimized information density
|
| 49 |
+
|
| 50 |
+
The framework employs budget-aware training objectives to balance memory informativeness and token efficiency.
|
| 51 |
+
|
| 52 |
+
<div align="center">
|
| 53 |
+
<img src="https://raw.githubusercontent.com/meituan/MemOCR/main/docs/figs/memocr_method_augmentation.png" width="50%" alt="Data Augmentation Strategy">
|
| 54 |
+
</div>
|
| 55 |
+
|
| 56 |
+
## π Performance
|
| 57 |
+
|
| 58 |
+
### Main Results
|
| 59 |
+
|
| 60 |
+
<div align="center">
|
| 61 |
+
<img src="https://raw.githubusercontent.com/meituan/MemOCR/main/docs/figs/memocr_main_results.png" width="90%" alt="Main Results">
|
| 62 |
+
</div>
|
| 63 |
+
|
| 64 |
+
MemOCR achieves state-of-the-art performance across multiple multi-hop QA benchmarks:
|
| 65 |
+
- **HotpotQA**: Superior accuracy with efficient memory budgets
|
| 66 |
+
- **2WikiMultihopQA**: Strong multi-hop reasoning capabilities
|
| 67 |
+
- **NaturalQuestions & TriviaQA**: Excellent knowledge retrieval performance
|
| 68 |
+
|
| 69 |
+
### Ablation Studies
|
| 70 |
+
|
| 71 |
+
<div align="center">
|
| 72 |
+
<img src="https://raw.githubusercontent.com/meituan/MemOCR/main/docs/figs/memocr_ablation.png" width="75%" alt="Ablation Studies">
|
| 73 |
+
</div>
|
| 74 |
+
|
| 75 |
+
### Analysis: Information Density & Budget
|
| 76 |
+
|
| 77 |
+
<div align="center">
|
| 78 |
+
<img src="https://raw.githubusercontent.com/meituan/MemOCR/main/docs/figs/memocr_analysis_budget.png" width="45%" style="display:inline-block">
|
| 79 |
+
<img src="https://raw.githubusercontent.com/meituan/MemOCR/main/docs/figs/memocr_analysis_density.png" width="45%" style="display:inline-block">
|
| 80 |
+
</div>
|
| 81 |
+
|
| 82 |
+
## π Usage
|
| 83 |
+
|
| 84 |
+
This model is designed to work with the MemOCR framework. Please refer to the [official repository](https://github.com/meituan/MemOCR) for detailed usage instructions.
|
| 85 |
+
|
| 86 |
+
### Quick Start
|
| 87 |
+
|
| 88 |
+
```python
|
| 89 |
+
# Install dependencies
|
| 90 |
+
pip install transformers torch
|
| 91 |
+
|
| 92 |
+
# Load model (example)
|
| 93 |
+
from transformers import AutoModel, AutoProcessor
|
| 94 |
+
|
| 95 |
+
model = AutoModel.from_pretrained("your-username/MemOCR-step900")
|
| 96 |
+
processor = AutoProcessor.from_pretrained("your-username/MemOCR-step900")
|
| 97 |
+
```
|
| 98 |
+
|
| 99 |
+
For complete training and evaluation pipelines, please visit the [GitHub repository](https://github.com/meituan/MemOCR).
|
| 100 |
+
|
| 101 |
+
## π Citation
|
| 102 |
+
|
| 103 |
+
If you find MemOCR useful in your research, please consider citing:
|
| 104 |
+
|
| 105 |
+
```bibtex
|
| 106 |
+
@article{shi2026memocr,
|
| 107 |
+
title={MemOCR: Layout-Aware Visual Memory for Efficient Long-Horizon Reasoning},
|
| 108 |
+
author={Yaorui Shi and Shugui Liu and Yu Yang and Wenyu Mao and Yuxin Chen and Qi GU and Hui Su and Xunliang Cai and Xiang Wang and An Zhang},
|
| 109 |
+
journal={arXiv preprint arXiv:2601.21468},
|
| 110 |
+
year={2026},
|
| 111 |
+
}
|
| 112 |
+
```
|
| 113 |
+
|
| 114 |
+
## π Acknowledgements
|
| 115 |
+
|
| 116 |
+
This model is built upon:
|
| 117 |
+
- **[Qwen2.5-VL](https://huggingface.co/Qwen/Qwen2.5-VL-7B-Instruct)** as the vision-language model backbone
|
| 118 |
+
- **[veRL](https://github.com/volcengine/verl)** as the reinforcement learning training framework
|
| 119 |
+
- **[MemAgent](https://github.com/BytedTsinghua-SIA/MemAgent)** for the recurrent module and training dataset
|
| 120 |
+
|
| 121 |
+
## π License
|
| 122 |
+
|
| 123 |
+
This model is licensed under the Apache License 2.0. See the LICENSE file for details.
|
| 124 |
+
|
| 125 |
+
### Dataset License
|
| 126 |
+
|
| 127 |
+
Training and evaluation datasets are derived from:
|
| 128 |
+
- **HotpotQA, 2WikiMultihopQA, Natural Questions, TriviaQA**: Wikipedia-derived content licensed under [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)
|
| 129 |
+
|