2D-Shapley: A Framework for Fragmented Data Valuation

Zhihong Liu, Hoang Anh Just, Xiangyu Chang, Xi Chen, Ruoxi Jia

Introduction

Traditional data valuation treats datasets as simple lists of samples or features. However, real-world data is frequently "fragmented" into blocks of both. 2D-Shapley introduces a novel axiomatic framework designed to quantify the value of specific data sub-matrices. This approach enables high-precision debugging and fairer data pricing in complex, decentralized data marketplaces.

The Challenge of Fragmented Data

In machine learning, "data valuation" determines how much a specific piece of data contributes to a model's predictive performance. This is essential for building equitable data marketplaces (compensating contributors) and debugging models (identifying erroneous or malicious data).

Historically, most valuation methods have relied on 1D-Shapley values, which assume data is partitioned in one of two strict ways:

  • Horizontally: Contributors provide different samples but share the exact same features.
  • Vertically: Contributors provide different features for the exact same samples.

Real-world scenarios, however, are rarely this neat. Consider a collaboration between multiple banks and e-commerce platforms. They likely possess different customer bases (samples) and different types of records (features). If an organization wants to value a specific block of data—such as the credit history of customers in a specific region—1D methods fail. They either ignore the two-dimensional structure of the data or require workarounds like data imputation, which inherently distorts the valuation results.

The 2D-Shapley Framework

To address these limitations, the authors propose 2D-Shapley, treating data valuation as a two-dimensional cooperative game. The framework is built on three main pillars:

1. 2D Counterfactual Analysis

Instead of simply removing an entire row or column, 2D-Shapley defines the "marginal contribution" of a specific block. It evaluates how model performance shifts when a specific sample-feature intersection is added or removed relative to its surrounding context.

2. Axiomatic Foundation

The authors mathematically prove that 2D-Shapley is the only valuation scheme satisfying four essential fairness properties:

  • 2D-Linearity: The value of a block across multiple independent tasks is the sum of its values in each task.
  • 2D-Dummy: A block that does not change the model's performance receives a value of zero.
  • 2D-Symmetry: The valuation remains consistent regardless of the arbitrary ordering of rows or columns.
  • 2D-Efficiency: The sum of all individual block values perfectly equals the total performance of the model.

3. Efficient Algorithms

Calculating exact Shapley values requires exponential computational time. To make 2D-Shapley practical, the authors introduce two approximations:

  • 2D-Shapley-MC: A Monte Carlo-based approximation.
  • 2D-Shapley-KNN: A K-Nearest Neighbors surrogate model that bypasses the need for constant model retraining, accelerating the valuation process by orders of magnitude.

Key Insights

  • The Summation Property: A highly elegant mathematical finding demonstrates that 2D-Shapley is a natural generalization of 1D-Shapley. Summing all 2D block values in a specific row yields the 1D value for that sample. Similarly, summing a column yields the 1D value for that feature.
  • Fine-Grained Debugging: While 1D valuation can flag a sample as poor quality, it cannot explain why. 2D-Shapley can pinpoint that a sample is detrimental specifically because a single feature (e.g., "Age") was corrupted, even while its other features remain highly valuable.
  • Structural Awareness: Unlike methods that "flatten" a matrix into a 1D list, 2D-Shapley respects the physical meaning of tabular data. The 2D-Symmetry axiom ensures that the mathematical valuation respects the contextual reality of swapping distinct features.

Experimental Results

The framework was rigorously evaluated using standard benchmarks from the UCI Machine Learning Repository, including Census Income, Default of Credit Card Clients, Heart Failure, Breast Cancer Wisconsin, and the Wine Dataset.

  • Superior Outlier Detection: In the Breast Cancer dataset, 2D-Shapley successfully detected 90% of injected outliers by inspecting only the first 5% of cells. By contrast, 1D-Shapley required inspecting over 90% of the data to achieve comparable detection rates.
  • Robust Sanity Checks: In data removal experiments, eliminating the highest-value cells identified by 2D-Shapley caused model performance to degrade significantly faster than 1D-Shapley or random removal. This confirms its superior ability to identify truly influential data points.
  • Massive Speedups: The KNN-based approximation (2D-Shapley-KNN) operated up to 300x faster than the Monte Carlo version on large datasets, proving its viability for real-world engineering pipelines.

Limitations and Future Directions

While groundbreaking, the 2D-Shapley framework has a few current limitations:

  • Rectangular Constraints: The methodology currently assumes data sources are rectangular blocks and does not yet natively handle irregularly shaped data fragments.
  • Label Valuation: The framework focuses on valuing feature blocks, assuming labels are provided separately. Incorporating label valuation directly into the 2D framework remains a critical next step.
  • Computational Overhead: Even with KNN surrogate models, valuing every single cell in massive datasets (e.g., millions of rows) poses a computational challenge that will require further algorithmic optimization or hardware acceleration.

Summary updated

BibTeX
@inproceedings{liu2023d,
  author = {Zhihong Liu and Hoang Anh Just and Xiangyu Chang and Xi Chen and Ruoxi Jia},
  title = {{2D-Shapley: A Framework for Fragmented Data Valuation}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=35kjF0gqjA},
}
Figure