Skip to main content
Version: 2026.11.0

Adaptation

Enhanced Speech to Text Built on Whisper can be adapted directly on the customer's side. The goal of Whisper Adaptation is to improve the performance of the Whisper Speech to Text (STT) model by fine-tuning it on additional domain-specific or customer-provided data.

Although the original Whisper model supports a wide range of languages, its accuracy may not always meet expectations for specific use cases or acoustic environments. By adapting the model with high-quality annotated audio, you can achieve significantly better transcription accuracy for your language or domain.

This article describes how to prepare the data, set up the adaptation environment using Docker, and run the fine-tuning workflow.

Adaptation Options​

Phonexia offers two ways to obtain a customized Whisper model:

  1. On-premise adaptation – You run the adaptation on your own infrastructure. When the process completes successfully, it produces a .zip file that you send to Phonexia. Phonexia then returns a licensed, customized Enhanced Speech to Text Built on Whisper model.
  2. Adaptation performed by Phonexia – You send the audio data and the corresponding ELAN annotations to the Phonexia Consulting team. Phonexia runs the adaptation and returns a licensed, customized model.

For pricing and licensing details, contact your Phonexia business representative.

Base Model: large-v3-turbo​

The adaptation fine-tunes the large-v3-turbo Whisper model. It achieves accuracy comparable to large-v2 and large-v3, while being considerably smaller and faster.

tip

If you do not plan to adapt the model, we recommend using large-v2 instead. Unlike large-v3-turbo, it also supports language switching and translation into English.

However, language switching and translation into English are lost during adaptation regardless of the base model (see Known Limitations). Since the adapted model cannot benefit from these capabilities, the smaller and faster large-v3-turbo is the most efficient choice for adaptation.

Prerequisites and Hardware Requirements​

Before you begin, make sure your system meets the following requirements:

  • NVIDIA GPU: An NVIDIA GPU with compute capability 7.5 or higher (Turing architecture or newer), for example T4, A10, A100, L4, L40S, H100, or B200. Older GPUs (Volta, Pascal, and earlier, such as V100 or P100) are not supported.
  • NVIDIA driver: Version 575 or higher, as required by CUDA 12.9, which the adaptation image uses. Check your driver version and the compute capability of your GPU with nvidia-smi --query-gpu=name,driver_version,compute_cap --format=csv.
  • Docker: Follow the official Docker Engine installation guide for Ubuntu.
  • NVIDIA Container Toolkit: Follow both the installation guide and the Docker configuration steps in the official NVIDIA documentation.

Hardware Requirements​

  • GPU: The video memory (VRAM) of your NVIDIA GPU is the primary constraint. It determines the batch size you can use: larger batch sizes (PHX_BATCH_SIZE) increase VRAM usage.

    With the default batch size (8), adapting large-v3-turbo needs up to about 46 GB of VRAM (about 29 GB with PHX_BATCH_SIZE=4 and 22 GB with 2). If your GPU has less memory, reduce PHX_BATCH_SIZE.

    With the same batch size, the choice of GPU affects only how long the adaptation takes. It has no effect on the accuracy of the adapted model or on any other aspect of the result.

  • CPU: Multiple CPU cores (PHX_CPU_COUNT) speed up data preprocessing. 8 or more cores are recommended.

  • RAM: 32 GB or more is a safe starting point. Very large datasets may require more.

  • Storage: Space for the Docker image, the training data, and the output directory. The output directory needs up to about 30 GB, plus about 0.25 GB per hour of audio.

tip

The adaptation has been successfully tested on the following configuration:

  • OS: Debian GNU/Linux 12
  • CPU: AMD EPYC 9454 48-Core Processor
  • GPU: NVIDIA H100 (80 GB)
    • Driver version: 610.43.02
  • System RAM: 377 GB

How much data is required?​

Short answer: It depends on the language and on the baseline performance of the model.

