Efficient Ensemble for Multimodal Punctuation Restoration using
  Time-Delay Neural Network
Punctuation restoration plays an essential role in the post-processing
procedure of automatic speech recognition, but model efficiency is a key
requirement for this task. To that end, we present EfficientPunct, an ensemble
method with a multimodal time-delay neural network that outperforms the current
best model by 1.0 F1 points, using less than a tenth of its inference network
parameters. We streamline a speech recognizer to efficiently output hidden
layer acoustic embeddings for punctuation restoration, as well as BERT to
extract meaningful text embeddings. By using forced alignment and temporal
convolutions, we eliminate the need for attention-based fusion, greatly
increasing computational efficiency and raising performance. EfficientPunct
sets a new state of the art with an ensemble that weights BERT's purely
language-based predictions slightly more than the multimodal network's
predictions. Our code is available at
https://github.com/lxy-peter/EfficientPunct.
Xing Yi Liu, Homayoon Beigi
Efficient Ensemble Architecture for Multimodal Acoustic and Textual Embeddings in Punctuation Restoration using Time-Delay Neural Networks

###### Abstract

Punctuation restoration plays an essential role in the post-processing procedure of automatic speech recognition, but model efficiency is a key requirement for this task. To that end, we present EfficientPunct, an ensemble method with a multimodal time-delay neural network that outperforms the current best model by 1.0 F1 points, using less than a tenth of its parameters to process embeddings. We streamline a speech recognizer to efficiently output hidden layer latent vectors as acoustic embeddings for punctuation restoration, as well as BERT to extract meaningful text embeddings. By using forced alignment and temporal convolutions, we eliminate the need for multi-head attention-based fusion, greatly increasing computational efficiency but also raising performance. EfficientPunct sets a new state of the art, in terms of both performance and efficiency, with an ensemble that weights BERT's purely language-based predictions slightly more than the multimodal network's predictions.

**Recognition Technologies, Inc. Technical Report: RTI-20230224-01**

**DOI: 10.13140/RG.2.2.29800.75528**

_Xing Yi Liu\({}^{1}\) and Homayoon Beigi\({}^{1,2}\)_

\({}^{1}\)Columbia University, New York, USA

\({}^{2}\)Recognition Technologies, Inc., New York, USA

liu.peter@columbia.edu, beigi@recotechnologies.com

**Index Terms**: speech recognition, punctuation restoration, multimodal learning

## 1 Introduction

Automatic speech recognition (ASR) systems' transformation of audio into text opens up possibilities for a wide range of downstream tasks. With natural language text, applications like machine translation and voice assistants are enabled. However, raw ASR outputs lack punctuation and hence the full meaning of texts, which must be restored for usage by the aforementioned tasks. To illustrate the importance of punctuation, consider how the meaning of the sentence, "I have a favorite, family," differs drastically from the unpunctuated version, "I have a favorite family." Punctuation restoration is therefore also important for readability of transcribed speech and accuracy of conveyed message.

Following the standard of the punctuation restoration task, we focus on three key punctuation marks which most commonly occur and play critical roles in language: commas (.), full stops (.), and question marks (?). We also consider no punctuation (NP) as a fourth class in need of our model's consideration.

### Related work

Many works and proposed architectures have been devoted to restoring punctuation, and two main research categories have emerged: (1) considering only text output from ASR, and (2) considering both text output from ASR and the original audio.

Most consider text only, effectively forming a natural language processing task. They usually train and evaluate on the benchmark, textual datasets from IWSLT 2011 and 2012. Researchers have studied a wide variety of methods, including \(n\)-gram models [1], recurrent neural networks [2, 3, 4], adversarial models [5], contrastive learning [6], and transformers [7, 8]. Conditional random fields [9, 10, 11, 12] had particularly notable success. Direct fine-tuning of BERT [13] has also proven effective, which we demonstrate in Section 4.1.

In the other category, both audio and text modalities are considered. Earlier techniques involved statistical models like finite state machines [14], but unsurprisingly, more recently we see the exploration of neural networks [15, 16] and re-purposing existing models to take audio-based input and predict punctuation [17, 18]. Current state of the art models begin in separate branches: one to tokenize and process text and the other to process raw audio waveforms. They then use the attention mechanism [19] to fuse text and acoustic embeddings [20, 21].

### Significance of multimodal approach

