On a theory of learning with similarity functions

Maria-Florina Balcan, Avrim Blum

TL;DR

This paper breaks the "Positive Semi-Definite" (PSD) shackles of traditional kernel methods by providing a formal theory for learning with general similarity functions. The authors prove that if a similarity function is "good"—meaning it generally rates points of the same class as more similar than points of different classes—it can be used to transform data into a low-dimensional space where simple linear classifiers achieve high accuracy.

The Problem: Beyond the Kernel Trick

In machine learning, Kernel Functions (like those used in Support Vector Machines) are the gold standard for dealing with non-linearly separable data. However, traditional theory relies on the "Kernel Trick," which requires functions to be symmetric and Positive Semi-Definite (PSD). This mathematical restriction allows data to be implicitly mapped into a high-dimensional Hilbert space where it becomes linearly separable.

This reliance on PSD kernels presents two main problems:

  1. The Intuition Gap: Domain experts usually design similarity measures based on "natural" properties (e.g., how many keywords two documents share or sequence alignment in biology), not abstract Hilbert space properties. Many of these intuitive measures are not PSD.
  2. Restrictive Math: Forcing a similarity measure to be PSD often requires "coercing" the data, which can degrade the quality of the measure and make it harder to interpret.

This paper asks a fundamental question: Can we build a robust learning theory based on similarity alone, without needing the "magic" of implicit high-dimensional spaces or the strict restriction of PSD functions?

Methods: Defining "Good" Similarity

The authors introduce a new framework that defines what it means for a pairwise function $K(x, x')$ to be a "good" similarity function for a specific learning problem.

  • Defining "Goodness": Instead of relying on eigenvalues or PSD matrices, they define goodness based on average similarity. A function is "good" if, for most points, the average similarity to points of the same class is significantly higher than the average similarity to points of the opposite class.
  • The Landmark Transformation: To learn with these functions, they propose a two-stage approach:
  • Landmark Selection: Pick a small, random subset of data points to act as "landmarks."
    1. Empirical Similarity Map: Represent every data point as a vector where each coordinate is the similarity of that point to one of the landmarks.
  • Linear Learning: They prove that if the similarity function meets their "goodness" criteria, the data in this new "landmark space" will be linearly separable with a large margin. This allows the use of standard, efficient algorithms (like a linear SVM or Perceptron) on the transformed data.

Synthetic Validation and Geometric Proofs

As a foundational theoretical paper, it does not perform benchmarks on standard empirical datasets. Instead, it uses synthetic mathematical constructions and geometric proofs to validate the theory.

Geometric construction of a circular distribution used to demonstrate the necessity of weighted similarity.

For example, the authors use a circular distribution in 2D space (shown above) to demonstrate why their "weighted" similarity definition is necessary to capture complex class boundaries that a simple traditional average similarity might miss.

Key Insights and Results

  • Similarity is Sufficient: You don't need the "Kernel Trick" to learn well. If your similarity measure is intuitive and captures class relationships, that is enough to guarantee learnability.
  • The Power of Landmarks: The landmark-based transformation (mapping $x \to [K(x, \tilde{x}_1), \dots, K(x, \tilde{x}_d)]$) acts as a practical bridge. It turns a "similarity-based" problem into a "feature-based" problem solvable by any standard linear learner.
  • Sample Complexity: The authors prove that if a similarity function has a margin $\gamma$, you only need $d \approx 8 \log(1/\delta)/\gamma^2$ landmarks to ensure the data becomes linearly separable with high probability.
  • Unifying Kernels and Similarity: The theory serves as a generalization of kernel theory. They prove that any "good" kernel is also a "good" similarity function, providing a more intuitive explanation for why kernels work.
  • Weighting Matters: Their main definition allows for a weighting function $w(x)$. This acknowledges that not all points are equally "representative" of their class, making the theory robust to outliers.

Limitations and Future Work

  • Margin Deterioration: When treating a valid kernel as a similarity function, the theoretical margin can shrink (e.g., from $\gamma$ to $O(\gamma^2)$). This suggests that if you know your function is a valid PSD kernel, you might still be better off using standard kernel methods to preserve the larger margin.
  • Symmetry and Non-Symmetry: While the theory explicitly allows for non-symmetric functions, the practical implications of highly asymmetric similarity measures in this framework aren't fully explored.
  • Beyond Linear Separators: The current theory focuses on transforming data to be linearly separable. Future work could explore direct learning with similarity functions without the intermediate linear step.
  • Unsupervised Learning: The paper hints at extending this "similarity-first" logic to clustering and other unsupervised tasks.

Summary updated

BibTeX
@inproceedings{balcan2006theory,
  author = {Maria-Florina Balcan and Avrim Blum},
  title = {{On a theory of learning with similarity functions}},
  booktitle = {International Conference on Machine Learning},
  year = {2006},
  doi = {10.1145/1143844.1143854},
}
Figure