Skip to content

ZJU-CTAG/FGIT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

FGIT: Fault-Guided Fine-Tuning for Code Generation

The overview of Fault-Guided Fine-Tuning

alt text

  1. Generate the dataset using the following command:
cd Generate
python generate_bad.py
python get_datat.py
  1. Train the model using the following command:
cd Train
python  train_new.py 
        --n_trials 1 
        --model_name_or_path model_path     
        --train_data_path dataset_path     
        --output_dir output_dir 
        --diff_level line 
        --hybrid true 
        --learning_rate 5e-6 
        --warmup_steps 5

An example generated by the tearch model

alt text This example demonstrates how our teacher model generates plausible but incorrect code implementations. The problem requires sorting an array in ascending order, and the teacher model produces code that shows understanding of the sorting concept but contains a subtle error. The incorrect implementation uses \textit{arr.sort()}, which sorts the list in-place but returns None, instead of \textit{sorted(arr)}, which returns a new sorted list. These nuanced examples help models learn to distinguish \textit{error-sensitive segments} to boost their code generation performance.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages