Skip to main content
Browse Models

Meta

CodeLlama 70B

Released

2023-08-24

Family

Llama 2

Type

Fine-Tuned Model

Downloads

External Download

You are about to open a link to an external source. Verify the URL before continuing.

Download

Instruct model, 4-bit GGUF (Q4_K_M)

GGUF · codellama-70b-instruct.Q4_K_M.gguf

Instruct model, 5-bit GGUF (Q5_K_M)

GGUF · codellama-70b-instruct.Q5_K_M.gguf

Instruct model, 6-bit GGUF (Q6_K)

GGUF · codellama-70b-instruct.Q6_K.gguf

Instruct model, 8-bit GGUF (Q8_0)

GGUF · codellama-70b-instruct.Q8_0.gguf

Ollama Model (q4_K_M)

Ollama

Model Report

Overview

Code Llama 70B is a generative AI model developed by Meta AI for code synthesis, understanding, and related tasks. As part of the Code Llama family, it utilizes large language model technology, building upon the Llama 2 architecture for applications in software engineering and programming assistance. Released in January 2024, Code Llama 70B is accessible for both research and commercial use under a community license. This article presents an in-depth review of its architecture, training techniques, capabilities, benchmarks, and limitations.

Animated demonstration of code debugging.

Figure 1. Code Llama 70B demonstrates live debugging: after receiving a prompt to ‘fix the bug in the code above and explain the fix’, the model provides a corrected Python snippet and a detailed explanation.

Model Architecture and Training

Code Llama 70B is based on a transformer architecture similar to Llama 2, with adaptations for code-centric tasks. The 70B parameter count refers to the number of trainable weights; it is the largest member of the Code Llama suite. Its design emphasizes compatibility with long-context operations, supporting up to 100,000 tokens of input for tasks such as understanding and generating large codebases.

The model family is available in several variants: the foundational Code Llama 70B, a Python-specialized version fine-tuned on extensive Python data, and an instruction-following variant, Code Llama 70B-Instruct, specifically adjusted to interpret and respond to natural language directions in code-related contexts.

Training of Code Llama 70B was conducted on a corpus comprising 1 trillion tokens of code and code-related data, with the Python variant undergoing additional fine-tuning on over 100 billion Python tokens. Instruction-following versions were optimized with datasets pairing natural language instructions with corresponding code outputs, intended to improve the model’s comprehension of developer queries and alignment with user intent, as documented in the Code Llama research paper.

Capabilities: Code Generation and Comprehension

As a generative model, Code Llama 70B produces source code from both natural language and code prompts. Its abilities cover a spectrum of programming tasks, including code generation, code completion, debugging, and the translation of code snippets into natural language explanations. The model is proficient across several programming languages, including Python, C++, Java, PHP, TypeScript, C#, and Bash.

Animated demonstration of code explanation.

Figure 2. Code Llama 70B interprets and explains a Python function, showcasing its ability to generate natural language descriptions from code.

The model’s long-context capability enables it to manage and analyze extended codebases, facilitating applications such as refactoring, documentation generation, and multi-part code reviews. Specialized instruction-tuning further enhances usefulness for scenarios where developers require step-by-step guidance or safe, helpful outputs on programming problems.

Animated demonstration of code summarization.

Figure 3. Using a code snippet as input, Code Llama 70B summarizes the code’s purpose in natural language, reflecting code comprehension skills.

Benchmarks and Performance

Benchmark evaluations place Code Llama 70B as a model with competitive performance among open source models for coding tasks. Its performance has been assessed using widely recognized metrics such as HumanEval and Mostly Basic Python Programming (MBPP). HumanEval measures the accuracy of code completion based on function docstrings, while MBPP evaluates the model’s ability to synthesize correct code from natural language descriptions.

Table of model benchmark results on various coding metrics.

Figure 4. Quantitative comparison of Code Llama models and other large language models on HumanEval, MBPP, and Multilingual HumanEval—demonstrating Code Llama 70B’s competitive coding accuracy.

