Code and data for the paper: Distilling Human-Aligned Privacy Sensitivity Assessment from Large Language Models, Gabriel Loiseau, Damien Sileo, Damien Riquet, Maxime Meyer, Marc Tommasi.
All models and datasets are available in the π€ HuggingFace collection.
from transformers import pipeline
classifier = pipeline("text-classification", model="gabrielloiseau/ettin-encoder-150m-privacy")
result = classifier("Happy First Day of Spring!")
print(result) # [{'label': '1', 'score': 0.98}]
git clone https://github.com/gabrielloiseau/privacy-distillation.git
cd privacy-distillation
uv sync
To reproduce the 200k-text privacy-annotated dataset from the paper. This samples 20,000 texts from each of 10 source domains and annotates them with Mistral Large 3:
# Set your API key
export MISTRAL_API_KEY=your-key-here
# Annotate all 10 domains (supports resume)
uv run python create_dataset.py
# Annotate a single domain
uv run python create_dataset.py --domains BAC EE
# Push finished dataset to HuggingFace Hub
uv run python create_dataset.py --push --repo-id your-username/your-dataset
Note: The Mental Health Blog (MHB) dataset is not hosted on HuggingFace. Place a parquet file with a
textcolumn atdata/MHB/raw_texts.parquetbefore running.
Fine-tune an encoder on the privacy dataset:
uv run python model_training.py
Override base model or hyperparameters:
uv run python model_training.py --model jhu-clsp/ettin-encoder-17m --epochs 3 --output-dir outputs/ettin-17m
uv run python evaluate_model.py --hf-model gabrielloiseau/ettin-encoder-150m-privacy
uv run python run_experiments.py
uv run python tab_exp.py
privacy-distillation/
βββ pyproject.toml # Project metadata and dependencies (uv)
βββ create_dataset.py # Sample source texts + LLM annotation pipeline
βββ annotator.py # DSPy signature for teacher model annotation
βββ model_training.py # Fine-tune encoder models for privacy classification
βββ evaluate_model.py # Evaluate model against human/LLM baselines
βββ run_experiments.py # Run all paper experiments
βββ tab_exp.py # Standalone TAB de-identification experiment
βββ utils.py # Shared utilities (scoring, masking)
βββ survey_data/ # 250-text human benchmark data
βββ texts.json # Benchmark texts
βββ text_idx.json # Dataset-to-index mapping
βββ survey_results.csv # 677 human annotations
βββ llm_improved_combined.csv # LLM ratings
The survey data originates from the privacy-judge repository, associated with the HAIPS 2025 paper "LLM-as-a-Judge for Privacy Evaluation? Exploring the Alignment of Human and LLM Perceptions of Privacy in Textual Data".
@misc{loiseau2026distilling,
title={Distilling Human-Aligned Privacy Sensitivity Assessment from Large Language Models},
author={Gabriel Loiseau and Damien Sileo and Damien Riquet and Maxime Meyer and Marc Tommasi},
year={2026},
eprint={2603.29497},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2603.29497},
}
3 commits
Python
100.0%
Code and data for the paper: Distilling Human-Aligned Privacy Sensitivity Assessment from Large Language Models, Gabriel Loiseau, Damien Sileo, Damien Riquet, Maxime Meyer, Marc Tommasi.
All models and datasets are available in the π€ HuggingFace collection.
from transformers import pipeline
classifier = pipeline("text-classification", model="gabrielloiseau/ettin-encoder-150m-privacy")
result = classifier("Happy First Day of Spring!")
print(result) # [{'label': '1', 'score': 0.98}]
git clone https://github.com/gabrielloiseau/privacy-distillation.git
cd privacy-distillation
uv sync
To reproduce the 200k-text privacy-annotated dataset from the paper. This samples 20,000 texts from each of 10 source domains and annotates them with Mistral Large 3:
# Set your API key
export MISTRAL_API_KEY=your-key-here
# Annotate all 10 domains (supports resume)
uv run python create_dataset.py
# Annotate a single domain
uv run python create_dataset.py --domains BAC EE
# Push finished dataset to HuggingFace Hub
uv run python create_dataset.py --push --repo-id your-username/your-dataset
Note: The Mental Health Blog (MHB) dataset is not hosted on HuggingFace. Place a parquet file with a
textcolumn atdata/MHB/raw_texts.parquetbefore running.
Fine-tune an encoder on the privacy dataset:
uv run python model_training.py
Override base model or hyperparameters:
uv run python model_training.py --model jhu-clsp/ettin-encoder-17m --epochs 3 --output-dir outputs/ettin-17m
uv run python evaluate_model.py --hf-model gabrielloiseau/ettin-encoder-150m-privacy
uv run python run_experiments.py
uv run python tab_exp.py
privacy-distillation/
βββ pyproject.toml # Project metadata and dependencies (uv)
βββ create_dataset.py # Sample source texts + LLM annotation pipeline
βββ annotator.py # DSPy signature for teacher model annotation
βββ model_training.py # Fine-tune encoder models for privacy classification
βββ evaluate_model.py # Evaluate model against human/LLM baselines
βββ run_experiments.py # Run all paper experiments
βββ tab_exp.py # Standalone TAB de-identification experiment
βββ utils.py # Shared utilities (scoring, masking)
βββ survey_data/ # 250-text human benchmark data
βββ texts.json # Benchmark texts
βββ text_idx.json # Dataset-to-index mapping
βββ survey_results.csv # 677 human annotations
βββ llm_improved_combined.csv # LLM ratings
The survey data originates from the privacy-judge repository, associated with the HAIPS 2025 paper "LLM-as-a-Judge for Privacy Evaluation? Exploring the Alignment of Human and LLM Perceptions of Privacy in Textual Data".
@misc{loiseau2026distilling,
title={Distilling Human-Aligned Privacy Sensitivity Assessment from Large Language Models},
author={Gabriel Loiseau and Damien Sileo and Damien Riquet and Maxime Meyer and Marc Tommasi},
year={2026},
eprint={2603.29497},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2603.29497},
}
3 commits
Python
100.0%