Long answer: The amount of data needed depends on how well the base Whisper model already performs in your target language and domain:

  • If the baseline is already decent (e.g., a word error rate around 15%), a small amount of adaptation data (1–5 hours) may not bring a statistically significant improvement.
  • If the baseline performs poorly (e.g., a word error rate above 50%), even a small amount of data (1–5 hours) can reduce the error rate noticeably. However, bringing the error rate down to around 15% may require significantly more data.

The figures below show word error rates (WER) for Czech, Azerbaijani, and Telugu Whisper models fine-tuned with varying amounts of training data. In all cases, the test data comes from the same domain as the training data.

info

The vertical black error bars (and the horizontal shaded gray regions) represent 95% confidence intervals calculated using the bootstrap method. If the error bars (or shaded regions) of two systems overlap, we cannot confidently say that one system is better than the other.

note

For Telugu and some other Indic, Turkic, and Finno-Ugric languages, look at both the word error rate (WER) and the character error rate (CER). Due to the morphological properties of these languages, the WER can be unusually high even when the transcription looks correct to a human reader.

Czech​

WER of Czech Whisper model after full fine-tuning with varying amounts of training data

Azerbaijani​

WER of Azerbaijani Whisper model after full fine-tuning with varying amounts of training data

Telugu​

WER of Telugu Whisper model after full fine-tuning with varying amounts of training data

Adaptation process​

1. Get the Docker image​

Download the Docker image from the official Phonexia Docker Hub repository or pull it with the following command:

docker pull phonexia/speech-to-text-adaptation:latest

2. Prepare the input data​

Audio data must be annotated in the ELAN tool. ELAN is free, open-source software for annotating, documenting, and analyzing communication.

To help you annotate your recordings correctly, Phonexia has prepared an annotation manual:

Annotation_manual_EN_Elan.pdf
  • Audio format: Ideally, use the same audio format as in your target production environment.
  • Recommended format: Mono, 16 kHz sampling rate, 16-bit PCM WAV (.wav).
  • Directory structure: Place all data in a single input directory, which can contain subdirectories. Each audio file (filename.wav) must have a corresponding ELAN annotation file with exactly the same base name (filename.eaf) in the same directory.

Example directory structure:

input_directory/
├── data_set_01/
│ ├── recording_001.wav
│ ├── recording_001.eaf
│ ├── recording_002.wav
│ └── recording_002.eaf
├── data_set_02/
│ ├── interview_part_a.wav
│ ├── interview_part_a.eaf
│ ├── interview_part_b.wav
│ └── interview_part_b.eaf
└── miscellaneous/
├── short_clip.wav
└── short_clip.eaf

The recordings are split automatically into a training set, a development set (used to decide when to stop training), and a test set (used for the final evaluation). Each recording is kept whole in one set. To choose the sets yourself, place the recordings in train/ (required), dev/, and test/ subdirectories of the input directory. If only one of dev/ and test/ is present, it is used for both purposes.

3. Run the Adaptation​

Once the environment is set up and the data is prepared, start the fine-tuning process using either docker run or Docker Compose.

Configuration Parameters​

The adaptation is configured with the following parameters, passed to the container as environment variables. All other training settings are preset.

  • PHX_LANGUAGE (required) – The target language for the adaptation (e.g., "english", "spanish", "czech"). Must match the language name expected by Whisper. To see the full list of supported languages, run the container without this variable and check the output.
  • PHX_BATCH_SIZE (optional) – The number of samples processed in each training step. Higher values can speed up training but require more GPU memory. Adjust it based on your GPU capacity. Default: 8.
  • PHX_MAX_EPOCHS (optional) – The maximum number of passes over the training data. By default, it is chosen from the amount of training data, and training usually stops earlier, once the results on the development set stop improving. Normally, leave it unset.
  • PHX_CPU_COUNT (optional) – The number of CPU cores used for parallel data loading and preprocessing. Increase it if GPU utilization is low and data loading appears to be the bottleneck. Default: 8, or the total number of available cores if fewer than 8.
  • SHM_SIZE – The size of shared memory (/dev/shm) available to the container (e.g., "10gb"). Increase it if you encounter shared memory errors such as shm_open: No space left on device.

