Skip to content

add per-stream biasing to RNN-T, TDT streaming beam search#15781

Merged
lilithgrigoryan merged 11 commits into
mainfrom
lgrigoryan/streaming-beam-search-multistrem-biasing
Jun 16, 2026
Merged

add per-stream biasing to RNN-T, TDT streaming beam search#15781
lilithgrigoryan merged 11 commits into
mainfrom
lgrigoryan/streaming-beam-search-multistrem-biasing

Conversation

@lilithgrigoryan

@lilithgrigoryan lilithgrigoryan commented Jun 10, 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 ?

  1. TDT hypothesis pruning: This change updates how TDT models prune hypotheses during decoding.

Before:
Hypotheses were selected using top-k over the full joint space: (V + 1) × num_durations

This means the decoder selected the top-k combinations of token and duration jointly.

After:
Hypotheses are pruned in two steps:

top-k over (V + 1) tokens
top-1 over num_durations

This makes beam transcripts more diverse and improves word-boosting quality for TDT models

  1. Adds per-stream biasing support to RNN-T and TDT streaming beam search for malsd_batch decoding algorithm

Collection: [Note which collection this PR will affect]

Changelog

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

Usage

python examples/asr/asr_chunked_inference/rnnt/speech_to_text_streaming_infer_rnnt.py \
  pretrained_name=nvidia/stt_en_fastconformer_transducer_large \
  dataset_manifest=/home/lgrigoryan/data/en/nvtalks_dataset/nemo_manifest_test_boost_gt.jsonl \
  batch_size=128 \
  output_filename=work/streaming_beam_search_pr/multibiasing/transducer_malsd_streaming_simfalse_biastrue_cudafalse.json \
  allow_mps=true \
  compute_dtype=bfloat16 \
  use_per_stream_biasing=true \
  calculate_rtfx=true \
  left_context_secs=10 \
  chunk_secs=2 \
  right_context_secs=2 \
  decoding.strategy=malsd_batch \
  decoding.beam.beam_size=4 \
  decoding.beam.allow_cuda_graphs=false
# Add a code snippet demonstrating how to use this 

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)

artbataev and others added 3 commits June 10, 2026 17:30
Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com>
Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com>
Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com>
@lilithgrigoryan lilithgrigoryan force-pushed the lgrigoryan/streaming-beam-search-multistrem-biasing branch from f3f320e to e701117 Compare June 10, 2026 13:33
Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com>
Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com>
Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com>
@artbataev

Copy link
Copy Markdown
Collaborator

/claude review

Comment thread nemo/collections/asr/parts/submodules/tdt_malsd_batched_computer.py
Comment thread tests/collections/asr/decoding/test_streaming_beam_decoding.py

@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.

Please move the logic to GPUBiasingMultiModel.get_alphas or smth like this.
Everything else looks good.
Also, there is a failing test on CI - please fix.

Comment thread nemo/collections/asr/parts/submodules/rnnt_malsd_batched_computer.py Outdated
Comment thread nemo/collections/asr/parts/submodules/tdt_malsd_batched_computer.py Outdated
Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com>
Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com>
…/streaming-beam-search-multistrem-biasing
Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com>
Signed-off-by: lilithgrigoryan <lgrigoryan@nvidia.com>
@github-actions

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.

@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.

Thanks!

@lilithgrigoryan lilithgrigoryan merged commit b483512 into main Jun 16, 2026
266 checks passed
@lilithgrigoryan lilithgrigoryan deleted the lgrigoryan/streaming-beam-search-multistrem-biasing branch June 16, 2026 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants