File size: 3,533 Bytes
90d65c3
 
 
3c645da
 
 
 
16c25f3
3c645da
 
bd53999
3c645da
 
 
 
 
 
 
 
 
 
502ee16
 
 
 
3c645da
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ae15e66
3c645da
 
 
 
9904f80
3c645da
 
 
 
 
 
 
 
 
9904f80
3c645da
 
 
 
 
 
928e689
 
 
 
 
 
 
 
 
 
 
 
3c645da
 
8f6ee48
3c645da
 
 
 
 
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
---
license: apache-2.0
---

<!-- This model card has been generated automatically according to the information the Trainer had access to. You
should probably proofread and complete it, then remove this comment. -->

This model is a fine-tuned model for Chat based on [mosaicml/mpt-7b](https://huggingface.co/mosaicml/mpt-7b) with **max_seq_lenght=2048** on a new mix of [instruction-dataset-for-neural-chat-v1](https://huggingface.co/datasets/Intel/neural-chat-dataset-v1), [databricks-dolly-15k](https://huggingface.co/datasets/databricks/databricks-dolly-15k), [HC3](https://huggingface.co/datasets/Hello-SimpleAI/HC3) and [oasst1](https://huggingface.co/datasets/OpenAssistant/oasst1) dataset.

## Model date
Neural-chat-7b-v1.1 was trained between June and July 2023.

## Evaluation
We use the same evaluation metrics as [open_llm_leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard) which uses [Eleuther AI Language Model Evaluation Harness](https://github.com/EleutherAI/lm-evaluation-harness/tree/master), a unified framework to test generative language models on a large number of different evaluation tasks.

| Model | Average ⬆️| ARC (25-s) ⬆️ | HellaSwag (10-s) ⬆️ | MMLU (5-s) ⬆️| TruthfulQA (MC) (0-s) ⬆️ |
| --- | --- | --- | --- | --- | --- |
|[mosaicml/mpt-7b](https://huggingface.co/mosaicml/mpt-7b)| 47.4  | 47.61 | 77.56 | 31 | 33.43 |
| [mosaicml/mpt-7b-chat](https://huggingface.co/mosaicml/mpt-7b-chat) | **49.95** | 46.5 | 75.55 | 37.60 | 40.17 |
| **Ours** | **51.41** | 50.09 | 76.69 | 38.79 | 40.07 |

### Bias evaluation

We follow the blog [evaluating-llm-bias](https://huggingface.co/blog/evaluating-llm-bias) to evaluate bias in Language Models.


## Training procedure

### Training hyperparameters

The following hyperparameters were used during training:
- learning_rate: 1e-05
- train_batch_size: 2
- eval_batch_size: 2
- seed: 42
- distributed_type: multi-GPU
- num_devices: 4
- gradient_accumulation_steps: 8
- total_train_batch_size: 64
- total_eval_batch_size: 8
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- lr_scheduler_warmup_ratio: 0.02
- num_epochs: 3.0

## Inference with transformers

```shell
import transformers
model = transformers.AutoModelForCausalLM.from_pretrained(
  'Intel/neural-chat-7b-v1-1',
  trust_remote_code=True
)
```

## Inference with INT8
Follow the instructions [link](https://github.com/intel/intel-extension-for-transformers/tree/main/examples/huggingface/pytorch/text-generation/quantization) to install the necessary dependencies. Use the below command to quantize the model using Intel Neural Compressor [link](https://github.com/intel/neural-compressor) and accelerate the inference.

```shell
python run_generation.py \
    --model Intel/neural-chat-7b-v1-1 \
    --quantize \
    --sq \
    --alpha 0.95 \
    --ipex
```

### Examples

- code generation
![code-generation](examples/code.png)

- summarization
![summarization](examples/summarization.png)

- trip
![trip](examples/trip.png)


## Organizations developing the model

The NeuralChat team with members from Intel/SATG/AIA/AIPT. Core team members: Kaokao Lv, Liang Lv, Chang Wang, Wenxin Zhang, Xuhui Ren, and Haihao Shen.

## Useful links
* Intel Neural Compressor [link](https://github.com/intel/neural-compressor)
* Intel Extension for Transformers [link](https://github.com/intel/intel-extension-for-transformers)
* Intel Extension for PyTorch [link](https://github.com/intel/intel-extension-for-pytorch)