File size: 3,533 Bytes
ed4b2d6
 
 
 
 
 
 
 
 
 
 
 
 
c24a258
 
 
 
 
 
 
1d4a66f
c24a258
 
f407368
c24a258
5f35bb3
 
c87b2cf
5f35bb3
d2ff468
4043b92
 
c24a258
1d4a66f
c24a258
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1d4a66f
c24a258
 
 
1d4a66f
c24a258
ed4b2d6
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
---
license: apache-2.0
language:
- en
- zh
metrics:
- accuracy
library_name: transformers
pipeline_tag: question-answering
tags:
- llm
- nanbeige
---
<div align="center">
<h1>
  Nanbeige2-16B-Chat
</h1>
</div>


## <span id="Introduction">Introduction</span>

The Nanbeige2-16B-Chat is the latest 16B model developed by the Nanbeige Lab, which utilized 4.5T tokens of high-quality training data during the training phase.
During the alignment phase, we initially trained our model using 1 million samples through Supervised Fine-Tuning (SFT). We then engaged in curriculum learning with 400,000 high-quality samples that presented a greater level of difficulty. Subsequently, we incorporated human feedback through the Direct Preference Optimization (DPO), culminating in the development of Nanbeige2-16B-Chat. Nanbeige2-16B-Chat has achieved superior performance across various authoritative benchmark datasets.

## <span id="Evaluation">Evaluation</span>

We have evaluated Nanbeige2-16B-Chat's general question-answering capabilities and human preference alignments on several popular benchmark datasets. The model has achieved notable results in single-turn English QA ([AlpacaEval 2.0](https://tatsu-lab.github.io/alpaca_eval/)), single-turn Chinese QA ([AlignBench](https://github.com/THUDM/AlignBench)), and multi-turn English QA ([MT-Bench](https://arxiv.org/abs/2306.05685)).

| AlpacaEval 2.0(LC Win Rate/ Win Rate) | AlignBench | MT-Bench |
|:--------------:|:----------:|:--------:|
|   43.0%/40.4%  |   7.62     |   8.60   |

## <span id="Inference">Inference</span>

```
from transformers import AutoModelForCausalLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained(
  'Nanbeige/Nanbeige2-16B-Chat',
  use_fast=False,
  trust_remote_code=True
)
model = AutoModelForCausalLM.from_pretrained(
  'Nanbeige/Nanbeige2-16B-Chat',
  torch_dtype='auto',
  device_map='auto',
  trust_remote_code=True
)
messages = [
  {'role': 'user', 'content': 'Hello'}
]
prompt = tokenizer.apply_chat_template(
  messages,
  add_generation_prompt=True,
  tokenize=False
)
input_ids = tokenizer(prompt, add_special_tokens=False, return_tensors='pt').input_ids
output_ids = model.generate(input_ids.to('cuda'))
resp = tokenizer.decode(output_ids[0][len(input_ids[0]):], skip_special_tokens=True)
print(resp)
```

## <span id="Limitations">Limitations</span>

While we place great emphasis on the safety of the model during the training process, striving to ensure that its outputs align with ethical and legal requirements, it may not completely avoid generating unexpected outputs due to the model's size and probabilistic nature. These outputs may include harmful content such as bias or discrimination. Please don't propagate such content. We do not assume any responsibility for the consequences resulting from the dissemination of inappropriate information.

## <span id="License">License</span>

When using the Nanbeige models, you must comply with the Apache 2.0 License and the [License Agreement for Large Language Models Nanbeige](https://huggingface.co/Nanbeige/Nanbeige-16B-Base-32k/resolve/main/License_Agreement_for_Large_Language_Models_Nanbeige.pdf). If you intend to use the Nanbeige Models or its derivatives for commercial purposes, please submit application materials to meet the requirements of the Nanbeige Models Community License Agreement by contacting nanbeige@126.com. After review, We will grant you a non-exclusive, worldwide, non-transferable, non-sublicensable and revocable commercial copyright license.