Softmax is widely used in deep learning to map some representation to a probability distribution. As it is based on exp/log functions that is relatively expensive in multi-party computation, Mohassel and Zhang (2017) proposed a simpler replacement based on ReLU to be used in secure computation. However, we could not reproduce the accuracy they reported for training on MNIST with three fully connected layers. Later works (e.g., Wagh et al., 2019 and 2021) used the softmax replacement not for computing the output probability distribution but for approximating the gradient in back-propagation. In this work, we analyze the two uses of the replacement and compare them to softmax, both in terms of accuracy and cost in multi-party computation. We found that the replacement only provides a significant speed-up for a one-layer network while it always reduces accuracy, sometimes significantly. Thus we conclude that its usefulness is limited and one should use the original softmax function instead.
翻译:Mohassel 和 Zhang (2017年) 依据在多方计算中相对昂贵的 Exp/log 函数, 提议在安全计算中使用基于 ReLU 的更简单替换。 但是, 我们无法复制他们所报告的三层完全连接的 MNIST 培训的精度。 后来的工程( 例如 Wagh 等人, 2019 和 2021 ) 使用了软式替换, 而不是计算输出概率分布, 而是将梯度与后方测量相近。 在这项工作中, 我们分析了替换的两种用途, 并将其与软体值进行比较, 在多方计算中的精确度和成本方面。 我们发现, 替换仅为单层网络提供了显著的超速, 而它总是降低精度, 有时会显著降低精度 。 因此, 我们的结论是, 它的有用性有限, 并且应该使用原始的软式功能 。