Search papers, labs, and topics across Lattice.
T(et)h=\frac{1}{T}\sum_{t=1}^{T}(e_{t}) where TT is the number of time frames in the audio after encoding, and ete_{t} is the encoder output at step tt. hh is a TT-dimensional vector that represents the entire utterance. This pooling strategy offers several advantages for safety. This yields a 512-dimensional vector (h) that represents the entire utterance. This pooling strategy offers several advantages for safety classification. First, it is parameter-free and computationally efficient, introducing no additional learnable parameters and adding minimal latency. Secondly, by averaging over all time steps, it highlights content that remains consistent throughout the utterance while diminishing transient acoustic events—a beneficial quality when the classification target (e.g., malicious intent, hate speech, adult content) is generally defined by prolonged linguistic or acoustic patterns [17] instead of fleeting anomalies. Third, the operation is differentiable, enabling gradients to return to the encoder while training the classification head; nonetheless, in practice, we keep the encoder frozen to maintain its pre-trained representations. III-B4 MLP Classification Head The pooled representation is fed into a two-layer MLP: • Layer 1: Linear(512, 256) + GELU + Dropout(0.1) • Layer 2: Linear(256, 2) (logits for safe/malicious) The final layer of the MLP produces raw logits for the two target classes (safe and malicious), which are transformed into well-calibrated probability scores via a SoftMax activation function. The head is trained with cross-entropy loss, using class weights to handle imbalance. III-B5 Whisper Decoder (Transcription) The decoder is unchanged from Whisper-small: 6 transformer layers, autoregressive, with cross attention to the encoder. It is frozen during the training of the classification head. During inference, it can be invoked to produce a transcript; its computation runs in parallel with the classification head after the encoder forward pass. III-C Parameter Count TABLE I: Model Parameter Summary Component Parameters Trainable? Whisper Encoder
1
0
3
Achieve near-perfect accuracy in real-time malicious speech detection without sacrificing transcription speed, using a lightweight model built on Whisper.