Despite research in multimodal punctuation restoration being far less numerous than the text-only category, [17] explicitly demonstrated the value of added acoustic information. Intuitively, audio provides more diverse features from which models may learn [22]. As a simple example, long pauses in speech are definitive indicators of a full stop's (.) occurrence. Similarly, shorter pauses may indicate a comma (.), and rising pitch is often associated with question marks (?).
The substantial benefit of involving both the transcribed text and original speech audio is that, in practical applications, we can design a highly streamlined system for restoring punctuation. Speech can first be transcribed into text by forward-passing audio signals through an ASR network, but one may preserve a hidden layer's latent representation for further usage as input (along with the transcribed text's embeddings) to a separate punctuation model. Then, the concatenated input would embed not only textual information, but also acoustics and prosody.

Our work is precisely motivated by this potential for high-speed punctuation labeling after receiving ASR output. We present EfficientPunct, a model that surpasses state of the art performance while requiring far fewer parameters, enabling practical usage.

## 2 Method

We formulate the problem as follows. We are given spoken audio signal \(\mathbf{a}=(a_{1},a_{2},\ldots,a_{S})\) and transcription words \(\mathbf{t}=(t_{1},t_{2},\ldots,t_{W})\). Here, \(S\) is the number of samples in the audio, and \(W\) is the number of words. The goal is to predict punctuation labels \(\mathbf{y}=\left(y_{1},y_{2},\ldots,y_{W}\right)\) that follow each word, where each \(y_{i}\in\{\textbf{",",".","?",NP}\}\).

As illustrated in Figure 1, EfficientPunct begins in two branches which separately process the audio signal \(\mathbf{a}\) and transcription text \(\mathbf{t}\). Their details are as follows.

### Text encoder

First, the text sequence \(\mathbf{t}\) is passed through the default WordPiece tokenizer used by BERT. Then, using a pre-trained BERT model which we have fine-tuned for predicting the four previously described punctuation classes, we obtain final hidden layer text embeddings

\[H_{t}=\text{BERT}(\mathbf{t}). \tag{1}\]

\(H_{t}\) is a matrix whose columns are \(768\)-dimensional vectors and represent embeddings of tokens. These text embeddings contain each token's context-aware information about grammar and linguistics.

### Audio encoder

To process raw spoken audio waveforms and obtain meaningful acoustic embeddings, we use a pre-trained model built using the Kaldi speech recognition toolkit [23]. This is directly analogous to previous works' usage of wav2vec 2.0 [24] as their pre-trained audio encoder. Kaldi's TED-LIUM 3 [25] framework first extracts Mel frequency cepstral coefficients (MFCCs) [22] and i-vectors, which are then passed to a time-delay neural network for speech recognition. We extract the 12th layer's representation of the input audio for further usage in the punctuation model:

\[H_{a}=\text{KaldiTedlium12}(\mathbf{a}). \tag{2}\]

\(H_{a}\) is a matrix whose columns are \(1024\)-dimensional embedding vectors. The number of columns is equal to the number of frames in the original audio.

### Alignment and fusion

The first step of fusing the \(768\)-dimensional embedding vectors from \(H_{t}\) and the \(1024\)-dimensional embedding vectors from \(H_{a}\) is to find correspondences between columns in each matrix. In other words, we must determine the text token being spoken during each frame of audio. This is performed through forced alignment. According to columns matched between the two modalities' embeddings, we concatenate them into columns of \(1792\)-dimensional embedding vectors. To fuse the two concatenated portions of each vector, we use a linear layer to learn affine transformations of embeddings which may be useful to punctuation restoration.

Many related works opt for attention-based fusion of the two modalities, but we found forced alignment and a simple linear layer to be the most parameter-efficient and competitive approach. Through experiments, we determined that more sophisticated fusion methods were counterproductive.

### Time-delay neural network

Next, the fused embeddings are passed through a time-delay neural network (TDNN) [26]. It contains a series of 1D convolution layers to capture temporal properties of the features, with a gradually decreasing number of channels. At the last convolution layer, there are \(4\) channels, with each one corresponding to a punctuation class. The channels are passed through two linear layers with weights and biases shared among the channels to output \(4\) values for softmax activation.

### Ensemble method

To complete EfficientPunct, we create an ensemble of the main TDNN and predictions using BERT's text embeddings only. We pre-trained BERT using the dark- and light-blue modules in Figure 1, which can still be used at inference time to obtain a set of predictions that only consider text, grammar, and linguistics. The other set of predictions obtained from the TDNN consider both text and audio.

Let \(\alpha\in[0,1]\) be the weight assigned to the TDNN's predictions and \(1-\alpha\) be the weight assigned to BERT's predictions. Our final predicted punctuation will be

\[f(\mathbf{a},\mathbf{t},\alpha)=\arg\max\left[\alpha y_{a}+(1-\alpha)y_{t} \right], \tag{3}\]

