Why does the sigmoid kernel sometimes fail to be a valid Mercer kernel?

Quick Overview

Asks why the tanh sigmoid kernel can violate Mercer's condition and what that means for an SVM. Tests positive semi-definite Gram matrices, failure cases on the diagonal and between two points, the power-series condition for dot-product kernels, and the effect on the convexity of the SVM dual.

Why does the sigmoid kernel sometimes fail to be a valid Mercer kernel?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: hard

Interview Round: Other

The sigmoid kernel is $k(x, z) = \tanh(\gamma x^\top z + r)$. Why does it sometimes fail to be a valid Mercer kernel, and what does that mean for training an SVM with it? ```hint Start with one point Look at the diagonal of the Gram matrix first. What sign must $k(x, x)$ have if it is a squared norm in some feature space? ``` ```hint Two points are enough A valid kernel must satisfy a Cauchy-Schwarz inequality between $k(x, z)$, $k(x, x)$ and $k(z, z)$. Think about what saturation of tanh does to that inequality. ``` ### What a Strong Answer Covers - Mercer's condition stated as positive semi-definiteness of every Gram matrix, and what it guarantees - At least one concrete way the sigmoid kernel violates it, with the parameter range - Why the problem is structural for tanh of an inner product, beyond one bad parameter choice - What happens to the SVM dual and to solvers when the kernel is indefinite, and why the kernel can still work in practice - A practical recommendation ### Follow-up Questions - What is conditional positive definiteness, and why is it enough for the SVM dual with the constraint $\sum_i y_i \alpha_i = 0$? - How do solvers such as LIBSVM handle a kernel matrix with negative eigenvalues? - How would you check numerically whether a kernel is PSD on your training set? - Why is the RBF kernel always PSD?

Overview: Asks why the tanh sigmoid kernel can violate Mercer's condition and what that means for an SVM. Tests positive semi-definite Gram matrices, failure cases on the diagonal and between two points, the power-series condition for dot-product kernels, and the effect on the convexity of the SVM dual.

Nov 25, 2026
hardMachine Learning EngineerOtherMachine Learning
0
0

The sigmoid kernel is k(x,z)=tanh⁡(γx⊤z+r)k(x, z) = \tanh(\gamma x^\top z + r). Why does it sometimes fail to be a valid Mercer kernel, and what does that mean for training an SVM with it?

What a Strong Answer Covers Guidance

  • Mercer's condition stated as positive semi-definiteness of every Gram matrix, and what it guarantees
  • At least one concrete way the sigmoid kernel violates it, with the parameter range
  • Why the problem is structural for tanh of an inner product, beyond one bad parameter choice
  • What happens to the SVM dual and to solvers when the kernel is indefinite, and why the kernel can still work in practice
  • A practical recommendation

Follow-up Questions Guidance

  • What is conditional positive definiteness, and why is it enough for the SVM dual with the constraint ∑iyiαi=0\sum_i y_i \alpha_i = 0 ?
  • How do solvers such as LIBSVM handle a kernel matrix with negative eigenvalues?
  • How would you check numerically whether a kernel is PSD on your training set?
  • Why is the RBF kernel always PSD?