Skip to content

Add batched streaming beam search for RNN-T (mALSD+mAES) and TDT (mALSD) - #15753

Merged
lilithgrigoryan merged 24 commits into
mainfrom
lgrigoryan/streaming-beam-search
Jun 8, 2026
Merged

lilithgrigoryan merged 24 commits into
mainfrom
lgrigoryan/streaming-beam-search

Conversation

@lilithgrigoryan

@lilithgrigoryan lilithgrigoryan commented Jun 4, 2026 •

Copy link
Copy Markdown
Collaborator

Important

The Update branch button must only be pressed in very rare occassions.
An outdated branch is never blocking the merge of a PR.
Please reach out to the automation team before pressing that button.

What does this PR do ?

Adds streaming-aware variants of the MALSD (malsd_batch, batched + CUDA-graphs) and MAES (maes_batch, torch eager) beam-search decoders for both RNN-T and TDT.

Word boosting and n-gram LM fusion are both supported.

Follow-up PRs (planned, separate):

  1. Wire the new decoders into the cache-aware streaming inference scripts in examples/asr/asr_chunked_inference/rnnt/.
  2. Add buffered RNN-T support to the same streaming inference scripts.

Internal WB test set (word boosting) — α=1.3 for both greedy and beam.
Model: nvidia/stt_en_fastconformer_transducer_large

strategy beam fusion WER WERR vs greedy
greedy – – 31.91% —
greedy – WB 27.75% +13.03%
malsd 4 WB 25.01% +21.62%
malsd 8 WB 24.08% +24.54%

SLURP test set (n-gram LM fusion) — α=0.8 greedy, α=0.4 beam.
Model: nvidia/stt_en_fastconformer_tdt_large

strategy beam fusion WER WERR vs greedy
greedy – – 23.68% —
greedy – LM 22.46% +5.15%
malsd 4 LM 19.69% +16.85%
malsd 8 LM 19.26% +18.66%

Headline: streaming MALSD + fusion gives +18–25% relative WER reduction vs streaming greedy on both datasets, with the gain growing monotonically with beam size.

Collection: [Note which collection this PR will affect]

Changelog

  • Add specific line by line info of high level changes in this PR.

Usage

Example

Run streaming beam search on your own data:

python examples/asr/asr_chunked_inference/rnnt/speech_to_text_streaming_infer_rnnt.py \
    pretrained_name=nvidia/stt_en_fastconformer_transducer_large \  # or nvidia/stt_en_fastconformer_tdt_large
    dataset_manifest=/path/to/your_test_manifest.json \
    output_filename=preds.jsonl \
    left_context_secs=10 chunk_secs=2 right_context_secs=2 \
    batch_size=256 \
    decoding.strategy=malsd_batch \  # or maes_batch for RNN-T
    decoding.beam.beam_size=4 \
    decoding.beam.allow_cuda_graphs=true

Usage with word-boosting:

python examples/asr/asr_chunked_inference/rnnt/speech_to_text_streaming_infer_rnnt.py \
    pretrained_name=nvidia/stt_en_fastconformer_transducer_large \  # or nvidia/stt_en_fastconformer_tdt_large
    dataset_manifest=/path/to/your_test_manifest.json \
    output_filename=preds.jsonl \
    left_context_secs=10 chunk_secs=2 right_context_secs=2 \
    batch_size=256 \
    decoding.strategy=malsd_batch \  # or maes_batch for RNN-T
    decoding.beam.beam_size=4 \
    decoding.beam.allow_cuda_graphs=true \
    decoding.beam.boosting_tree.key_phrases_file=/path/to/key_phrases.txt \
    decoding.beam.boosting_tree_alpha=1.3

Usage with LM fusion:

python examples/asr/asr_chunked_inference/rnnt/speech_to_text_streaming_infer_rnnt.py \
    pretrained_name=nvidia/stt_en_fastconformer_transducer_large \  # or nvidia/stt_en_fastconformer_tdt_large
    dataset_manifest=/path/to/your_test_manifest.json \
    output_filename=preds.jsonl \
    left_context_secs=10 chunk_secs=2 right_context_secs=2 \
    batch_size=256 \
    decoding.strategy=malsd_batch \  # or maes_batch for RNN-T
    decoding.beam.beam_size=4 \
    decoding.beam.allow_cuda_graphs=true \
    decoding.beam.ngram_lm_model=/path/to/your.kenlm.nemo \
    decoding.beam.ngram_lm_alpha=0.4

GitHub Actions CI

The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.

The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR.
To re-run CI remove and add the label again.
To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

PR Type:

  • New Feature
  • Bugfix
  • Documentation

If you haven't finished some of the above items you can still open "Draft" PR.

Who can review?

Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.

Additional Information

  • Related to # (issue)

Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com>
Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com>
Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com>
Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com>
Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com>
Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com>
@github-actions github-actions Bot removed the core Changes to NeMo Core label Jun 4, 2026
Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com>
Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com>
Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com>
artbataev
artbataev previously approved these changes Jun 8, 2026

@artbataev artbataev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!!
Major suggestion: add tests to tests/functional_tests/L2_Speech_Transcription_Speech_to_Text_Streaming_Infer.sh similar to existing to ensure malsd/maes_batch executed end-to-end on CI (at least for RNN-T).

Also, minor suggestions below.

Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com>
Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com>
Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com>
Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com>
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

[🤖]: Hi @lilithgrigoryan 👋,

We wanted to let you know that a CICD pipeline for this PR just finished successfully.

So it might be time to merge this PR or get some approvals.

@lilithgrigoryan
lilithgrigoryan requested a review from artbataev June 8, 2026 17:20

This branch was previously deployed

2 inactive deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants