Skip to content

fix(asr): fix beam score normalization - #16175

Draft
naymaraq wants to merge 2 commits into
mainfrom
dkaramyan/improve-beam-search-cache-aware
Draft

fix(asr): fix beam score normalization#16175
naymaraq wants to merge 2 commits into
mainfrom
dkaramyan/improve-beam-search-cache-aware

Conversation

@naymaraq

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 ?

Add a one line overview of what this PR aims to accomplish.

Collection: [Note which collection this PR will affect]

Changelog

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

Usage

  • You can potentially add a usage example below
# 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.

Trusted PRs run automatically through copy-pr-bot. For an untrusted PR, a maintainer can trigger CI by commenting
/ok to test <head-sha>; repeat this after a new push if the PR remains untrusted.

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)
…eaming

select_best_beam_idx_(score_norm=True) ranked beams at every EOU using
score / (current_lengths_nb + 1), but both fields are cumulative over the
whole stream -- they are only ever collapsed, never reset, at each EOU.
On a multi-utterance stream this dilutes the ranking signal for utterance
2, 3, ... and manifests as leading-word truncation once enough prior
session mass has accumulated (confirmed on SLURP: 19.07% WER at
beam_size=12, ngram_lm_alpha=0.5, vs 14.29% fixed).

Snapshot a per-utterance (score, length) baseline right after each EOU
beam collapse and subtract it before normalizing. Also generalize the
length term to a tunable length_norm_power (default 1.0, unchanged
behavior) -- a SLURP sweep across the full beam_size x ngram_lm_alpha
grid shows p=1.0 is never optimal and p=0 collapses to empty hypotheses
under LM fusion once alpha >= 0.2; see BEAM_SEARCH_LENGTH_NORM_FIX.md for
the full comparison table and recommended operating points.

Signed-off-by: naymaraq <dkaramyan@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Aug 31, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the ASR label Aug 31, 2026
…dation

The SLURP comparison table was measured with endpointing.residue_tokens_at_end=0
on the old side, not main's actual default of 2. Direct A/B on pristine main
alone (same code, only that flag changed) shows WER at beam_size=12,
ngram_lm_alpha=0.5 jumping from 14.391% (rte=2, true default) to 19.071%
(rte=0) -- most of the previously reported improvement was an artifact of an
unrelated EoU-buffer-sizing bug being incidentally masked by that setting, not
the beam-normalization fix itself. Re-running the grid at the correct default
before restoring this doc with valid numbers.

Signed-off-by: naymaraq <dkaramyan@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 participant