On these benchmarks, Code Llama 70B-Instruct and Code Llama 70B-Python achieve high scores among open models. For example, the Code Llama 34B parameter variant achieves a 53.7% pass@1 rate on HumanEval and a 56.2% pass@1 on MBPP. The 70B models surpass these metrics, particularly on Python-specific tasks, as outlined in the official benchmark comparisons.

Applications and Model Variants

Code Llama 70B’s versatility supports a variety of programming applications, from software development and code review to educational tools for learning programming concepts. It can function as an assistant within integrated development environments (IDEs), facilitating code completion, real-time debugging, and documentation generation.

The suite comprises several model variants:

  • Code Llama 70B (general coding)
  • Code Llama 70B-Python (fine-tuned for Python tasks)
  • Code Llama 70B-Instruct (instruction-following for natural language queries)

Developers are encouraged to utilize the instruct variants for most use cases involving human interaction, as these versions have been specifically aligned for helpfulness and safety in responding to developer prompts. Base and language-specialized versions are appropriate for tasks that require raw code synthesis or domain-specific expertise.

Earlier models in the Code Llama family, such as Code Llama 7B, Code Llama 13B, and Code Llama 34B parameter models, offer a trade-off between inference speed and code generation ability. These smaller models are useful for low-latency or resource-constrained scenarios, and some include features like fill-in-the-middle (FIM) completion for advanced code editing workflows, as documented in the official GitHub repository.

Limitations, Licensing, and Responsible Use

Code Llama 70B, like other large language models, is subject to inherent limitations including the potential for unpredictable responses and inaccuracies. Its training was centered on English and programming languages, and its performance on non-English or niche codebases may vary. Outputs should be rigorously evaluated and safety testing conducted before deployment in sensitive applications. Data on model robustness and failure modes is detailed in the Code Llama arXiv preprint and associated documentation.

The model is distributed under Meta’s community license, permitting both research and commercial application, provided use adheres to stated guidelines. Developers are encouraged to consult the Responsible Use Guide and Meta’s framework for responsible AI when integrating Code Llama 70B into real-world systems.

Helpful Links

About Llama 2: The Llama 2 family, developed by Meta, comprises large language models ranging from 7 billion to 70 billion parameters, trained on 40% more data than their predecessors and featuring a doubled context length of 4,096 tokens.

More in the Llama 2 Family

Meta /

Llama 2 7B

7 billion parameter version of the 2nd iteration in Meta's Llama series of open source models.
codellama /

CodeLlama 7B

Fine-tuned version of Llama 7b, with training data optimized for code generation and completion tasks.
lmsys /

Vicuna 7B

Llama 7B fine-tuned on 125k GPT-4 conversations, with strong performance in chatbot and instruction following use-cases.
PygmalionAI /

Pygmalion 2 7B

Llama 7B fine-tuned for conversation, roleplaying, and storywriting.
openchat /

OpenChat 3.5 7B

Llama 2 7B fine-tuned using the C-RLFT strategy, with performance surpassing GPT 3.5 on some benchmarks.
Xwin-LM /

Xwin LM 7B

Llama 2 7B fine-tune using numerous emerging techniques including SFT, RM, and RLHF, achieving top results on AlpacaEval.
Meta /

Llama 2 13B

13 billion parameter version of the 2nd iteration in Meta's Llama series of open source models.
Meta /

CodeLlama 13B

Fine-tuned version of Llama 13b, with training data optimized for code generation and completion tasks.
NousResearch /

Nous Hermes 13b

Llama 13b fine-tuned on over 300k curated GPT-4 outputs, known long high-quality outputs.
lmsys /

Vicuna 13B

Llama 13B fine-tuned on 125k GPT-4 conversations, with strong performance in chatbot and instruction following use-cases.
Gryphe /

MythoMax L2

An improved variant of MythoMix (MythoLogic-L2 and Huginn merge) using an experimental tensor-type merge technique. Originally a merge of multiple popular Llama 2 fine-tunes, including Hermes, Chronos, and Airoboros. Very popular for rich descriptions, storywriting, and roleplay.
WizardLM /

