LLaMA-NAS: Efficient Neural Architecture Search for Large Language Models (2405.18377v1)
Abstract: The abilities of modern LLMs in solving natural language processing, complex reasoning, sentiment analysis and other tasks have been extraordinary which has prompted their extensive adoption. Unfortunately, these abilities come with very high memory and computational costs which precludes the use of LLMs on most hardware platforms. To mitigate this, we propose an effective method of finding Pareto-optimal network architectures based on LLaMA2-7B using one-shot NAS. In particular, we fine-tune LLaMA2-7B only once and then apply genetic algorithm-based search to find smaller, less computationally complex network architectures. We show that, for certain standard benchmark tasks, the pre-trained LLaMA2-7B network is unnecessarily large and complex. More specifically, we demonstrate a 1.5x reduction in model size and 1.3x speedup in throughput for certain tasks with negligible drop in accuracy. In addition to finding smaller, higher-performing network architectures, our method does so more effectively and efficiently than certain pruning or sparsification techniques. Finally, we demonstrate how quantization is complementary to our method and that the size and complexity of the networks we find can be further decreased using quantization. We believe that our work provides a way to automatically create LLMs which can be used on less expensive and more readily available hardware platforms.
- Llama 2: Open foundation and fine-tuned chat models, 2023.
- Llama: Open and efficient foundation language models, 2023.
- Stanford alpaca: An instruction-following llama model. https://github.com/tatsu-lab/stanford_alpaca, 2023.
- Gpt-4 technical report. arXiv preprint arXiv:2303.08774, 2023.
- Bloom: A 176b-parameter open-access multilingual language model. arXiv preprint arXiv:2211.05100, 2023.
- Awq: Activation-aware weight quantization for llm compression and acceleration, 2024.
- Gptq: Accurate post-training quantization for generative pre-trained transformers, 2023.
- Llm-pruner: On the structural pruning of large language models, 2023.
- Slicegpt: Compress large language models by deleting rows and columns, 2024.
- Instatune: Instantaneous neural architecture search during fine-tuning. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 1523–1527, 2023.
- A hardware-aware framework for accelerating neural architecture search across modalities, 2022.
- Lora: Low-rank adaptation of large language models, 2021.
- Think you have solved question answering? try arc, the ai2 reasoning challenge, 2018.
- Measuring massive multitask language understanding, 2021.
- Truthfulqa: Measuring how models mimic human falsehoods, 2022.
- Winogrande: An adversarial winograd schema challenge at scale, 2019.
- Adversarial filters of dataset biases. In International conference on machine learning, pages 1078–1088. Pmlr, 2020.
- Tim Dettmers. bitsandbytes [computer software]. https://github.com/TimDettmers/bitsandbytes, 2024.
- Anthony Sarah (10 papers)
- Sharath Nittur Sridhar (16 papers)
- Maciej Szankin (7 papers)
- Sairam Sundaresan (17 papers)