Official reproduction guide for BootTrans: Bootstrapping Code Translation with Weighted Multilanguage Exploration (ACL 2026).
BootTrans studies reinforcement-learning-based code translation. This repository contains the training pipeline, code-execution reward, validation data, and evaluation script used to reproduce the main experimental workflow.
We recommend using a clean Python environment. The project is tested with Python 3.9+.
conda create -n boottrans python=3.12 -y
conda activate boottrans
pip install -r requirements.txt
pip install -e .The training code depends on torch, transformers, vllm, ray, and other packages listed in requirements.txt. Please install the CUDA-compatible versions of PyTorch and vLLM according to your local GPU driver and CUDA version if the default installation is not suitable.
BootTrans uses the MultiPL-E execution framework for code evaluation.
cd MultiPLE/evaluation
pip install -e .
cd ../..Some Java evaluation cases require the bundled JavaFX environment.
unzip ./envs/javafx.zip -d ./envs/The repository also provides envs/javatuples-1.2.jar for Java-related execution.
The released data files are placed under data/.
| Split | File | Description |
|---|---|---|
| Training | data/kodcode.jsonl |
Training data for BootTrans. |
| Validation | data/validation_humanevalx.jsonl |
HumanEval-X validation set. |
| Validation | data/validation_transcoder.jsonl |
TransCoder validation set. |
Each JSONL sample follows the fields consumed by the training and evaluation scripts, including source prompt, solution, source language, and target language.
The default training entry point is:
bash ./examples/boottrans.shBy default, the script uses Qwen/Qwen3-1.7B as the base model:
MODEL_PATH=Qwen/Qwen3-1.7BTo reproduce experiments with another base model, modify both:
MODEL_PATHinexamples/boottrans.shworker.actor.model.model_pathinexamples/qwen_lang.yaml
The main configuration file is examples/qwen_lang.yaml. Important fields include:
| Field | Meaning |
|---|---|
data.train_files |
Training JSONL file. |
data.val_files |
Validation JSONL file used during training. |
algorithm.adv_estimator |
Advantage estimator; BootTrans uses grpo_lang. |
worker.rollout.n |
Number of sampled responses per prompt. |
worker.rollout.tensor_parallel_size |
Tensor parallel size for rollout. |
trainer.n_gpus_per_node |
Number of GPUs used on each node. |
trainer.total_epochs |
Number of training epochs. |
trainer.save_freq |
Checkpoint saving frequency. |
For a single-node run, set trainer.n_gpus_per_node and worker.rollout.tensor_parallel_size according to the available GPUs. The default configuration uses 2 GPUs.
Evaluation is implemented in evaluation/autochatmodel.py. The script loads a model with vLLM, generates translations for both validation sets, executes the generated programs, and reports execution accuracy by language pair.
Edit the models dictionary in evaluation/autochatmodel.py:
models = {
"qwen_base": "Qwen/Qwen3-1.7B",
}The key is the output name, and the value is the Hugging Face model ID or a local checkpoint path.
Run the evaluation script from the repository root:
python ./evaluation/autochatmodel.pyThe script evaluates:
data/validation_transcoder.jsonl
data/validation_humanevalx.jsonl
and writes JSONL results to:
result/<model_name>_transcoder.jsonl
result/<model_name>_humanevalx.jsonl
- Code execution evaluation requires the corresponding language runtimes to be available in the environment.
- If using a local checkpoint saved by training, set the checkpoint path in
evaluation/autochatmodel.py.
If you use this repository, please cite:
@inproceedings{boottrans2026,
title = {Bootstrapping Code Translation with Weighted Multilanguage Exploration},
booktitle = {ACL},
year = {2026}
}