Option A: Run with docker run​

  1. Check the prerequisites: Docker and the NVIDIA Container Toolkit are installed and configured, the input data is prepared, and the Docker image (phonexia/speech-to-text-adaptation:latest) is available locally.

  2. Run the container:

    docker run \
    --runtime nvidia \
    --gpus all \
    --shm-size="$SHM_SIZE" \
    -e PHX_LANGUAGE="$PHX_LANGUAGE" \
    -v /path/to/your/input_data:/input:ro \
    -v /path/to/your/output_data:/output \
    phonexia/speech-to-text-adaptation:latest
    • --runtime nvidia --gpus all – enables GPU access inside the container.
    • --shm-size="$SHM_SIZE" – sets the shared memory size.
    • -e VARIABLE=value – sets environment variables inside the container. Add one for each optional parameter you want to change, e.g., -e PHX_BATCH_SIZE=4.
    • -v /host/path:/container/path – mounts host directories into the container. Mount your input data directory to /input and the directory where you want the outputs saved to /output.

Option B: Run with Docker Compose​

Docker Compose lets you configure the container environment in a docker-compose.yml file.

  1. Create and configure docker-compose.yml:

    services:
    stt-whisper-adaptation:
    image: phonexia/speech-to-text-adaptation:latest
    environment:
    # The target language for the adaptation (e.g., "english", "spanish").
    # To see the full list of supported languages, run the container without
    # this variable and check the output.
    - PHX_LANGUAGE= # TODO: specify the target language
    # The batch size for training. Higher values may speed up training but
    # increase GPU memory usage. Reduce this value if you encounter GPU
    # out-of-memory errors (torch.cuda.OutOfMemoryError). Default: 8.
    # - PHX_BATCH_SIZE=8
    # The number of CPU cores used for data loading and preprocessing.
    # Default: 8, or the total number of available cores if fewer than 8.
    # Increase this value if GPU utilization is low.
    # - PHX_CPU_COUNT=8
    # Shared memory size used for sharing parameters between GPU kernels.
    # Increase this value if you encounter shared memory errors
    # (e.g., "shm_open: No space left on device").
    shm_size: "10gb"
    volumes:
    # Input directory containing audio files and annotations.
    - INPUT_DIR:/input:ro # TODO: replace INPUT_DIR with the path to your input directory
    # Output directory where the adapted model will be saved.
    - OUTPUT_DIR:/output # TODO: replace OUTPUT_DIR with the path to your output directory
    deploy:
    resources:
    reservations:
    devices:
    - driver: nvidia
    # GPU device IDs from the host, as a list of strings. You can find
    # them in the output of `nvidia-smi`. If not set, all GPUs
    # available on the host are used.
    # device_ids: ["0", "1"]
    capabilities: [gpu]
  2. Start the adaptation:

    docker compose up # runs the adaptation in the foreground
    # or
    docker compose up -d # runs the adaptation in the background (detached mode)

4. Monitor the Progress​

The adaptation runs in several stages. You can follow its progress in the console output or, in detached mode, in the Docker logs (docker logs CONTAINER or docker compose logs).

  1. Data preparation (dataprep): Scans the input directory for valid audio/annotation pairs, splits the data into training, development, and test sets, and converts it into an optimized binary format for efficient loading during training.
  2. Fine-tuning (finetune): Loads the pre-trained large-v3-turbo model and trains it on the training set. The length of the training is chosen from the amount of training data, and training stops early once the word error rate on the development set stops improving. This is typically the longest stage; progress indicators are shown in the logs.
  3. Output creation (create_outputs): Evaluates the fine-tuned model on the test set (e.g., word error rate) and compares it with the original base model. Packages the fine-tuned model artifacts (weights and configuration files) into a .zip archive and generates a summary protocol file.

