﻿# UnivNet reproducibility: generated noise can enter before the model forward call

Trace UnivNet feature-extractor noise versus model-generated noise, tensor-length matching, and separate random generators before comparing vocoder outputs.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-univnet-noise-sequence-rng-provenance/
Language: en

## Distinguish the paper from the implementation

The [UnivNet paper](https://arxiv.org/abs/2106.07889) describes a neural vocoder conditioned on spectral features. The [documented conversion card](https://huggingface.co/dg845/univnet-dev) explicitly identifies its checkpoint as deriving from an unofficial implementation, rather than an original-author code release. Preserve that provenance when discussing concrete inference behavior. A paper title establishes the architectural family, but the deployed library and converted artifact determine which preprocessing and random-number interfaces an application actually uses.

## Locate the noise input

The [Transformers documentation](https://huggingface.co/docs/transformers/model_doc/univnet) exposes `noise_sequence` alongside `input_features`. The noise sequence is Gaussian, and its sequence length must match the feature sequence length. It is not additive noise that a denoising service is trying to remove from a recording. It is a generative input consumed by the vocoder. Supplying an arbitrary mismatched array or replacing it with zeros changes the tested inference setup rather than merely removing an irrelevant helper argument.

## Track upstream randomness

The documented feature extractor returns generated noise by default and accepts a NumPy random generator. If noise is omitted at the model boundary, the model can generate it, with a PyTorch generator controlling that route. These are different entry points. Seeding the model's generator does not retroactively alter a noise tensor already returned by preprocessing. To reproduce a comparison, preserve the effective noise tensor or control the generator at the stage where that tensor was actually created.

## Diagnose an unstable export comparison

Suppose a converted graph matches its reference when given identical features and noise, but an end-to-end wrapper produces different waveforms across runs. Compare the prepared noise before blaming graph precision. If preprocessing regenerated it independently, the experiment changed an input as well as the implementation. Keep paired feature-and-noise fixtures and record padding removal through the documented decoding helper. This distinguishes randomness provenance from model equivalence without claiming that all output variation is caused by the same source.

## Record the full reproducibility contract

Keep checkpoint provenance, feature settings, noise source, generator type, effective tensor lengths, padding metadata, and output waveform. Guides to [tensor axes](/journal/tensor-axes-batch-sequence-hidden/) and [inference evaluation](/journal/inference-benchmark-method/) support the audit. Compare complete inputs before interpreting waveform differences. A reproducible vocoder test controls every consumed random tensor, rather than relying on a single seed label that leaves upstream feature extraction free to generate another stochastic input.
