Code Base for "MixMin: Finding Data Mixtures via Convex Minimization" published at ICML 2025.
The code for the LLM experiments is under "LLM_DataMixing", and the workflow is:
- train proxy models (run train.py with desired arguments)
- eval proxy models on target (run llm_eval.py)
- collect logprobs from eval (run logprobs.py)
- run mixmin (run mixmin_gen.py)
- train final model (run train.py with mixture weights pointing to the mixmin weight)
The code for the chemistry experiments is under "PCBA", and the workflow is (analogous to above):
- train proxy models(run pcba_100k_models.py)
- run mixmin (run pcba_100k_mixmin.py)
- train final model (run pcba_100k_mixmin_train.py)
If adapting to a new dataset, I recommend adapting the pcba codebase (which has cleaner functions) unless dealing specifically with LLMs.
NOTE: I used the environment in mixmin_requirements.txt for everything except training and evaluating LLMs, where I used the llm_requirements.txt in the LLM_DataMixing folder. Both of the requirements.txt have some unecessary packages, and I recommend looking at the imports for the files to have a more streamlined environment.