Skip to main content
Browse Models

Google

CodeGemma 1.1 7B

Released

2024-04-30

Family

Gemma 1

Type

Foundation 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 · codegemma-1.1-7b-it-Q4_K_M.gguf

Instruct model, 5-bit GGUF (Q5_K_M)

GGUF · codegemma-1.1-7b-it-Q5_K_M.gguf

Instruct model, 6-bit GGUF (Q6_K)

GGUF · codegemma-1.1-7b-it-Q6_K.gguf

Instruct model, 8-bit GGUF (Q8_0)

GGUF · codegemma-1.1-7b-it-Q8_0.gguf

Ollama Model (q4_K_M)

Ollama

Model Report

Overview

CodeGemma 1.1 7B is an open large language model focused on code generation and understanding, developed by the CodeGemma Team at Google LLC. Building upon Google's Gemma model family, CodeGemma specializes in programming tasks such as code completion, infilling, and explanation, while preserving natural language and mathematical reasoning abilities. The 1.1 update, released in May 2024, incorporates changes that relate to model quality and robustness.

Model Architecture and Training

CodeGemma 1.1 7B is based on the architecture of the original Gemma models, adapting their design for enhanced code understanding and code synthesis. Like its predecessors, CodeGemma utilizes the Transformer architecture, optimized for both language and programming-specific challenges.

The training corpus for the 7B variant consists of a mixture of approximately 80% code and 20% natural language, sourced primarily from deduplicated, filtered, publicly available code repositories and technical documents. CodeGemma 1.1 leverages over 500 billion tokens of text for pretraining, combining data on programming languages, mathematics, and general language. Instruction tuning is accomplished using open-source mathematics datasets such as MATH, GSM8K, and MathQA, as well as synthetically generated code and question-answer pairs post-filtered by large language models for correctness.

Notably, the CodeGemma models employ an advanced "Fill-in-the-Middle" (FIM) pretraining objective, which improves the model's ability to generate or fill in missing sections of code given partial context. Multi-file and repository-level heuristics during training further enable CodeGemma to reason about dependencies and broader codebases, mimicking real-world development environments.

Features and Capabilities

Central to CodeGemma 1.1 7B are its code generation and completion capabilities. The model can synthesize functions, complete docstrings, suggest imports, or fill in code sections, according to the user's prompt. Its FIM training enables effective support for tasks where code fragments are missing or need to be completed within a larger file, using specialized control tokens to demarcate code sections. These tokens, such as <|fim_prefix|>, <|fim_middle|>, and <|fim_suffix|>, allow the model to work with both prefix-suffix-middle (PSM) and suffix-prefix-middle (SPM) formats.

Instruction-tuned versions offer enhanced performance on guided and open-ended tasks, with improved abilities for reasoning and following user instructions. CodeGemma preserves a substantial degree of natural language competence inherited from the base Gemma models, enabling it to explain code, process mixed queries, and handle mathematical reasoning challenges. The addition of multi-file packing and training on repository-level context helps the model operate effectively in settings common to real-world software engineering, such as integrated development environments (IDEs).

Evaluation and Benchmarks

Extensive benchmarking demonstrates the performance of CodeGemma 1.1 7B across standard code evaluation datasets. On Python programming benchmarks such as HumanEval and MBPP, CodeGemma 1.1 7B achieves Python HumanEval scores up to 60.4%, outpacing earlier versions and comparable models of similar scale. The 7B instruction-tuned (IT) variant demonstrates particularly strong results, with robust performance across multi-language settings recorded on datasets such as BabelCode, which tests the model’s proficiency in languages including C++, Java, JavaScript, Kotlin, Python, and Rust.

The model’s FIM-aware design is also evaluated with benchmarks targeting code infilling scenarios. Here, CodeGemma exhibits competitive latency and quality, especially in low-latency environments where inference time is critical. For code completion involving both single-line and multi-line infills, CodeGemma compares favorably to other open models such as DeepSeek Coder, StarCoder2, and Code Llama, maintaining high performance and practical response times.

