{'fraction_non_alphanumeric': 0.03138759966678567, 'fraction_numerical': 0.011573247649648935, 'mean_word_length': 4.82749653259362, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
HD-cos Networks: Efficient Neural Architectures for Secure Multi-Party Computation

Multi-party computation (MPC) is a branch of cryptography where multiple non-colluding parties execute a well designed protocol to securely compute a function. With the non-colluding party assumption, MPC has a cryptographic guarantee that the parties will not learn sensitive information from the computation process, making it an appealing framework for applications that involve privacy-sensitive user data. In this paper, we study training and inference of neural networks under the MPC setup. This is challenging because the elementary operations of neural networks such as the ReLU activation function and matrix-vector multiplications are very expensive to compute due to the added multi-party communication overhead. To address this, we propose the HD-cos network that uses 1) cosine as activation function, 2) the Hadamard-Diagonal transformation to replace the unstructured linear transformations. We show that both of the approaches enjoy strong theoretical motivations and efficient computation under the MPC setup. We demonstrate on multiple public datasets that HD-cos matches the quality of the more expensive baselines.


Introduction
Machine learning models are often trained with user data that may contain private information. For example, in healthcare patients diagnostics contain sensitive information and in financial sectors, user data contains potentially private information such as salaries and taxes. In these applications, storing the user data in plain text format at a centralized server can be privacy invasive. There have been several efforts to design secure and private ways of learning and inferring machine learning models. In this work, we focus on secure multi-party computation (MPC), a branch of cryptography that allows parties to collaboratively perform computations on data sets without revealing the data they possess to each other (Evans et al., 2017). Recently, there are several research papers that proposed to train and infer machine learning models in a secure fashion via MPC (Gilad-Bachrach et al., 2016;Graepel et al., 2012;Obla et al., 2020). Loosely speaking, in the MPC setup, a piece of sensitive data is split into multiple shards called secret shares, and each secret share is stored with a different party. These parties are further chosen such that their fundamental interests are to protect sensitive data and hence can be viewed as non-colluding. The cryptography guarantee states that unless all the parties (or at least k out of all parties, depending on the cryptographic algorithm design) collude, sensitive data cannot be reconstructed and revealed to anyone/anything.
Training in the MPC setup is challenging due to several reasons. Firstly, only limited data types (e.g. integer) and/or operations (e.g. integer addition and multiplication) are natively supported in most MPC algorithms. This increases the complexity to support non-trivial operations over MPC. Secondly, since data is encrypted into multiple secret shares and stored in multiple parties, one share per party, directly training a machine learning model on this data can be expensive, both in terms of communication between the servers and computation at the individual servers. More concretely if simple operations like addition and multiplications take orders of nanoseconds in the normal computation scenarios, in the MPC setup they can take milliseconds or more, if the operation requires the parties in the MPC setup to communicate with each other. Furthermore, one of the key bottlenecks of secret sharing mechanisms is that most non-linear operations e.g., ReLU(x) = max(0, x), cannot be efficiently computed.
In this paper, we address these questions by proposing a general network construct that can be implemented in MPC setup efficiently. Our proposal consists of two parts: 1) use the cosine function as the activation function, and 2) use a structured weight matrix based on the Hadamard transform in place of the standard fully connected layer. We provide an algorithm to compute cosine under two-party computation (2PC) setup. Unlike ReLU which involves multiple rounds of communication, our proposed algorithm for cosine requires only two online rounds of communication between the two computation servers. The use of the proposed Hadamard transform for weight matrices means that the number of parameters in each dense layer scales linearly with the input dimenion, as opposed to the standard dense layer which scales quadratically. We demonstrate on a number of challenging datasets that the combination of these two constructs leads to a model that is as accurate as the commonly used ReLU-based model with fully connected layers.
The rest of the paper is organized as follows. We first overview multiparty computation in Section 2 and then overview related works in Section 3. We present the cosine activation function and structured matrix transformation with theoretical motivations and analysis of their computational efficiency in Section 4 and Section 5. We then provide extensive experimental evaluations on several datasets in Section 6.

