Code related to the paper: https://arxiv.org/abs/2501.05855
Authors:
- Antonin Poché (antonin.poche@irt-saintexupery.com)
- Alon Jacovi
- Agustin Martin Picard
- Victor Boutin
- Fanny Jourdan
git clone https://github.com/AntoninPoche/ConSim.git
pip install -e .
First you need to download datasets and adapt src/utils/dataset_utils.py to load your datasets. You will also have to adapt src/utils/models_configs.py to create model configs for your dataset. Finally, you might also have to add a prompting relative to the dataset for SplittedLlamaForCausalLM in src/utils/splitted_models.py.
Then, the different scripts are in the scripts folder. In order:
train_evaluate.pyto train and evaluate a model on a dataset and compute its embeddingsllama_embeddings.pyto compute the embeddings for llama on a datasetcompute_concepts_and_co.pyto compute the concepts and their importance for a model-dataset pair.concepts_communication.pyto compute the communication between concepts for a model-dataset pair.make_prompts.pyto create the simulatability prompts for a model-dataset pair.call_openai_api.pyto call open-ai API as meta-predictors for simulatability prompts on a model-dataset pair.compute_methods_perfs.pyto compute the performances of different methods based on open-ai models' answers on a model-dataset pair.visualize_methods_perfs.pyto visualize the performances of different methods based on open-ai models' answers.compute_metrics.pyto compute the other metrics for a model-dataset pair.analyze_metrics.pyto analyze the other metrics with regard to simulatability.
Parameters for scripts can be found in src/utils/general_utils.py.
You can check examples in xp_to_launch.txt. There are also examples of how to launch many scripts using launch_scripts.sh.