mlsanityData to 14 Oct 2026

Adapting LLaMA Decoder to Vision Transformer

arXiv 2404.06773 ↗First posted 10 Apr 2024cs.CVcited by 3

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

  1. 2017Attention Is All You Needcited by 60,361
  2. 2015Deep Residual Learning for Image Recognitioncited by 52,096
  3. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
  4. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
  5. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
  6. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
  7. 2021Swin Transformer: Hierarchical Vision Transformer using Shifted Windowscited by 12,139
  8. 2023Visual Instruction Tuningcited by 7,869
  9. 2021Masked Autoencoders Are Scalable Vision Learnerscited by 7,403
  10. 2016Layer Normalizationcited by 5,669
  11. 2015Rethinking the Inception Architecture for Computer Visioncited by 5,475
  12. 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,326
38 more
  1. 2017mixup: Beyond Empirical Risk Minimizationcited by 5,183
  2. 2017On Calibration of Modern Neural Networkscited by 4,960
  3. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
  4. 2020Training data-efficient image transformers & distillation through attentioncited by 4,586
  5. 2023Improved Baselines with Visual Instruction Tuningcited by 4,418
  6. 2022A ConvNet for the 2020scited by 3,579
  7. 2022OPT: Open Pre-trained Transformer Language Modelscited by 3,512
  8. 2016Gaussian Error Linear Units (GELUs)cited by 3,502
  9. 2023Mistral 7Bcited by 3,164
  10. 2019CutMix: Regularization Strategy to Train Strong Classifiers with Localizable Featurescited by 2,884
  11. 2023MiniGPT-4: Enhancing Vision-Language Understanding with Advanced Large Language Modelscited by 2,711
  12. 2021BEiT: BERT Pre-Training of Image Transformerscited by 2,375
  13. 2019RandAugment: Practical automated data augmentation with a reduced search spacecited by 2,269
  14. 2023Code Llama: Open Foundation Models for Codecited by 2,139
  15. 2020Shortcut Learning in Deep Neural Networkscited by 1,969
  16. 2021Pyramid Vision Transformer: A Versatile Backbone for Dense Prediction without Convolutionscited by 1,962
  17. 2020GLU Variants Improve Transformercited by 1,804
  18. 2016WaveNet: A Generative Model for Raw Audiocited by 1,722
  19. 2017Accurate, Large Minibatch SGD: Training ImageNet in 1 Hourcited by 1,492
  20. 2019Root Mean Square Layer Normalizationcited by 1,480
  21. 2020Linformer: Self-Attention with Linear Complexitycited by 1,474
  22. 2018ImageNet-trained CNNs are biased towards texture; increasing shape bias improves accuracy and robustnesscited by 1,432
  23. 2019Generating Diverse High-Fidelity Images with VQ-VAE-2cited by 1,387
  24. 2018Unified Perceptual Parsing for Scene Understandingcited by 1,271
  25. 2017Random Erasing Data Augmentationcited by 1,239
  26. 2017Visualizing the Loss Landscape of Neural Netscited by 1,130
  27. 2016Semantic Understanding of Scenes through the ADE20K Datasetcited by 1,069
  28. 2016Deep Networks with Stochastic Depthcited by 979
  29. 2017Sigmoid-Weighted Linear Units for Neural Network Function Approximation in Reinforcement Learningcited by 950
  30. 2016Conditional Image Generation with PixelCNN Decoderscited by 862
  31. 2016Pixel Recurrent Neural Networkscited by 816
  32. 2023ConvNeXt V2: Co-designing and Scaling ConvNets with Masked Autoencoderscited by 712
  33. 2023MiniGPT-v2: large language model as a unified interface for vision-language multi-task learningcited by 625
  34. 2021ImageNet-21K Pretraining for the Massescited by 613
  35. 2021MetaFormer Is Actually What You Need for Visioncited by 524
  36. 2017Non-Autoregressive Neural Machine Translationcited by 463
  37. 2021Attention is Not All You Need: Pure Attention Loses Rank Doubly Exponentially with Depthcited by 419
  38. 2022DeiT III: Revenge of the ViTcited by 419

50 most cited of 68 All 68 (JSON)

Built on by

Cited by year

Citing papers per year: 2024: 2; 2025: 1.

3 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2023LLaMA-Adapter: Efficient Fine-tuning of Language Models with Zero-init Attention
  2. 2025Efficient LLaMA-3.2-Vision by Trimming Cross-attended Visual Features
  3. 2023LLaMA-Adapter V2: Parameter-Efficient Visual Instruction Model
  4. 2024VoCo-LLaMA: Towards Vision Compression with Large Language Models
  5. 2025Zero-Shot Vision Encoder Grafting via LLM Surrogates
  6. 2023LLaMA-VID: An Image is Worth 2 Tokens in Large Language Models
  7. 2025Enhancing Self-Supervised Visual Representation Learning via Low-Rank Adapted LLMs
  8. 2023Video-LLaMA: An Instruction-tuned Audio-Visual Language Model for Video Understanding