Model Card for Model ID
gemma-3n-e2b-it-unsloth-bnb-4bit model LoRA finetuned for ASR task on Common Voice Scripted Speech 24.0 - Hungarian.
- Developed by: GaborMadarasz
- License: apache-2.0
- Finetuned from model : unsloth/gemma-3n-e2b-it-unsloth-bnb-4bit
Metrics
| Model | WER ↓ | CER ↓ |
|---|---|---|
| Base Gemma-3n | 1.3391 | 0.7731 |
| LoRA fine-tuned model | 0.1485 | 0.0302 |
Lower is better.
Prompt Configuration
The best evaluation results were obtained using the following prompt setup, which was kept consistent across all measurements.
messages = [
{
"role": "system",
"content": [
{
"type": "text",
"text": "You are an assistant that transcribes hungarian speech accurately."
}
],
},
{
"role": "user",
"content": [
{"type": "audio", "audio": audio_array},
{"type": "text", "text": "Please transcribe this hungarian audio."}
],
},
]
Where audio_array: sampling rate: 16000 Hz, mono=True, dtype: float32
Evaluation Setup
The model was evaluated on a held-out test set consisting of 200 samples from Common Voice Scripted Speech 24.0 - Hungarian dataset. Each sample contains a 16 kHz mono audio waveform and a verbatim Hungarian text transcription.
Evaluation was performed in inference-only mode with deterministic decoding (do_sample=False) and a fixed generation budget.
Base model: unsloth/gemma-3n-E2B-it Fine-tuning method: LoRA (parameter-efficient fine-tuning) Task: Automatic Speech Recognition (Hungarian) Metrics: Word Error Rate (WER), Character Error Rate (CER)
Interpretation
The base Gemma-3n model performs poorly on Hungarian ASR, with a WER greater than 1.0, indicating that the number of word-level errors exceeds the number of reference words. This confirms that the pretrained model is not suitable for ASR out of the box, particularly for Hungarian.
After LoRA fine-tuning, the model shows a substantial performance improvement, achieving:
an absolute WER reduction of 1.19
a ~9× relative improvement in WER
a ~25× relative improvement in CER
The low CER (3.02%) indicates strong character-level alignment with the audio signal, suggesting that remaining errors are primarily due to word segmentation, morphology, or minor lexical substitutions rather than acoustic misrecognition.
Comparison to Common ASR Baselines
On similar Hungarian ASR benchmarks, the fine-tuned model’s performance is comparable to:
Whisper small to medium models in terms of WER
traditional encoder–decoder ASR systems trained on medium-sized supervised datasets
This is notable given that the underlying architecture is a multimodal large language model, not a conventional ASR model with frame-level alignment or CTC-based training.
Limitations
Evaluation was conducted on a single in-domain test split; results may not generalize to other domains, speakers, or recording conditions.
Punctuation and casing were normalized prior to scoring.
The model is optimized for Hungarian speech; performance on other languages was not evaluated.
Training Procedure
LoRA config:
finetune_vision_layers = False,
finetune_language_layers = True,
finetune_attention_modules = True,
finetune_mlp_modules = True,
r = 16,
lora_alpha = 16,
lora_dropout = 0.01,
bias = "none",
random_state = 3407,
use_rslora = False,
loftq_config = None,
target_modules = [
"q_proj", "k_proj", "v_proj", "o_proj",
"gate_proj", "up_proj", "down_proj",
Audio layers
"post", "linear_start", "linear_end",
"embedding_projection",
],
Text Generation Capability
In addition to strong ASR performance, the LoRA fine-tuned Gemma-3N model retains high-quality general text generation abilities.
The model was evaluated in a text-only setting using the standard chat template and stochastic decoding.
Inference Setup
messages = [{
"role": "user",
"content": [
{"type": "text", "text": "Mit gondolsz a Gemma-3N-ről?"}
]
}]
inputs = processor.apply_chat_template(
messages,
add_generation_prompt=True,
return_tensors="pt",
tokenize=True,
return_dict=True,
).to("cuda")
from transformers import TextStreamer
_ = model.generate(
**inputs,
max_new_tokens=1024,
temperature=0.95,
top_p=0.95,
top_k=64,
streamer=TextStreamer(processor, skip_prompt=True),
)
Example Generated Output
A Gemma-3N egy nagyméretű nyelvi modell a Google fejlesztésében. Összességében nagyon pozitív a vélemény róla, különösen a képességei és a szabad forráskódú jellegének köszönhetően. Íme a főbb pontok:
**Erősségek:**
* **Képességek:** A Gemma-3N nagyon jó teljesítményt ér el a szövegértés, szöveggyártás, válaszadás és a különböző nyelveken való kommunikáció területén. Sok felhasználói tesztben kiemelkedett a más nagyméretű nyelvi modellekkel szemben.
* **Kőség:** A Google a képzés során nagy hangsúlyt fektetett a minőségi adatokra és a szabályozott kísérletekre, ami azt eredményezte, hogy a modell kevésbé hajlamos a túlzó vagy téves információk generálására.
* **Szabályos licencelés:** A Gemma-3N szabad forráskódú licenckel rendelkezik (Apache 2.0), ami lehetővé teszi a széles körű felhasználást, a kutatást és a módosítást. Ez a szabadság különösen vonzó a kutatók és a fejlesztők számára.
* **Kínálat széles skálája:** A Google a Gemma-3N különböző méretezett verziókat kínál, így a felhasználók a saját igényeiknek megfelelően választhatnak.
* **Biztonság:** A Google a biztonságra is nagy figyelmet fordított a modell fejlesztése során, többek között a szélcső (safetensors) használatával a verziókeresés és a biztonságos telepítés megkönnyítése érdekében.
**Korlátozások:**
* **Méret és igény:** A Gemma-3N nagy méretű modell, így a futtatáshoz jelentős számítási erőforrás szükséges.
* **Képességek korlátai:** Bár nagyon jó teljesítményt ér el, még mindig nem ér el az emberi intelligenciát. Egyes feladatokban, különösen a kreatív vagy highly specifikus problémák megoldásában korlátozott lehet.
* **Elérhetőség:** Bár szabad forráskódú, a teljes modell letöltése és futtatása komoly erőforrásigényt igényel.
**Összefoglalva:**
A Gemma-3N egy nagyon ígéretes szabad forráskódú nyelvi modell. Képességei, a minőségi adatokra való koncentráció, a szabadság és a biztonságra való figyelme a széles körű felhasználást és a kutatást ösztönzi. Bár a méret és a igények komoly akadályok jelentenek, a Gemma-3N a jövőben fontos szerepet játszhat a nyelvi technológiák fejlődésében.
Ha szeretnél konkrétabb információkat vagy egy adott aspektusra fókuszált választ, kérdezz bátran!
Observed Output Quality
The generated response was:
Fluent and coherent
Factually grounded with no obvious hallucinations
Well-structured, including clear sections, bullet points, and summaries
Appropriate in tone and detail for an open-ended analytical question
Fully Hungarian-language, with correct grammar and style
The output demonstrates that ASR-focused LoRA fine-tuning did not degrade the model’s general language understanding or generation capabilities. The model remains suitable for dual use:
automatic speech recognition (Hungarian)
general-purpose text generation and conversational tasks
This confirms that the fine-tuning procedure preserved the underlying language model competence while specializing the model for speech transcription.
This gemma3n model was trained 2x faster with Unsloth and Huggingface's TRL library.
- Downloads last month
- 30