Multi-party computation
Secure multi-party computation (MPC) is a branch of cryptography that allows two or more parties to collaboratively perform computations on data sets without revealing the data they possess to each other (Evans et al., 2017). Following earlier works (Liu et al., 2017;Mohassel & Zhang, 2017;Kelkar et al., 2021), we focus on the two party computation (2PC) setup. Our results can be extended to multi-party setup by existing mechanisms. If the two parties are non-colluding, then 2PC setup guarantees that the two parties will not learn anything from the computation process and hence there is no data leak.
During training in the 2PC setup, each party receives features and labels of the training dataset in the form of secret shares. They compute and temporarily store all intermediate results in the form of secret shares. Thus during training, both the servers collaboratively learn a machine learning model, which again is split between two parties. Upon completion of the training process, the final result, i.e. the ML model itself, composed of trained parameters, are in secret shares to be held by each party in the 2PC setup. At prediction time, each party receives features in secret shares, and performs the prediction where all intermediate results are in secret shares. The MPC cluster sends the prediction results in secret share back to the caller who provided the features for prediction. The caller can combine all shares of the secret prediction result into its plaintext representation. In this entire training/prediction process, the MPC cluster does not learn any sensitive data.
While MPC may provide security/privacy guarantee and is Turing complete, it might be significantly slower than equivalent plaintext operation. The overall performance of MPC is determined by the computation and communication cost. The computation cost in MPC is typically higher than the cost of equivalent operations in cleartext. The bigger bottleneck is the communication cost among the parties in the MPC setup. The communication cost has three components.
• Number of rounds: the number of times that parties in the MPC setup need to communicate/synchronize with each other to complete the MPC crypto protocol. For 2PC, this is often equivalent to the number of Remote Procedure Calls (or RPCs) that the two parties need per the crypto protocol design. Many MPC algorithms differentiate offline rounds vs. online rounds, where the former is input-independent and can be performed asynchronously in advance, and the latter is input-dependent, is on the critical path for the computation and must be performed synchronously. For example, addition of additive secret shares requires no online rounds, whereas multiplication of additive secret shares requires one online round.
field and the non-linear activations are computed at the clients directly in plaintext. The main caveat of this approach is that, to compute a L layer neural network, L rounds of communication is required between server and clients which can be prohibitive and furthermore intermediate results are leaked to the clients, which may not be desired. To overcome the information leakage, Orlandi et al. (2007) proposed methods to hide the results of the intermediate data from the clients; the method still requires multiple rounds of communication. Liu et al. (2017) proposed algorithms that allows for evaluating arbitrary neural networks; the intermediate computations (e.g., sign(x)) are much more expensive than summations and multiplications.
Efficient activation functions. Since inferring arbitrary neural networks can be inefficient, several papers have proposed different activation functions which are easy to compute. Gilad-Bachrach et al. (2016) proposed to use the simple square activation function. They also proposed to use mean-pooling instead of max-pooling. Chabanne et al. (2017) also noticed the limited accuracy guarantees of the square function and proposed to approximate ReLU with a low degree polynomial and added a batch normalization layer to improve accuracy. Wu et al. (2018) proposed to train a polynomial as activation to improve the performance. Obla et al. (2020) proposed a different algorithm for approximating activation methods and showed that it achieves superior performance on several image recognition datasets. Recently Knott et al. (2021) released a library for training and inference of machine learning models in the multi-party setup.
Cosine as activation function. Related to using cosine as the activation function, Yu et al. (2015) proposed the Compact Nonlinear Maps method which is equivalent of using cosine as the activation function for neural networks with one hidden layer. Training machine learning models under MPC. Graepel et al. (2012) proposed to use training algorithms that can be expressed as low degree polynomials, so that the training phase can be done over encrypted data. Aslett et al. (2015) proposed algorithms to train models such as random forests over training data. Mohassel & Zhang (2017) proposed a 2PC setup for training and inference various types of models including neural networks where data is distributed to two non-colluding servers. Kelkar et al. (2021) proposed an efficient algorithm for Poisson regression by adding a secure exponentiation primitive.
Combining with differential privacy. We note that while the focus of this work is multiparty computation, it can be combined with other privacy preserving techniques such as differential privacy (Dwork et al., 2014). There are some recent works which combine MPC with differential privacy (Jayaraman & Wang, 2018). Systematically evaluating performances with the combination of our proposed technique and that of differential privacy remains an interesting future direction.

Cosine as activation
The most widely used activation function in the non-MPC setup is the Rectified Linear Unit (ReLU) function: ReLU(x) = max(0, x). Unfortunately, it is not efficient to compute ReLU under the MPC setup. To this end, Wu et al. (2018) and Obla et al. (2020) proposed to approximate ReLU with low-degree polynomials. This still incurs large communication cost as it requires d − 1 online online rounds of communications to compute d-degree polynomial approximation. Another simple alternative is the square function (Gilad-Bachrach et al., 2016). In this case, the trained neural network often has a subpar quality as noted by Wu et al. (2018).
In this work, we propose to use cosine as the activation function. We show that it has good theoretical properties (Section 4.1) and can be implemented efficiently under the 2PC setup (Section 4.2). We compare different activation functions in Figure 1 and give the corresponding computation costs in Table 4.

