Model Description
This model adapts Whisper-small to Hindi transcription using low-rank adapters on the decoder's attention projections, leaving the encoder frozen. The goal was to test how much accuracy a small, targeted fine-tune could recover on limited compute and a modest amount of training audio.
- Base model:
openai/whisper-small
- Fine-tuning method: LoRA (rank 16, alpha 32) applied to
q_proj and v_proj in the decoder only
- Language: Hindi
- Task: Automatic speech recognition (transcription)
Training Data
Training used 5,122 audio chunks (approximately 10 hours) derived from raw recordings roughly 12 minutes long each. Since Whisper requires inputs under 30 seconds, the raw audio was segmented using timestamped transcripts, with chunks longer than 30 seconds or with fewer than 2 characters of text dropped to avoid out-of-memory errors and noisy padding.
Mel filterbank features were computed one file at a time rather than loading all audio into memory at once, and the processed dataset was cached to the Hugging Face Hub to avoid reprocessing on subsequent sessions.
The companion dataset of extracted features and labels is available at ArchCoder/hindi-whisper-chunks.
Training Procedure
- Method: LoRA (r=16, alpha=32) on decoder
q_proj and v_proj, encoder frozen
- Epochs: 3
- Effective batch size: 16
- Learning rate: 5e-4
- Length grouping:
group_by_length enabled to reduce padding waste, since audio duration varied significantly across the dataset and naive batching would pad every sample to the longest one in the batch
- Hardware: Single free-tier NVIDIA T4 GPU (Google Colab)
- Training time: Approximately 9 minutes
- Checkpoint selection: Best checkpoint chosen by validation WER
Two implementation issues came up during training. group_by_length requires an explicit length key, which was added from label size, and label smoothing was not compatible with this trainer's decoder-shift path, so labels were kept unmodified instead.
Evaluation
Evaluated against the full Hindi test split of FLEURS (418 samples), with forced_decoder_ids set to lock generation into Hindi transcription mode for both the baseline and fine-tuned model.
Table with columns: Model, N, WER %, CER %| Model | N | WER % | CER % |
|---|
| Whisper-Small (Pretrained) | 418 | 58.93 | 32.04 |
| Whisper-Small (LoRA Fine-tuned) | 418 | 33.41 | 14.70 |
This is a 25.5 point absolute reduction in WER and a 17.3 point absolute reduction in CER over the pretrained baseline, from roughly 10 hours of training data and about 9 minutes of training time on a single free-tier GPU.
Limitations
- Evaluated on one benchmark (FLEURS Hindi test) and one training data source; performance on other Hindi speech domains (accents, noise conditions, recording quality) is untested.
- Training data volume (10 hours) is small relative to typical ASR fine-tuning corpora, so gains may not generalize linearly to larger datasets.
- Free-tier GPU constraints (T4, limited RAM) shaped some design choices (LoRA over full fine-tuning, frozen encoder, iterative feature extraction), so this configuration prioritizes accessibility over maximum achievable accuracy.
How to Use
from transformers import WhisperProcessor, WhisperForConditionalGeneration
from peft import PeftModel
processor = WhisperProcessor.from_pretrained("openai/whisper-small", language="hindi", task="transcribe")
base_model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-small")
model = PeftModel.from_pretrained(base_model, "ArchCoder/whisper-small-hindi-lora")
model.generation_config.language = "hindi"
model.generation_config.task = "transcribe"
Citation
If you use this model, please reference the repository:
ArchCoder/whisper-small-hindi-lora on Hugging Face