google/gemma-7b

  • Modal Card
  • Files & version

Model Card for Gemma 7B Base

Table of Contents

TL;DR

Gemma 7B Base is part of Google’s open model family designed for general-purpose text generation tasks. With 8.54 billion parameters, this model is built for versatility and can be deployed across various platforms, enabling powerful text generation capabilities on devices with constrained resources.


Model Details

Model Information

  • Model Type: Text-to-text, decoder-only large language model
  • Language(s): Primarily English
  • License: Terms of Use available on the Gemma model page
  • Related Models: Gemma 2B Base, Gemma 2B Instruct, Gemma 7B Instruct

Usage

Inputs and Outputs

  • Input: Text string (e.g., a question, prompt, or document to summarize)
  • Output: Generated English text in response to the input, such as an answer or summary

Fine-tuning

Gemma 7B Base can be fine-tuned using provided scripts and notebooks for Supervised Fine-Tuning (SFT) on datasets like UltraChat. Users can adapt these scripts to enhance the model's performance on domain-specific tasks.

Hardware Compatibility

Supports various deployment environments, including CPU-only and multi-GPU setups. Quantization options (e.g., 8-bit and 4-bit) are available for enhanced performance on resource-constrained devices.


Uses

Direct Use and Downstream Use

Gemma 7B Base is ideal for:

  • Text Generation: Generating diverse formats, including poems, scripts, and marketing copy.
  • Summarization: Condensing lengthy documents or articles.
  • Question Answering: Providing responses to various queries.
  • Conversational AI: Supporting chatbots and virtual assistants.

Bias, Risks, and Limitations

Ethical Considerations and Risks

While the model provides general-purpose language capabilities, it may inherit biases from training data, leading to unintended outputs. Potential misuse could lead to the generation of biased or harmful content.

Known Limitations

  • Data Bias: Outputs may reflect biases present in the training data.
  • Context Handling: Performance might degrade with longer or highly complex inputs.
  • Factual Reliability: Not guaranteed to provide accurate or up-to-date information.

Training Details

Training Dataset

Gemma models are trained on a diverse dataset totaling 6 trillion tokens, including:

  • Web Documents: Exposure to a wide range of linguistic styles and topics.
  • Code: Familiarity with programming syntax, enabling code generation and comprehension.
  • Mathematics: Enhanced logical reasoning capabilities for handling mathematical queries.

Data Preprocessing

Data preparation involved multiple filtering stages for quality and safety:

  • CSAM Filtering: Rigorous filtering to exclude illegal content.
  • Sensitive Data Filtering: Removal of personal and sensitive data.
  • Quality Filtering: Ensuring high-quality content for model training.

Hardware and Software

  • Hardware: Trained on TPUv5e, optimized for efficient large-scale computations.
  • Software: Utilized JAX and ML Pathways, simplifying the development and deployment workflow.

Evaluation

Benchmark Results

Gemma 7B Base has been evaluated on a variety of benchmarks to assess performance across text generation, comprehension, and reasoning tasks.

BenchmarkMetricGemma 2B BaseGemma 7B Base
MMLU5-shot, top-142.364.3
HellaSwag0-shot71.481.2
PIQA0-shot77.381.2
TriviaQA5-shot53.263.4
CommonsenseQA7-shot65.371.3
GSM8Kmaj@117.746.4
Average45.056.9

Ethics and Safety

Evaluation Approach

Gemma models were rigorously tested through structured evaluations, including human assessments on content safety, representational harms, and data memorization risks.

Evaluation Results

The 7B Base model met ethical standards, showing acceptable performance in established safety benchmarks.

BenchmarkMetricGemma 2B BaseGemma 7B Base
RealToxicityAverage6.867.90
BBQ Ambig1-shot, top-162.5892.54
WinogenderTop-151.2554.17
TruthfulQAAverage44.8431.81
ToxigenTop-129.7739.59

Intended Usage and Limitations

Intended Usage

Gemma models are designed for a range of applications, such as:

  • Content Creation: Producing text for creative and business needs.
  • Educational Tools: Assisting in grammar correction, summarization, and exploratory research.
  • Conversational AI: Enhancing customer service interactions.

Limitations

  • Bias: Outputs may reflect inherent socio-cultural biases in training data.
  • Complexity Handling: Performance may vary with highly intricate prompts.
  • Accuracy: Outputs are generated based on statistical patterns, which may limit factual precision.

Benefits

Gemma models offer powerful, open-access language capabilities with a focus on responsible and democratized AI. Their high-performance metrics position them as competitive solutions among similarly sized models.


Citation

If you use Gemma in your research, please cite:

```bibtex @misc{https://doi.org/10.48550/arxiv.2210.11416, doi = {10.48550/ARXIV.2210.11416}, url = {https://arxiv.org/abs/2210.11416}, author = {Google AI}, title = {Gemma 7B: Base Model for General AI Tasks}, publisher = {arXiv}, year = {2023}, keywords = {Machine Learning (cs.LG), Computation and Language (cs.CL)}, copyright = {Creative Commons Attribution 4.0 International} }