ziqipang/LM4VisualEncoding
소개
[ICLR 2024 (Spotlight)] "Frozen Transformers in Language Models are Effective Visual Encoder Layers"
AI 및 머신러닝측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalPretrained Transformers from Language Models for Visual Encoding
Official code implementation for "Frozen Transformers in Language Models are Effective Visual Encoder Layers"
Ziqi Pang, Ziyang Xie*, Yunze Man*, Yu-Xiong Wang
If you find our paper or code helpful for your work, please consider cite by
@article{pang2023fozen,
title={Frozen transformers in language models are effective visual encoder layers},
author={Pang, Ziqi and Xie, Ziyang and Man, Yunze and Wang, Yu-Xiong},
journal={arXiv preprint arXiv:2310.12973},
year={2023}
}
News
01/16/2024: Papers accepted at ICLR 2024 (Spotlight). :tada:10/24/2023: Code release.10/19/2023: Paper is available on Arxiv with initial code release on image classification.
1. Introduction
This paper reveals an intriguing discovery: pretrained transformers from LLMs, despite being trained solely on textual data, are surprisingly strong encoders for purely visual tasks in the absence of language. Our exploration shows the potential of LLMs as general-purpose encoders for visual data, as opposed to the previous usages of either pure encoders for text embeddings or decoders for tokenized outputs.
Our approach is straightforward yet overlooked: incorporating a frozen transformer block from a pre-trained LLM as a general-purpose visual encoder layer, directly processing the visual tokens.
We intuitively illustrate our approach below (also Figure 1 in the paper). The procedure is as simple as three steps:
- Extract a frozen LLM transformer block and append it on top of the original visual encoder.
- Insert trainable linear layers before and after the added LLM block to align the feature dimensions.
- Freeze the LLM transformer while optimizing the other modules as usual during training.

To explain the benefits of using frozen LLM transformers, we further propose information filtering hypothesis: the pre-trained LLM transformer blocks discern informative visual tokens and further amplify their contribution to the latent representation. This is supported empirically from our observation that feature activation concentrated better on relevant regions as below (also Figure 3 in the paper).

2. Getting Started with the Experiments
We examine our discovery on a wide range of tasks and release their code in different directories. Please check our subdirectories for instructions.
관련 프로젝트 살펴보기
불러오는 중…