File size: 5,509 Bytes
bd8525c
 
 
 
 
e523dd0
bd8525c
e523dd0
 
 
bd8525c
16b12b4
 
63276c1
bd8525c
 
 
 
 
 
6614299
 
 
 
 
 
bd8525c
 
 
16b12b4
bd8525c
 
 
 
 
 
63276c1
e523dd0
 
 
63276c1
e523dd0
bd8525c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bf20380
bd8525c
 
 
 
 
 
 
 
 
16b12b4
bd8525c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: other
license_name: bilibili
license_link: LICENSE
---

<div align="center">
  <h1>
    <font size="7">Index-1.9B-32K</font>
  </h1>


[切换到中文](https://huggingface.co/IndexTeam/Index-1.9B-32K/blob/main/README_zh.md)
</div>



## Model Overview
Index-1.9B-32K is a language model with only 1.9 billion parameters, yet it supports a context length of 32K (meaning this extremely small model can read documents of over 35,000 words in one go). The model has undergone Continue Pre-Training and Supervised Fine-Tuning (SFT) specifically for texts longer than 32K tokens, based on carefully curated long-text training data and self-built long-text instruction sets. The model is now open-source on both Hugging Face and ModelScope.

Despite its small size (about 2% of models like GPT-4), Index-1.9B-32K demonstrates excellent long-text processing capabilities. 
As shown in the figure below, our 1.9B-sized model's score even surpasses that of the 7B-sized model. Below is a comparison with models like GPT-4 and Qwen2:

<p align="center"> <img src="z-attach-pic-pk-all.png" alt="" width="800"> 
</p> <p align="center"><strong>Comparison of Index-1.9B-32K with GPT-4, Qwen2, and other models in Long Context capability</strong>
</p>

In a 32K-length needle-in-a-haystack test, Index-1.9B-32K achieved excellent results, as shown in the figure below. The only exception was a small yellow spot (91.08 points) in the region of (32K length, 10% depth), with all other areas performing excellently in mostly green zones.
<div style="text-align: center;">
    <img src="z-attach-pic-needle-bench-en.png" alt="" width="900">
    <p><strong>NeedleBench Evaluation</strong></p>
</div>

## Index-1.9B-32K Model Download, Usage, and Technical Report:
For details on downloading, usage, and the technical report for Index-1.9B-32K, see:

<div align="center">
<a href="https://github.com/bilibili/Index-1.9B/blob/main/Index-1.9B-32K_Long_Context_Technical_Report.md" style="color:blue; font-size:30px;">
  <strong>Index-1.9B-32K Long Context Technical Report.md</strong>
</a>
</div>


---
---
---

## Usage:Long Text Translation and Summary(Index-1.9B-32K)
- Clone the code repository for model execution and evaluation:
```shell
git clone https://github.com/bilibili/Index-1.9B
cd Index-1.9B
```
- Download the model files to your local machine.

- Use pip to install the required environment:

```shell
pip install -r requirements.txt
```

- Run the interactive tool for long text: **demo/cli_long_text_demo.py**
- The model will, by default, read this file: data/user_long_text.txt and summarize the text in Chinese.
- You can open a new window and modify the file content in real-time, and the model will read the updated file and summarize it.

```shell
cd demo/
CUDA_VISIBLE_DEVICES=0 python cli_long_text_demo.py --model_path '/path/to/model/' --input_file_path data/user_long_text.txt
```
- Run & Interaction Example (Translation and summarization of the Bilibili financial report released on 2024.8.22 in English --- [Original English report here](https://github.com/bilibili/Index-1.9B/tree/main/demo/data/user_long_text.txt)):
<div style="text-align: center;">
    <img src="z-attach-pic-qa-mark.png" alt="" width="1000">
    <p><strong>Translation and Summary (Bilibili financial report released on 2024.8.22)</strong></p>
</div>


## Limitations and Disclaimer

Index-1.9B-32K may generate inaccurate, biased, or otherwise objectionable content in some cases. The model cannot understand or express personal opinions or value judgments when generating content, and its output does not represent the views or stance of the model developers. Therefore, please use the generated content with caution. Users are responsible for evaluating and verifying the generated content and should refrain from spreading harmful content. Before deploying any related applications, developers should conduct safety tests and fine-tune the model based on specific use cases.

We strongly caution against using these models to create or spread harmful information or engage in any activities that could harm the public, national, or social security or violate regulations. Additionally, these models should not be used in internet services without proper security review and registration. We have done our best to ensure the compliance of the training data, but due to the complexity of the models and data, unforeseen issues may still arise. We accept no liability for any problems arising from the use of these models, whether data security issues, public opinion risks, or risks and issues caused by misunderstanding, misuse, or non-compliant use of the models.

## Model Open Source License

The source code in this repository is licensed under the [[Apache-2.0]{.underline}](https://github.com/bilibili/Index-1.9B/blob/main/LICENSE) open-source license. The Index-1.9B-32K model weights are subject to the [[Model License Agreement]{.underline}](https://github.com/bilibili/Index-1.9B/blob/main/INDEX_MODEL_LICENSE)。

The Index-1.9B-32K model weights are fully open for academic research and support free commercial use.

## Citation

If you find our work helpful, feel free to cite it!

```shell
@article{Index-1.9B-32K,
        title={Index-1.9B-32K Long Context Technical Report},
        year={2024},
        url={https://github.com/bilibili/Index-1.9B/blob/main/Index-1.9B-32K_Long_Context_Technical_Report.md},
        author={Changye Yu, Tianjiao Li, Lusheng Zhang and IndexTeam}
}
```