Giter Site home page Giter Site logo

kamel-yamani / curriculumlearningforsmallcodelanguagemodels Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 1.0 23.08 MB

This repository explores the effectiveness of curriculum learning (CL) in improving small code language models.

License: Apache License 2.0

Python 100.00%

curriculumlearningforsmallcodelanguagemodels's Introduction

Curriculum Learning for Small Code Language Models

This repository contains code and models_checkpoint for the paper "Curriculum Learning for Small Code Language Models". It implements training and evaluation of code language models on the TinyPy dataset using various curriculum learning techniques.

You can access the paper using this link : https://aclanthology.org/2024.acl-srw.44/

Directory Structure

├── README.md
├── code
│   ├── evaluate_*.py - Evaluation scripts
│   ├── model.py - Model definition
│   ├── train_*.py - Training scripts for different techniques
│   └── pycache
├── data
│   ├── TinyPy - Raw TinyPy dataset
│   │   ├── [Split] - Data splits
│   └── TinyPy_processed - Preprocessed binary data  
├── models_checkpoint - Saved model checkpoints

Models

The following models are included:

  • baseline_model_1M.pth - Baseline model trained on all data
  • hybrid_cl_model_1M.pth - Hybrid curriculum learning
  • incremental_cl_model_1M.pth - Incremental curriculum learning
  • sequential_cl_model_1M.pth - Sequential curriculum learning

Data

The data folder should be added manually by downloading the dataset from Kaggle:

  1. Create a new folder named data inside the code folder.
  2. Go to the Kaggle dataset TinyPy for Curriculum Learning.
  3. Download the dataset.
  4. Extract the contents and place them in the data folder.

Dependencies

  • numpy
  • pandas
  • torch
  • tqdm
  • wandb (optional)
  • fuzzywuzzy

Usage

Train a model

To train a model, use one of the training scripts. For example, to train the baseline model:

python train_baseline.py

To train with hybrid curriculum learning:

python code/train_hybrid_cl.py

To train with incremental curriculum learning:

python code/train_incremental_cl.py

To train with sequential curriculum learning:

python code/train_sequential_cl.py

Evaluate a model

To evaluate a model, use one of the evaluation scripts. For example, to evaluate the code execution:

python evaluate_code_execution.py

To evaluate code completion at the token level:

python code/evaluate_code_completion_tokenlevel.py

To evaluate code completion at the line level:

python code/evaluate_code_completion_linelevel.py

Acknowledgement

This work was supported in part through the NYU IT High Performance Computing resources, services, and staff expertise

curriculumlearningforsmallcodelanguagemodels's People

Contributors

kamel-yamani avatar marwanair avatar

Stargazers

 avatar XieBing avatar Bennacer Mohamed Akram avatar  avatar

Watchers

 avatar

Forkers

naturesphere

curriculumlearningforsmallcodelanguagemodels's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.