Adapting LLaMA Decoder to Vision Transformer
Not on the map. Why?
Abstract (arXiv)
This work examines whether decoder-only Transformers such as LLaMA, which were originally designed for large language models (LLMs), can be adapted to the computer vision field. We first "LLaMAfy" a standard ViT step-by-step to align with LLaMA's architecture, and find that directly applying a causal mask to the self-attention brings an attention collapse issue, resulting in the failure to the network training. We suggest to reposition the class token behind the image tokens with a post-sequence class token technique to overcome this challenge, enabling causal self-attention to efficiently capture the entire image's information. Additionally, we develop a soft mask strategy that gradually introduces a causal mask to the self-attention at the onset of training to facilitate the optimization behavior. The tailored model, dubbed as image LLaMA (iLLaMA), is akin to LLaMA in architecture and enables direct supervised learning. Its causal self-attention boosts computational efficiency and learns complex representation by elevating attention map ranks. iLLaMA rivals the performance with its encoder-only counterparts, achieving 75.1% ImageNet top-1 accuracy with only 5.7M parameters. Scaling the model to ~310M and pre-training on ImageNet-21K further enhances the accuracy to 86.0%. Extensive experiments demonstrate iLLaMA's reliable properties: shape-texture bias, calibration, quantization compatibility, ADE20K segmentation and CIFAR transfer learning. We hope our study can kindle fresh views to visual architectures in the wave of LLMs and inspire the development of unified multimodal models. Pre-trained models and codes are available https://github.com/techmonsterwang/iLLaMA.
Key facts. Cited by 3 papers in the map (data through 14 Oct 2026). Builds on 68 of its 78 references that are in the map. First posted on arXiv 10 Apr 2024.
Builds on
68 of 78 references.
References · 68
- 2017Attention Is All You Needcited by 60,361
- 2015Deep Residual Learning for Image Recognitioncited by 52,096
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
- 2021Swin Transformer: Hierarchical Vision Transformer using Shifted Windowscited by 12,139
- 2023Visual Instruction Tuningcited by 7,869
- 2021Masked Autoencoders Are Scalable Vision Learnerscited by 7,403
- 2016Layer Normalizationcited by 5,669
- 2015Rethinking the Inception Architecture for Computer Visioncited by 5,475
- 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,326
38 more
- 2017mixup: Beyond Empirical Risk Minimizationcited by 5,183
- 2017On Calibration of Modern Neural Networkscited by 4,960
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
- 2020Training data-efficient image transformers & distillation through attentioncited by 4,586
- 2023Improved Baselines with Visual Instruction Tuningcited by 4,418
- 2022A ConvNet for the 2020scited by 3,579
- 2022OPT: Open Pre-trained Transformer Language Modelscited by 3,512
- 2016Gaussian Error Linear Units (GELUs)cited by 3,502
- 2023Mistral 7Bcited by 3,164
- 2019CutMix: Regularization Strategy to Train Strong Classifiers with Localizable Featurescited by 2,884
- 2023MiniGPT-4: Enhancing Vision-Language Understanding with Advanced Large Language Modelscited by 2,711
- 2021BEiT: BERT Pre-Training of Image Transformerscited by 2,375
- 2019RandAugment: Practical automated data augmentation with a reduced search spacecited by 2,269
- 2023Code Llama: Open Foundation Models for Codecited by 2,139
- 2020Shortcut Learning in Deep Neural Networkscited by 1,969
- 2021Pyramid Vision Transformer: A Versatile Backbone for Dense Prediction without Convolutionscited by 1,962
- 2020GLU Variants Improve Transformercited by 1,804
- 2016WaveNet: A Generative Model for Raw Audiocited by 1,722
- 2017Accurate, Large Minibatch SGD: Training ImageNet in 1 Hourcited by 1,492
- 2019Root Mean Square Layer Normalizationcited by 1,480
- 2020Linformer: Self-Attention with Linear Complexitycited by 1,474
- 2018ImageNet-trained CNNs are biased towards texture; increasing shape bias improves accuracy and robustnesscited by 1,432
- 2019Generating Diverse High-Fidelity Images with VQ-VAE-2cited by 1,387
- 2018Unified Perceptual Parsing for Scene Understandingcited by 1,271
- 2017Random Erasing Data Augmentationcited by 1,239
- 2017Visualizing the Loss Landscape of Neural Netscited by 1,130
- 2016Semantic Understanding of Scenes through the ADE20K Datasetcited by 1,069
- 2016Deep Networks with Stochastic Depthcited by 979
- 2017Sigmoid-Weighted Linear Units for Neural Network Function Approximation in Reinforcement Learningcited by 950
- 2016Conditional Image Generation with PixelCNN Decoderscited by 862
- 2016Pixel Recurrent Neural Networkscited by 816
- 2023ConvNeXt V2: Co-designing and Scaling ConvNets with Masked Autoencoderscited by 712
- 2023MiniGPT-v2: large language model as a unified interface for vision-language multi-task learningcited by 625
- 2021ImageNet-21K Pretraining for the Massescited by 613
- 2021MetaFormer Is Actually What You Need for Visioncited by 524
- 2017Non-Autoregressive Neural Machine Translationcited by 463
- 2021Attention is Not All You Need: Pure Attention Loses Rank Doubly Exponentially with Depthcited by 419
- 2022DeiT III: Revenge of the ViTcited by 419
50 most cited of 68 All 68 (JSON)
Built on by
Citing papers per year: 2024: 2; 2025: 1.
3 papers.
Similar, not cited
Close in wording, no citation either way
- 2023LLaMA-Adapter: Efficient Fine-tuning of Language Models with Zero-init Attention
- 2025Efficient LLaMA-3.2-Vision by Trimming Cross-attended Visual Features
- 2023LLaMA-Adapter V2: Parameter-Efficient Visual Instruction Model
- 2024VoCo-LLaMA: Towards Vision Compression with Large Language Models
- 2025Zero-Shot Vision Encoder Grafting via LLM Surrogates
- 2023LLaMA-VID: An Image is Worth 2 Tokens in Large Language Models
- 2025Enhancing Self-Supervised Visual Representation Learning via Low-Rank Adapted LLMs
- 2023Video-LLaMA: An Instruction-tuned Audio-Visual Language Model for Video Understanding