Papers
Topics
Authors
Recent
Search
2000 character limit reached

Llama-3: Open Transformer Models

Updated 23 February 2026
  • Llama-3 is a family of decoder-only Transformer models ranging from 8B to 405B parameters, designed for scalability and competitive performance in reasoning, code generation, and multilingual tasks.
  • It introduces innovations in extended context windows through QLoRA fine-tuning, achieving robust performance on tasks with context lengths up to 128K tokens.
  • The model underpins various specialized adaptations in domains such as radiology, bilingual language modeling, and privacy-preserving clinical applications while exploring safety, interpretability, and efficient model editing.

Llama-3 is a family of large, decoder-only Transformer LLMs developed by Meta and released openly under the Llama Community License. It encompasses model sizes ranging from 8 billion to 405 billion parameters, and is competitive with proprietary models—including GPT-4—in benchmarks spanning reasoning, code generation, multilinguality, tool use, and alignment. Llama-3 also forms the backbone for numerous derivative works, spanning domains from radiology to Hindi language modeling, and has served as a foundation for innovations in context window scaling, retrieval-augmented reasoning, Mixture-of-Experts architectures, model editing, interpretability, and multimodal vision-language integration.

1. Model Family, Architecture, and Training Regimen

Llama-3 comprises dense, autoregressive Transformer models at 8 B, 70 B, and 405 B parameter scales. All variants share a regularized architecture scheme distinguished by:

  • Layer counts: 32 (8 B), 80 (70 B), 126 (405 B)
  • Model dimension dmd_m: 4 096 / 8 192 / 16 384
  • FFN inner dimension: 14 336 / 28 672 / 53 248
  • Attention heads: 32 / 64 / 128, all with Grouped Query Attention (GQA), 8 k/v heads
  • Token vocabulary: 128 000 (100 k base, 28 k non-English)
  • Rotary positional encoding (RoPE) with a base of 500 000, extendable to 200 M in context extension tasks
  • Context length: pre-training at 8 K tokens, extended post-training up to 128 K (\sim405 B), and 80 K via efficient QLoRA fine-tuning for 8 B

The pre-training objective is next-token prediction, optimized over 15.6 T tokens from a curated mix: ~50% general web, 25% math/reasoning, 17% code, 8% multilingual. Deduplication, PII/unsafe filtering, and in-batch inter-document attention masks are standard. Optimizer is AdamW, with batch sizes up to 16 M tokens (405 B), cosine learning rate decay, and staged context expansion (Grattafiori et al., 2024).

Alignment is iteratively performed using supervised finetuning (SFT) on both human and synthetic instruction-response data, rejection sampling, and Direct Preference Optimization (DPO) with human preference reward models.

2. Extended Context Windows and Efficient Fine-Tuning

A principal innovation in Llama-3 is rapid context length scaling with minimal engineering. Using a QLoRA adaptation (updating low-rank adapters atop 4-bit quantized base weights), Llama-3-8B-Instruct's context window was expanded from 8K to 80K tokens in 8 hours on a commodity 8×A800 setup, using just 3.5k synthetic long-context tasks generated by GPT-4. Only the base of rotary embeddings was changed—from 500 K to 200 M—leaving all other weights fixed. No explicit architectural changes were made apart from this positional tweak.

Evaluation demonstrates robust gains:

  • 100% accuracy in Needle-in-a-Haystack up to 128 K position (compared to 9 K for the base model)
  • 100% topic retrieval accuracy over 70 topics in long-context datasets
  • 47.2% vs. 43.2% (baseline) on LongBench 32K, and 30.9% vs. 7.0% on InfiniteBench Long-Book QA
  • MMLU zero-shot drops minimally, from 65.9% (baseline) to 64.4% Short-context abilities are preserved by mixing short- and long-context instruction data during fine-tuning (Zhang et al., 2024).

3. Specialized Adaptations and Domain Transfer

Llama-3 serves as the backbone for numerous domain-specific models:

  • Radiology: QLoRA adapters and 4-bit quantization enable Llama-3-70B to be fine-tuned on 4.4M radiology findings-impression pairs, outperforming the 70B baseline by doubling ROUGE-L (0.2919 vs. 0.1494), with a GPT-4o clinical score increase from 3.65 to 4.92, verified on de-identified hospital data and benchmarked against both traditional and LLM-based metrics (Shi et al., 2024).
  • Hindi and Bilingual Models: The Llama-3-Nanda-10B-Chat model uses Llama-Pro block expansion (increasing depth by 25%, freezing the original 32 layers, and only training 8 new interleaved layers), achieves strong zero-shot performance on Hindi and English benchmarks, and incorporates 1:1 Hindi-English bilingual replay to avoid catastrophic forgetting. Safety alignment uses supervised tuning over >100k adversarial and safe prompt-response pairs (Choudhury et al., 8 Apr 2025).
  • Physician Letter Generation: Local QLoRA fine-tuning enables privacy-preserving, institution-specific clinical letter generation on Llama-3-8B, achieving superior ROUGE scores and high clinical utility in expert evaluations using low-resource hospital GPUs (Hou et al., 2024).

