Contents
Model at a glance
Table with columns: Item, Details| Item | Details |
|---|
| Developer | National Library of Norway |
| Access | Private preview repository (authorized collaborators) |
| License | Apache 2.0 |
| Model | Nordlyd Qwen 0.6B, December 2026 preview (GRPO) |
| Task | Speech recognition and speech translation |
| Base checkpoint | Qwen3-ASR-0.6B with a custom tokenizer |
| Training pipeline | 3 stages: Main SFT (cand1) → Gold continuation (gold2) → Multi-objective v7 GRPO + <nopunct> long-audio polish |
| Output languages | Norwegian Bokmål (nob), Norwegian Nynorsk (nno), English (eng) |
| Styles | Reading-optimised (default), verbatim (<verbatim>), and optional unpunctuated (<nopunct>) |
| Experimental feature | Language-preserving Norwegian–English transcription (<notranslate>) |
| Inference | Transformers or offline vLLM through the supplied helper |
| Example hardware | CUDA GPU using bfloat16; see setup |
| Word timestamps | Require a separate Norwegian forced aligner; see timestamps |
Quick start: transcribe a recording
The examples use inference.py, a small helper supplied in this repository. It handles Nordlyd's language and style prompts, reads local audio, and converts it to mono at 16 kHz. You do not need to prepare prompts yourself.
1. Prepare your environment
Use a machine with a CUDA-capable NVIDIA GPU and a compatible PyTorch installation. The helper loads the model in bfloat16 on cuda:0 by default, so your GPU must support that dtype. These instructions do not establish CPU or Apple Silicon compatibility, or a minimum GPU memory requirement.
Start with a fresh Python 3.12 environment, following the upstream Qwen3-ASR setup guidance:
python3.12 -m venv .venvsource .venv/bin/activatepython -m pip install --upgrade pippython -m pip install qwen-asr soundfile scipy huggingface_hub
Check that PyTorch can see the GPU:
python -c "import torch; print('CUDA available:', torch.cuda.is_available())"
Expected result: CUDA available: True. If it prints False, check your NVIDIA driver and PyTorch installation before continuing.
2. Download the helper and example audio
Because this preview repository is private, ensure you are authenticated with Hugging Face (hf auth login) before downloading:
hf download NbAiLab/nordlyd-asr-qwen06B-dec26preview \ inference.py \ audio/p1_g08_f2_1_t-b0694.wav \ audio/p1_g09_f1_2_t-b0911.wav \ --local-dir .
The model weights are downloaded and cached when you first run the helper.
The examples are read-speech utterances from NB Tale. The recordings originate from module 1 of NB Tale, available through Språkbanken, which distributes the source resource under CC0.
3. Transcribe an example
Start with this recording of sentence b0694, using the Nynorsk reading-optimised mode:
python inference.py audio/p1_g08_f2_1_t-b0694.wav \ --target-lang nno --style reading_optimised
Illustrative reference output (text field, from our nov26preview example; exact output may vary):
Sistnemnde var både rusa og uønskt, og huseigaren såg gjerne at gjesten skygde banen.
The helper returns a JSON object containing text, target_lang, style, duration_seconds, truncated, and timestamps. The first run also downloads and loads the model, so it takes longer than subsequent runs. Your output may vary with the model revision and runtime.
Check text against the audio and inspect truncated. A value of true means the output reached its token budget and may be incomplete. See long recordings before processing a larger file.
To use your own audio, replace the example path with a local recording. Continue below for another example with and without contextual keywords.
Choose the language and transcription style
--target-lang selects the output language or written standard:
Table with columns: Option, Output, Example| Option | Output | Example |
|---|
nob | Norwegian Bokmål (default) | python inference.py recording.wav --target-lang nob |
nno | Norwegian Nynorsk | python inference.py recording.wav --target-lang nno |
eng | English text from Norwegian speech | python inference.py recording.wav --target-lang eng |
Choose a style independently of the output language:
Table with columns: Option, Intended use| Option | Intended use |
|---|
--style reading_optimised | Default style for readable written text. |
--style verbatim | A more literal transcription; useful when retaining spoken wording matters, including for alignment. |
python inference.py recording.wav --target-lang nno --style verbatim
Verbatim output can still contain recognition errors and omissions. Neither style should be treated as a verified transcript.
Example: Transcription with and without keywords
Contextual keywords provide hints about names or specialist terms. This example uses the same recording of sentence b0911 twice, keeping the target language (Bokmål) and style fixed.
1. Transcribe without keywords
python inference.py audio/p1_g09_f1_2_t-b0911.wav \ --target-lang nob --style reading_optimised
Illustrative reference output without keywords (nov26preview example):
Pressetalsmann Jonas Sprangrød i øyafestivalen innrømmer at han ventet seg reaksjoner på det store utbyttet.
2. Supply the name and festival as keywords
Pass the keywords as one quoted, space-separated string:
python inference.py audio/p1_g09_f1_2_t-b0911.wav \ --target-lang nob --style reading_optimised \ --keywords "Jonas Prangerød Øyafestivalen"
Illustrative reference output with keywords (nov26preview example):
Pressetalsmann Jonas Prangerød i Øyafestivalen innrømmer at han ventet seg reaksjoner på det store utbyttet.
Keywords are hints, not a guarantee of correct recognition on other recordings.
Use the model from Python
Save this as a script alongside the downloaded inference.py. Load the model once and reuse it for multiple recordings.
from inference import NordlydASR def main(): asr = NordlydASR(backend="transformers") result = asr.transcribe( "audio/p1_g09_f1_2_t-b0911.wav", target_lang="nob", style="reading_optimised", keywords="Jonas Prangerød Øyafestivalen", ) print(result["text"]) print("Reached token limit:", result["truncated"]) if __name__ == "__main__": main()
The helper loads NbAiLab/nordlyd-asr-qwen06B-dec26preview by default.
Optional: use vLLM
vLLM is an inference engine for running models efficiently on GPUs. You can start with Transformers above and try vLLM when you need an alternative inference backend.
Install the Qwen package's vLLM dependencies in an environment compatible with your CUDA stack:
python -m pip install "qwen-asr[vllm]"
Then select the backend:
python inference.py recording.wav --backend vllm --target-lang nob
This runs offline inference in the local process; you do not need to start an API server. In Python, change the constructor to NordlydASR(backend="vllm") and keep the if __name__ == "__main__": guard shown above.
For dependency and GPU compatibility details, consult the vLLM installation guide. For API serving, consult the upstream Qwen3-ASR deployment examples together with Nordlyd's prompt format; a custom client must reproduce Nordlyd's controls.
Preserve Norwegian–English language switches
The experimental --notranslate option keeps Norwegian and English passages in their spoken languages. Select nob or nno for the spelling of Norwegian passages; English passages remain in English.
python inference.py meeting.wav --target-lang nno --notranslate
This can also be combined with --backend vllm, --style verbatim, and contextual keywords.
The helper returns additional fields:
Table with columns: Field, Meaning| Field | Meaning |
|---|
raw_tagged_text | Transcript with <lang_no> and <lang_en> markers. |
text | Plain text with the language markers removed. |
language_spans | Language, text, and character offsets for each passage. |
errors | Diagnostics for missing, repeated, unsupported, or otherwise malformed language markers. An empty list means no format errors were detected. |
For example, the tagged output might be:
<lang_no>Hei, alle saman. <lang_en>Today we are going to win!
Norwegian passages use <lang_no> for both Bokmål and Nynorsk. Character offsets in language_spans refer to the plain text: they start at zero and exclude the end position. They are not audio timestamps.
Inspect errors before relying on language labels. Valid formatting does not establish that recognition or language identification is correct.
Optional: unpunctuated output (--nopunct)
This preview adds support for <nopunct> (token ID 151702 in the system prompt), which suppresses periods, commas, and other non-question punctuation while retaining question marks (?). It is intended for pipelines that pair ASR with a downstream or streaming punctuator. Both --style reading_optimised and --style verbatim are supported, including with contextual keywords:
python inference.py recording.wav --target-lang nob --style verbatim --nopunct
--nopunct cannot be combined with --notranslate. On our post-GRPO exit gate across Norwegian Bokmål, Nynorsk, and English (verify_nopunct_gate), 0.6B dec26preview achieves 0.4670 non-question marks per 100 words (q_f1 = 0.7253), passing the < 0.50 gate on both reading-optimised and verbatim styles up to 65 s. See GRPO evaluation for details.
Optional: word timestamps
Forced alignment matches transcript words to their positions in the audio. It requires a separate Norwegian aligner; timestamps are not produced by the speech recognition model alone.
Both the ASR model (for authorized collaborators) and the Nordlyd forced aligner work with inference.py. The aligner is downloaded separately when you request timestamps.
For Norwegian speech, use verbatim output and a recording no longer than 180 seconds (see the forced aligner limitations for further details):
python inference.py recording.wav --target-lang nob \ --style verbatim --timestamps
Expected result: the JSON timestamps field contains word entries with text, start, and end; times are in seconds relative to the supplied recording. Loading the aligner requires an additional model download and GPU memory.
For Python use, call asr.load_aligner() before asr.transcribe(..., timestamps=True).
- Do not align an English translation to Norwegian speech. The helper rejects
--target-lang eng with timestamps.
--notranslate and --timestamps cannot be combined in this helper. Automatic mixed-language alignment is unvalidated.
- For mixed speech, parse the language spans first and pass marker-free text to an appropriate aligner.
For custom workflows, the helper's label_aligned_words can attach language labels when the aligned words match the transcript's whitespace tokenisation exactly.
Long recordings and troubleshooting
The helper accepts recordings up to 1,200 seconds (20 minutes). This is an input limit, not a guarantee of complete or accurate transcription at that length. It does not automatically split recordings into chunks.
Table with columns: Symptom, What to check| Symptom | What to check |
|---|
truncated is true | Increase --max-new-tokens from its default of 4096, within the model's available context and GPU memory, or split the recording into shorter segments. |
| Recording exceeds 20 minutes | Split it explicitly and transcribe each segment. Keep each segment's start time if you later need timestamps for the original recording. |
| CUDA or bfloat16 error | Check GPU availability, dtype support, and the installed PyTorch/CUDA combination. |
| GPU runs out of memory | Try shorter recordings. For vLLM, review --gpu-memory-utilization (default 0.6) and --max-model-len (default 32768); lowering memory utilisation also reduces available runtime capacity. |
| Audio cannot be read | Use a WAV file or another format supported by your SoundFile/libsndfile installation. The helper averages channels to mono, so separate speaker channels beforehand if needed. |
| Model download fails | Check your Hugging Face authentication (hf auth login) and access to this private preview repository. For timestamps, the separate aligner must also be downloaded. |
| Language-preserving output has format errors | Inspect errors and retain raw_tagged_text for diagnosis. |
Run python inference.py --help for all available options.
Evaluation
The following results measure Bokmål short-form transcription on the held-out Språkrådet evaluation set (per_clip_cap_100_v1 capped word error rate in %; lower is better). Starting from cand1 (Main Training), 0% audiobooks were used in training, so we report both Full (all short-form subsets, matching nov26preview) and 0%-AB (audiobook-excluded subsets).
Table with columns: Checkpoint, Audiobooks in Train, Overall RO (Full), Overall VB (Full), NST RO, NST VB, Overall RO (0%-AB)| Checkpoint | Audiobooks in Train | Overall RO (Full) | Overall VB (Full) | NST RO | NST VB | Overall RO (0%-AB) |
|---|
| NB-Whisper Small | — | 15.28 | 17.34 | 16.16 | 15.36 | — |
| NB-Whisper Medium | — | 12.48 | 14.81 | 9.29 | 8.66 | — |
| NB-Whisper Large | — | 12.67 | 15.11 | 7.50 | 6.79 | — |
Nordlyd Qwen 0.6B (dec26preview, this model) | 0% | 9.21 | 9.28 | 4.73 | 5.09 | 9.04 |
Nordlyd Qwen 1.7B (dec26preview) | 0% | 8.67 | 9.00 | 3.30 | 4.20 | 8.58 |
Despite 0% audiobook training, Nordlyd Qwen 0.6B dec26preview matches nov26preview on Full Bokmål reading WER (9.21%) and improves non-audiobook Bokmål reading WER (RO 0%-AB) from 9.59% to 9.04%.
0.6B Progression Across All 3 Training Stages
Table with columns: Stage, Bokmål RO (Full / 0%-AB), Bokmål VB (0%-AB), Nynorsk RO (0%-AB), English RO (0%-AB), Noisy NST Mean, No-Cap (RO/VB), <notranslate> nob_nt (Delta), <nopunct> non_q/100w, no_neg Omit| Stage | Bokmål RO (Full / 0%-AB) | Bokmål VB (0%-AB) | Nynorsk RO (0%-AB) | English RO (0%-AB) | Noisy NST Mean | No-Cap (RO/VB) | <notranslate> nob_nt (Delta) | <nopunct> non_q/100w | no_neg Omit |
|---|
1. After Main Training (cand1, 44,913) | 9.67 / 9.65 | 9.17 | 13.62 | 23.09 | 4.67 | 4% / 6% | 11.12% (+1.216pp) | — | — |
2. After Gold (gold2, 51,206) | 9.48 / 9.45 | 9.16 | 13.36 | 22.88 | 4.92 | 3% / 3% | 9.77% (+0.069pp) | 0.7013 (FAIL) | 5/250 (6.53%) |
3. After GRPO (dec26preview, nplong-150) | 9.21 / 9.04 | 9.12 | 13.01 | 22.82 | 5.06 | 3% / 3% | 9.55% (+0.252pp) | 0.4670 (PASS) | 4/250 (6.05%) |
Training and provenance
This preview follows a three-stage post-training pipeline starting from NbAiLab/Qwen3-ASR-0.6B-custom-tokenizer:
- Main Training (
nordlyd-preview-cand1): 3 epochs (44,913 steps on 64x GH200) across 19.85M rows (29 sources, 0% audiobooks) with 10% <notranslate> and contextual keywords.
- Gold Continuation (
nordlyd-preview-cand1-gold2): 1 epoch (6,293 steps → 51,206 on 64x GH200) on 9.34M rows (nordlyd_gold2_v1), introducing <nopunct> (151702) and expanding native <notranslate>.
- GRPO Post-Training (
v7 Unified GRPO + nppol2 + np_long_fix): Multi-objective GRPO on 8x GH200 optimizing normalized WER/CER, ForcedAligner grounding (NbAiLab/nordlyd-forcedaligner-qwen06B-nov26preview), style margin (reading_optimised vs <verbatim>), <notranslate> deletion/span-F1 parity, Norwegian negation preservation, and <nopunct> punctuation suppression up to 65 s (checkpoint-150 selected for optimal balance across all gates).
See training_configs.md for the full 3-stage configuration details. Internal checkpoint reference: v7-gold2-unified-06b-np-long-fix-3227849/checkpoint-150.
Advanced: build your own prompts
The supplied helper implements the following format. Use the bundled tokenizer and chat template when building a custom client.
Table with columns: Message, Content| Message | Content |
|---|
| System | Empty by default. Use space-separated contextual keywords, start with <notranslate> (151684) to preserve spoken languages, or start with <nopunct> (151702) to suppress non-question punctuation. (<notranslate> and <nopunct> are mutually exclusive.) |
| User | Audio, optionally followed by the <verbatim> (151677) control. Reading-optimised mode uses audio alone. |
Assistant prefix for nob | language Norwegian<asr_text> |
Assistant prefix for nno | language Norwegian Nynorsk<asr_text> |
Assistant prefix for eng | language English<asr_text> |
Render the system and user messages with the bundled chat template and the assistant generation prompt, then append the selected assistant prefix once. Supply audio through the model's audio input and decode only newly generated tokens. These language names are literal prefill strings.
For language-preserving output, keep <lang_no> and <lang_en> through decoding and parse them before transcript cleanup. The bundled tokenizer retains these markers even with skip_special_tokens=True. See inference.py (make_prompt and parse_tagged) for the reference implementation.
Limitations and responsible use
- Recognition errors: the preview can repeat, omit, or substitute words, including names and specialist vocabulary. Review transcripts against the recording when accuracy matters.
- Transcription style: reading-optimised output, verbatim output, and unpunctuated (
<nopunct>) output serve different purposes. Neither guarantees an exact record of what was spoken.
- Language switching: natural within-sentence Norwegian–English switching remains experimental; synthetic joins used in SFT do not guarantee accuracy on spontaneous bilingual speech.
- Language coverage: inherited language lists and reserved tokenizer symbols do not establish evaluated support beyond Bokmål, Nynorsk, and English.
- Evaluation coverage: while our evaluation suite spans Bokmål, Nynorsk, English translation, noisy NST audio, no-caption clips,
<notranslate> code-switching, <nopunct>, and negation panels, performance can still vary across unseen dialects, speakers, domains, and acoustic conditions.
- Timestamps: alignment depends on the transcript and a separate model. Incorrect words can produce misleading word times. Automatic mixed-language alignment is unvalidated.
Handle recordings and transcripts according to your organisation's privacy and data-handling requirements. For uses where errors could affect people, include human review appropriate to the task.
License, feedback and acknowledgments
This model is released under the Apache License 2.0. See LICENSE for the full terms.
Report reproducible issues through this repository's Community tab. Include the model revision, backend, package versions, relevant options, and whether truncated or language-format errors were reported. Share audio only when you have permission to do so, or email ai-lab@nb.no.
When referring to this preview, use Nordlyd Qwen 0.6B — December 2026 preview, National Library of Norway, together with the model repository and revision used.
Nordlyd is a research project at the National Library of Norway. The National Library of Norway retains full ownership of the models and associated research outputs. Research contributions were made by Phoebe Parsons, Freddy Wetjen, Thea Tollersud, and Per Egil Kummervold, who take responsibility for any remaining errors and shortcomings.
We would like to acknowledge Sigma2 for providing computational and storage resources on the Olivia/LUMI HPC system under project NN30001K.