File size: 3,409 Bytes
cefe22b
 
 
 
 
 
 
 
 
f15815f
 
 
 
 
 
 
 
 
 
 
 
 
cefe22b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
06bc2b9
 
 
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
---
license: apache-2.0
language:
- pl
library_name: transformers
tags:
- polish
- nlp
---
<style>
@import url('https://fonts.googleapis.com/css2?family=Pacifico&display=swap')
.markdown-custom-font {
  font-family: "Pacifico", cursive;
  font-weight: 400;
  font-style: normal;
}
</style>

<div class="markdown-custom-font" align="center">
  <img src="logo.png" alt="Logo" width="300">
    Curie-7B-v1
</div>

## Introduction
This research demonstrates the potential of fine-tuning English Large Language Models (LLMs) for Polish text generation. By employing Language Adaptive Pre-training (LAPT) on a high-quality dataset of 3.11 GB (276 million Polish tokens) and subsequent fine-tuning on the [KLEJ challenges](https://klejbenchmark.com), the `Curie-7B-v1` model achieves remarkable performance. It not only generates Polish text with the lowest perplexity of 3.02 among decoder-based models but also rivals the best Polish encoder-decoder models closely, with a minimal performance gap on 8 out of 9 tasks. This was accomplished using about 2-3% of the dataset size typically required, showcasing the method's efficiency. The model is now open-source, contributing to the community's collaborative progress.
### Language Adaptive Pre-training Dataset
The LAPT phase utilized the [SpeakLeash dataset](http://speakleash.org/en/), a comprehensive collection of Polish texts, focusing on the highest quality extract of approximately 2 GB from the original 1TB.
## Hardware and Software Stack
Experiments were conducted on a server featuring an [NVIDIA RTX A6000 ADA GPU](https://www.nvidia.com/content/dam/en-zz/Solutions/design-visualization/rtx-6000/proviz-print-rtx6000-datasheet-web-2504660.pdf) with 48GB of VRAM, AMD Epyc 7742 processor, and running Ubuntu with Pytorch 2.0 and CUDA 12.2.
## The Adaptive Pre-training
The model was trained using AdamW optimizer, with specific hyperparameters aimed at optimizing performance. Training completed in one epoch, taking a total of 106 hours, demonstrating the onset of overfitting beyond this point.
### Hyperparameters
- **lora_rank:** 32
- **lora_dropout:** 0.05
- **lora_alpha:** 16
- **warmup_steps:** 0.1
- **learning_rate:** 2.5 x 10^-5
- **neftune_noise_alpha:** 2
- **batch_size:** 128
- **max_seq_len:** 128

## Fine-tuning for KLEJ Downstream Tasks
`Curie-7B-v1` was exceptionally close to the best baseline models on 8 of 9 KLEJ tasks by using significantly less data, showcasing its efficiency and capability in handling a variety of NLP tasks in Polish.

### Performance Highlights
- **NKJP-NER:** 93.4
- **CDSC-E:** 92.2
- **CDSC-R:** 94.9
- **CBD:** 49.0 (Demonstrating room for improvement)
- **PolEmo2.0-IN:** 92.7
- **PolEmo2.0-OUT:** 80.0
- **DYK:** 76.2
- **PSC:** 98.6
- **AR:** 86.8

## Conclusions
The `Curie-7B-v1` model, through LAPT, matches foundational models on eight downstream tasks with significantly less data. Its versatility in generating Polish text and the ability to be transformed into classifiers, regressors, and AI assistants highlights the method's effectiveness. This open-source Polish LLM provides a foundation for developing efficient business solutions.

## Research Paper
Work and details regarding this model are described in the reserach paper [Efficient Language Adaptive Pre-training: Extending State-of-the-Art Large Language Models for Polish](https://arxiv.org/abs/2402.09759) by Szymon Ruciński.