# Instruction of Reproducing *SynAdapt*

## The file structure of *SynAdapt* code

1. ./CCoT_Generation: containing code for **generating synthetic CCoT**.
2. ./CCoT_finetune: containing code for **fine-tuning LLM to learn CCoT** by synthetic CCoT and code for **training difficulty classifier**.
3. ./Eval: containing code for evalauting *SynAdapt* on five math-related benchmarks.

## Quick Start

### [Step 1]: Prepare Env

```bash
cd SynAdapt_code/

conda create -n fastThink python=3.10 -y
conda activate fastThink
pip install -r ./requirements.txt
pip install -e ./third_party/peft
```

### [Step 2]: Synthetic CCoT Generation
```bash
1. cd CCoT_Generation
2. fill the parameters in run.sh
3. sh run.sh
```

### [Step 2]: Synthetic CCoT Enhanced Fine-tuning
```bash
1. cd ../CCoT_Finetune
2. fill the parameters in train_llm.sh
3. sh train_llm.sh
4. fill the parameters in train_difficulty_classifier.sh
5. sh train_difficulty_classifier.sh
```

### [Step 3]: Evaluation (Adaptive Reasoning via CCoT)
```bash
1. cd ../Eval
2. fill the parameters in test.sh
3. sh test.sh
```