Autoregressive Models:
Qwen/Qwen2.5-Coder-7B-Instruct)deepseek-ai/deepseek-coder-6.7b-instruct)Qwen/Qwen3-8B)Diffusion Models:
Dream-org/Dream-Coder-v0-Instruct-7B)GSAI-ML/LLaDA-8B-Instruct)apple/DiffuCoder-7B-cpGRPO)The evaluation is performed using the nuprl/CanItEdit dataset from Hugging Face.
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python main.py
ssh <netid>@login.delftblue.tudelft.nl
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
bash Miniforge3-Linux-x86_64.sh
conda create -n dllms python=3.11 -y
conda activate dllms
pip install -r <dllms_path>/requirements.txt
mkdir -p /scratch/<netid>/hf_cache
export HF_HOME=/scratch/<netid>/hf_cache
export TRANSFORMERS_CACHE=/scratch/<netid>/hf_cache
module load 2025
module load python
python download_models.py
#!/bin/bash
#
#SBATCH --job-name="dllms"
#SBATCH --partition=gpu
#SBATCH --time=04:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=4
#SBATCH --gpus-per-task=1
#SBATCH --mem-per-cpu=16G
#SBATCH --account=<your-account-name>
source ~/miniforge3/etc/profile.d/conda.sh
conda activate dllms
cd /home/<netid>/dllms
export HF_HOME=/scratch/<netid>/hf_cache
export TRANSFORMERS_CACHE=/scratch/<netid>/hf_cache
export TOKENIZERS_PARALLELISM=false
export HF_HUB_OFFLINE=1
export TRANSFORMERS_OFFLINE=1
srun python main.py
Because of compatibility issues, different transformers versions are required for the different model families:
transformers version in requirements.txt (which includes a custom shim in the pipeline).transformers version (e.g., transformers==4.38.2) due to custom generation code and masking utilities.You will need to make separate runs for AR models and Diffusion models by commenting out the respective groups in pipeline.py and running them in separate conda environments with the appropriate transformers versions installed.
This project employs two main caching mechanisms:
nuprl/CanItEdit dataset are cached in HF_HOME. Run the download_models.py script to populate this cache locally before running jobs in an offline cluster environment.cache_artifacts/): The outputs from each model (prefix and suffix generations) and their evaluated metrics are saved as JSON files in the cache_artifacts/ directory. If a run is interrupted or if you restart the pipeline, it will automatically load cached generation results, bypassing the expensive model inference steps.main.py: The entry point script that orchestrates the execution of the evaluation pipeline and aggregates metrics.pipeline.py: Defines the models used (AR and Diffusion), manages the generation code for each model family, and controls inference.data.py: Responsible for loading and processing the nuprl/CanItEdit dataset.evaluation.py: Evaluates the generated code by checking AST validity, computing deviation from gold code, and running test assertions.permutations.py: Generates the positional prompts (prefix vs suffix configurations) to evaluate order-invariance.utils.py: Contains helper functions such as python code extraction and checking for degenerate outputs.download_models.py: A standalone script to cache model weights and the dataset locally before running the pipeline on a cluster.requirements.txt: Python package dependencies.cache_artifacts/: Directory for caching model generations and evaluated metrics per model to save inference time on subsequent runs. This folder is part of the .gitignore and is generated while the comparison is running.Autoregressive Models:
Qwen/Qwen2.5-Coder-7B-Instruct)deepseek-ai/deepseek-coder-6.7b-instruct)Qwen/Qwen3-8B)Diffusion Models:
Dream-org/Dream-Coder-v0-Instruct-7B)GSAI-ML/LLaDA-8B-Instruct)apple/DiffuCoder-7B-cpGRPO)The evaluation is performed using the nuprl/CanItEdit dataset from Hugging Face.
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python main.py
ssh <netid>@login.delftblue.tudelft.nl
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
bash Miniforge3-Linux-x86_64.sh
conda create -n dllms python=3.11 -y
conda activate dllms
pip install -r <dllms_path>/requirements.txt
mkdir -p /scratch/<netid>/hf_cache
export HF_HOME=/scratch/<netid>/hf_cache
export TRANSFORMERS_CACHE=/scratch/<netid>/hf_cache
module load 2025
module load python
python download_models.py
#!/bin/bash
#
#SBATCH --job-name="dllms"
#SBATCH --partition=gpu
#SBATCH --time=04:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=4
#SBATCH --gpus-per-task=1
#SBATCH --mem-per-cpu=16G
#SBATCH --account=<your-account-name>
source ~/miniforge3/etc/profile.d/conda.sh
conda activate dllms
cd /home/<netid>/dllms
export HF_HOME=/scratch/<netid>/hf_cache
export TRANSFORMERS_CACHE=/scratch/<netid>/hf_cache
export TOKENIZERS_PARALLELISM=false
export HF_HUB_OFFLINE=1
export TRANSFORMERS_OFFLINE=1
srun python main.py
Because of compatibility issues, different transformers versions are required for the different model families:
transformers version in requirements.txt (which includes a custom shim in the pipeline).transformers version (e.g., transformers==4.38.2) due to custom generation code and masking utilities.You will need to make separate runs for AR models and Diffusion models by commenting out the respective groups in pipeline.py and running them in separate conda environments with the appropriate transformers versions installed.
This project employs two main caching mechanisms:
nuprl/CanItEdit dataset are cached in HF_HOME. Run the download_models.py script to populate this cache locally before running jobs in an offline cluster environment.cache_artifacts/): The outputs from each model (prefix and suffix generations) and their evaluated metrics are saved as JSON files in the cache_artifacts/ directory. If a run is interrupted or if you restart the pipeline, it will automatically load cached generation results, bypassing the expensive model inference steps.main.py: The entry point script that orchestrates the execution of the evaluation pipeline and aggregates metrics.pipeline.py: Defines the models used (AR and Diffusion), manages the generation code for each model family, and controls inference.data.py: Responsible for loading and processing the nuprl/CanItEdit dataset.evaluation.py: Evaluates the generated code by checking AST validity, computing deviation from gold code, and running test assertions.permutations.py: Generates the positional prompts (prefix vs suffix configurations) to evaluate order-invariance.utils.py: Contains helper functions such as python code extraction and checking for degenerate outputs.download_models.py: A standalone script to cache model weights and the dataset locally before running the pipeline on a cluster.requirements.txt: Python package dependencies.cache_artifacts/: Directory for caching model generations and evaluated metrics per model to save inference time on subsequent runs. This folder is part of the .gitignore and is generated while the comparison is running.