|
--- |
|
language: |
|
- ru |
|
--- |
|
# T-pro-it-1.0 |
|
|
|
**🚨 T-pro is designed for further fine-tuning and is not intended as a ready-to-use conversational assistant. Users are advised to exercise caution and are responsible for any additional training and oversight required to ensure the model's responses meet acceptable ethical and safety standards. The responsibility for incorporating this model into industrial or commercial solutions lies entirely with those who choose to deploy it.** |
|
|
|
## Description |
|
|
|
T-pro-it-1.0 is a model built upon the Qwen 2.5 model family and incorporates both continual pre-training and alignment techniques. |
|
|
|
### 📚 Dataset |
|
|
|
Pre-training Stage 1: |
|
100B tokens, consisting of diverse Russian data from Common Crawl, books, code, and proprietary datasets, mixed with re-played English data (English added as it is the primary language of the base model). |
|
|
|
Pre-training Stage 2: |
|
40B tokens, a mix of instruction and pre-training data. |
|
|
|
Supervised Fine-Tuning (SFT): |
|
1B tokens, a mix of diverse instruction data. |
|
|
|
Preference Tuning: |
|
1B tokens, training the model to be helpful. |
|
|
|
## 📊 Benchmarks |
|
|
|
Proprietary models: |
|
|
|
| Benchmark | T-pro-it-1.0 | GPT-4o | GPT-4o-mini | GigaChat Max 1.0.26.20 | |
|
|------------------------------------------------|-----------------------|------------------------------|-----------------------|---------------------| |
|
| [MERA](https://mera.a-ai.ru) | <u>0.629</u> | **0.642** | 0.57 | 0.588 | |
|
| [MaMuRaMu](https://mera.a-ai.ru/ru/tasks/22) | <u>0.841</u> | **0.874** | 0.779 | 0.824 | |
|
| ruMMLU-PRO | <u>0.665</u> | **0.713** | 0.573 | 0.535 | |
|
| ruGSM8K | **0.941** | <u>0.931</u> | 0.888 | 0.892 | |
|
| ruMATH | **0.776** | <u>0.771</u> | 0.724 | 0.589 | |
|
| ruMBPP | **0.805** | <u>0.802</u> | 0.79 | 0.626 | |
|
| [ruCodeEval](https://mera.a-ai.ru/ru/tasks/23) | 0.432 / 0.626 / 0.677 | <u>0.529 / 0.649 / 0.683</u> | **0.704 / 0.753 / 0.768** | 0.077 / 0.093 / 0.098 | |
|
| Arena-Hard-Ru | **90.17** | <u>84.87</u> | 81 | - | |
|
| MT Bench Ru | <u>8.7</u> | **8.706** | 8.45 | 8.53 | |
|
| Alpaca Eval Ru | <u>47.61</u> | **50** | 45.51 | 38.13 | |
|
|
|
Open-source models: |
|
|
|
| Benchmark | T-pro-it-1.0 | Qwen-2.5-32B-Instruct | RuAdapt-Qwen-32B-Instruct-v1 | gemma-2-27b-it | Llama-3.3-70B-Instruct | |
|
|------------------------------------------------|---------------------------|-------------------------------|------------------------------|------------------------------|------------------------| |
|
| [MERA](https://mera.a-ai.ru) | **0.629** | 0.578 | <u>0.615</u> | 0.574 | 0.567 | |
|
| [MaMuRaMu](https://mera.a-ai.ru/ru/tasks/22) | **0.841** | <u>0.824</u> | 0.812 | 0.768 | 0.818 | |
|
| ruMMLU-PRO | **0.665** | 0.637 | 0.631 | 0.470 | <u>0.653</u> | |
|
| ruGSM8K | **0.941** | 0.926 | 0.923 | 0.894 | <u>0.934</u> | |
|
| ruMATH | **0.776** | 0.727 | <u>0.742</u> | 0.538 | 0.636 | |
|
| ruMBPP | 0.805 | **0.825** | <u>0.813</u> | 0.708 | 0.77 | |
|
| [ruCodeEval](https://mera.a-ai.ru/ru/tasks/23) | **0.432 / 0.626 / 0.677** | 0.06 / 0.098 / 0.116 | 0.426 / 0.561 / 0.598 | <u>0.259 / 0.586 / 0.689</u> | 0.112 / 0.166 / 0.189 | |
|
| Arena-Hard-Ru | **90.17** | 74.54 | <u>80.23</u> | 66.4 | 76.51 | |
|
| MT Bench Ru | **8.7** | 8.15 | 8.39 | 7.96 | <u>8.26</u> | |
|
| Alpaca Eval Ru | **47.61** | 35.01 | <u>43.15</u> | 38.82 | - | |
|
|
|
Detailed evaluation results can be found in our [habr post](https://habr.com/ru/companies/tbank/articles/865582/) |
|
|
|
## 👨💻 Examples of usage |
|
|
|
### HF Usage |
|
|
|
```python |
|
from transformers import AutoTokenizer, AutoModelForCausalLM |
|
import torch |
|
torch.manual_seed(42) |
|
|
|
model_name = "t-tech/T-pro-it-1.0" |
|
tokenizer = AutoTokenizer.from_pretrained(model_name) |
|
model = AutoModelForCausalLM.from_pretrained( |
|
model_name, |
|
torch_dtype="auto", |
|
device_map="auto", |
|
) |
|
|
|
prompt = "Напиши стих про машинное обучение" |
|
messages = [ |
|
{"role": "system", "content": "Ты T-pro, виртуальный ассистент в Т-Технологии. Твоя задача - быть полезным диалоговым ассистентом."}, |
|
{"role": "user", "content": prompt} |
|
] |
|
text = tokenizer.apply_chat_template( |
|
messages, |
|
tokenize=False, |
|
add_generation_prompt=True |
|
) |
|
model_inputs = tokenizer([text], return_tensors="pt").to(model.device) |
|
|
|
generated_ids = model.generate( |
|
**model_inputs, |
|
max_new_tokens=256 |
|
) |
|
generated_ids = [ |
|
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids) |
|
] |
|
|
|
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0] |
|
|
|
print(response) |
|
``` |
|
|
|
Output: |
|
``` |
|
В мире данных и алгоритмов, где путь просветления лежит, |
|
Машинное обучение — как звезда, что светом знаний сияет. |
|
Слои нейронов, как мозг огромный, в цифровой тишине дремлют, |
|
Изучают закономерности, скрытые в числах глубоко. |
|
|
|
Оно учится на примерах, как ребёнок, открывая мир, |
|
На ошибках своих корректируясь, шаг за шагом к совершенству стремится. |
|
Где раньше требовалась рука человека, теперь сеть сама решает, |
|
Прогнозы точные строит, решения сложные принимает. |
|
|
|
В облаках данных, как корабль, плывёт через шторм и спокойствие, |
|
Поиск закономерностей — его цель, открыть тайны бытия. |
|
От распознавания лиц до понимания речи, |
|
Машинное обучение — это ключ, что открывает двери. |
|
``` |
|
|
|
### VLLM Usage |
|
|
|
```python |
|
from transformers import AutoTokenizer |
|
from vllm import LLM, SamplingParams |
|
|
|
model_name = "t-tech/T-pro-it-1.0" |
|
tokenizer = AutoTokenizer.from_pretrained(model_name) |
|
llm = LLM(model=model_name, max_model_len=8192) |
|
sampling_params = SamplingParams(temperature=0.7, |
|
repetition_penalty=1.05, |
|
top_p=0.8, top_k=70) |
|
|
|
prompt = "Напиши стих про машинное обучение" |
|
messages = [ |
|
{"role": "system", "content": "Ты T-pro, виртуальный ассистент в Т-Технологии. Твоя задача - быть полезным диалоговым ассистентом."}, |
|
{"role": "user", "content": prompt} |
|
] |
|
|
|
prompt_token_ids = tokenizer.apply_chat_template(messages, add_generation_prompt=True) |
|
|
|
outputs = llm.generate(prompt_token_ids=prompt_token_ids, sampling_params=sampling_params) |
|
|
|
generated_text = [output.outputs[0].text for output in outputs] |
|
print(generated_text) |
|
``` |