While using with transformers you can only use the 15M variant for now.
NGen 2 is an advanced Transformer model training pipeline that supports multiple model variants. It ranges from a nano variant (approximately 120M parameters) to a foundational variant (approximately 1B parameters). The pipeline incorporates modern architectural improvements such as rotary positional embeddings, RMSNorm, and GEGLU activations to boost performance and training efficiency.
Note: Although NGen 2 is designed to train a 1B-parameter model, its advanced architecture pushes its performance closer to that of much larger models. Try using NGen3 for performance.
The NGen2 Series was only Produced till 170M and The other Variants were produced but were never made public
Model Variants
NGen 2 supports the following variants via the --variant flag:
nano: ~120M parameters
small: ~300M parameters
medium: ~500M parameters
large: ~700M parameters
foundational: ~1B parameters
Each variant adjusts key hyperparameters such as the number of layers, model dimension (d_model), number of attention heads (n_heads), and the feed-forward dimension (d_ff).
Requirements
Python 3.8+
PyTorch
Transformers
Datasets
DeepSpeed (optional, for efficient training)
Azure ML SDK (for distributed training on Azure)
Install dependencies using pip (adjust as needed):
This script downloads, tokenizes, and saves the dataset in Arrow format to the ./data directory.
2. Local Training
The main training script is train.py. It loads the processed dataset (by default from ./data), instantiates the desired model variant, and starts training.
The deepspeed.json file configures mixed-precision training and ZeRO optimizations. To leverage DeepSpeed, ensure it is installed and adjust your training script or submission command to enable DeepSpeed support.
License
License
The NGen 2 project is developed and maintained by TNSA AI. The licensing model is dual:
The nano and small variants are open source and released under the MIT License.
The medium, large, and foundational variants are proprietary and are not open source. Use of these proprietary components is subject to TNSA AI's proprietary licensing terms.