Independence Tests for Language Models

Sally Zhu*, Ahmed Ahmed*, Rohith Kuditipudi*, Percy Liang · 2025

Read Independence Tests for Language Models by Sally Zhu*, Ahmed Ahmed*, Rohith Kuditipudi*, Percy Liang (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2502-12292.txt.

Introduction

Two language models can look independent while one was quietly copied or cut down from the other. Zhu and co-authors ask whether the weights alone can prove they were trained from separate random starts. In the simpler setting, where the training recipe is known, they build statistical tests that simulate copies of each model. The tests compare weight and activation patterns and yield exact p-values, no matter what data trained the models.

Across 210 pairs drawn from twenty-one open models, the tests caught every non-independent pair, even after heavy fine-tuning. For the harder setting, with unknown recipes and tricks to hide copying, they instead match hidden activations between models. That test flags copied models, can point to the exact parts taken, and survives retraining of layers. It traced, for instance, how one small Llama model was pruned from a larger sibling.

Catalog record

CREATORSally Zhu*, Ahmed Ahmed*, Rohith Kuditipudi*, Percy Liang
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE66 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2502-12292

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Independence Tests for Language Models Sally Zhu*, Ahmed Ahmed*, Rohith Kuditipudi*, Percy Liang Abstract We consider the following problem: given the weights of two models, can we test whether they were trained independently—i.e., from independent random initializations? We consider two settings: constrained and unconstrained . In the constrained setting, we make assumptions about model architecture and training and propose a family of statistical tests that yield exact p-values with respect to the null hypothesis that the models are trained from independent random initializations. These p-values are valid regardless of the composition of either model’s training data; we compute them by simulating exchangeable copies of each model under our assumptions and comparing various similarity measures of weights and activations between the original two models versus these copies. We report the p-values from these tests on pairs of 21 open-weight models (210 total pairs) and find we correctly identify all pairs of non-independent models. Notably, our tests remain effective even if one of the models was fine-tuned for many tokens. In the unconstrained setting, where we make no assumptions about training procedures, can change model architecture, and allow for adversarial evasion attacks, the previous tests no longer work. Instead, we propose a new test which matches hidden activations between two models, and use it to construct a test that is robust to adversarial transformations and to changes in model architecture. The test can also perform localized testing : identifying specific non-independent components of models. Though we no longer obtain exact p-values from this test, empirically we find it behaves as one and reliably distinguishes non-independent models. Notably, we can use the test to identify specific parts of one model that are derived from another (e.g., how Llama 3.1-8B was pruned to initialize Llama 3.2-3B, or shared layers between Mistral-7B and StripedHyena-7B), and it is even robust to retraining individual layers of either model from scratch. † † \ast Equal contribution; more junior authors listed earlier. We share code at https://github.com/ahmeda14960/model-tracing . 1 Introduction Consider the ways in which two models could be related: one model may be a finetune of the other; one could be spliced and pruned from certain parts of the other; both models could be separately fine-tuned from a common ancestor; finally, they could be independently trained from each other. We consider the problem of determining whether two models are independently trained versus not from their weights, which we formalize as a hypothesis testing problem in which the null hypothesis is that the weights of the two models are independent. We concretely treat only the weight initialization as random and thus consider two models with different random initial seeds as independent, even if both models were trained on the same data, or one model was distilled from the outputs of the other. Figure 1 : Given the weights of two language models, what relationships can we derive? They could be two models trained from scratch (left). Or, one model could be derived from the other: the dependent model could be a fine-tune, a pruned model, or a partially pruned model (right). We present tests to identify such relationships. A solution to this independence testing problem would enable independent auditors to track provenance of open-weight models. This is pertinent because while open-weight models enable broader access and customization, they also pose potential risks for misuse as they cannot be easily monitored or moderated ( Kapoor et al. 2025 ) . Model developers would also gain an enhanced ability to protect their intellectual property (IP) ( Mensch 2024 ; Peng et al. 2023 ) and enforce custom model licenses ( Dubey et al. 2024 ; DeepSeek-AI et al. 2024 ) . We consider two settings of the independence testing problem (Table 1 ). In the constrained setting, we make assumptions on training and initialization (essentially, that the training algorithm is equivariant to permuting the hidden units of the random initialization) that enable us to obtain provably valid p-values. The main idea is that under these assumptions we can cheaply simulate many exchangeable copies of each model’s weights and compare the value of some test statistic (e.g., cosine similarity of model weights) on each of these copies with the original model pair. The assumptions generally hold in practice but preclude robustness to adversarial evasion attacks and architectural changes. For the constrained setting, we evaluate various test statistics on 21 models of the Llama 2 architecture ( Touvron et al. 2023 ) , including 12 fine-tunes of Llama 2 and nine independently trained models, obtaining extremely small p-values for all 69 non-independent model pairs. Notably, our tests retain significant (small) p-values over different fine-tuning methods (e.g., different optimizers) and on models fine-tuned for many tokens from the base model such as Llemma ( Azerbayev et al. 2024 ) , which was fine-tuned on an additional 750B tokens from Llama 2 (37.5% of the Llama 2 training budget). We are also able to confirm that the leaked Miqu-70B model from Mistral is derived from Llama 2-70B. Next, we consider the unconstrained setting. While the constrained setting is useful for studying the existing ecosystem of open-weight models, simple modifications to model weights and architecture such as permuting hidden units can violate the assumptions of the constrained setting if an adversary applies them after fine-tuning a model. We address this limitation in the unconstrained setting, wherein we do not make any assumptions on training. Though we are not able to obtain provably exact p-values in the unconstrained setting, we derive a test whose output empirically behaves like a p-value and reliably distinguishes non-independent models from independent models. In particular, we first align the hidden units of two models—which may each have different activation types and hidden dimensions—and then compute some measure of similarity between the aligned models. Because of the alignment step, the test is robust to changes in model architecture and various adversarial evasion attacks (including those that break prior work). Moreover, it can localize the dependence: we can identify specific components or weights that are not independent between two models, even when they have different architectures. constrained setting unconstrained setting gives exact p-values does not give exact p-values not robust to permutation robust to permutations and other adversarial transformations only applies to models of fixed shared architecture works for models of different architectures and gives localized testing of shared weights Table 1 : Features of the constrained versus unconstrained problem settings. In the unconstrained setting, we evaluate our test on 141 independent model pairs and find that its output empirically behaves like a p-value in the sense that it is close to uniformly distributed in (0,1] over these pairs. In contrast, it is almost zero for all dependent pairs we test (including those for which we simulate a somewhat strong adversary by retraining entire layers from scratch). We also employ our test to identify pruned model pairs, which occur when a model is compressed through dimension reduction techniques, such as reducing the number of layers or decreasing the hidden dimension by retaining select activations and weights; for example, we identified the precise layers of Llama 3.1-8B from which each of the layers of Llama 3.2-3B and Llama 3.2-1B derive. We defer a full discussion

Read the complete text