Views
No views yet
@misc{kallini2024mission,
title={Mission: Impossible Language Models},
author={Julie Kallini and Isabel Papadimitriou and Richard Futrell and Kyle Mahowald and Christopher Potts},
year={2024},
eprint={2401.06416},
archivePrefix={arXiv},
primaryClass={cs.CL}
}git clone https://github.com/jkallini/mission-impossible-language-models.git
cd mission-impossible-language-models
pip install -r requirements.txtdata/ directory.
First, you must download a copy of the BabyLM dataset, which we use for our experiments.
Then, make sure to set BABYLM_DATA_PATH in the utils.py file to the path on your system where your BabyLM dataset is located.tag.py script.PERTURBATIONS section at the end of utils.py. Here is an
example for the PartialReverse language from the paper:python3 perturb.py reverse_partial 100Mperturb.py or perturb.sh to perturb multiple splits at the same time.perturbation_function: function mapping tagged sentences to sequences of GPT-2 tokens.affect_function: function that determines whether an input sentences is "affected" or altered by the perturbation.filter_function: function that determines whether an input sentence should be included in the final dataset.gpt2_tokenizer: tokenizer used to perturb this dataset.utils.py, where the existing perturbations are located.mistral. If you would like to train GPT-2s with mistral as well, please follow their steps for installation. You may download their repo anywhere on your system.utils.py:CHECKPOINT_WRITE_PATH: the path where your training checkpoints will be written.CHECKPOINT_READ_PATH: the path where you will read training checkpoints when running experiments.training/ directory.
Once you have mistral installed, set MISTRAL_PATH to the path of your library in prepare_training.sh. Then, you can use this script to generate the config files that you will use to launch mistral training runs.mistral directory—you will only need to launch the training run. Here's an example command to launch training for the PartialReverse language using the 100M training set with the random seed set to 41:CUDA_VISIBLE_DEVICES=0 python3 train.py --config conf/train_reverse_partial_100M_randinit_seed41.yaml --nnodes 1 --nproc_per_node 1 --training_arguments.fp16 true --training_arguments.warmup_steps 300 --training_arguments.max_steps 3000perplexities/: code to run perplexity experiments. You may use perplexities.py or perplexities.sh to run experiments for multiple languages at the same time.hop_surprisal/: code to run surprisal experiments for the *Hop languages, in hop_surprisal.py.hop_interventions/: code to run interchange intervention experiments for the *Hop languages. First generate the agreement data using create_agreement_data.py, then run the intervention experiments using hop_interventions.py.
You will need to separately clone and install align-transformers (recently renamed to pyvene) and set PATH_TO_ALIGN_TRANSFORMERS to the path where the library is located on your system.edge_probing/: code to run constituency probing experiments. Use get_constituency_parses.py and load_phrase_data.py to prepare the test data, and use edge_probing.py to run the experiments.