Theoretical motivation of cosine
When using cosine as the activation function, the output of a neural network layer becomes cos(W x + b), where x ∈ R d is the input, W ∈ R k×d is the weight matrix, and b ∈ R k is a bias vector. This form coincides with the Random Fourier Feature method (Rahimi & Recht, 2007), widely used in the kernel approximation literature. Kernel method is a type of powerful nonlinear machine learning models that is computationally expensive to scale to large-scale datasets. Kernel approximation methods aim at mapping the input into a new feature space, such that the dot product in that space approximate the value of the kernel. The benefit is that a linear classifier trained in the mapped space approximate a kernel classifier.
Let φ(x) = cos(W x + b), the follow result in Rahimi & Recht (2007) shows that φ(x) · φ(y) approximates a shift-invariant kernel with proper choice of the parameters in W and b. Note that since (Rahimi & Recht, 2007), there have been many improvements of Random Fourier Features such as better rate of approximation (Sriperumbudur & Szabó, 2015) and more efficient sampling (Yang et al., 2014). Cosine is also shown to be able to approximate other kernel types such as the polynomial kernels on unit sphere (Pennington et al., 2015).
Lemma 1 (Cosine approximates a shift-invariant kernel (Rahimi & Recht, 2007) The above lemma shows that, at random initialization, a linear classification model trained with the transformed features using cosine approximates a kernel-based classifier. In specific, if the weights {w i } D i=1 are sampled from a Gaussian distribution, the model is approximating a Gaussiankernel based classifier, already a strong baseline at initialization.
Besides the connection the kernel methods, cosine and its derivative are bounded functions. As shall be seen in our experiments, having a linearly-growing (e.g., ReLU) or a bounded activation (e.g., cos) means that the model can be trained without carefully fine-tuning the optimization method. That is, models with the cosine activation can be trained with a wide range of learning rates, in contrast to, for instance, the square function which grows quickly enough that a careful choice of learning rate is needed to prevent numerical overflow. Note that techniques like batchnorm that improves stability in neural network training are hard to be applied under the MPC setup due to the expensive operation of division. Hence, having a numerically stable activation function is very important.

Algorithm to compute cosine activation function
In this section, we provide an algorithm to compute cosine activation function in the 2PC setup. The algorithm is given in Figure 1. We state the algorithm in the bracket notation, where [y] i denote the shard of y located in server i . Therefore By the trignometric identity cos(a + b) = cos(a) cos(b) − sin(a) sin(b), Theorem 1. Cosine can be computed in the 2PC setup with two online rounds of communication.
Proof. Observe that in Algorithm 1 the overall computation only requires known 2PC protocols for addition, secure exchange, and multiplication. Addition does not require any online rounds. It is known that multiplication can be implemented using Beaver Triplets Beaver (1991) in one online round. Finally secure exchange requires one online round of communication. Hence the total number of online rounds of communication is two.

Fast linear transformation using the Hadamard-Diagonal matrices
One elementary computation in neural network is linear transformation: 3. Multiplication:

Final computation:
Algorithm 1: Securely compute cosine activation in the 2PC setup. Mult() refers to the known secure multiplication protocol based on Beaver Triplets (Beaver, 1991).
the MPC setup, both W and x are encrypted and thus computing their product requires bandwidth proportional to O(dk), which can be prohibitive.
In this paper we propose to impose specific types of structure on the W matrix. For simplicity, let us assume k = d. 1 We propose using W = HD, where D ∈ R d×d is a diagonal matrices with learnable weights, and H is the normalized Walsh-Hadamard matrix of order d with the following recursive definition:

Theoretical motivations
Speeding up linear transformations y = W x has been an extensively studied topic under different applications. For example, in dimensionality reduction (k < d), when the element of W are sampled iid from a Gaussian distribution, the well-known Johnson-Lindenstrauss lemma states that the l2 distance of the original space is approximately preserved in the new space. Here W can be replaced by structured matrices such as the fast Johnson-Lindenstrauss transformation (a sparse matrix, a Walsh-Hadamard matrix, and a random binary matrix) (Ailon & Chazelle, 2006), sparse matrices 1 k < d can be handled with picking the first k elements of the output. x can be padded with 0s such that d is a power of 2. (Matoušek, 2008) and circulant matrices (Hinrichs & Vybíral, 2011). Such matrices give faster computation with similar error bound. Another example is binary embedding y = sign(W x). When elements of W are sampled iid from the standard Gaussian distribution, the Hamming distance of the new space approximates the angle of the original space. Similarly, this operation can be made faster with structured matrices such as circulant (Yu et al., 2018) and bilinear matrices (Gong et al., 2013). Several types of structures have also been applied in speeding up the fully connected layers in neural networks. Examples are circulant (Cheng et al., 2015), fastfood (Yang et al., 2015), low-displacement rank (Thomas et al., 2018) matrices.
The reason why we chose to use the Hadamard-Diagonal structure goes back to the literature of kernel approximation. It was shown that by using such a structure, the mapping y = cos(W x) provides even lower approximation error of a shift-invariant kernel (Yu et al., 2016) in comparison with the random unstructured matrices. Notice that other types of structures such as "fastfood" (Le et al., 2013) and circulant do not have such good properties. By pairing cosine with the Hadamard-Diagonal structure, even at initialization, the feature space already well mimic that of a kernel. Furthermore, by optimizing the weights of the diagonal matrices, we are implicitly learning a good shift invariant kernel for the task. In Section 6 we show that this structure almost does not hurt the quality of the model while reducing the computational cost. We also show in the appendix that cosine is indeed performing better than circulate and fastfood.

Cost of computing the Hadamard-Diagonal transformation
There are two operations in computing the Hadamard-Diagonal transformation.
1. Multiplication with a variable diagonal matrix. This involves O(d) secure multiplications.

Multiplication with a fixed Hadamard matrix. Since the Hadamard matrix is a linear trans-
formation that is fixed and publicly known, multiplying a vector with Hadamard matrix requires O(d log d) sums and subtractions on each server locally and does not require any communication between the servers.
Thus computing HDx for a vector x, requires O(d log d) sums and subtractions locally and O(d) bits of communication. This is significantly smaller than the traditional matrix vector multiplication, which requires O(d 2 ) bits of communication between the two servers. Note that one can simply improve the model capacity by using multiple HD blocks such as y = HD 3 HD 2 HD 1 x. We empirically observe that more blocks only provides marginal quality improvements, yet much high computational cost. So in this work, we advocate using a single HD block.

Experiments
In this section, we study how modeling choices affect the model prediction accuracy. These choices include the optimization method, activation function, number of layers, and structure of weight matrices. For all the experiments, we use SGD as the optimizer as it is known that implementing optimizers which compute moments such as Adam incurs significantly more overhead in MPC setup. For all the datasets, we sweep learning rates in the set {1e-5, 1e-4, 1e-3, 0.01, 0.1, 0.5}, and show the best averaged result over five trials. We note that our goal here is not to produce the state-of-the-art results on datasets we consider. In fact under the MPC setup, it is not practical to use many more advanced architectures (e.g. attention), optimizes (e.g. Adam) and techniques (e.g. batchnorm).
Rather, we aim to investigate the predictive performance of simple models that are suitable for the MPC setup. More specifically, we provide empirical evidence for the following important findings: 1. Cosine activation performs better than other existing activation functions in the 2PC setup. Furthermore, the performance is significantly superior if the network has many layers.
2. Replacing dense matrices with Hadamard-diagonal matrices incurs only a small performance degradation.
We report additional results in the appendix. There, we show that cosine activation is more stable to train compared to square activation and hence is preferred in the MPC setup. While the use of an adaptive optimization procedure like Adam (Kingma & Ba, 2014) is limited in the MPC setting, for completeness, we report our results with Adam in the appendix, where we show that cosine still performs better than other existing activation functions. In the main text, we will focus on SGD as our optimization method of choice. For all experimental results reported, the standard deviation computed across trials is in the order of 0.1 or smaller i.e., the only factor of variability is the initialization. We omit the standard deviation for brevity. Datasets We consider four classification datasets: MNIST, Fashion-MNIST, Higgs, and Criteo. These data cover challenging problems from computer vision, physics and online advertising domains, respectively. Briefly the MNIST and Fashion-MNIST datasets are 10-class classification problems where each example is an image of size 28 × 28 pixels. The Higgs dataset 2 represents a problem of detecting the signatures of Higgs Boson from background noise (Baldi et al., 2014). This is a binary classification problem where each record consists of 28 floatingpoint features representing kinematic properties. We randomly subsample 7.7M records (70%) from the available 11M examples, and use them for training. The remaining 3.3M records are used for testing. The Criteo dataset is a challenging ad click-through rate prediction problem, and was used as part of a public Kaggle competition. 3 There are 36 million records in total with 25.6% labeled as clicked. We preprocess the Criteo data following the setup of Wang et al. (2017). More technical details regarding these datasets and propcessing steps can be found in Section A in the appendix.

Datasets and Models
Models For MNIST and Fashion-MNIST, we use LeNet-5 (LeCun et al., 1998) Wang et al. (2017) and use an MLP with four hidden layers, with 1024 hidden units in each. In all cases, we consider three variants for each dense layer in the model: 1) the standard dense (fully connected) layer, 2) the fast Hadamard-Diagonal layer as proposed in Section 5, and 3) a dense layer where the weight matrix has rank at most two i.e., the weight matrix W = V 1 V 2 where both matrices V 1 and V 2 have two rows. Table 2 summarizes our results for different activation functions. Recall that for each activation function, we report the best trial-averaged performance across a number of learning rate candidates (trained with SGD). Here we use the standard dense layer, as opposed to a structured weight matrix. We report the test accuracy for all datasets, except for Criteo where we instead report AUC-PR which is more appropriate for its skewed label distribution. We observe that our proposed cosine activation function performs as well as the standard activation function like ReLU, while being more computationally tractable for the 2PC setup. To understand other activation functions, consider the example of Higgs dataset. In this dataset, using no activation function yields an accuracy of 63.5%, whereas e x − 1 and Square only performance at the chance level since theses models struggle to train without a numerical issue. Specifically, a closer inspection reveals that these activation functions grow fast, and require a careful choice of the optimization method, and learning rate to prevent numerical overflow. By contrast, cosine is bounded and is more robust to a sub-optimal choice of the optimization algorithm (more on this point in the appendix). We also investigated the performance of these activations as a function of number of layers for the Higgs dataset. The results are given in Figure 2 where the proposed Hadamard structure is used for all activation functions. While most activation functions perform well with fewer hidden layers, only cosine and ReLU performs well as the number of layers increases. This is because these functions grow at most linearly as their derivatives are bounded by one, and do not require a careful tuning of the learning rate to prevent numerical overflow. We note that the same observation holds true when we use the standard dense layer, and a low rank weight matrix. We omit these results for brevity. More discussion on this aspect can be found in Section B.2 in the appendix.

