Llama 3 on Your Local Computer | Free GPT-4 Alternative

· Source: Martin Thissen · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Software Development & Engineering · Depth: Intermediate, extended

Summary

Meta has released the Llama 3 model, available in 8 billion and 70 billion parameter variants, demonstrating a 10% relative improvement over Llama 2. The 8 billion Llama 3 model can sometimes outperform the Llama 2 70 billion model. Key improvements include an increased context size from 4,000 to 8,000 tokens and training on 15 trillion tokens, seven times more than Llama 2, with four times more code data. Architectural changes are minimal, primarily a new tokenizer with a 128,000-token vocabulary (four times larger than Llama 2's 32,000) and the inclusion of Group Query Attention in the 8 billion variant. These changes enhance token efficiency by up to 15% and maintain inference speed despite increased parameters. The training data, though closed source, includes over 5% high-quality non-English data covering 30+ languages. Meta also developed scaling laws for optimal data mix and utilized advanced instruction fine-tuning techniques like rejection sampling, PPO, and DPO, emphasizing high-quality prompt data.

Key takeaway

For AI Engineers deploying large language models locally, consider Llama 3's 4-bit quantized versions to maximize performance within your GPU's VRAM constraints. The 70 billion parameter model, when 4-bit quantized, requires approximately 37 GB of VRAM, making it accessible on GPUs like the RTX 6000 Ada. Utilize the vLLM library for significantly faster inference speeds compared to standard methods, ensuring a responsive user experience for your applications.

Key insights

Llama 3 achieves significant performance gains through extensive training data, an improved tokenizer, and advanced fine-tuning.

Principles

Method

Llama 3's improvement pillars include a refined tokenizer, 15 trillion tokens of pre-training data, scaling laws for data mix optimization, and instruction fine-tuning with supervised learning, rejection sampling, PPO, and DPO.

In practice

Topics

Best for: Machine Learning Engineer, Deep Learning Engineer, AI Engineer

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by Martin Thissen.