paname 0.0.1.dev1__tar.gz → 0.0.1.dev2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/PKG-INFO +37 -37
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/README.md +1 -1
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/README_FR.md +1 -1
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/pyproject.toml +4 -4
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/.gitignore +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/CHANGELOG.md +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/LICENSE +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/LICENSES/CC0-1.0.txt +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/LICENSES/MIT.txt +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/paname_use_cases/apertus70b_canaries.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/paname_use_cases/bert_wnut.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/paname_use_cases/cifar10_mobilenet.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/paname_use_cases/discoverable_extraction_wikipedia.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/paname_use_cases/gpt2_imdb.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/paname_use_cases/gpt2_imdb_overfit.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/paname_use_cases/gpt2_wikitext.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/paname_use_cases/ministrallm_fineweb_gguf.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/paname_use_cases/ministrallm_fineweb_hf_lm.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/paname_use_cases/ministrallm_fineweb_vllm_offline.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/paname_use_cases/pleias1b_wtotext.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/paname_use_cases/pythia_mimir.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/paname_use_cases/random_forest_1m.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/paname_use_cases/resnet18_cifar10_shadow.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/paname_use_cases/sklearn_classifier_synthetic.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/paname_use_cases/sklearn_regressor_synthetic.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/paname_use_cases/utils/cifar10_helpers.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/paname_use_cases/utils/huggingface_text_helpers.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/paname_use_cases/utils/sklearn_helpers.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/__init__.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/config.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/__init__.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/configurable.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/discoverable_extraction/__init__.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/discoverable_extraction/evaluation.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/discoverable_extraction/metrics.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/mia/__init__.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/mia/attack_model.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/mia/base.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/mia/gradient.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/mia/hop_skip_jump.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/mia/likelihood_ratio.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/mia/lira.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/mia/loss.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/mia/min_k_prob.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/mia/neighborhood.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/mia/noise_label_only.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/mia/perplexity.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/mia/reference_based.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/mia/rmia.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/mia/shadow_model_pool/__init__.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/mia/shadow_model_pool/base.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/mia/shadow_model_pool/local_model.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/mia/zlib.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/reconstruction/__init__.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/reconstruction/base.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/reconstruction/diffusion_clique.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/reconstruction/informed_adversary.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/reconstruction/llm_from_sampling.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/reconstruction/utils.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/io/__init__.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/io/dataset.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/io/huggingface.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/io/sklearn.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/io/torch.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/metrics/__init__.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/metrics/base.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/metrics/metrics.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/metrics/mia.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/metrics/reconstruction.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/mia_runner.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/perturbators/__init__.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/perturbators/base.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/perturbators/gaussian.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/perturbators/hsja.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/perturbators/text_neighbors.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/py.typed +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/reporting/__init__.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/reporting/lang.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/reporting/report.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/scripts/__init__.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/scripts/discoverable_extraction.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/scripts/mia.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/scripts/reconstruction.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/signal_extraction/__init__.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/signal_extraction/extractors.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/signal_extraction/model_wrappers/__init__.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/signal_extraction/model_wrappers/base.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/signal_extraction/model_wrappers/gguf_lm.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/signal_extraction/model_wrappers/huggingface_base.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/signal_extraction/model_wrappers/huggingface_diffusers.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/signal_extraction/model_wrappers/huggingface_lm.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/signal_extraction/model_wrappers/huggingface_text_utils.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/signal_extraction/model_wrappers/huggingface_token_classification.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/signal_extraction/model_wrappers/online_api_lm.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/signal_extraction/model_wrappers/onnx.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/signal_extraction/model_wrappers/sklearn.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/signal_extraction/model_wrappers/text_generation_utils.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/signal_extraction/model_wrappers/text_sampling.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/signal_extraction/model_wrappers/torch_classifier.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/signal_extraction/model_wrappers/vllm_offline_lm.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/signal_extraction/utils/__init__.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/signal_extraction/utils/process_logprobs.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/signal_extraction/utils/signal_transformations.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/typing.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/use_case.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/utils/__init__.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/utils/device.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/utils/gradient_estimation.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/utils/lp.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/utils/resampling.py +0 -0
- {paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/utils/seeding.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: paname
|
|
3
|
-
Version: 0.0.1-
|
|
3
|
+
Version: 0.0.1-dev2
|
|
4
4
|
Summary: Assess self-conformity of ML models by running extraction techniques.
|
|
5
5
|
Author: ANSSI, CNIL, Inria
|
|
6
6
|
Author-email: "Pôle d'Expertise de la Régulation Numérique (PEReN)" <contact@peren.gouv.fr>
|
|
@@ -55,8 +55,8 @@ Description-Content-Type: text/markdown
|
|
|
55
55
|
|
|
56
56
|
<p align="center">
|
|
57
57
|
<picture>
|
|
58
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/paname-lib/paname/tree/
|
|
59
|
-
<img src="https://github.com/paname-lib/paname/tree/
|
|
58
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/paname-lib/paname/tree/main/assets/logo/Paname_baseline_rvb_dark.svg">
|
|
59
|
+
<img src="https://github.com/paname-lib/paname/tree/main/assets/logo/Paname_baseline_rvb.svg" alt="PANAME Logo" width="600">
|
|
60
60
|
</picture>
|
|
61
61
|
</p>
|
|
62
62
|
|
|
@@ -84,7 +84,7 @@ In practice, extraction techniques fall into 3 categories:
|
|
|
84
84
|
These extraction techniques require varying degrees of prior knowledge (*priors*) and of access to the training data and the AI model, which is referred to as the **Threat Model**.
|
|
85
85
|
The performance of extraction techniques can vary depending on the Threat Model, which can help guide mitigation mechanisms in AI systems.
|
|
86
86
|
|
|
87
|
-
An introductory note on the theory of extraction testing is available in the [documentation](https://github.com/paname-lib/paname/tree/
|
|
87
|
+
An introductory note on the theory of extraction testing is available in the [documentation](https://github.com/paname-lib/paname/tree/main/docs/source/theory.rst).
|
|
88
88
|
|
|
89
89
|
## Context
|
|
90
90
|
|
|
@@ -103,7 +103,7 @@ An introductory note on the theory of extraction testing is available in the [do
|
|
|
103
103
|
Clone the repository and access the project:
|
|
104
104
|
|
|
105
105
|
```bash
|
|
106
|
-
git clone https://
|
|
106
|
+
git clone https://github.com/paname-lib/paname.git
|
|
107
107
|
cd paname
|
|
108
108
|
```
|
|
109
109
|
|
|
@@ -149,7 +149,7 @@ docker container run -it --rm paname:latest
|
|
|
149
149
|
|
|
150
150
|
# Tests
|
|
151
151
|
|
|
152
|
-
The test suite is documented in [`CONTRIBUTING.md`](https://github.com/paname-lib/paname/tree/
|
|
152
|
+
The test suite is documented in [`CONTRIBUTING.md`](https://github.com/paname-lib/paname/tree/main/CONTRIBUTING.md). For a quick
|
|
153
153
|
verification of an end-user install:
|
|
154
154
|
|
|
155
155
|
```bash
|
|
@@ -166,21 +166,21 @@ Notebooks to get started with the library are available in the `examples/cookboo
|
|
|
166
166
|
These notebooks aim to give developers a first idea of what can be done with **PANAME**. They are progressive tutorials for mastering the library and its abstractions.
|
|
167
167
|
|
|
168
168
|
The following notebooks explain how to build use cases, adapters (wrappers) and run extractions with PANAME:
|
|
169
|
-
- [`1.mia_getting_started.ipynb`](https://github.com/paname-lib/paname/tree/
|
|
170
|
-
- [`2.mia_CLM_w_precomputed_workflow.ipynb`](https://github.com/paname-lib/paname/tree/
|
|
171
|
-
- [`2bis.mia_w_various_CLM_wrappers.ipynb`](https://github.com/paname-lib/paname/tree/
|
|
172
|
-
- [`3.mia_torchclassifier_w_shadow_models.ipynb`](https://github.com/paname-lib/paname/tree/
|
|
173
|
-
- [`4.mia_w_custom_wrapper.ipynb`](https://github.com/paname-lib/paname/tree/
|
|
174
|
-
- [`5.mia_evaluation_dataset_best_practices.ipynb`](https://github.com/paname-lib/paname/tree/
|
|
175
|
-
- [`6.mia_w_label_only_hopskip.ipynb`](https://github.com/paname-lib/paname/tree/
|
|
176
|
-
- [`7.reconstruction_diffusion_carlini2023.ipynb`](https://github.com/paname-lib/paname/tree/
|
|
177
|
-
- [`8.discoverable_extraction.ipynb`](https://github.com/paname-lib/paname/tree/
|
|
178
|
-
|
|
179
|
-
A few extra, unlisted scripts and notebooks live in [`examples/others/`](https://github.com/paname-lib/paname/tree/
|
|
169
|
+
- [`1.mia_getting_started.ipynb`](https://github.com/paname-lib/paname/tree/main/examples/cookbook/1.mia_getting_started.ipynb): getting started with MIAs — loading data, training models and running a basic membership inference audit.
|
|
170
|
+
- [`2.mia_CLM_w_precomputed_workflow.ipynb`](https://github.com/paname-lib/paname/tree/main/examples/cookbook/2.mia_CLM_w_precomputed_workflow.ipynb): runs MIAs on an overfitted GPT-2 model using a precomputed reference signal.
|
|
171
|
+
- [`2bis.mia_w_various_CLM_wrappers.ipynb`](https://github.com/paname-lib/paname/tree/main/examples/cookbook/2bis.mia_w_various_CLM_wrappers.ipynb): applies the same MIA to an LLM served through different back-ends — a Hugging Face model, an OpenAI-compatible API via vLLM, a GGUF model via llama.cpp and vLLM offline — showing that only the wrapper changes while the rest of the pipeline stays identical.
|
|
172
|
+
- [`3.mia_torchclassifier_w_shadow_models.ipynb`](https://github.com/paname-lib/paname/tree/main/examples/cookbook/3.mia_torchclassifier_w_shadow_models.ipynb): runs a shadow-model attack on a torch-based image classifier.
|
|
173
|
+
- [`4.mia_w_custom_wrapper.ipynb`](https://github.com/paname-lib/paname/tree/main/examples/cookbook/4.mia_w_custom_wrapper.ipynb): shows how to build a custom wrapper to connect a model's signals to compatible attacks.
|
|
174
|
+
- [`5.mia_evaluation_dataset_best_practices.ipynb`](https://github.com/paname-lib/paname/tree/main/examples/cookbook/5.mia_evaluation_dataset_best_practices.ipynb): best practices for building an MIA evaluation dataset (evaluation regimes, biases, …).
|
|
175
|
+
- [`6.mia_w_label_only_hopskip.ipynb`](https://github.com/paname-lib/paname/tree/main/examples/cookbook/6.mia_w_label_only_hopskip.ipynb): label-only membership inference with the HopSkipJump attack.
|
|
176
|
+
- [`7.reconstruction_diffusion_carlini2023.ipynb`](https://github.com/paname-lib/paname/tree/main/examples/cookbook/7.reconstruction_diffusion_carlini2023.ipynb): extracts training images from a text-to-image diffusion model (Carlini et al., 2023) by generating many candidates per prompt and keeping those that form clusters of near-duplicates; the reconstructions are evaluated against the memorized images (requires `--extra diffusion`).
|
|
177
|
+
- [`8.discoverable_extraction.ipynb`](https://github.com/paname-lib/paname/tree/main/examples/cookbook/8.discoverable_extraction.ipynb): generates `(n, p)`-discoverable extraction curves for a local Hugging Face model.
|
|
178
|
+
|
|
179
|
+
A few extra, unlisted scripts and notebooks live in [`examples/others/`](https://github.com/paname-lib/paname/tree/main/examples/others/). They are not part of the numbered tutorial series.
|
|
180
180
|
|
|
181
181
|
## Registered use cases
|
|
182
182
|
|
|
183
|
-
The [`paname_use_cases`](https://github.com/paname-lib/paname/tree/
|
|
183
|
+
The [`paname_use_cases`](https://github.com/paname-lib/paname/tree/main/paname_use_cases/) folder offers examples of what needs to be implemented to run membership inference attacks on a given target model + dataset pair, in the `PanameUseCase` format defined in the script `src/paname/use_case.py`.
|
|
184
184
|
|
|
185
185
|
> [!warning]
|
|
186
186
|
> ⚠️ The models and datasets referenced by the `paname_use_cases` use cases are not redistributed with PANAME; they are downloaded from their original sources at run time. They remain subject to their own licensing terms, held by their respective rights holders, which take precedence over the repository's MIT license. Check their original license before use.
|
|
@@ -219,9 +219,9 @@ This work was (partially) funded by the National Research Agency under the Franc
|
|
|
219
219
|
# License
|
|
220
220
|
|
|
221
221
|
This project is licensed under MIT. A full copy of the license
|
|
222
|
-
text can be found in the file [MIT.txt](https://github.com/paname-lib/paname/tree/
|
|
222
|
+
text can be found in the file [MIT.txt](https://github.com/paname-lib/paname/tree/main/LICENSES/MIT.txt).
|
|
223
223
|
|
|
224
|
-
|
|
224
|
+
<hr>
|
|
225
225
|
<!--
|
|
226
226
|
# SPDX-FileCopyrightText: 2026 PANAME Consortium (ANSSI, CNIL, Inria and PEReN)
|
|
227
227
|
#
|
|
@@ -230,8 +230,8 @@ text can be found in the file [MIT.txt](https://github.com/paname-lib/paname/tre
|
|
|
230
230
|
|
|
231
231
|
<p align="center">
|
|
232
232
|
<picture>
|
|
233
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/paname-lib/paname/tree/
|
|
234
|
-
<img src="https://github.com/paname-lib/paname/tree/
|
|
233
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/paname-lib/paname/tree/main/assets/logo/Paname_baseline_rvb_dark.svg">
|
|
234
|
+
<img src="https://github.com/paname-lib/paname/tree/main/assets/logo/Paname_baseline_rvb.svg" alt="PANAME Logo" width="600">
|
|
235
235
|
</picture>
|
|
236
236
|
</p>
|
|
237
237
|
|
|
@@ -259,7 +259,7 @@ En pratique, les techniques d'extraction sont segmentées en 3 types :
|
|
|
259
259
|
Ces techniques d'extraction nécessitent plus ou moins de connaissances préalables (*priors*) et d'accès aux données d'entraînement ainsi qu'au modèle d'IA, ce que l'on appelle le **Modèle de Menace** (*Threat Model*).
|
|
260
260
|
La performance des techniques d'extraction peut varier en fonction du Modèle de Menace, ce qui peut aider à orienter les mécanismes d'atténuation (*mitigation*) dans les systèmes d'IA.
|
|
261
261
|
|
|
262
|
-
Une note d'introduction à la théorie des tests d'extraction est disponible dans la [documentation](https://github.com/paname-lib/paname/tree/
|
|
262
|
+
Une note d'introduction à la théorie des tests d'extraction est disponible dans la [documentation](https://github.com/paname-lib/paname/tree/main/docs/source/theory.rst).
|
|
263
263
|
|
|
264
264
|
## Contexte
|
|
265
265
|
|
|
@@ -278,7 +278,7 @@ Une note d'introduction à la théorie des tests d'extraction est disponible dan
|
|
|
278
278
|
Cloner le dépôt et accéder au projet :
|
|
279
279
|
|
|
280
280
|
```bash
|
|
281
|
-
git clone https://
|
|
281
|
+
git clone https://github.com/paname-lib/paname.git
|
|
282
282
|
cd paname
|
|
283
283
|
```
|
|
284
284
|
|
|
@@ -324,7 +324,7 @@ docker container run -it --rm paname:latest
|
|
|
324
324
|
|
|
325
325
|
# Tests
|
|
326
326
|
|
|
327
|
-
La suite de tests est documentée dans [`CONTRIBUTING.md`](https://github.com/paname-lib/paname/tree/
|
|
327
|
+
La suite de tests est documentée dans [`CONTRIBUTING.md`](https://github.com/paname-lib/paname/tree/main/CONTRIBUTING.md). Pour une
|
|
328
328
|
vérification rapide d'une installation :
|
|
329
329
|
|
|
330
330
|
```bash
|
|
@@ -341,20 +341,20 @@ Des notebooks de prise en main de la bibliothèque sont disponibles dans le doss
|
|
|
341
341
|
L’objectif de ces notebooks est de donner aux développeurs une première idée de ce qu’il est possible de faire avec **PANAME**. Ils consistent en des tutoriels progressifs pour bien maîtriser la bibliothèque et ses abstractions.
|
|
342
342
|
|
|
343
343
|
Les notebooks suivants expliquent comment construire des cas d’usage, des adaptateurs (wrappers) et lancer des extractions avec PANAME :
|
|
344
|
-
- [`1.mia_getting_started.ipynb`](https://github.com/paname-lib/paname/tree/
|
|
345
|
-
- [`2.mia_CLM_w_precomputed_workflow.ipynb`](https://github.com/paname-lib/paname/tree/
|
|
346
|
-
- [`2bis.mia_w_various_CLM_wrappers.ipynb`](https://github.com/paname-lib/paname/tree/
|
|
347
|
-
- [`3.mia_torchclassifier_w_shadow_models.ipynb`](https://github.com/paname-lib/paname/tree/
|
|
348
|
-
- [`4.mia_w_custom_wrapper.ipynb`](https://github.com/paname-lib/paname/tree/
|
|
349
|
-
- [`5.mia_evaluation_dataset_best_practices.ipynb`](https://github.com/paname-lib/paname/tree/
|
|
350
|
-
- [`6.mia_w_label_only_hopskip.ipynb`](https://github.com/paname-lib/paname/tree/
|
|
351
|
-
- [`7.reconstruction_diffusion_carlini2023.ipynb`](https://github.com/paname-lib/paname/tree/
|
|
352
|
-
- [`8.discoverable_extraction.ipynb`](https://github.com/paname-lib/paname/tree/
|
|
353
|
-
Quelques scripts et notebooks supplémentaires non listés ci-dessus se trouvent dans [`examples/others/`](https://github.com/paname-lib/paname/tree/
|
|
344
|
+
- [`1.mia_getting_started.ipynb`](https://github.com/paname-lib/paname/tree/main/examples/cookbook/1.mia_getting_started.ipynb) : prise en main des MIA : chargement de données, entraînement de modèles et lancement d’un audit d’inférence d’appartenance de base.
|
|
345
|
+
- [`2.mia_CLM_w_precomputed_workflow.ipynb`](https://github.com/paname-lib/paname/tree/main/examples/cookbook/2.mia_CLM_w_precomputed_workflow.ipynb) : exécute des MIA sur un modèle GPT-2 surentraîné en utilisant un signal de référence pré-calculé.
|
|
346
|
+
- [`2bis.mia_w_various_CLM_wrappers.ipynb`](https://github.com/paname-lib/paname/tree/main/examples/cookbook/2bis.mia_w_various_CLM_wrappers.ipynb) : applique la même MIA sur un LLM servi via différents back-ends — un modèle Hugging Face, une API compatible OpenAI via vLLM, un modèle GGUF via llama.cpp et vLLM hors-ligne — en montrant que seul le wrapper change alors que le reste du pipeline reste identique.
|
|
347
|
+
- [`3.mia_torchclassifier_w_shadow_models.ipynb`](https://github.com/paname-lib/paname/tree/main/examples/cookbook/3.mia_torchclassifier_w_shadow_models.ipynb) : exécute une attaque par modèles fantômes (shadow models) sur un classifieur d’images basé sur torch.
|
|
348
|
+
- [`4.mia_w_custom_wrapper.ipynb`](https://github.com/paname-lib/paname/tree/main/examples/cookbook/4.mia_w_custom_wrapper.ipynb) : montre comment construire un wrapper personnalisé pour connecter les signaux d’un modèle aux attaques compatibles.
|
|
349
|
+
- [`5.mia_evaluation_dataset_best_practices.ipynb`](https://github.com/paname-lib/paname/tree/main/examples/cookbook/5.mia_evaluation_dataset_best_practices.ipynb) : bonnes pratiques pour construire un jeu de données d’évaluation MIA (régimes d’évaluation, biais, …).
|
|
350
|
+
- [`6.mia_w_label_only_hopskip.ipynb`](https://github.com/paname-lib/paname/tree/main/examples/cookbook/6.mia_w_label_only_hopskip.ipynb) : inférence d’appartenance *label-only* avec l’attaque HopSkipJump.
|
|
351
|
+
- [`7.reconstruction_diffusion_carlini2023.ipynb`](https://github.com/paname-lib/paname/tree/main/examples/cookbook/7.reconstruction_diffusion_carlini2023.ipynb) : extrait des images d'entraînement d'un modèle de diffusion texte-vers-image (technique de Carlini et al., 2023) en générant de nombreux candidats par prompt puis en filtrant ceux qui forment des groupes de quasi-doublons ; les reconstructions sont évaluées contre les images mémorisées (nécessite `--extra diffusion`).
|
|
352
|
+
- [`8.discoverable_extraction.ipynb`](https://github.com/paname-lib/paname/tree/main/examples/cookbook/8.discoverable_extraction.ipynb) : génère les courbes d’extraction découvrable `(n, p)` pour un modèle Hugging Face local.
|
|
353
|
+
Quelques scripts et notebooks supplémentaires non listés ci-dessus se trouvent dans [`examples/others/`](https://github.com/paname-lib/paname/tree/main/examples/others/). Ils ne font pas partie de la série de didacticiels numérotés.
|
|
354
354
|
|
|
355
355
|
## Cas d'usage enregistrés
|
|
356
356
|
|
|
357
|
-
Le dossier [`paname_use_cases`](https://github.com/paname-lib/paname/tree/
|
|
357
|
+
Le dossier [`paname_use_cases`](https://github.com/paname-lib/paname/tree/main/paname_use_cases/) propose des exemples de ce qu’il faut implémenter pour exécuter des attaques par inférence d’appartenance sur un couple modèle cible et jeu de données, au format `PanameUseCase` défini dans le script `src/paname/use_case.py`.
|
|
358
358
|
|
|
359
359
|
> [!warning]
|
|
360
360
|
> ⚠️ Les modèles et jeux de données référencés par les cas d'usage de `paname_use_cases` ne sont pas redistribués avec PANAME ; ils sont téléchargés depuis leurs sources d'origine à l'exécution. Ils restent soumis à leurs propres conditions de licence, détenues par leurs ayants droit respectifs, qui priment sur la licence MIT du dépôt. Vérifiez leur licence d'origine avant toute utilisation.
|
|
@@ -393,4 +393,4 @@ Ce travail a bénéficié d'une aide de l'État gérée par l'Agence Nationale d
|
|
|
393
393
|
# Licence
|
|
394
394
|
|
|
395
395
|
Ce projet est sous licence MIT. Une copie intégrale du texte
|
|
396
|
-
de la licence se trouve dans le fichier [MIT.txt](https://github.com/paname-lib/paname/tree/
|
|
396
|
+
de la licence se trouve dans le fichier [MIT.txt](https://github.com/paname-lib/paname/tree/main/LICENSES/MIT.txt).
|
|
@@ -54,7 +54,7 @@ An introductory note on the theory of extraction testing is available in the [do
|
|
|
54
54
|
Clone the repository and access the project:
|
|
55
55
|
|
|
56
56
|
```bash
|
|
57
|
-
git clone https://
|
|
57
|
+
git clone https://github.com/paname-lib/paname.git
|
|
58
58
|
cd paname
|
|
59
59
|
```
|
|
60
60
|
|
|
@@ -54,7 +54,7 @@ Une note d'introduction à la théorie des tests d'extraction est disponible dan
|
|
|
54
54
|
Cloner le dépôt et accéder au projet :
|
|
55
55
|
|
|
56
56
|
```bash
|
|
57
|
-
git clone https://
|
|
57
|
+
git clone https://github.com/paname-lib/paname.git
|
|
58
58
|
cd paname
|
|
59
59
|
```
|
|
60
60
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "paname"
|
|
7
|
-
version = "0.0.1-
|
|
7
|
+
version = "0.0.1-dev2"
|
|
8
8
|
description = "Assess self-conformity of ML models by running extraction techniques."
|
|
9
9
|
authors = [
|
|
10
10
|
{ name = "ANSSI" },
|
|
@@ -164,18 +164,18 @@ content-type = "text/markdown"
|
|
|
164
164
|
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
|
|
165
165
|
# Literal TOML strings (single quotes) need no escaping of backslashes.
|
|
166
166
|
pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)'
|
|
167
|
-
replacement = '[\1](https://github.com/paname-lib/paname/tree/main
|
|
167
|
+
replacement = '[\1](https://github.com/paname-lib/paname/tree/main/\g<2>)'
|
|
168
168
|
|
|
169
169
|
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
|
|
170
170
|
# image assets from relative to absolute paths
|
|
171
171
|
pattern = '(srcset|src)="((?!https?://)\S+?)"'
|
|
172
|
-
replacement = '\1="https://github.com/paname-lib/paname/tree/main
|
|
172
|
+
replacement = '\1="https://github.com/paname-lib/paname/tree/main/\g<2>"'
|
|
173
173
|
|
|
174
174
|
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
|
|
175
175
|
path = "README.md"
|
|
176
176
|
|
|
177
177
|
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
|
|
178
|
-
text = "\n
|
|
178
|
+
text = "\n<hr>\n"
|
|
179
179
|
|
|
180
180
|
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
|
|
181
181
|
path = "README_FR.md"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{paname-0.0.1.dev1 → paname-0.0.1.dev2}/paname_use_cases/discoverable_extraction_wikipedia.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{paname-0.0.1.dev1 → paname-0.0.1.dev2}/paname_use_cases/ministrallm_fineweb_vllm_offline.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/mia/attack_model.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/mia/hop_skip_jump.py
RENAMED
|
File without changes
|
{paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/mia/likelihood_ratio.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/mia/neighborhood.py
RENAMED
|
File without changes
|
{paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/mia/noise_label_only.py
RENAMED
|
File without changes
|
|
File without changes
|
{paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/mia/reference_based.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/reconstruction/__init__.py
RENAMED
|
File without changes
|
{paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/reconstruction/base.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/extraction_techniques/reconstruction/utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/signal_extraction/model_wrappers/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/signal_extraction/model_wrappers/gguf_lm.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/signal_extraction/model_wrappers/online_api_lm.py
RENAMED
|
File without changes
|
|
File without changes
|
{paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/signal_extraction/model_wrappers/sklearn.py
RENAMED
|
File without changes
|
|
File without changes
|
{paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/signal_extraction/model_wrappers/text_sampling.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/signal_extraction/utils/process_logprobs.py
RENAMED
|
File without changes
|
{paname-0.0.1.dev1 → paname-0.0.1.dev2}/src/paname/signal_extraction/utils/signal_transformations.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|