Downloads · 30 days
1.5K
1% of all-time downloads
OPI-PG/Qra-7b
Qra-7b is a text generation model from OPI-PG. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as llama2.
<center<img src="https://huggingface.co/OPI-PG/Qra-7b/resolve/main/images/7b-logo.png"</img</center
Downloads · 30 days
1.5K
1% of all-time downloads
All-time downloads
185K
Public
Parameters
6.7B
13.5 GB on disk
Likes
13
Public
Click a slice to open those files.
.safetensors13.5 GB · 100%
From the Hugging Face model README
Qra is a series of LLMs adapted to the Polish language, resulting from a collaboration between the National Information Processing Institute (OPI) and Gdańsk University of Technology (PG). The models were trained on the infrastructure of PG TASK Computing Center using 21 Nvidia A100 cards. The published versions of the Qra models were initialized with the weights of English LLama 2 checkpoints and then further trained on a carefully cleaned, filtered, and deduplicated corpus of Polish texts, totaling about 90 billion tokens. The original corpus consisted primarily of web data, including CommonCrawl dumps, and the MADLAD-400 corpus.
⚠️ Important: Qra are foundation language models trained with causal language modeling objective on a large corpus of texts. They are therefore not intended for conversational or instruction-following purposes, and should be further fine-tuned to be used for such tasks. ⚠️
The preprocessing pipeline included the following steps:
The final distribution of documents by topic is shown in the chart below:
<center><img src="https://huggingface.co/OPI-PG/Qra-7b/resolve/main/images/topics.png"></img></center>The models were trained for one epoch on sequences of 4096 tokens. During training, we used many modern optimizations such as:
--bf16 and --tf32 options)Below is a summary of the Qra-7B model:
| Attribute | Value |
|---|---|
| Adapted from | Llama-2-7b-hf |
| License | LLama 2 Community License Agreement |
| Batch size | 1344 |
| Context length | 4096 |
| Learning rate | 2e-5 |
| Learning rate decay | cosine |
| Warmup steps | 0 |
| Training time | 14 days |
In this section we compare the perplexity of Qra models on Polish texts with other Polish and English LLMs.
Note that perplexity values between different text segmentations are not directly comparable. Therefore, we can draw conclusions based on comparisons only beetween models using the same tokenizer, such as Qra and the original LLama / TinyLLama.
In 2018, the PolEval competition included a language modeling task, for which training and test sets totaling over 20 million Polish sentences were made available. We used the first 10k sentences from the test set to evaluate modern neural language models. To calculate the perplexity, we used a script from the HuggingFace Evaluate library.
<table> <thead> <tr><th>Model</th><th>Perplexity</th></tr> </thead> <tr><td colspan="2"><strong>English models</strong></td></tr> <tr><td>meta-llama/Llama-2-7b-hf</td><td>24.3</td></tr> <tr><td>meta-llama/Llama-2-13b-hf</td><td>21.4</td></tr> <tr><td>mistralai/Mistral-7B-v0.1</td><td>21.4</td></tr> <tr><td>TinyLlama/TinyLlama-1.1B</td><td>40.4</td></tr> <tr><td colspan="2"><strong>Polish models</strong></td></tr> <tr><td>sdadas/polish-gpt2-small</td><td>134.4</td></tr> <tr><td>sdadas/polish-gpt2-medium</td><td>100.8</td></tr> <tr><td>sdadas/polish-gpt2-large</td><td>93.2</td></tr> <tr><td>sdadas/polish-gpt2-xl</td><td>94.1</td></tr> <tr><td>Azurro/APT3-275M-Base</td><td>129.8</td></tr> <tr><td>Azurro/APT3-500M-Base</td><td>153.1</td></tr> <tr><td>Azurro/APT3-1B-Base</td><td>106.8</td></tr> <tr><td>eryk-mazus/polka-1.1b</td><td>18.1</td></tr> <tr><td>szymonrucinski/Curie-7B-v1</td><td>13.5</td></tr> <tr><td colspan="2"><strong>Qra models</strong></td></tr> <tr><td>OPI-PG/Qra-1b</td><td>14.7</td></tr> <tr><td>OPI-PG/Qra-7b</td><td>11.3</td></tr> <tr><td>OPI-PG/Qra-13b</td><td>10.5</td></tr> </table>Currently, LLMs support contexts of thousands of tokens. Their practical applications usually also involve processing long documents. Therefore, evaluating perplexity on a sentence-based dataset such as PolEval-2018 may not be meaningful. Additionally, the PolEval corpus has been publicly available on the internet for the past few years, which raises the possibility that for some models the training sets have been contaminated by this data. For this reason, we have prepared a new collection consisting of long papers published exclusively in 2024, which will allow us to more reliably test the perplexities of the models on new knowledge that was not available to them at the time of training. The corpus consists of 5,000 documents ranging from several hundred to about 20,000 tokens. Half of the set consists of press texts from Polish news portals from February 2024, the other half are scientific articles published since January 2024. Most of the documents exceed the context size of the evaluated models. To calculate perplexity for these documents, we divided them into chunks of size equal to the model's context length with a stride of 512 tokens, following this example.
<table> <thead> <tr><th>Model</th><th>Context</th><th>Perplexity</th></tr> </thead> <tr><td colspan="3"><strong>English models</strong></td></tr> <tr><td>meta-llama/Llama-2-7b-hf</td><td>4096</td><td>5.9</td></tr> <tr><td>meta-llama/Llama-2-13b-hf</td><td>4096</td><td>5.3</td></tr> <tr><td>mistralai/Mistral-7B-v0.1</td><td>4096</td><td>4.9</td></tr> <tr><td>TinyLlama/TinyLlama-1.1B</td><td>2048</td><td>9.6</td></tr> <tr><td colspan="3"><strong>Polish models</strong></td></tr> <tr><td>sdadas/polish-gpt2-small</td><td>2048</td><td>27.3</td></tr> <tr><td>sdadas/polish-gpt2-medium</td><td>2048</td><td>20.3</td></tr> <tr><td>sdadas/polish-gpt2-large</td><td>1536</td><td>18.0</td></tr> <tr><td>sdadas/polish-gpt2-xl</td><td>1536</td><td>16.6</td></tr> <tr><td>Azurro/APT3-275M-Base</td><td>2048</td><td>77.0</td></tr> <tr><td>Azurro/APT3-500M-Base</td><td>2048</td><td>50.5</td></tr> <tr><td>Azurro/APT3-1B-Base</td><td>2048</td><td>19.1</td></tr> <tr><td>eryk-mazus/polka-1.1b</td><td>2048</td><td>6.9</td></tr> <tr><td>szymonrucinski/Curie-7B-v1</td><td>4096</td><td>4.8</td></tr> <tr><td colspan="3"><strong>Qra models</strong></td></tr> <tr><td>OPI-PG/Qra-1b</td><td>4096</td><td>6.1</td></tr> <tr><td>OPI-PG/Qra-7b</td><td>4096</td><td>4.5</td></tr> <tr><td>OPI-PG/Qra-13b</td><td>4096</td><td>4.2</td></tr> </table>