WizardLM 13B

Llama 2 13B model fine-tuned to follow complex instructions using the WizardLM training methodology.
PygmalionAI /

Pygmalion 2 13B

Llama 13B fine-tuned for conversation, roleplaying, and storywriting.
PygmalionAI /

Mythalion 13B

Merge of two popular fine-tunes: Pygmalion and Mythomax L2, resulting in a model that is good at roleplaying and instruction-following.
Xwin-LM /

Xwin LM 13B

Llama 2 13B fine-tune using numerous emerging techniques including SFT, RM, and RLHF, achieving top results on AlpacaEval.
Meta /

CodeLlama 34B

Fine-tuned version of unreleased Llama 2 34b, with training data optimized for code generation and completion tasks.
Meta /

Llama 2 70B

70 billion parameter version of the 2nd iteration in Meta's Llama series of open source models.
Xwin-LM /

Xwin 70B

Llama 2 70B fine-tune using numerous emerging techniques including SFT, RM, and RLHF, achieving top results on AlpacaEval.
WizardLM /

WizardLM 70B

Llama 2 70B model fine-tuned to follow complex instructions using the WizardLM training methodology.
NousResearch /

Nous Hermes Llama 2 70B

Llama 2 70B fine-tuned on over 300k curated GPT-4 outputs.

More from Meta

Meta /

LLaMA 7B

A 7-billion parameter transformer language model trained on one trillion tokens from publicly available datasets for natural language processing research.
Meta /

LLaMA 13B

A 13-billion parameter transformer-based language model trained on 1.4 trillion tokens from publicly available datasets, demonstrating competitive performance on various benchmarks.
Meta /

LLaMA 33B

A 32.5 billion parameter transformer-based language model trained on 1.4 trillion tokens of publicly available data with competitive benchmark performance.
Meta /

LLaMA 65B

A 65.2-billion parameter transformer language model trained on 1.4 trillion tokens from publicly available datasets for research applications.
Meta /

Llama 4 Scout (17Bx16E)

A natively multimodal transformer with mixture-of-experts architecture supporting 10 million token context and multilingual text-image understanding capabilities.
Meta /

Llama 4 Maverick (17Bx128E)

Multimodal instruction-tuned model with 17 billion active parameters from 400 billion total, trained on 22 trillion tokens across 200 languages.
Meta /

Llama 3 8B

Large language model with 8 billion parameters featuring transformer architecture, trained on 15 trillion tokens for text generation and coding tasks.
Meta /

Llama 3 70B

State-of-the-art 70B foundation model from Meta, trained on over 15 trillion tokens.
Meta /

Llama 3.1 8B

Llama 3.1 is a new state-of-the-art large language model from Meta.
Meta /

Llama 3.1 70B

The Llama 3.1 series of open models rivals top closed models in performance. It was trained on over 15 trillion tokens using over 16K H100 GPUs. These models display state-of-the-art capabilities in general knowledge, steerability, math, tool use, and translation.
Meta /

Llama 3.2 3B

The next iteration in the Llama series of open models. This lightweight model was designed to run on edge devices, even mobile.
Meta /

Llama 3.3 70B

Llama 3.3 is a text-only 70B instruction-tuned model that provides enhanced performance relative to Llama 3.1 70B and to Llama 3.2 90B when used for text-only applications. For some applications, Llama 3.3 70B approaches the performance of Llama 3.1 405B.
Meta /

MusicGen

MusicGen is a text-to-music autoregressive transformer model capable of generating music samples conditioned on text descriptions or audio prompts.
Meta /

Magnet

Magnet is a single-stage, non-autoregressive transformer model for text-to-music and text-to-audio generation, with faster generation that MusicGen.
Meta /

Seamless

Seamless is a MMMMT (Massively Multilingual and Multimodal Machine Translation) model that can translate and generate audio in over 100 languages.