Structured matrices
Next we investigate the effect of using a structured weight matrix in each dense layer. To this end, we consider the cosine activation function for all datasets, and consider replacing each dense layer with one of the three variants described in Section 6.1: 1) the standard dense layer (Dense), 2) the proposed Hadamard-Diagonal layer (Hadamard) as described in Section 5, and 3) dense layer with a weight matrix of at most rank two (Low rank). We present test accuracy and AUC-PR in Table 3. It can be seen that using the Hadamard weight matrix incurs a minor loss of performance across different datasets, compared to the standard dense layer. Recall that the number of parameters in the proposed Hadamard-Diagonal layer is only linear in the number of inputs, as opposed to being quadratic as in the standard dense layer. Interestingly the performance of the low-rank weight matrix is lower than that of the Hadamard weight matrix, even though it has four times as many learnable parameters. This hints that having an orthogonal weight matrix helps increase expressiveness of the model, presumably because it forms a basis in the latent feature space of the network.  Table 3: Test accuracy on the four problems with cosine activation function. For Criteo where the label distribution is skewed, we report AUC-PR.
In fact, we observe that the superiority of the Hadamard-Diagonal layer to the low-rank weight matrix is not specific to cosine. We provide evidence in Table 4 where we report performance on Fashion-MNIST and Criteo for each combination of activation function and type of weight structure. Note that for Criteo, since the two classes are skewed with roughly 25% of the data belonging to the positive class, we report AUC-PR instead of the test accuracy. We observe that in most cases our proposed Hadamard structure yields models with higher performance than the low rank approach does for all activation functions, while being competitive to the standard dense layer (which has an order of magnitude more parameters). We include comparisons to more baselines in Table 9 in the Appendix: PHD (Yang et al., 2015) and Circulant matrix (Cheng et al., 2015). There too we find Hadamard tranform to be the best performing approach.

