NeMo-Aligner: Scalable Toolkit for Efficient Model Alignment

Gerald Shen, Zhilin Wang, Olivier Delalleau, Jiaqi Zeng, Yi Dong, Daniel Egert, Shengyang Sun, Jimmy J. Zhang, Sahil Jain, Ali Taghibakhshi, Markel Sanz Ausin, Ashwath Aithal, Oleksii Kuchaiev

TL;DR

NeMo-Aligner is a new, open-source toolkit designed to make aligning large language models (LLMs) with human values more efficient and scalable. It tackles the challenge of training massive models (hundreds of billions of parameters) on thousands of GPUs, supporting popular alignment techniques like RLHF and DPO.

What Problem Does This Paper Address?

Aligning LLMs with human values and preferences is crucial for making them helpful and safe. However, this process, especially for the largest and most capable LLMs, is computationally intensive and complex. Existing tools struggle to efficiently scale to the massive hardware requirements (thousands of GPUs) needed for these models, hindering widespread adoption and research. This paper addresses the need for a scalable, efficient, and extensible toolkit to democratize advanced LLM alignment.

Methods

NeMo-Aligner is built on top of NVIDIA's Megatron-LM, incorporating 3D parallelism (data, tensor, pipeline) for distributed training. Key optimizations include:

  • Distributed PPO Training: A distributed approach to Proximal Policy Optimization (PPO) for Reinforcement Learning from Human Feedback (RLHF).
  • TensorRT-LLM Integration: Optimized inference kernels and automatic kernel fusion using TensorRT-LLM for faster response generation during the rollout phase of PPO. This significantly reduces latency and memory bandwidth bottlenecks.
  • Parameter-Efficient Fine-Tuning (PEFT) Support: The toolkit supports techniques like LoRA for more efficient alignment, reducing GPU requirements and speeding up training.
  • Extensible Framework: Designed for easy integration of new alignment techniques with minimal code changes.

The toolkit supports several major alignment paradigms: Reinforcement Learning from Human Feedback (RLHF), Direct Preference Optimization (DPO), SteerLM, and Self-Play Fine-Tuning (SPIN).

Datasets

The paper mentions the use of several datasets for training and evaluation:

  • Ultrachat: Used for Supervised Fine-Tuning (SFT) and Self-Play Fine-Tuning (SPIN).
  • Ultrafeedback: Used for Direct Preference Optimization (DPO).
  • HelpSteer and Open Assistant datasets: Used for SteerLM training.
  • MT-Bench: Used for evaluating the performance of the trained RLHF models. The paper notes that GPT-4-Turbo is used as a judge for MT-Bench evaluations.

Key Insights and Ideas

  • Scalability is Paramount: The core innovation is enabling efficient alignment of LLMs at the scale of thousands of GPUs, which is critical for state-of-the-art models.
  • Rollout Optimization is Key: The response generation stage during PPO training is a major bottleneck. Integrating TensorRT-LLM significantly accelerates this process, leading to substantial speedups.
  • PEFT for Accessibility: Supporting PEFT methods like LoRA makes advanced alignment techniques more accessible to researchers with limited compute resources.
  • Modular Design for Future-Proofing: The framework's extensibility ensures it can adapt to new alignment methods as the field evolves.

Key Results

  • Significant Speedups: NeMo-Aligner achieved a 1.80x speedup when scaling from 8+4 to 16+8 compute nodes for Llama 3 70B training. Further scaling to 64+32 nodes with a larger batch size resulted in a 3.35x speedup.
  • TensorRT-LLM Impact: Ablation studies showed that integrating TensorRT-LLM was the most critical component, reducing PPO step time by nearly 7x compared to a setup without it.
  • Model Performance: A Llama 3 70B model trained with NeMo-Aligner achieved an MT-Bench score of 8.13, an improvement over the baseline SFT checkpoint (7.96).
  • Largest Model Support: The toolkit successfully supports alignment of very large models like Llama 3.1 405B using 1008 H100 GPUs.
  • LoRA Efficiency: Applying LoRA to SteerLM training reduced the minimum GPU requirement from 32 to 8 and achieved a 5x speedup compared to full-parameter fine-tuning, while maintaining comparable MT-Bench scores.

Limitations and Future Work

  • Pipeline Parallelism for Largest Models: For models like Llama 3.1 405B, generation cannot fit into a single node and requires pipeline parallelism, which the authors plan to optimize further.
  • Response Length Discrepancies: For very large problem sizes, differences in response generation times between data parallel workers can cause bottlenecks. The current worker pool balancing is expected to help more with larger problem sizes.
  • Future Improvements: The authors expect scaling to improve with future versions of NeMo-Aligner. They also plan to incorporate more alignment techniques like Constitutional AI and Rejection Sampling.

Summary updated

BibTeX
@inproceedings{shen2024nemo,
  author = {Gerald Shen and Zhilin Wang and Olivier Delalleau and Jiaqi Zeng and Yi Dong and Daniel Egert and Shengyang Sun and Jimmy J. Zhang and Sahil Jain and Ali Taghibakhshi and Markel Sanz Ausin and Ashwath Aithal and Oleksii Kuchaiev},
  title = {{NeMo-Aligner: Scalable Toolkit for Efficient Model Alignment}},
  booktitle = {COLM},
  year = {2024},
  url = {https://openreview.net/forum?id=yK2eGE8QVW},
}
Figure