Gemma Tounsi Alpha

An experimental QLoRA adapter exploring Tunisian Arabic with Gemma 3 27B IT.

Release stage: Alpha
Artifact: PEFT adapter (not a standalone model)
Base model: google/gemma-3-27b-it

Overview

Modification notice: This repository distributes a QLoRA adapter derived from and modifying Google's Gemma 3 27B IT model. It is an independent community project and is not an official Google product or endorsed by Google.

Gemma Tounsi Alpha is an experimental parameter-efficient fine-tuning (PEFT) adapter built on Google's Gemma 3 27B instruction-tuned model.

The project explores adapting Gemma's conversational behavior to better handle Tunisian Arabic (Derja), including the varied ways people write it: Arabic script and Arabizi (Tunisian Arabic written with Latin characters and numerals).

This is an early-stage release intended for testing, feedback, and further development. It should not be treated as a fully evaluated or production-ready Tunisian Arabic model. No claim of improvement over the untouched base model is made without comparative evaluation.

Model details

Field Details
Model name Gemma Tounsi Alpha
Model type QLoRA / LoRA adapter
Base model google/gemma-3-27b-it
Base architecture Gemma 3 27B IT
Main target Tunisian Arabic (Derja)
Writing forms of interest Arabic script and Arabizi
Adapter format PEFT
PEFT version recorded in the original model card 0.21.3
Release stage Alpha / experimental

Intended use

Gemma Tounsi Alpha is intended for:

  • Experimenting with Tunisian Arabic conversations and text generation.
  • Exploring how a general-purpose instruction model can be adapted to local dialect and writing conventions.
  • Research, prototyping, qualitative testing, and community feedback.

For reliable use, load the adapter on top of its required base model and evaluate outputs for the target task and audience.

Out-of-scope use

This release is not validated for high-stakes decisions or as a sole source of advice in medical, legal, financial, safety-critical, or other consequential settings. It should not be used to generate or facilitate harmful, unlawful, deceptive, or discriminatory content.

Important limitations

  • Alpha quality: behavior may be inconsistent, incomplete, or incorrect.
  • Dialect coverage: Tunisian Arabic varies by region, speaker, age, and context. This adapter should not be assumed to represent every variety.
  • Arabizi variation: spelling is not standardized; the same word may be written in several ways.
  • Code-switching: performance may vary when Tunisian Arabic is mixed with French, English, or Modern Standard Arabic.
  • No published benchmark: this release does not include verified benchmark results or a controlled comparison against the original Gemma 3 27B IT model.
  • Base-model dependency: the adapter does not contain the full base model and cannot be used on its own.
  • Generative-model risks: outputs may contain factual errors, stereotypes, or inappropriate responses. Review outputs before relying on or sharing them.

Files in this repository

The repository distributes the adapter and supporting files, including:

  • GEMMA_TERMS_OF_USE.md โ€” a copy of the applicable Gemma Terms of Use.

  • NOTICE โ€” the notice required by the Gemma Terms of Use.

  • MODIFICATIONS.md โ€” a summary identifying this repository's Gemma-derived modifications.

  • adapter_config.json โ€” adapter configuration.

  • adapter_model.safetensors โ€” trained adapter weights.

  • tokenizer.json and tokenizer_config.json โ€” tokenizer assets supplied with this release.

  • special_tokens_map.json โ€” special-token configuration.

  • chat_template.jinja โ€” chat template supplied with this release.

The full Gemma 3 27B base-model weights are not included. Training-resume files such as optimizer state, scheduler state, random-number-generator state, and trainer state are not required for ordinary inference and are not part of the intended model release.

Getting started

1. Prerequisites

You need:

  1. Access to google/gemma-3-27b-it on Hugging Face, subject to Google's access conditions.
  2. A compatible installation of PyTorch, Transformers, Accelerate, and PEFT.
  3. Hardware with sufficient memory to load the 27B base model. The example below loads the base model without specifying a quantization configuration; use a suitable quantized loading setup if your hardware cannot accommodate it.

Install the core libraries:

pip install -U transformers peft accelerate

2. Load the adapter

The example below uses the Gemma 3 27B Transformers model class and the PEFT loader. Replace YOUR_HF_USERNAME with the Hugging Face account that hosts this repository.

import torch
from peft import PeftModel
from transformers import AutoProcessor, Gemma3ForConditionalGeneration

