GitHub for the CLRS tasks in language form.
-
Install Requirements:
pip install -r requirements.txt
-
Generate data:
The options for
<TASK>
are defined in the tasks array in data_schema.pypython data_generator.py --task <TASK> --part <train or test> --num_samples <number of generated samples>
-
(Optional) Create txt files of inputs:
This only works for 2d array inputs.
python inputs_to_text_files.py --task <TASK> --dp <number of decimal places to round data to>
-
Generate prompts:
We give a framework to generate prompts automatically. You can then add your prompt for each task, to the respective function in prompt_generator.py.
python prompt_generator.py --task <TASK> --part <train or test> --num_samples <number of generated samples>`
You can then call
prompt_gen(task, partition, max_samples)
to generate prompts at test time.
Some CLRS outputs are pointers, for example the output of: [13, 13, 7, 0, 4, 12, 11, 13, 14, 13, 2, 7, 0, 13, 0, 7]
depicts the tree in the diagram below. I.e. A[i] = parent of node i
@article{mcleish2024benchmarking,
title={Benchmarking ChatGPT on Algorithmic Reasoning},
author={McLeish, Sean and Schwarzschild, Avi and Goldstein, Tom},
journal={arXiv preprint arXiv:2404.03441},
year={2024}
}