Model Equality Testing: Which Model Is This API Serving?

Irena Gao, Percy Liang, Carlos Guestrin
10/26/2024
cs.LG

No official code found. Best implementation: i-gao/model-equality-testing (18 stars, last commit 2024-10-29).

Abstract

Users often interact with large language models through black-box inference APIs, both for closed- and open-weight models (e.g., Llama models are popularly accessed via Amazon Bedrock and Azure AI Studio). In order to cut costs or add functionality, API providers may quantize, watermark, or finetune the underlying model, changing the output distribution -- possibly without notifying users. We formalize detecting such distortions as Model Equality Testing, a two-sample testing problem, where the user collects samples from the API and a reference distribution and conducts a statistical test to see if the two distributions are the same. We find that tests based on the Maximum Mean Discrepancy between distributions are powerful for this task: a test built on a simple string kernel achieves a median of 77.4% power against a range of distortions, using an average of just 10 samples per prompt. We then apply this test to commercial inference APIs from Summer 2024 for four Llama models, finding that 11 out of 31 endpoints serve different distributions than reference weights released by Meta.

View on arXivView PDF

Code Implementations(1)

Test equality between a black-box LLM API and a reference distribution

182Python, Jupyter NotebookOct 24, 20241 years ago

Similar Papers

Cite this paper

@article{gao2024model,
  title  = {Model Equality Testing: Which Model Is This API Serving?},
  author = {Irena Gao and Percy Liang and Carlos Guestrin},
  year   = {2024},
  eprint = {2410.20247},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2410.20247v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2410.20247.svg)](https://codeofpaper.com/paper/2410.20247)

Discussion