NeMo
PyTorch
English
Hindi
nemotron
ravirajoshi's picture
Update README.md
53324d8 verified
|
raw
history blame
5.89 kB
metadata
license: other
license_name: nvidia-open-model-license
license_link: >-
  https://developer.download.nvidia.com/licenses/nvidia-open-model-license-agreement-june-2024.pdf
language:
  - en
  - hi
base_model: nvidia/Minitron-4B-Base
library_name: nemo

Model Overview

Nemotron-4-Mini-Hindi-4B-Base is a base model pre-trained on Hindi and English corpus. The Nemotron-Mini-4B-Base (Minitron-4B) is subject to continuous pre-training using Hindi and English data (400B tokens) exclusively to create a strong base model for Hindi, English, and Hinglish. We make extensive use of synthetic data during the continuous pre-training stage. The base small language model (SLM) is optimized through distillation, pruning, and quantization for speed and on-device deployment. Please refer to our arXiv paper for more details.

This model is for research and development only.

Model Developer: NVIDIA

Model Dates: Nemotron-4-Mini-Hindi-4B-Base was trained between June 2024 and Sept 2024.

License

Nemotron-4-Mini-Hindi-4B-Base is released under the NVIDIA Open Model License Agreement.

Model Architecture

Nemotron-4-Mini-Hindi-4B-Base uses a model embedding size of 3072, 32 attention heads, and an MLP intermediate dimension of 9216. It also uses Grouped-Query Attention (GQA) and Rotary Position Embeddings (RoPE).

Architecture Type: Transformer Decoder (auto-regressive language model)

Network Architecture: Nemotron-4

Input Type: Text

Input Format: String

Input Parameters: None

Other Properties Related to Input: None

Output Type: Text

Output Format: String

Output Parameters: None

Other Properties Related to Output: None

Usage

Support for Nemotron models is added to the transformers library

The following code provides an example of how to load the Nemotron-4-Mini-Hindi-4B-Base model and use it to perform text generation.

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM

# Load the tokenizer and model
model_path = 'nvidia/Nemotron-4-Mini-Hindi-4B-Base'
tokenizer  = AutoTokenizer.from_pretrained(model_path)

device = 'cuda'
dtype  = torch.bfloat16
model  = AutoModelForCausalLM.from_pretrained(model_path, torch_dtype=dtype, device_map=device)

# Prepare the input text
prompt = 'भारत की राजधानी क्या है?'
inputs = tokenizer.encode(prompt, return_tensors='pt').to(model.device)

# Generate the output
outputs = model.generate(inputs, max_length=15)

# Decode and print the output
output_text = tokenizer.decode(outputs[0])
print(output_text)

Dataset & Training

Data Collection Method: Hybrid

Labeling Method: Not Applicable

Properties: The Nemotron-Mini-4B base model is used for continuous pre-training. The Nemotron-Mini-4B model is derived from the Nemotron-15B model using compression techniques such as pruning and distillation, consisting of 2.6B trainable parameters. Re-training is performed using a standard causal modeling objective. The dataset consists of 400B tokens, with an equal mix of Hindi and English. The corpus spans domains including legal, math, science, finance, and more. Our sources cover a variety of document types such as: webpages, dialogue, articles, and other written materials.

Data Freshness: The pre-training data has a cutoff of June 2023.

Evaluation Results

Zero-shot performance. Evaluated using select Hindi datasets from the Airavata Evaluation Framework with additions:

MMLU ARC-C ARC-E HellaSwag BoolQ
49.89 65.02 78.81 31.66 71.71

Please refer to our paper for the full set of results.

Inference

Engine: TensorRT-LLM

Test Hardware: NVIDIA A100

DType: Float16/BFloat16

Limitations

The model was trained on data that contains toxic language and societal biases, originally crawled from the internet. Therefore, the model may amplify those biases and return toxic responses, especially when prompted with toxic prompts. The model may generate answers that may be inaccurate, omit key information, or include irrelevant or redundant text producing socially unacceptable or undesirable text, even if the prompt itself does not include anything explicitly offensive. The model may answer with I statements, exhibiting some anthropomorphizing. This issue could be exacerbated without the use of the recommended prompt template.

Ethical Considerations

NVIDIA believes Trustworthy AI is a shared responsibility, and we have established policies and practices to enable development for a wide array of AI applications. When downloaded or used in accordance with our terms of service, developers should work with their internal model team to ensure this model meets requirements for the relevant industry and use case and addresses unforeseen product misuse. Please report security vulnerabilities or NVIDIA AI Concerns here.

Citation

If you find our work helpful, please consider citing our paper:

@article{hindinemotron2024,
      title={Adapting Multilingual LLMs to Low-Resource Languages using Continued Pre-training and Synthetic Corpus}, 
      author={Raviraj Joshi and Kanishk Singla and Anusha Kamath and Raunak Kalani and Rakesh Paul and Utkarsh Vaidya and Sanjay Singh Chauhan and Niranjan Wartikar and Eileen Long},
      journal={arXiv preprint arXiv:2410.14815},
      year={2024},
      url={https://arxiv.org/abs/2410.14815}, 
}