LensVLM: Compressing long context as images, expanding only relevant pages

原始链接: https://huggingface.co/apple/LensVLM-9B

LensVLM 是一款由苹果公司开发的 90 亿参数视觉语言模型(VLM),专为高效文档处理而设计。它具备独特的“选择性上下文扩展”机制:模型首先扫描文档页面的压缩版本,然后利用预设工具仅针对相关页面进行全分辨率扩展,从而进行详细分析。这种方法在处理大型数据集时优化了计算资源。 该模型及其修改版本遵循苹果机器学习研究模型许可协议(Apple Machine Learning Research Model License),源代码则遵循苹果示例代码许可协议(Apple Sample Code License)。用户可通过官方 GitHub 仓库实现该模型,仓库支持多种压缩比(5 倍、10 倍和 15 倍),以平衡性能与效率。仓库文档中包含了安装、自定义文档推理以及数据准备的相关说明。

Sorry.
相关文章

原文

LensVLM is a 9B Vision Language Model (VLM) that scans compressed images of text, then selectively expands only the relevant pages to their uncompressed form via learned tools.

License

All ML model files in this repository, including Apple's modifications to the Qwen model, are provided under the terms of the Apple Machine Learning Research Model License.

The source code that accompanies this model is distributed separately and is provided under the terms of the Apple Sample Code License.

Usage

Install the LensVLM code and run inference:

git clone https://github.com/apple-aiml-research/ml-lensvlm
cd ml-lensvlm
pip install -r requirements.txt
python scripts/run_demo.py --model apple/LensVLM-9B

For a custom document:

python demo.py \
    --model apple/LensVLM-9B \
    --text_file document.txt \
    --question "What is the main finding?" \
    --compression 10x

Compression options: 5x, 10x, 15x. See the repository README for data preparation and evaluation.

Citation

@article{xie2026lensvlm,
  title={LensVLM: Selective Context Expansion for Compressed Visual Representation of Text},
  author={Xie, Roy and Friedman, Dan and Yu, Donghan and Pan, Bowen and Fifty, Christopher and Kim, Jang-Hyun and Du, Xianzhi and Gan, Zhe and Rathod, Vivek and Dhingra, Bhuwan},
  journal={arXiv preprint arXiv:2605.07019},
  year={2026}
}
联系我们 contact @ memedata.com