turbo-llm/turbo-alignment
Acerca de
Library for industrial alignment.
Ciencia e ingenieríaWhat you can do
- 📊 Comprehensive Metrics and Logging: Includes a wide range of metrics such as self-bleu, KL divergence, diversity, etc. all supported out of the box.
- 🛠️ Streamlined Method Deployment: Simplifies the process of deploying new methods, allowing for quick development and integration of new datasets and trainers into your pipelines.
- 📚 Ready-to-Use Examples: Convenient examples with configurations and instructions for basic tasks.
- ⚡ Fast Inference: Optimized for quick inference using vLLM.
Crecimiento de estrellas medido
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- +1
- in 1 month
- Recopilando historial
Cambios netos en períodos que se solapan, no totales diarios. Los datos no disponibles se dejan en blanco. Las estrellas indican interés, no calidad.
README.md
Original🚀 Turbo-Alignment
Library for industrial alignment.
Table of Contents
- What is Turbo-Alignment?
- Key Features
- Supported Methods
- Implemented metrics
- How to Use
- Installation
- Development
- Library Roadmap
- FAQ
- License
🌟 What is Turbo-Alignment?
Turbo-Alignment is a library designed to streamline the fine-tuning and alignment of large language models, leveraging advanced techniques to enhance efficiency and scalability.
✨ Key Features
- 📊 Comprehensive Metrics and Logging: Includes a wide range of metrics such as self-bleu, KL divergence, diversity, etc. all supported out of the box.
- 🛠️ Streamlined Method Deployment: Simplifies the process of deploying new methods, allowing for quick development and integration of new datasets and trainers into your pipelines.
- 📚 Ready-to-Use Examples: Convenient examples with configurations and instructions for basic tasks.
- ⚡ Fast Inference: Optimized for quick inference using vLLM.
- 🔄 End-to-End Pipelines: From data preprocessing to model alignment.
🛠️ Supported Methods
Turbo-Alignment supports a wide range of methods for model training and alignment, including:
- 🎯 Supervised Fine-Tuning
- 🏆 Reward Modeling
- 👍 Offline Preference Optimization
- 🤗 Online Preference Optimization ⌛️ in progress..
🧮 Implemented Metrics
- 🎯 Accuracy
- 🔠 Distinctness
- 🌈 Diversity
- 🔵 Self-BLEU
- ➗ KL-divergence
- 🏆 Reward
- 📏 Length
- 🌀 Perplexity
🤖 How to Use
Turbo-Alignment offers an intuitive interface for training and aligning large language models. Refer to the detailed examples and configuration files in the documentation to get started quickly with your specific use case. User-friendly guid available here.
The most crucial aspect is to prepare the dataset in the required format, after which the pipeline will handle everything automatically. Examples of datasets are available here.
Table of use-cases
Train
Supervised Fine-Tuning
- 📚 Dataset type prepare your dataset in the
ChatDataset, examples available here format. - 📝 Configs Example: sft.json
- 🖥️ CLI launch command
python -m turbo_alignment train_sft --experiment_settings_path tutorials/sft/sft.json
Offine Preference Tuning
Reward Modeling
- 📚 Dataset type prepare your dataset in the
PairPreferencesDatasetformat, examples available here - 📝 Configs Example: rm.json
- 🖥️ CLI launch command
python -m turbo_alignment train_rm --experiment_settings_path tutorials/rm/rm.json
DPO
- 📚 Dataset type prepare your dataset in the
PairPreferencesDatasetformat, examples available here - 📝 Configs Example: dpo.json
- 🖥️ CLI launch command
python -m turbo_alignment train_dpo --experiment_settings_path tutorials/dpo/dpo.json
Inference
Chat Inference
- 📚 Dataset type prepare your dataset in the
ChatDataset, examples available here format. - 📝 Configs Example: base.json
- 🖥️ CLI launch command
python -m turbo_alignment inference_chat --inference_settings_path tests/fixtures/configs/inference/sft/base.json
Classification Inference
- 📚 Dataset type prepare your dataset in the
ClassificationDataset, examples available here format. - 📝 Configs Example: classification_inference.json
- 🖥️ CLI launch command
python -m turbo_alignment inference_classification --inference_settings_path tests/fixtures/configs/inference/classification/base.json
Sampling
Random Sampling
- 📚 Dataset type prepare your dataset in the
SamplingRMDataset, examples available here format. - 📝 Configs Example: random.json
- 🖥️ CLI launch command
python -m turbo_alignment random_sample --experiment_settings_path tests/fixtures/configs/sampling/base.json
RSO Sampling
- 📚 Dataset type prepare your dataset in the
SamplingRMDataset, examples available here format. - 📝 Configs Example: rso.json
- 🖥️ CLI launch command
python -m turbo_alignment rso_sample --experiment_settings_path tests/fixtures/configs/sampling/rso.json
Reward Model Sampling
- 📚 Dataset type prepare your dataset in the
SamplingRMDataset, examples available here format. - 📝 Configs Example: rm.json
- 🖥️ CLI launch command
python -m turbo_alignment rm_sample --experiment_settings_path tests/fixtures/configs/sampling/rm.json
Common
Merge Adapters to base model
- 📝 Configs Example: merge.json
- 🖥️ CLI launch command
python -m turbo_alignment merge_adapters_to_base --settings_path tests/fixtures/configs/utils/merge_adapters_to_base/merge.json
🚀 Installation
📦 Python Package
pip install turbo-alignment
🛠️ From Source
For the latest features before an official release:
pip install git+https://github.com/turbo-llm/turbo-alignment.git
📂 Repository
Clone the repository for access to examples:
git clone https://github.com/turbo-llm/turbo-alignment.git
🌱 Development
Contributions are welcome! Read the contribution guide and set up the development environment:
git clone https://github.com/turbo-llm/turbo-alignment.git
cd turbo-alignment
poetry install
📍 Library Roadmap
- Increasing number of tutorials
- Enhancing test coverage
- Implementation of Online RL methods like PPO and Reinforce
- Facilitating distributed training
- Incorporating low-memory training approaches
❓ FAQ
How do I install Turbo-Alignment?
See the Installation section for detailed instructions.
Where can I find docs?
Guides and docs are available here.
Where can I find tutorials?
Tutorials are available here.
📝 License
This project is licensed, see the LICENSE file for details.
References
DPO Trainer implementation inspired by Leandro von Werra et al. (2020) TRL: Transformer Reinforcement Learning. GitHub repository, GitHub. Available at: https://github.com/huggingface/trl.
Registry implementation inspired by Matt Gardner, Joel Grus, Mark Neumann, Oyvind Tafjord, Pradeep Dasigi, Nelson F. Liu, Matthew Peters, Michael Schmitz, and Luke S. Zettlemoyer. 2017. AllenNLP: A Deep Semantic Natural Language Processing Platform. Available at: arXiv:1803.07640.
Liger Kernels implementation inspired by Pin-Lun Hsu and Yun Dai and Vignesh Kothapalli and Qingquan Song and Shao Tang and Siyu Zhu and Steven Shimizu and Shivam Sahni and Haowen Ning and Yanning Chen, 2024. Liger-Kernel: Efficient Triton Kernels for LLM Training. Available at: https://github.com/linkedin/Liger-Kernel.
Explorar proyectos relacionados
Cargando…