Submodular Hamming Metrics

Jennifer Gillenwater, Rishabh K. Iyer, Bethany Lusch, Rahul Kidambi, Jeff A. Bilmes

In machine learning, the choice of a distance metric fundamentally dictates the success of an algorithm. For binary data, the Hamming distance is the standard go-to. However, it operates on a simplistic "bag of bits" assumption, where every coordinate difference contributes independently to the total distance.

This paper introduces Submodular Hamming (SH) metrics, a novel class of distance functions that generalize the standard Hamming distance by incorporating complex, higher-order interactions between elements. By leveraging the properties of submodular functions, the authors provide a framework that is mathematically rigorous—guaranteeing the triangle inequality—and computationally practical for optimization tasks like clustering and diversification.

The Problem with "Bag of Bits"

In real-world data, features rarely act in isolation; they interact. Consider document clustering: if two documents differ by two words from the exact same topic (e.g., "neural" and "network"), that difference should arguably be penalized less than if they differed by two entirely unrelated words (e.g., "neural" and "biochemistry").

While the Mahalanobis distance can account for pairwise correlations, it fails to capture higher-order group interactions. Conversely, using arbitrary high-order functions usually breaks the fundamental properties of a "metric" (such as the triangle inequality) or results in optimization problems that are NP-hard. The authors seek a "sweet spot": a metric capable of capturing complex interactions while remaining tractable.

The Submodular Solution

The authors define the distance between two binary sets $A$ and $B$ as $d_f(A, B) = f(A \Delta B)$, where $\Delta$ represents the symmetric difference and $f$ is a positive polymatroid (a set function that is positive, normalized, monotone, and submodular).

Submodularity as a Proxy for "Diminishing Returns"

By using submodular functions, the metric naturally models redundancy. The more "similar" differences you have between two sets, the less each additional difference adds to the total distance.

The authors successfully prove that if $f$ is a positive, normalized, monotone, and subadditive function, then $d_f$ is a valid metric.

Optimization Challenges and Algorithms

The researchers tackle two primary optimization problems using their new metric:

  1. SH-min (Centroid Finding): Finding a set $A$ that minimizes the sum of distances to a collection of sets $B_i$. This is highly relevant for clustering.
  2. SH-max (Diversification): Finding a set $A$ that maximizes the sum of distances to $B_i$. This is useful for generating diverse $k$-best lists.

The Optimization Paradox: Even though $f$ is submodular, the objective function $g(A) = f(A \Delta B)$ is not necessarily submodular or supermodular in $A$. This makes SH-min and SH-max surprisingly difficult (NP-hard in many cases). Furthermore, the "hardness" of the problem is tied to the curvature ($\kappa_f$) of the function. If the function is nearly modular (like standard Hamming), it is easy to optimize; as it becomes more "submodular," the approximation guarantees shift.

To solve these challenges, the authors propose several approximation algorithms:

  • UNION-SPLIT: A 2-approximation for unconstrained SH-min that splits the subadditive function into two submodular components.
  • MAJOR-MIN: A majorization-minimization algorithm for constrained settings that iteratively optimizes a modular upper bound of the objective.
  • Bi-directional Greedy: Used for SH-max to provide a 1/4-approximation in unconstrained settings.
Approximation guarantees for proposed algorithms

Experimental Validation

The researchers evaluated their metrics across three distinct types of data, demonstrating significant improvements over standard baselines.

1. Clustering Accuracy on Synthetic and Text Data

On a synthetic dataset of 100 documents designed to test if a metric can recover hidden group structures, the standard Hamming distance (HM) failed entirely, achieving only 28.4% accuracy. In contrast, the Submodular Hamming (SM) metric achieved 69.4% accuracy. When initialized properly, SM reached 100% accuracy, effectively recovering the latent topic structure.

On the real-world NIPS Paper Dataset (5,522 research papers using 12,262 unique word features), SM optimized the submodular loss 1.635x better than the Hamming approach, suggesting it creates much tighter, more thematic clusters in high-dimensional text data.

2. Image Diversification

The metrics were also tested on an Image Summarization Dataset (14 image collections) to evaluate the "diverse $k$-best" task. The goal here is to select a representative and varied set of images.

The submodular approach—specifically using the "Two-Part" (TP) algorithm—outperformed the standard Hamming approach on 10 out of 14 datasets based on V-ROUGE scores, producing summaries that were visually more diverse and less redundant.

Performance comparison of Hamming (HM) and Two-Part (TP) algorithms

Limitations and Future Work

While Submodular Hamming metrics offer a powerful new tool for binary data, some challenges remain:

  • Theoretical Gaps: The complexity of the homogeneous unconstrained SH-min problem remains an open question. It might be solvable in polynomial time, but a formal proof is currently lacking.
  • Constraint Complexity: The authors successfully addressed cardinality constraints (e.g., $|A| \leq k$), but left more complex constraints, such as matroids or graph cuts, for future research.
  • Application Expansion: The paper suggests these metrics could significantly improve Structured SVMs by providing a more nuanced "loss-augmented inference" step, paving the way for future implementations.

Summary updated

BibTeX
@inproceedings{gillenwater2015submodular,
  author = {Jennifer Gillenwater and Rishabh K. Iyer and Bethany Lusch and Rahul Kidambi and Jeff A. Bilmes},
  title = {{Submodular Hamming Metrics}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2015},
  url = {https://openreview.net/forum?id=H1VIFLZOZB},
}
Figure