where \(y_{a}\) is the TDNN's softmax values and \(y_{t}\) is BERT's softmax values. Essentially, if either the TDNN or BERT outputs a maximum class probability much lower than \(1\), then the other model may help resolve the ambiguity in predicting a punctuation mark.
## 3 Experiments

### Data

Our primary dataset is the publicly available MuST-C version 1 [27], the same as that used by UniPunc [21] for sake of fair comparison. This dataset was compiled using TED talks. We also use same training and test set splits as the original authors, whose information is available on GitHub. We further split the original training set into 90% for training and 10% for validation. Please see Table 1 for full information.

Each sample is an English audio piece of approximately \(10\,\mathrm{s}\) to \(30\,\mathrm{s}\) with the corresponding transcription text. In Kaldi, we use a frame duration of \(10\,\mathrm{ms}\) for MFCCs, i-vectors, and 12th layer acoustic embeddings. We follow the procedure described in Section 2.3 to generate a matrix of aligned embeddings for each data sample. Then, to obtain examples for training and inference, we consider segments of \(301\) frames, or \(3\,\mathrm{s}\), wherein the exact middle frame is the point of transition from one text token to the next. The resulting example will thus be labeled with the punctuation following the prior token and occurring at the middle frame. We use a context window of \(3\,\mathrm{s}\), because this duration should be sufficient to capture all acoustic and prosodic information relevant to a punctuation mark, such as pauses and pitch rises. At the same time, this duration is not so long as to include much unnecessary information, such as extensions into adjacent words.

For the entire dataset, punctuation label distributions were as follows. Due to the highly imbalanced nature of the dataset, we sampled less occurring classes more frequently for training so that, in effect, all class counts are equal, and the network avoids learning only the prior probability distribution.

Moreover, since BERT was already pre-trained on massive corpora, we fine-tune it for punctuation prediction using the National Speech Corpus [28] of Singaporean English, in addition to MuST-C.

### Training

To fine-tune BERT and pre-train the text encoder, we place two linear layers on top of the base, uncased BERT's last hidden layer for four-way classification. For the pre-trained audio encoder, we use the TED-LIUM 3 [25] framework in Kaldi.

Our main TDNN module for punctuation restoration comprises seven 1-dimensional convolution layers, with said dimension spanning across time. Figure 1 shows the number of input and output channels of each layer. The kernel sizes used are, in order: \(9\), \(9\), \(5\), \(5\), \(7\), \(7\), \(5\), alternating between no dilation and a dilation of \(2\). The stride was kept at \(1\) in all layers. Additionally, we apply ReLU activation and batch normalization [29] to the output of each layer. We trained using stochastic gradient descent [30] with learning rate \(0.00001\) and momentum \(0.9\), instead of the typically used Adam optimizer [31]. This allowed for greater generalizability but still reasonable training speed [32].

To experiment with our ensemble, we explored the effect of varying \(\alpha\), the weight assigned to the TDNN for final predictions. \(1-\alpha\) is the weight assigned to BERT.

\begin{table}
\begin{tabular}{c c c} \hline \hline
**Set** & **Number of samples** & **Total duration** (\(\mathrm{h}\)) \\ \hline Training & 92,723 & 392.0 \\ Validation & 10,301 & 43.5 \\ Test & 490 & 2.8 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Training, validation, and test set information

\begin{table}
\begin{tabular}{c c c} \hline \hline
**Label** & **Number of examples** & **\% of total** \\ \hline No punctuation (NP) & 3,567,572 & 86.9\% \\ Comma (.) & 280,446 & 6.8\% \\ Full stop (.) & 238,213 & 5.8\% \\ Question mark (?) & 20,897 & 0.5\% \\ \hline \hline \end{tabular}
\end{table}
Table 2: Punctuation label distributions

Figure 1: The EfficientPunct framework. The top branch predicts using text only, while the bottom branch predicts using text and audio.
In Section 4, we report results for \(\alpha=0.3\) to \(\alpha=0.7\) in \(0.1\) increments.

We used a standard Linux computing environment hosted on Google Cloud Platform with a single NVIDIA Tesla P100 GPU. Training took roughly 2 days, and inference can be performed on CPU-only machines 50 times faster than real time, or in about 0.02 seconds per second of audio.

## 4 Results

Our results reported in Table 3 includes a comparison with current state of the art (SOTA) and best-performing models, MuSe [20] and UniPunc [21]. We also divide the reporting of EfficientPunct's results into three categories:

1. _EfficientPunct-BERT_ considers text only, which is equivalent to the fine-tuned BERT model.
2. _EfficientPunct-TDNN_ considers text and audio via our TDNN.
3. _EfficientPunct_ is an ensemble of predictions from categories (1) and (2) with \(\alpha=0.4\), the best performing weight as reported in Section 4.2.