BASE_MODEL_ID = "google/gemma-3-27b-it"
ADAPTER_ID = "YOUR_HF_USERNAME/gemma-tounsi-alpha"

processor = AutoProcessor.from_pretrained(BASE_MODEL_ID)

base_model = Gemma3ForConditionalGeneration.from_pretrained(
    BASE_MODEL_ID,
    torch_dtype="auto",
    device_map="auto",
)

model = PeftModel.from_pretrained(base_model, ADAPTER_ID)
model.eval()

messages = [
    {
        "role": "user",
        "content": [
            {"type": "text", "text": "ุนุณู„ุงู…ุฉุŒ ุดู†ูŠุฉ ุฃุญูˆุงู„ูƒุŸ"}
        ],
    }
]

inputs = processor.apply_chat_template(
    messages,
    tokenize=True,
    return_dict=True,
    return_tensors="pt",
    add_generation_prompt=True,
).to(model.device)

with torch.inference_mode():
    output_ids = model.generate(**inputs, max_new_tokens=128)

print(processor.decode(output_ids[0], skip_special_tokens=True))

Compatibility note: use a Transformers version that supports Gemma 3. The model class and target modules must match the architecture used when the adapter was trained. If your training configuration used a different Gemma 3 model class, follow that configuration when loading the adapter.

Training information

The adapter was produced using QLoRA, a quantized-base-model approach to parameter-efficient fine-tuning. The project training workflow used the Soup training stack, with PEFT used for adapter handling.

The following details are not fully documented in this release and are therefore not reported as facts here:

  • Training dataset names, provenance, exact composition, and total example/token counts.
  • LoRA rank, alpha, dropout, target modules, and quantization configuration.
  • Learning rate, optimizer settings, batch size, gradient accumulation, sequence length, and number of epochs or steps.
  • Exact hardware, runtime, and compute cost.

These details should be added when verified against the final training configuration and logs.

Evaluation

No formal evaluation results are published with this Alpha release. Before drawing conclusions about its performance, compare it with the unmodified google/gemma-3-27b-it model using the same prompts, decoding settings, and a held-out evaluation set.

Useful evaluation dimensions include:

  • Understanding of Tunisian Arabic across common regional and conversational forms.
  • Generation quality in Arabic script and Arabizi.
  • Robustness to spelling variation and French/English code-switching.
  • Instruction following, factuality, and response consistency.
  • Regression on general capabilities retained from the base model.

Evaluation results should include the test-set source, sample count, scoring method, and limitations.

Licensing and distribution

Gemma Tounsi Alpha is an adapter derived from Google's Gemma model. Its distribution and use are subject to the Google Gemma Terms of Use. This model card does not replace those terms or grant rights to the underlying Gemma model.

Before distributing this adapter, ensure the repository and the distribution process satisfy the Gemma Terms of Use, including the requirements to:

  • provide recipients with a copy of the Gemma Terms of Use;
  • communicate the applicable use restrictions to recipients;
  • place prominent modification notices on modified files; and
  • include a NOTICE text file containing the exact notice required by the current terms:
Gemma is provided under and subject to the Gemma Terms of Use found at gemma.ai/resources/terms

A copy of the current terms is included as GEMMA_TERMS_OF_USE.md. The applicable use restrictions are described in Section 3.2 of those terms. Recipients must review and comply with them.

Do not describe this adapter as being independently licensed under MIT, Apache-2.0, or another permissive license unless that statement has been reviewed for consistency with the Gemma Terms of Use.

Acknowledgements

Gemma Tounsi Alpha builds on Google's Gemma 3 27B IT and the Hugging Face PEFT ecosystem.

Contributors

Gemma Tounsi Alpha is a collaborative AI engineering project developed by two engineering students in Tunisia.

Contributor Institution Contribution
Mohamed Bensaad National Engineering School of Carthage, Tunisia Project leadership, model development, and QLoRA fine-tuning
Haithem Nasr National Engineering School of Sousse, Tunisia Collaborative research and project development

We believe in building open AI technologies that better represent Tunisia's linguistic identity and contribute to the development of the Tunisian AI ecosystem.

Built collaboratively in Tunisia. ๐Ÿ‡น๐Ÿ‡ณ

Feedback

Feedback, reproducible examples, and evaluation results are welcome. Please clearly identify the prompt, expected behavior, observed output, and software versions when reporting an issue.

Downloads last month
34
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for med-bsd/gemma-tounsi-alpha

Adapter
(290)
this model