Beyond Vector Spaces: Compact Data Representation as Differentiable Weighted Graphs

Denis Mazur, Vage Egiazarian, Stanislav Morozov, Artem Babenko

In the world of representation learning, researchers and engineers almost instinctively reach for vectors. Whether dealing with word embeddings, image features, or user profiles, the standard approach is to map data points into a high-dimensional Euclidean space ($\mathbb{R}^n$). But is a flat, vector-based geometry always the most natural fit for our data?

A team of researchers from Yandex and Skoltech argues that it isn't. In their paper, "Beyond Vector Spaces: Compact Data Representation as Differentiable Weighted Graphs," they introduce PRODIGE (Probabilistic Differentiable Graph Embeddings), a method that replaces traditional vector embeddings with a learnable, weighted graph.

The Problem with Vector Spaces

Most machine learning models assume that data lives in a Euclidean space. However, recent research has shown that certain types of data—like hierarchical taxonomies or complex social networks—are much better suited for non-Euclidean geometries, such as hyperbolic or spherical spaces.

The core issue is that choosing the "right" geometry imposes a strong inductive bias. If the chosen geometry doesn't align with the underlying data structure, the model's performance suffers. Furthermore, vector representations can be highly memory-intensive; capturing intricate, multi-faceted relationships often requires scaling up to massive, high-dimensional vectors.

The authors sought a more general, "geometry-agnostic" representation that could adapt to any finite metric space while remaining extremely compact.

The PRODIGE Approach

PRODIGE addresses these limitations by representing a dataset as an undirected weighted graph $G(V, E, w)$.

  • Vertices ($V$): Each data item is represented as a node.
  • Edges ($E$) and Weights ($w$): Instead of relying on fixed vectors, the model learns which edges should exist between nodes and how much weight each edge should carry.
  • Distance: The distance between two data items is defined simply as the shortest path between their corresponding nodes in the graph.

To make this discrete graph structure trainable via gradient descent, the authors treat the graph probabilistically. Each potential edge is assigned a probability $p$ of existing. The model then minimizes a task-specific loss function in expectation over all possible graph configurations.

Because the "shortest path" operation (typically computed via Dijkstra's algorithm) isn't naturally differentiable with respect to the discrete existence of an edge, the authors employ the log-derivative trick—a technique similar to the REINFORCE algorithm used in reinforcement learning—to estimate gradients. To ensure the representation remains compact, they incorporate a sparsity regularization term that penalizes the total number of edges, effectively "pruning" unnecessary connections during training.

Key Insights: The "Traffic Hub" Phenomenon

One of the most fascinating outcomes of PRODIGE is its geometry agnosticism. Because a graph utilizing shortest-path distances can approximate any finite metric space, PRODIGE frees researchers from having to guess whether their data is "hyperbolic" or "spherical." The graph automatically learns the optimal underlying geometry.

Qualitatively, the graphs learned by PRODIGE strongly resemble human transport networks or airline routing maps.

Instead of connecting every node to every other node, the model develops a few high-degree "hub" vertices that act as central landmarks. To calculate the distance between two far-flung points, the shortest path typically routes from the starting node to its nearest local hub, travels across a "long-haul" edge to another major hub, and then branches out to the target node.

This hub-and-spoke architecture is the secret to PRODIGE's incredible memory efficiency.

As seen in the degree distribution of the learned graphs, the vast majority of nodes only require a handful of edges to connect to the rest of the network. This sparsity allows the model to drastically outperform dense vectors, even when restricted to a fraction of the memory footprint.

Empirical Results

The authors evaluated PRODIGE across three distinct tasks, demonstrating its versatility and efficiency:

  1. Distance-Preserving Compression: On datasets like MNIST (images), GloVe (word embeddings), and CelebA (face embeddings), PRODIGE outperformed Multidimensional Scaling (MDS) and PCA by a wide margin. For example, on the GloVe dataset with a strict budget of just 4 parameters per instance, PRODIGE achieved a Mean Squared Error of 0.033, compared to 0.131 for standard MDS.
  2. Collaborative Filtering: On the Pinterest dataset for recommendation systems, PRODIGE achieved higher HitRatio@k scores than traditional Matrix Factorization (SVD/ALS) and Euclidean metric learning, given the same memory budget.
  3. Sentiment Classification: On the IMDB movie review benchmark, a PRODIGE-based model reached 84.4% accuracy using a mere 2.16 MB of memory. To achieve comparable results, a standard GloVe-based vector model required 12.24 MB.

Limitations and Future Directions

While PRODIGE offers a powerful new paradigm for representation learning, it does come with specific computational hurdles:

  • Computational Complexity: Calculating shortest paths using Dijkstra’s algorithm is inherently more computationally expensive during training and inference than computing a simple vector dot product or Euclidean distance.
  • Scalability: Training on massive datasets with millions of nodes remains a challenge. The potential edge space scales at $O(N^2)$. Although the authors mitigate this by using heuristics to limit the initial edge set (such as starting with $k$-nearest neighbors), scaling to industry-level graphs requires further optimization.
  • Optimization Sensitivity: The loss landscape of these probabilistic graphs can be tricky to navigate. The authors noted that convergence was highly sensitive to the choice of optimizer (specifically requiring SparseAdam) and initialization heuristics.

Future work will likely focus on exploring more efficient shortest-path approximations and adapting PRODIGE to dynamic datasets where nodes and edges are continuously added over time. By moving beyond the rigid constraints of vector spaces, PRODIGE opens up a promising new frontier for highly compact, geometry-aware machine learning.

Summary updated

BibTeX
@inproceedings{mazur2019beyond,
  author = {Denis Mazur and Vage Egiazarian and Stanislav Morozov and Artem Babenko},
  title = {{Beyond Vector Spaces: Compact Data Representation as Differentiable Weighted Graphs}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2019},
}
Figure