A theory of learning with similarity functions

Maria-Florina Balcan, Avrim Blum, Nathan SrebroMachine Learning 2008

Abstract

This paper introduces a foundational theoretical framework for learning with general similarity functions, liberating machine learning from the restrictive positive semi-definite (PSD) constraint of traditional kernel methods. We define a notion of "goodness" for similarity functions based on class-wise separability and propose a landmark-based mapping that enables linear classification in an explicit feature space. Our results include learning guarantees and a tight analysis of the relationship between kernel margins and similarity margins.

1. Introduction: Beyond the Kernel Trick

For decades, the "Kernel Trick" has been central to machine learning, allowing algorithms like Support Vector Machines (SVMs) to find linear separators in high-dimensional Hilbert spaces. However, this theory relies on the positive semi-definite (PSD) constraint, which often conflicts with natural similarity measures used in fields like linguistics or biology. Furthermore, kernel theory's reliance on abstract $\phi$-spaces lacks the intuitive appeal of direct similarity measures. This work bridges the gap by defining what it means for a similarity function to be "good" for learning without requiring PSD properties or implicit mappings.

2. Theoretical Framework: Defining "Good" Similarity

The core of this theory is the $(\epsilon, \gamma)$-good similarity function. A function $K(x, x')$ is considered good if, for most examples $x$, the expected similarity to random examples of the same label is at least $\gamma$ higher than the expected similarity to examples of the opposite label. This definition aligns with human intuition: an object should be more similar to its own class than to others. Unlike kernels, these functions do not require symmetry ($K(x, x') = K(x', x)$), providing greater flexibility for domain-specific applications.

3. The Landmark Mapping Algorithm

To utilize these similarity functions, we propose a two-stage "Landmark Mapping" algorithm:

  1. Sampling: Draw a small set of $d$ "landmark" points from the data.
  2. Explicit Mapping: Represent each data point $x$ as a vector in $\mathbb{R}^d$, where each component is the similarity of $x$ to one of the landmarks.
  3. Linear Learning: Apply a standard linear separator (e.g., linear SVM) in this new explicit space.

We prove that if a similarity function is $(\epsilon, \gamma)$-good, a linear separator with an error rate close to $\epsilon$ can be found using only $O(1/\gamma^2)$ landmarks.

4. Margin Tightness and Geometric Analysis

A key contribution of this work is the analysis of "margin tightness"—the relationship between traditional kernel margins and our similarity-based margins. We demonstrate that any "good" kernel is also a "good" similarity function, though the margin may degrade. Specifically, a kernel with margin $\gamma$ in Hilbert space translates to a similarity function with a margin of approximately $\gamma^2$.

Geometric construction used to prove the tightness of the margin bound between kernel and similarity functions.

To prove these bounds, we employ synthetic geometric proofs, such as constructing specific distributions of labeled points to test the limits of the margin degradation. These proofs ensure that the theoretical guarantees are as tight as possible.

5. Discussion and Conclusion

This framework demystifies the success of kernels, suggesting they work not because of "magic" high-dimensional spaces, but because they serve as effective similarity measures. By treating similarities as features, we can use non-PSD functions directly with standard hinge-loss objectives.

While the quadratic drop in margin (from $\gamma$ to $\gamma^2$) may increase data requirements for small-margin problems, the flexibility of using non-symmetric and non-PSD functions opens new avenues for machine learning. Future work includes extending this framework to unsupervised learning and exploring goodness properties that do not rely on linear separability.

Summary updated

BibTeX
@article{balcan2008theory,
  author = {Maria-Florina Balcan and Avrim Blum and Nathan Srebro},
  title = {{A theory of learning with similarity functions}},
  journal = {Machine Learning},
  year = {2008},
  doi = {10.1007/s10994-008-5059-5},
}
Figure