Discussion and future work
The HD-cos approach offers a generic, computationally efficient building block for training and inference of a neural network in the multi-party computation setup. The efficiency gain is a result of two novel ideas: 1) use a fast Hadamard transform in place of the standard dense layer to reduce the number of parameters from d 2 to d parameters where d is the input dimension; 2) use cosine as the activation function. As we demonstrated, the smoothness and boundedness of its derivative helps ensure robust training even when the learning rate is not precisely chosen. Both of these properties are of obvious value; yet a natural question remains: can we reduce the computational cost even further? A potential idea is to combine HD-cos with Johnson-Lindenstrauss random  projection, which reduces the input dimensionality (without learnable parameters) while preserving distances. Investigating this would be an interesting topic for future research.

B Adaptive optimization and training stability
In the main text, we omit the results for all learning rates and choose to present only the best performance across learning rates for each activation and type of weight structure, for the sake of brevity. In this section, we report results for all learning rates, study the interplay between the network depth and the choice of the activation function, as well as investigate the use of an adaptive optimization method like Adam (Kingma & Ba, 2014). Note again that for all experimental results reported in this paper, the standard deviation computed across trials is in the order of 0.1 or smaller i.e., the only factor of variability is the initialization. We omit the standard deviation for brevity.

B.1 Optimization algorithms
We show that the optimization method used affects the performance of each activation function differently. To demonstrate, we consider the MNIST dataset and use the LeNet-5 (LeCun et al., 1998) model; this is a convolutional neural network with two convolution layers interleaved with average pooling layers, followed by two dense layers. Each of the convolution and dense layers has an activation function. Activation function candidates are cosine (proposed), exponential, none (no activation function), ReLU, ReLU Poly (3), and square. The ReLU Poly(3) is a degree-3 polynomial approximation of ReLU investigated in (Obla et al., 2020). Unlike ReLU which is expensive to implement in the MPC setup (i.e., requires scalar comparison), a polynomial only relies on multiplication and addition, and is more suitable for MPC. We consider f (x) = e x − 1 instead of e x so that f (0) = 0, a property common to many activation functions. Table 5 shows the test accuracy for different optimization methods: Stochastic Gradient Descent (SGD) vs Adam (Kingma & Ba, 2014), learning rates, and activation functions.
Several important observations can be made from Table 5. When no activation function is used, the model achieves roughly the same performance for both optimization algorithms across different learning rates. On the other hand, the performance of other nonlinear activations changes with different optimization methods. In particular, for activation function that grow fast (i.e., e x − 1, square), it is crucial to use an optimization method equipped with an adaptive learning rate like Adam to ensure stable training. By contrast, for a standard choice such as the linearly growing ReLU function, and a bounded function such as cosine, the model can learn with either optimizer without a precise tuning of the learning rate.

