[Paper Review] Fast Prediction with SVM Models Containing RBF Kernels
This paper proposes a second-order Maclaurin series approximation for RBF kernel evaluations in SVM models, enabling prediction complexity to scale quadratically with input dimensions rather than with the number of support vectors. The method achieves significant speedups and model compression—up to 290×—when input dimensions are small relative to support vectors, while maintaining bounded error and enabling data obfuscation.
We present an approximation scheme for support vector machine models that use an RBF kernel. A second-order Maclaurin series approximation is used for exponentials of inner products between support vectors and test instances. The approximation is applicable to all kernel methods featuring sums of kernel evaluations and makes no assumptions regarding data normalization. The prediction speed of approximated models no longer relates to the amount of support vectors but is quadratic in terms of the number of input dimensions. If the number of input dimensions is small compared to the amount of support vectors, the approximated model is significantly faster in prediction and has a smaller memory footprint. An optimized C++ implementation was made to assess the gain in prediction speed in a set of practical tests. We additionally provide a method to verify the approximation accuracy, prior to training models or during run-time, to ensure the loss in accuracy remains acceptable and within known bounds.
Motivation & Objective
- To reduce the prediction time of RBF kernel SVMs, which scales linearly with the number of support vectors and becomes prohibitive in real-time or high-throughput applications.
- To develop an approximation method that decouples prediction speed from the number of support vectors, making models faster when input dimensionality is low.
- To provide a conservative, verifiable error bound ensuring approximation accuracy remains within acceptable limits prior to or during model deployment.
- To enable smaller, data-obfuscating models suitable for privacy-sensitive domains such as biomedical research.
Proposed method
- Approximate the RBF kernel function $ \kappa(\mathbf{x}_i, \mathbf{x}_j) = e^{-\gamma \|\mathbf{x}_i - \mathbf{x}_j\|^2} $ using a second-order Maclaurin series expansion of the exponential function.
- Replace the exact kernel evaluation with a quadratic form in the input features, resulting in a decision function dependent on a dense vector $ \mathbf{v} $ and symmetric matrix $ \mathbf{M} $.
- Derive a bound on the relative error of the approximation using the condition $ |x| < 0.5 $, where $ x $ is the exponent in the exponential, ensuring $ \leq 3.05\% $ relative error.
- Store the approximated model as three scalars ($ b, c, \gamma $), a vector $ \mathbf{v} \in \mathbb{R}^d $, and a matrix $ \mathbf{M} \in \mathbb{R}^{d \times d} $, reducing memory footprint.
- Apply the approximation to all kernel methods relying on the representer theorem, including SVMs, Gaussian processes, kernel PCA, and kernel discriminant analysis.
- Implement an optimized C++ version to empirically validate speed, accuracy, and compression gains across multiple datasets.
Experimental results
Research questions
- RQ1Can a second-order Maclaurin approximation of the RBF kernel significantly reduce prediction time without sacrificing model accuracy?
- RQ2Does the approximation maintain bounded error across diverse datasets, and can this bound be verified a priori or at runtime?
- RQ3How does the model size of the approximated RBF-SVM compare to the exact model, especially when input dimensionality is small relative to the number of support vectors?
- RQ4To what extent does the approximation obscure the original training data, enabling use in privacy-sensitive applications?
Key findings
- The approximated model achieves up to 290× compression ratio on the sensit dataset, with model size reduced from 32 MB to 113 KB.
- Prediction speed scales quadratically with input dimensionality $ d $, not with the number of support vectors $ n_{\text{SV}} $, enabling significant speedups when $ d \ll n_{\text{SV}} $.
- The method maintains a relative error of less than 3.05% when the exponent in the RBF kernel is bounded by $ |x| < 0.5 $, providing a verifiable error bound.
- The approximated model is significantly smaller than the exact model in all but one tested dataset, with the largest gain observed on high-$ n_{\text{SV}} $, low-$ d $ datasets.
- The approximation obfuscates training data by replacing support vectors with complex combinations, making reverse-engineering of original instances highly challenging.
- The method outperforms neural network-based approximations in speed and error control, particularly when $ d $ is small, due to its linear approximation cost and known error bounds.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.