/ Модель

Характеристики

Контекст
8 192 токена
Параметры
1,7 млрд
Лицензия
MIT
Архитектура
rugpt3xl · dense
Базовая модель
ruGPT3XL
Библиотека
transformers
Опубликована
31 мар 2026

ruGPT3XL-8k

Генерация текстаТекст → текст3 профессии

Русскоязычная предобученная GPT-2-подобная модель на 1,3 млрд параметров с контекстом 8192 токена для генерации длинных текстов.

123скачиваний за 30 дней6лайковвеса обновлены31 мар 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

ruGPT-3 XL 8k — русскоязычная авторегрессионная языковая модель на 1,3 млрд параметров, разработанная Павлом Рыковым на основе evilfreelancer/ruGPT3XL. Это трансформер GPT-2-типа с архитектурой decoder-only и окном контекста 8192 токена: контекст расширен поэтапно с 2k до 4k и затем до 8k с продолжением предобучения и циклическим заполнением новых позиций таблицы позиционных эмбеддингов.

Модель предназначена для генерации и продолжения русскоязычного текста с учётом длинного контекста. Она является базовой предобученной моделью, а не дообученной для следования инструкциям; возможность общения указана в метаданных, но качество ответов в диалоговом режиме не гарантируется. В README приведён датасет IlyaGusev/gazeta, а файлы модели представлены в формате safetensors. Лицензия — MIT.

Сценарии применения

  • продолжение длинного русскоязычного текста
  • генерация русских статей и черновиков
  • создание русскоязычного текста с учётом большого контекста

Ограничения

Модель не дообучена для следования инструкциям, поэтому может не выполнять запросы в формате чат-бота. Расширение контекста выполнено циклическим заполнением позиционных эмбеддингов; README не приводит оценок качества на длине 8192 токена.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

ruGPT-3 XL 8k

A 1.3B-parameter GPT-2-style language model for Russian with an extended context window of 8192 tokens, trained via continued pretraining from evilfreelancer/ruGPT3XL.

This is a base (pretrained) model, not instruction-tuned.

Model Details

ParameterValue
Parameters1.3B
ArchitectureGPT-2 (decoder-only transformer)
Hidden size2048
Layers24
Attention heads16
FFN intermediate size8192
Max sequence length8192
Vocabulary50,264 tokens (BPE)
ActivationGELU
NormalizationPre-LayerNorm
Position encodingLearned absolute (tiled extension)
AttentionAlternating sparse/dense
Precisionbfloat16
Base modelevilfreelancer/ruGPT3XL (2048 ctx)
Fine-tuning datasetIlyaGusev/gazeta

Quick Start

from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "evilfreelancer/ruGPT3XL-8k"

tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    trust_remote_code=True,
    torch_dtype="bfloat16",
    device_map="auto",
)

