Skip to content

SamAdamDay/neural-interactive-proofs

Repository files navigation

Neural Interactive Proofs Experiments

arXiv | OpenReview | Website | Documentation

This repository houses the code used to run the experiments for the ICLR 2025 paper 'Neural Interactive Proofs' by Lewis Hammond and Sam Adam-Day.

The codebase is designed to be easy to use and extend. For example, it supports the addition of new protocols, new training algorithms, and new domains of evaluation. Read the documentation for guides and the API reference.

Requirements

  • The library requires Python 3.11 or later.
  • You need git to clone the repository.
  • uv is recommended for installing packages, but pip also works.
  • To log experiment data, you will need a Weights & Biases account.
  • To run experiments with OpenAI models, you need an OpenAI API key. You can get one by signing up at OpenAI. Note that in general the use of the OpenAI API is not free.

Installation

See the installation docs for a more detailed installation guide.

  1. Clone the repository. If you're just running experiments, you can download a specific release, e.g.:

    git clone https://github.com/SamAdamDay/neural-interactive-proofs.git --branch v2.1.1 --depth 1

    To get the latest version, run:

    git clone https://github.com/SamAdamDay/neural-interactive-proofs.git
  2. Change to the repository directory: cd neural-interactive-proofs

  3. Install library and dependencies: uv sync.

    If you just want to run experiments and don't want to make changes to the codebase, you can do uv sync --no-dev.

    If you want to host open-weight language models on your machine, install the lm-server optional dependencies: uv sync --extra lm-server.

    If using pip, create a virtual environment, activate it, then run:

    pip install wheel
    pip install torch==2.7.0 torchvision==0.22.0 --index-url https://download.pytorch.org/whl/cu118
    pip install -e --group dev .
  4. Log in to Weights & Biases: wandb login

  5. Copy the template secrets file: cp .env.template .env

    Edit the .env file and fill in the necessary information for your use case. The comments in the file should guide you on what to fill in.

Running an experiment

See the guide to running experiments for a more information.

The HyperParameters class contains all experiment parameters needed for a reproducible experiment. Running an experiment looks like:

from nip import HyperParameters, run_experiment
hyper_params = HyperParameters(
    "{scenario_name}", 
    "{trainer_name}", 
    "{dataset_name}", 
    **additional_parameters,
)
run_experiment(hyper_params)
  • additional_parameters can include nested dictionaries. See the parameters module for details.
  • run_experiment takes additional parameters, like the device and whether to log to Weights & Biases.
  • The nip.utils.experiment contains utility classes for running hyperparameter experiments in sequence or in parallel.

Contributing

We welcome issues and pull requests! See the guide to contributing for more information.

Citation

@inproceedings{neural_interactive_proofs,
    author        = {Lewis Hammond and Sam Adam-Day},
    title         = {Neural Interactive Proofs},
    booktitle     = {The Thirteenth International Conference on Learning Representations (ICLR)},
    year          = {2025},
    eprint        = {2412.08897},
    archivePrefix = {arXiv},
    primaryClass  = {cs.AI},
}

Contributors 2

  •  
  •  

Languages