Skip to main content

NeMo-Aligner - a toolkit for model alignment

Project description

NVIDIA NeMo-Aligner

Introduction

NeMo-Aligner is a scalable toolkit for efficient model alignment. The toolkit has support for state of the art model alignment algorithms such as SteerLM, DPO and Reinforcement Learning from Human Feedback (RLHF). These algorithms enable users to align language models to be more safe, harmless and helpful. Users can do end-to-end model alignment on a wide range of model sizes and take advantage of all the parallelism techniques to ensure their model alignment is done in a performant and resource efficient manner.

NeMo-Aligner toolkit is built using the NeMo Toolkit which allows for scaling training up to 1000s of GPUs using tensor, data and pipeline parallelism for all components of alignment. All of our checkpoints are cross compatible with the NeMo ecosystem; allowing for inference deployment and further customization.

The toolkit is currently in it's early stages, and we are committed to improving the toolkit to make it easier for developers to pick and choose different alignment algorithms to build safe, helpful and reliable models.

Key features

  • SteerLM: Attribute Conditioned SFT as an (User-Steerable) Alternative to RLHF.
  • Supervised Fine Tuning
  • Reward Model Training
  • Reinforcement Learning from Human Feedback using the PPO Algorithm
  • Direct Preference Optimization as described in paper

Learn More

Latest Release

For the latest stable release please see the releases page. All releases come with a pre-built container. Changes within each release will be documented in CHANGELOG.

Installing your own environment

Requirements

NeMo-Aligner has the same requirements as the NeMo Toolkit Requirements with the addition of PyTriton.

Installation

Please follow the same steps as the NeMo Toolkit Installation Guide but run the following after installing NeMo

pip install nemo-aligner

or if you prefer to install the latest commit

pip install .

Docker Containers

We provide an official NeMo-Aligner Dockerfile which is based on stable, tested versions of NeMo, Megatron-LM, and TransformerEngine. The goal of this Dockerfile is stability, so it may not track the very latest versions of those 3 packages. You can access our Dockerfile here

Alternatively, you can build the NeMo Dockerfile here NeMo Dockerfile and add RUN pip install nemo-aligner at the end.

Future work

  • Add Rejection Sampling support
  • We will continue improving the stability of the PPO learning phase.
  • Improve the performance of RLHF

Contributing

We welcome community contributions! Please refer to CONTRIBUTING.md for guidelines.

License

This toolkit is licensed under the Apache License, Version 2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nemo_aligner-0.2.0.tar.gz (70.6 kB view details)

Uploaded Source

Built Distribution

nemo_aligner-0.2.0-py3-none-any.whl (97.1 kB view details)

Uploaded Python 3

File details

Details for the file nemo_aligner-0.2.0.tar.gz.

File metadata

  • Download URL: nemo_aligner-0.2.0.tar.gz
  • Upload date:
  • Size: 70.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.10

File hashes

Hashes for nemo_aligner-0.2.0.tar.gz
Algorithm Hash digest
SHA256 bbae6e5668ffa414d4f707b7aef789fb6ebd7685f700b0d92119e43259eedbb9
MD5 8f8d70a0377ff37aed88b0acf25dd7c6
BLAKE2b-256 c81d00228a95227654d0cef2a19151339a6be226a20c6c13c995cb7256bc4f66

See more details on using hashes here.

File details

Details for the file nemo_aligner-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: nemo_aligner-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 97.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.10

File hashes

Hashes for nemo_aligner-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3bc2723bc9d1dc31ab2625088c9d889ffa132c57423996ac6109088b2d518293
MD5 a98d3b404d566802528b1cda233d10fc
BLAKE2b-256 515a2cddf8e67387d93262213f9c58fb23112fe578da8aa3b27f9b8a6a7f8f7f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page