inputs = tokenizer("Москва - столица", return_tensors="pt").to(model.device)
outputs = model.generate(
    **inputs,
    max_new_tokens=200,
    do_sample=True,
    temperature=0.7,
    top_p=0.9,
    repetition_penalty=1.2,
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Context Extension: 2k -> 4k -> 8k

The original ruGPT3XL uses Learned Absolute Positional Embeddings (APE): the position table embed_positions is a plain nn.Embedding(max_position_embeddings, hidden_size) that is trained together with all other weights. This means the model has never seen position indices beyond 2047 and cannot generalize to longer sequences without fine-tuning.

Additionally, the model uses alternating sparse attention where the attention mask grid is built dynamically as num_blocks = max_position_embeddings // sparse_block_size, so increasing max_position_embeddings automatically adjusts the sparse grid without any architectural changes.

Strategy

Context was extended in two steps: 2k -> 4k, then 4k -> 8k, continuing from the previous checkpoint each time.

Step 1 - Positional embedding tiling. The existing embedding matrix is kept intact for known positions (0 to N-1). New positions are filled by cycling through the original table:

position 2048 <- weights of position 0
position 2049 <- weights of position 1
...
position 4095 <- weights of position 2047

position 4096 <- weights of position 0   (second cycle)
...
position 8191 <- weights of position 4095

This is deliberately chosen over linear interpolation: interpolation perturbs all existing embeddings and causes severe perplexity regression on short contexts. Tiling preserves exact weights for positions 0..N-1, so the model does not "forget" how to handle short sequences.

Step 2 - Mixed-length dataset. Training uses a 60/40 mix of long and short examples:

  • Long (60%): multiple news articles from IlyaGusev/gazeta packed together with EOS tokens until reaching the target context length. All packed samples exceed half the target length, ensuring the model is consistently exposed to new position indices.
  • Short (40%): single-article chunks up to half the target length. Prevents forgetting short-context behavior.

Step 3 - Continued pretraining. 3 epochs, lr=5e-6, cosine decay, warmup_steps=50, gradient_checkpointing=True, bfloat16, gradient_accumulation_steps=8, hardware: RTX 4090 (48 GB VRAM).

Note on OOM. Training at 8k context caused CUDA memory fragmentation during backpropagation, crashing at step 517/936 despite ~1 GB of technically free VRAM. Fix: PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True. After this, peak usage dropped from 46.8 GB to 38.5 GB and training completed without issues.

Perplexity

Evaluated on the test split of IlyaGusev/gazeta, strategy non_overlapping, bfloat16.

Perplexity chart

ModelPPL @ 2048PPL @ 4096PPL @ 8192
ruGPT3XL (baseline)11.68--
ruGPT3XL-4k (intermediate)11.7512.04-
ruGPT3XL-8k (this model)11.7711.9913.00

Regression on the original 2k context is +0.09 PPL - essentially unchanged. The 4k evaluation on the 8k model is slightly better than the intermediate 4k checkpoint (11.99 vs 12.04), indicating that continued pretraining improved overall quality.

VRAM Requirements (inference, batch=1, bfloat16)

VRAM chart

Context lengthVRAM peakKV + activations
5122.92 GiB0.25 GiB
10243.16 GiB0.49 GiB
20483.86 GiB1.19 GiB
40966.57 GiB3.90 GiB
819215.98 GiB13.31 GiB

Model weights occupy ~2.67 GiB (bfloat16). Overhead from KV cache and activations grows roughly linearly up to ~2k (sparse attention helps) and becomes near-quadratic beyond that. GPUs with 8 GB VRAM are practical up to ~3.5-4k context.

Generation Speed (bfloat16, 64 new tokens, batch=1, RTX 4090)

Speed chart

Prompt lengthtok/sms / token
51214440.7
10248821.1
20483782.6
40966714.9
80003826.6

Speed is measured for autoregressive decoding with KV cache. The 2x step from 4k to 8k prompt length causes only ~1.8x slowdown (67 -> 38 tok/s), consistent with the linear scaling expected from sparse attention.

Sparse Attention

Inherited from the base model: even-numbered layers (0, 2, 4, ...) use block-sparse causal attention, odd-numbered layers use standard dense causal attention. The sparse pattern is computed from config.json at model init and does not require DeepSpeed at inference time.

ParameterValue
sparse_mode"alternating"
sparse_block_size16
sparse_num_local_blocks8 (local window = 128 tokens)
sparse_num_global_blocks1
sparse_num_different_global_patterns8

Limitations

  • Base model, not instruction-tuned. Works best for text completion.
  • Primarily Russian text. Limited capability in other languages.
  • Content may be biased, factually incorrect, or offensive - inherited from the original pretraining corpus.
  • At 8k context, inference requires ~16 GB VRAM (bfloat16, batch=1).

Training Details

Parameter2k -> 4k step4k -> 8k step
Baseevilfreelancer/ruGPT3XLruGPT3XL-4k (intermediate)
DatasetIlyaGusev/gazetaIlyaGusev/gazeta
Train samples2500 (1500 long + 1000 short)2500 (1500 long + 1000 short)
Val samples250250
Packed length40968192
Short max length20484096
Epochs33
Learning rate5e-65e-6
LR schedulercosinecosine
Warmup steps5050
Batch size (effective)88
OptimizerAdamW fusedAdamW fused
Precisionbfloat16bfloat16
HardwareRTX 4090 48 GBRTX 4090 48 GB
Training time~2.6 h~3.9 h (incl. resume)

Citation

@misc{rugpt3xl_8k,
  title={ruGPT-3 XL 8k - extended context window via positional embedding tiling},
  author={Pavel Rykov},
  year={2026},
  publisher={Hugging Face},
  url={https://huggingface.co/evilfreelancer/ruGPT3XL-8k}
}

Links

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Нельзя запустить

Модели нужен код из репозитория; автор пока не в списке доверенных организаций.

Класс архитектуры
RuGPT3XLForCausalLM
Ревизия весов
ff00c33

0 моделей