Categories (1), (2), and (3) are reported in the third, fourth, and fifth rows of Table 3, respectively.

As is standard in punctuation restoration research, we report the F1 scores of commas, full stops, and question marks. The "overall" F1 score aggregates these while considering the imbalanced classes' varying numbers of examples. We also state each model's number of parameters to provide an indication of computational efficiency.

### EfficientPunct and submodules

Our main EfficientPunct model achieves an overall F1 score of 79.5, outperforming all current state of the art frameworks by 1.0 or more points. We also achieve highest F1 scores for each individual punctuation mark, with the most significant improvement occurring for question marks. These were accomplished with EfficientPunct using less than half of UniPunc's total number of parameters, which achieved the previous best results. The significant improvement in recognizing question marks may be attributed to our audio encoder, Kaldi's TED-LIUM 3 framework, aiming explicitly at phone recognition. In this process, the acoustics surrounding question marks may be more pronounced in the embedding representation than other acoustics models.

Even more lightweight models are EfficientPunct-BERT and EfficientPunct-TDNN. EfficientPunct-BERT is simply a concatenation of two linear layers and a softmax layer on top of BERT. With the incorporation of audio features, we observe that EfficientPunct-TDNN indeed performs slightly better.

These results validate the strength of TDNNs, traditionally used in speech and speaker recognition, in punctuation restoration. UniPunc and MuSe both used attention-based mechanisms for fusing text and acoustic embeddings, but alignments learned as such rely on trainable attention weights. Our forced alignment strategy likely generated more precise temporal matches between text and audio. Combined with a TDNN architecture, we achieved a significantly more efficient model.

### Ensemble weights

In this section, we observe the effect of ensemble weights on EfficientPunct's performance. Equation 3 details the role of \(\alpha\) in weighting predictions made by the TDNN and BERT, with \(\alpha=0\) meaning pure consideration of BERT, and \(\alpha=1\) meaning pure consideration of the TDNN.

Table 4 reports the effect of \(\alpha\) on model performance. When both BERT and the TDNN play an approximately equal role in the ensemble, a fair voting mechanism is enabled, and we achieve the highest F1 scores. However, notice that \(\alpha=0.4\), a weight that considers BERT slightly more strongly than the TDNN, achieves the maximum overall F1. This gain comes mostly from sharper comma predictions, which present notorious difficulties due to varying grammatical and (transcription) writing styles. We reason that \(\alpha=0.4\) excels, because a stronger reliance on BERT's language modeling perspective yields more linguistically correct punctuation, as agreed upon by countless writers' contributions to BERT's training corpora.

The strength of our ensemble method is that, in cases of uncertain predictions by either party, i.e. approximately equal softmax probabilities over all classes, the other can provide guidance to clarify the ambiguity. This process demands very little additional parameters through which the input must be passed, as shown by the last two rows of Table 3, but greatly advances state of the art performance.

### Parameter Breakdown

In order to show the specific modules in which we attain superior efficiency, we further break down the parameters count from the last column of Table 3. In Table 5, we detail the number of parameters devoted by each model to extracting embeddings and inferring those embeddings to make punctuation decisions.

EfficientPunct requires much less computational cost in both the embedding extraction and inference stages. Our usage of Kaldi's TED-LIUM 3 model brought massive efficiency gains compared to MuSe and UniPunc's usage of wav2vec 2.0. Moreover, our inference module uses less than a tenth of UniPunc's parameters in the same stage, which achieved the previous best results.
## 5 Conclusion

In this paper, we explored the application of time-delay neural networks in punctuation restoration, which proved to be more computationally efficient than and as effective as previous approaches. Combined with BERT in an ensemble, EfficientPunct establishes a strong, new state of the art with a fraction of previous approaches' number of parameters. A key factor of our model's success is removing the need for attention-based fusion of text and audio features. In previous approaches, multiple attention heads added extraordinary overhead in the punctuation prediction stage. We demonstrated that forced alignment of text and acoustic embeddings, in conjunction with temporal convolutions, rendered attention unnecessary.

Additionally, we studied the effect of different weights assigned to members of the ensemble. We found that a slightly stronger weighting of BERT against the multimodal TDNN optimized performance by emphasizing language rules associated with punctuation.

In future works, the effectiveness of jointly training ensemble weights and the TDNN may be examined, which could allow the learning of an optimal ensemble. Jointly training with the text and audio encoders may also be considered, but this procedure should not inhibit the encoders' generalizability for purposes other than punctuation restoration. Finally, we would like to explore the applicability of EfficientPunct in more languages and a similar framework for other post-processing tasks of speech recognition.
