File size: 5,892 Bytes
7624c49 53324d8 7624c49 53324d8 7624c49 1710dbe 7624c49 c040672 7624c49 53324d8 7624c49 c040672 7624c49 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
---
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](https://arxiv.org/abs/2410.14815) 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](https://developer.download.nvidia.com/licenses/nvidia-open-model-license-agreement-june-2024.pdf).
## 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](https://huggingface.co/docs/transformers/en/model_doc/nemotron)
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.
```python
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](https://github.com/AI4Bharat/IndicInstruct) with additions:
| MMLU | ARC-C | ARC-E | HellaSwag | BoolQ |
| :------------- | :------------- | :------------- | :------------- | :------------- |
| 49.89 | 65.02 | 78.81 | 31.66 | 71.71 |
Please refer to our [paper](https://arxiv.org/abs/2410.14815) 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](https://www.nvidia.com/en-us/support/submit-security-vulnerability/).
## 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},
}
``` |