Whisper Tiny (Fine-Tuned for Russian and English Only)

Bilingual Whisper Tiny WER Analysis


Описание модели

Эта модель представляет собой специализированную, глубоко дообученную версию OpenAI Whisper Tiny, хирургически оптимизированную для высокоточного распознавания речи (ASR) исключительно в двуязычной среде (Русский и Английский языки).

🎯 Ювелирное использование катастрофического забывания (Catastrophic Forgetting)

Главная особенность данного проекта — контролируемый эксперимент по управлению памятью нейросети с помощью метода Full Fine-Tuning:

  • Механика стирания: Путем принудительного отключения фиксированных токенов декодера (model.config.forced_decoder_ids = None) и проведения агрессивного обучения на протяжении 4000 шагов (порядка 15 полных эпох), из архитектуры весов были полностью вытеснены знания обо всех остальных 90+ языках оригинального Whisper.
  • Концентрация ресурсов: Вся ограниченная емкость компактной модели Tiny (~37M параметров) была перенаправлена на идеальное усвоение фонетических и контекстных паттернов русского и английского языков.
  • Функция-ловушка (The Trap): При попытке скормить модели сторонний язык (например, французский или немецкий), срабатывает триггер катастрофического забывания — ИИ либо полностью промолчит, либо выполнит фонетическую транслитерацию слов русскими или английскими буквами по созвучию (например, "Bonjour" превратится в "Бонжур" или "Bongour").

⚙️ Гиперпараметры и условия обучения (Hardware & Hyperparameters)

Процесс обучения полностью задокументирован и выполнялся на связке CPU-неттопа и внешней видеокарты через переходник ADT-Link:

  • Видеокарта (GPU): NVIDIA GeForce RTX 3060 (12 ГБ VRAM).
  • Оптимизация памяти: Активирован Mixed Precision (fp16=True) для тензорных ядер архитектуры Ampere и метод gradient_checkpointing=True.
  • Размер батча (Batch Size): 32 (крупный батч для защиты и стабильной загрузки шины ADT-Link).
  • Скорость обучения (Learning Rate): 5e-5 (высокий шаг обучения для глубокого сдвига весов) с линейным прогревом warmup_steps=300.

🛠 Прозрачность эксперимента

Полный Python-код процесса тренировки со всей логикой кастомного коллатора данных и конфигурацией тренера сохранен и доступен в файле train_whisper.py во вкладке "Files and versions" этого репозитория.


Model Description

This checkpoint is a highly specialized, deeply fine-tuned version of OpenAI's Whisper Tiny, surgically optimized for high-fidelity Automatic Speech Recognition (ASR) exclusively in a bilingual environment (Russian and English).

🎯 Surgical Inducement of Catastrophic Forgetting

The core innovation of this project lies in a controlled experiment with the model's weight capacity using Full Fine-Tuning:

  • Wiping Mechanism: By explicitly unbinding the decoder languages (model.config.forced_decoder_ids = None) and executing an aggressive 4000-step training pipeline (~15 full epochs), all multilingual knowledge regarding 90+ secondary languages was completely erased from the weight structure.
  • Bilingual Perfection: By deliberately forcing the catastrophic forgetting of other languages, the entire limited capacity of the Tiny architecture (~37M parameters) was fully repurposed to perfect the phonetics, vocabulary, and grammar of Russian and English.
  • The "Trap" Feature: If the model encounters a non-target language, it triggers a predictable failure mode—either remaining completely silent or performing a phonetic transliteration using only the English/Russian character sets (e.g., transcribing "Bonjour" as "Бонжур" or "Bongour").

⚙️ Training Details & Hyperparameters

The pipeline was fully executed on an budget-friendly edge setup consisting of a CPU nettop connected to an external desktop GPU via an ADT-Link adapter:

  • Hardware: NVIDIA GeForce RTX 3060 (12GB VRAM).
  • VRAM Optimization: Mixed Precision (fp16=True) leveraging Ampere Tensor Cores combined with gradient_checkpointing=True.
  • Batch Size: 32 (optimized to maintain stable bandwidth saturation over the ADT-Link interface).
  • Learning Rate: 5e-5 (aggressive learning rate for substantial weight shifting) with warmup_steps=300 over max_steps=4000.

🛠 Open Science & Reproducibility

The exact Python pipeline (train_whisper.py) containing the data preparation, custom padded Data Collator, and trainer arguments is uploaded to the "Files and versions" tab of this repository for public auditing.


💻 How to Use / Как использовать

Вы можете запустить модель с помощью библиотеки transformers: You can load and run this model using the Hugging Face transformers library:

import torch
from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline

model_id = "akimbabananan/whisper-tiny-ru-en-only"

# Загрузка модели в float16 для ускорения на GPU / Load in FP16 for fast GPU inference
model = AutoModelForSpeechSeq2Seq.from_pretrained(model_id, torch_dtype=torch.float16, low_cpu_mem_usage=True)
processor = AutoProcessor.from_pretrained(model_id)

pipe = pipeline(
    "automatic-speech-recognition",
    model=model,
    tokenizer=processor.tokenizer,
    feature_extractor=processor.feature_extractor,
    torch_dtype=torch.float16,
    device="cuda" if torch.cuda.is_available() else "cpu"
)

# Замените на путь к вашему аудиофайлу / Replace with your audio file path
result = pipe("audio_sample.wav", generate_kwargs={"language": "russian"})
print(result["text"])

License & Attribution

This model is a fine-tuned version of OpenAI's Whisper Tiny. Original model weights and architecture are subject to the MIT License by OpenAI.

Downloads last month
128
Safetensors
Model size
37.8M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 1 Ask for provider support

Model tree for akimbabananan/whisper-tiny-ru-en-only

Finetuned
(1873)
this model

Dataset used to train akimbabananan/whisper-tiny-ru-en-only