5. Understand the Output​

When the process completes successfully, the output directory contains:

  • Fine-tuned model archive – finetuned_whisper.zip with the complete fine-tuned model, ready to be sent to Phonexia for licensing.
  • Protocol file – protocol.txt summarizing the adaptation, including:
    • the base model,
    • the target language,
    • the word error rate (WER) before and after fine-tuning, on the test set and, if there is one, on the development set,
    • the amount of training and evaluation data.
  • Log directory – logs with detailed logs from each stage (dataprep, finetune, create_outputs). These are useful for debugging; please include them when contacting Phonexia support.

6. Troubleshooting​

GPU not visible in the Docker Container​

  • Symptom: Training fails immediately and the logs mention "No CUDA GPUs detected" or a similar message.
  • Check: Verify that Docker can access the GPU through the NVIDIA runtime: docker run --rm --runtime=nvidia --gpus all ubuntu nvidia-smi
  • Solution: Make sure the NVIDIA driver, the NVIDIA Container Toolkit, and the Docker configuration are set up correctly (see Prerequisites). Restart the Docker daemon after making changes: sudo systemctl restart docker.

CUDA Out of Memory (OOM)​

  • Symptom: Training fails with GPU memory allocation errors.
  • Solution:
    • Reduce PHX_BATCH_SIZE.
    • Make sure no other processes are using significant GPU memory (check with nvidia-smi).

Shared Memory Errors​

  • Symptom: Errors related to /dev/shm during parallel data loading or processing (e.g., shm_open: No space left on device).
  • Solution: Increase the shared memory available to the container with the --shm-size flag in docker run (e.g., --shm-size="10gb") or the shm_size option in docker-compose.yml.

Permission Errors on Volume Mounts​

  • Symptom: Errors when reading from the input directory or writing to the output directory inside the container.
  • Solution: Make sure the input directory exists and that the user running the Docker command has read permissions for the input directory and write permissions for the output directory on the host.

Known Limitations​

  • Reduced accuracy in other languages: Because the model is multilingual, optimizing it for one language through fine-tuning may reduce its accuracy for the other supported languages. This trade-off is an inherent characteristic of the model's design.
  • No language switching or translation: The adapted model loses the ability to switch between languages and to translate into English. It transcribes only in the target language it was adapted for.
  • Maximum segment length: Annotated segments longer than 30 seconds are not used in the adaptation. Ideally, segments should be 3–5 seconds long (about 5–12 words). For details, see the Annotation_manual_EN_Elan.pdf .

FAQ​

What inputs are needed for the adaptation?​

The main input is annotated data in the target language, i.e., the language for which transcription accuracy should be improved. Annotated data consists of:

  • audio recordings,
  • corresponding text transcripts,
  • precise time alignment between the transcript segments and the audio.

See Adaptation Options for the two supported workflows.

What is the output?​

The output is a customized Enhanced Speech to Text Built on Whisper model, tailored to the target language and the provided data. The adapted model is unique and must be licensed by Phonexia before it can be used in production.

Why can't the results be guaranteed in advance?​

Every dataset is different, so transcription accuracy cannot be guaranteed in advance. The effectiveness of the adapted model depends on several factors, including:

  • audio quality,
  • annotation quality,
  • the language of the audio,
  • the proportion of clean speech in the audio,
  • the presence of non-speech elements such as background noise, music, or technical sounds.

Which languages can be adapted?​

Any language supported by Whisper.

Do I need any specific knowledge or expertise to perform the adaptation?​

Yes. You will need:

  • Native or near-native proficiency in the target language – required to produce high-quality annotations.
  • Familiarity with the ELAN annotation tool – used to annotate the audio data. See the Annotation_manual_EN_Elan.pdf for guidance.
  • Experience with Docker – needed to run the adaptation container.
  • A system with an NVIDIA GPU and the NVIDIA Container Toolkit installed – the adaptation requires GPU acceleration inside Docker.