SwissGov-RSD: A Human-annotated, Cross-lingual Benchmark for the Recognition of Token-level Semantic Differences Between Related Documents
A comprehensive benchmark for evaluating token-level semantic difference recognition across multiple languages including iSTS-RSD (Vamvas and Sennrich, 2023) and SwissGov-RSD (Wastl et al., 2025).
We recommend using Python 3.11 for this project.
Install the required dependencies in two steps:
Step 1: Install main requirements
pip install -r requirements.txtStep 2: Install RSD-specific requirements
pip install -r rsd/requirements.txtBefore training encoder models:
- Adjust the data path in
encoders/finetuning/data - Update the
output_dirname inencoders/finetuning/run_train_modernbert-large.sh - Update the model path in
scripts/run_predict_encoders.sh
Then run the training script:
bash encoders/finetuning/run_train_modernbert-large.shLlama Models:
bash llama/run_train_llama_8b.shGPT-4o-mini:
Training for GPT-4o-mini was performed using the browser application.
bash scripts/run_predict_encoder.shbash scripts/run_predict_llama.shpython scripts/predict_openai.py --model [openai_modelname]python scripts/predict_llama_405b_fireworkspython scripts/predict_deepseekr1.pyEvaluate predictions on the SwissGov-RSD benchmark:
python -m scripts.evaluate_predictions_admin [prediction_path_prefix]Example prediction path prefix:
data/evaluation/encoder_predictions/dev/DiffAlign(model=Alibaba-NLP_gte-multilingual-base, layer=-1_admin_
Use --split to evaluate against a specific gold label split regardless of which predictions file is provided (default: full):
python -m scripts.evaluate_predictions_admin [prediction_path_prefix] --split dev
python -m scripts.evaluate_predictions_admin [prediction_path_prefix] --split testSpecial Note for DiffAlign with XLM-R + SimCSE:
When evaluating DiffAlign with a model that can take only relatively short input sequences, e.g. XLM-R + SimCSE for SwissGov, add the --short flag:
python -m scripts.evaluate_predictions_admin [prediction_path_prefix] --shortEvaluate predictions on the iSTS-RSD benchmark:
python -m scripts.evaluate_predictions_ists [path_to_preds]Get statistics about the test dataset:
python -m scripts.get_test_data_statsVisualize Gold Labels:
Display annotations for a specific sample from the gold standard:
python -m scripts.visualize_labeled_text [path_to_gold] [sample_id] --goldExample:
sample_id:admin_de_1path_to_gold: Full path to the file containing gold annotations
Visualize Predicted Labels:
Display annotations from model predictions:
python -m scripts.visualize_labeled_text [path_to_preds] [sample_id]Visualize iSTS-RSD Sample:
Create a visualization example from the iSTS-RSD dataset:
python -m scripts.create_rsd_exampleGet correlation statistics per bucket for length analysis:
python -m scripts.get_corr_per_bucket [path_to_preds] --get-corr-per-bucketExample path:
data/evaluation/encoder_predictions/dev/DiffAlign(model=Alibaba-NLP_gte-multilingual-base, layer=-1_admin_
The following scripts are available for label projection and evaluation:
scripts/project_labels.py- Project labels across languagesscripts/merge_projected_data.py- Merge projected label datascripts/sample_projected_data.py- Sample from projected data
Test model inference latency:
python -m scripts.latency_test-
07.07.2026: The SwissGov-RSD paper received an SAC Highlight at ACL 2026! 🏆
-
06.04.2026: The SwissGov-RSD paper was accepted to ACL Main! 🎉
-
19.03.2026: Multi-parallel datasets can be very valuable for translation-related tasks! Find a translation-specific subset of SwissGov here: https://github.com/miwytt/multi-parallel-swissgov/
-
04.03.2026: Due to previously low annotator agreements for the German subset, the German subset has been re-annotated. The previous annotations are preserved at: https://github.com/ZurichNLP/SwissGov-RSD/tree/old-german-annotations. Note that the data used in the experiments and described in the paper is the new re-annotated version.
If you use this library in your research, please cite the accompanying paper:
@misc{wastl2025swissgovrsdhumanannotatedcrosslingualbenchmark,
title={SwissGov-RSD: A Human-annotated, Cross-lingual Benchmark for Token-level Recognition of Semantic Differences Between Related Documents},
author={Michelle Wastl and Jannis Vamvas and Rico Sennrich},
year={2025},
eprint={2512.07538},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2512.07538},
}