B.2 Training stability as a function of network depth
In this section, we expand results presented in Figure 2 in the main text by including the performance on Higgs for every learning rate tried. Our conclusion remains the same as discussed in Section 6.2 which is that activation functions with bounded derivatives (e.g., cos, ReLU) can be trained with a wide range of learning rates, and different optimizers. By contrast, models relying on activation functions with high growth rate (e.g., exponential, square) can only be trained with a careful choice of the learning rate. This training instability is more pronounced when the number of layers is larger (deeper network).

C Structured weight matrices
Here we expand results in Section 6.3 and present more results showing the influence of structured weight matrices on the model performance. Table 7 and Table 8 give results in the same setting as in Table 2 presented in the main text, except that each dense layer is replaced with the proposed Hadamard layer (Table 7), and a dense layer with a low-rank weight matrix (Table 2). For completeness, we also compare to other types of weight matrices: 1) PHD (Yang et al., 2015), 2) circulant matrix (Yu et al., 2018). The PHD approach is similar to our proposed Hadamard-Diagonal layer. The weight matrix is given by W = P HD where P is a sparse matrix with non-zero entries drawn from a Gaussian distribution, H is the Hadamard matrix, and D is the diagonal weight matrix. The PHD has the same number of parameters as our Hadamdard-Diagonal (HD) approach. The main difference is the presence of the sparse matrix P . The circulant matrix approach of Yu et al. (2018) also only requires d weights parameters. The weight matrix is formed by forming a circulant matrix from these weights. We present a comparison of these three related approaches on Fashion-MNIST in Table 9.
We observe that our proposed Hadamard layer performs better than the PHD approach. This suggests that the presence of the sparse random matrix P hurts the expressiveness of the model. It can be seen that the circulant weight matrix generally does not performance as well as the other two variants.    Table 8: Test accuracy on all the datasets using low-rank dense layers. We report test accuracy except Criteo where we report AUC-PR due to its skewed label distribution.