## 4 Experimental Setup
### Hyperparameter Tuning  
Though this work was not oriented towards optimizing the wav2 letter++ framework used to built our ASR systems, we realized that three hyperparameters were critical for ASR performance: (1) _lmweight_: the language model weight which is accumulated with the acoustic model score; (2) _silscore_: the silence score (penalty) added whenever a silence unit is appended to the output; and (3) _wordscore_: the score (penalty) added when appending a word to the output. To get the most of the wav2 letter++ framework, tuning these parameters really makes a difference. So, a random walk search (see Algorithm 1) is performed to optimize ASR performance on a tuning dataset, and then the optimal hyperparameters are applied when processing a test set. Both the tuning and test datasets are independent from the training set (see Section 4.2 for details).  
```
1:functionrwopt(\(D\), \(M\), \(N\))\(\triangleright\)\(D\): tuning data, \(M\): ASR model, \(N\): max iterations
2:\(l,s,w\gets 1,-1,1\)
3:\(\delta=(\delta_{l}\), \(\delta_{s}\), \(\delta_{w})\leftarrow(0.3\), \(0.3\), \(0.3\))
4:\(\delta^{(min)}=\left(\delta^{(min)}_{l}\), \(\delta^{(min)}_{s}\), \(\delta^{(min)}_{w}\right)\leftarrow(0.001,\ 0.001,\ 0.001)\)
5:\(E\leftarrow\emptyset\)\(\triangleright\)\(E\): grid points already evaluated
6:\(min\_wer\gets comp\_wer(D,M,l,s,w)\)
7:\(i\gets 0\)
8:while\(i<N\)and\(\delta\
eq\delta^{(min)}\)do
9:\(C\leftarrow\{(x,y,z)\mid x\gets l\pm\delta_{l},\ y\gets s\pm\delta_{s},\ z\gets w\pm\delta_{w}\}\)
10:\(C\gets C-C\cap E\)\(\triangleright\)\(C\): grid points to be evaluated at this iteration
11:if\(C\
eq\emptyset\)then
12:\(i\gets i+1\)
13:\(x,y,z\gets pick\_random(C)\)
14:\(E\gets E\cup\{(x,y,z)\}\)
15:\(wer\gets comp\_wer(D,M,x,y,z)\)
16:if\(wer\)\(<\)\(min\_wer\)then
17:\(min\_wer\gets w\)
18:\(l,s,w\gets x,y,z\)
19:endif
20:else
21:\(\delta_{l}\leftarrow\max(\delta^{(min)}_{l},\delta_{l}/2)\)
22:\(\delta_{s}\leftarrow\max(\delta^{(min)}_{s},\delta_{s}/2)\)
23:\(\delta_{w}\leftarrow\max(\delta^{(min)}_{w},\delta_{w}/2)\)
24:endif
25:endwhile
26:return\((l,s,w)\)
27:endfunction
```  
**Algorithm 1** Random walk optimization  
The method sketched in Algorithm 1 includes the initial values of the hyperparameters (_l: lmweight, s_: silscore and _w: wordscore_), the initial values of the deltas used to explore the hyperparameter space and the minimum values of those deltas, which mark an exit point when attained. All of them were heuristically adjusted in preliminary experiments. Note that the method also terminates when it reaches a maximum number of iterations \(N\), which has been set to 500 in this work. Note also that two auxiliary functions are used: (1) _comp_wer_, which is assumed to perform ASR on a dataset \(D\) using some pretrained models \(M\) and some hyperparameter values, and returns the attained Word Error Rate (WER); and (2) _pick_random_, which is assumed to return a random element from a given set. Finally, note that the method involves some amount of randomness which might produce convergence issues. To study the impact of randomness, we ran the method a number of times on different datasets and observed that the hyperparameters obtained on a given set may actually differ across runs (due to randomness), but the ASR performance attainedwas almost the same in all cases. This means that different hyperparameter values could be equally good and lead to the same (close to optimal) performance.