TeleSparseRepo is a research codebase for privacy-preserving inference via sparse neural networks. It integrates pruning, teleportation, and zkML benchmarking, with tools and interfaces for reproducible experiments targeting proof generation and activation optimization.
This project supports the paper accepted at PETS 2025.
- Prune model weights using structured methods.
- Teleport activations to optimize proof-efficiency.
- Benchmark proof systems (e.g., zkML, ezkl).
TeleSparseRepo/
├── Benchmark/ # Benchmarking and evaluation scripts
│ ├── benchmarks/ # Charts, plots, tables
│ ├── models/ # Model structures and formats
│ └── Results/ # Output metrics and zk proof files
├── frameworks/ # zkML engines: ezkl, zkml, opML, circomlib-ml
├── NeuralTeleportation/ # Model teleportation logic
│ ├── neuralteleportation/ # Activation teleportation core logic
│ ├── requirements/ # Component dependencies
│ └── tests/ # Unit tests for teleportation logic
├── env/ # Virtualenv configurations
├── requirements.txt # Project dependencies
├── run_table1_ezkl_resnet20.sh # Benchmark script for ezkl
├── run_table1_zkml_resnet20.sh # Benchmark script for zkML
└── README.md
git clone https://github.com/yourusername/TeleSparseRepo.git
cd TeleSparseRepo
python3 -m venv venv
source venv/bin/activate # Linux/macOS
pip install -r requirements.txt
cd NeuralTeleportation
pip install -e .
Use RD-Prune for ResNet/MobileNet:
python iterate.py --dataset cifar100 --model resnet20_cifar100 \
--pruner rd --worst_case_curve \
--calib_size 1024 --iter_end 1
Output will be a pruned ONNX model.
python resnet20_teleport_ZO.py --prefix_dir path/to/pruned_model_dir
Generates:
resnet20_cob_activation_norm_teleported.onnx
network_complete.onnx
input_convs.json
Run the two benchmarking scripts:
./run_table1_ezkl_resnet20.sh
./run_table1_zkml_resnet20.sh
Results are saved under Benchmark/Results/
- Teleportation logic is based on the neuralteleportation repository.
- Benchmarking pipeline and scripts are adapted from ZKML-Benchmark.
If you use this code in your work, please cite:
@article{maheri2025telesparse,
title={TeleSparse: Practical Privacy-Preserving Verification of Deep Neural Networks},
author={Maheri, Mohammad M and Haddadi, Hamed and Davidson, Alex},
journal={Proceedings on Privacy Enhancing Technologies (PETS)},
year={2025}
}
Please open a GitHub issue or contact m.maheri23 [at] imperial.ac.uk
for questions or contributions.