Beyond code synthesis, CodeGemma's natural language abilities remain strong. The 7B instruction-tuned models surpass competitive LLMs, such as Mistral 7B and Llama-2 13B, by notable margins in general language capability. Additionally, on mathematical reasoning tasks using datasets like GSM8K and MATH, CodeGemma 1.1 7B shows advancement over earlier open code LLMs, benefiting from targeted fine-tuning with synthetic and curated mathematical data.

Applications and Use Cases

Owing to its coding proficiency, CodeGemma 1.1 7B is tailored for a range of programming and development scenarios. Its moderate size balances model quality and efficiency, making it suited for integration within software IDEs, local analysis tools, or collaborative development environments. The model supports tasks including code completion, generation, documentation, and repository-level understanding, assisting in both learning and professional engineering workflows.

The model's multi-language coverage and fill-in-the-middle training extend its utility beyond isolated code synthesis. It can be deployed for automated code review, assisting with bug fixes, generating explanations for code snippets, or optimizing existing codebases. The natural language processing capabilities further allow users to issue mix-typed queries that blend code and descriptive instructions, enhancing versatility in daily development tasks.

Model Usage and Prompt Formatting

Successful use of CodeGemma 1.1 7B hinges on effective prompt formatting. For code completion, infilling, or function generation, users are encouraged to employ FIM control tokens in their prompts—such as placing relevant file paths and data within <|fim_prefix|>, <|fim_middle|>, and <|fim_suffix|> sections. For instruction-tuned models, conversational turns should be delineated with &lt;start_of_turn&gt; and &lt;end_of_turn&gt; tokens, aligning with conventions of the broader Gemma family. Output generation can be managed by truncating results when a FIM sentinel token is reached, a straightforward approach for integration into automated tools.

Limitations and Licensing

While CodeGemma 1.1 7B offers a strong balance of language and coding capability, its memory requirements are greater than lightweight models (such as the 2B variant), particularly during inference and interaction with extensive codebases. This can make it less optimal for highly memory-constrained settings, though it remains practical for locally hosted development or research.

As with all open large language models, general limitations apply, including possible errors, incomplete generalization, or outdated knowledge—considerations discussed in the Responsible Deployment section of the Gemma research paper.

CodeGemma is released as an "open code model" with its architecture, weights, and documentation made publicly available by Google. The license terms permit scientific use and research, although specific conditions should be confirmed in the associated model documentation.

Helpful Links

About Gemma 1: The Gemma 1 family consists of lightweight, open-source AI models developed by Google, available in 2B and 7B parameter sizes, designed to deliver state-of-the-art performance in language understanding and reasoning tasks while being efficient enough to run on devices with limited resources, such as laptops and desktops.

More from Google

Google /

Gemma 2 9B

A 9-billion parameter decoder-only transformer model trained on 8 trillion tokens, designed for text generation and natural language processing tasks.
Google /

Gemma 2 27B

Open model from Google built from the same research and technology used to create the Gemini models. Well-suited for a variety of text-generation tasks, including question answering, summarization, and reasoning.
Google /

Gemma 3 1B

A 1 billion parameter multimodal transformer model trained on 2 trillion tokens with 32,000 token context window supporting text and image processing.
Google /

Gemma 3 4B

A 4.3 billion parameter multimodal transformer model that processes text and images, supports 128K token contexts, and operates across 140+ languages.
Google /

Gemma 3 12B

A 12-billion parameter multimodal transformer that processes text and images, supporting 140+ languages with 128,000-token context length.
Google /

Gemma 3 27B

A 27-billion parameter multimodal model processing text and image inputs with 128K context length and SigLIP vision encoder integration.
Google /

Gemma 3n E2B

A 2-billion-parameter multimodal transformer supporting text, images, audio, and video with memory-efficient architecture optimized for resource-constrained devices.
Google /

Gemma 3n E4B

Multimodal text generation model with 4 billion effective parameters, optimized for mobile deployment using MatFormer architecture and elastic inference capabilities.