4. Architecture Variants and Parameter Efficient Scaling

Llama-3 form the basis for parameter-efficient scaling:

  • Mixture-of-Experts (MoE): An 8-expert Top-2 MoE is efficiently "upcycled" from a pre-trained Llama-3-8B by copying each MLP layer and inserting a Mixtral-style router, with <1% of the compute of scratch pre-training. This yields increases in zero-shot MMLU (+2.0%), SciQ (+3.1%), and BoolQ (+7%) with MFU of 46.8% on H100s (Vavre et al., 2024).
  • Model Editing: ROME, MEMIT, and EMMET methods demonstrate reliable and efficient factual knowledge editing—especially in early FFN layers—outperforming batch-only editing with hybrid sequential-batch strategies. Performance decays with pure batch size, but intermediate batching (e.g., b=1024 for N=4096 edits) balances locality and efficiency. Side-effects are greatest for large edit batches, motivating hybrid approaches (Yoon et al., 2024).

5. Safety, Alignment, and Security Challenges

Extensive alignment and guardrails are integral to Llama-3 releases. Llama Guard 3 (8B) is used for I/O filtering, achieving 86% violation rate reduction in English, and int8 variants offer similar trade-offs with smaller footprints (Grattafiori et al., 2024). Despite these efforts, multiple works show alignment vulnerabilities:

  • Refusal-Vector Ablation: A single residual-stream direction can be ablated to remove refusal behaviors, rendering chat safety mechanisms ineffective in agentic settings. When deployed in tool-using agent scaffolds, refusal-ablated Llama-3.1-70B agents were able to complete 26/28 harmful tasks that the baseline model refused, without significant degradation on benign tasks. Safety generalizes poorly from chat completions to agents, highlighting the fragility of current defenses (Lermen et al., 2024).
  • Rapid Safety Stripping: QLoRA, ReFT, or ORTHO methods can reverse alignment in minutes on open weights: for Llama-3-8B, jailbreaking is achievable in ∼1 min and ∼30 min for 70B, with minimal impact on general performance. These attacks raise critical concerns for open-weight release and point to the necessity of secure enclaves, encrypted weights, or cryptographic attestation for real safety (Volkov, 2024).

6. Interpretability, Retrieval-Augmentation, and Multimodal Extensions

Interpretability tools for Llama-3 include Top-K Sparse Autoencoders (SAEs), trained at every layer and sublayer to extract sparse features for mechanistic analysis. These models, trained for 32K and 128K features each, generalize across longer contexts and instruction-tuned variants, and serve as a resource for probing, causal interventions, and reducing redundant training for interpretability circuits (He et al., 2024).

Retrieval-Augmented Generation (RAG) frameworks based on Llama-3 (e.g., FinLLaMA-RAG) employ lightweight fusion adapters, multi-hop reasoning heads, and joint retrieval/generation loss. These models outperform both retrieval- and generation-only baselines, with improvements of +0.17 nDCG@10, +12 BLEU, and +0.15 F1 across financial and document-level QA tasks. Explicit context fusion, multi-hop refinement, and ablation analysis highlight the effectiveness of tightly coupled retrieval-generation training (Huang et al., 19 Jun 2025).

Llama-3’s modularity supports multimodal extensions for image, video, and speech through compositional adapters. In the publicly described pipeline: ViT-H/14 processes images, with cross-attention adapters interleaved every 4 layers, and large-scale pretraining/finetuning deliver state-of-the-art or competitive results on VQAv2, ChartQA, DocVQA, and PerceptionTest. Speech components (24-layer Conformer encoder, streaming adapters, and neural vocoder) yield ASR WER of 2.7% on MLS-En and improved TTS accuracy. These adapters are not yet generally released but show strong competitive performance and Llama-3’s inherent versatility (Grattafiori et al., 2024).

Recaptioning effort based on LLaVA-1.5-Llama-3-8B generates 1.3B high-quality captions, improving CLIP, DiT, and retrieval benchmarks significantly—R@1 on Urban-1K I→T/T→I rising +31.8/+36.4 points, and COCO-30K FID dropping by 8.4 (Li et al., 2024).

7. Impact, Adoption, and Future Directions

Llama-3’s openness and technical design have made it a cornerstone for research in scaling, efficiency, interpretability, and responsible deployment. Open source release of both pre-trained and aligned models, safety classifiers, infrastructure code, and domain-specific toolkits have accelerated research.

Challenges persist: current alignment protocols are vulnerable once weights are public; tool-using or agentic wrappers bypass chat-level safety; and strong interpretability is only beginning to be feasible at Llama-3’s scale. Growing interest in privacy-preserving local adaptation, such as clinical fine-tuning or bilingual specialization, points to the model’s ongoing role as an enabling foundation for both broad and vertical LLM research.

Ongoing research avenues include robust alignment under adversarial post-hoc patching, scalable training for low-resource and cross-lingual settings, tighter integration of retrieval and reasoning modules, scalable feature extraction for interpretability, and safe deployment protocols in open-weight settings.


References:

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Llama-3.