/ Модель

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

Контекст
512 токенов
Лицензия
MIT
Архитектура
gpt2 · dense
Библиотека
transformers
Опубликована
5 ноя 2026

c4-gpt-mini-causallm

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

Компактная модель GPT-2, обученная с нуля для продолжения англоязычного текста и экспериментов с генерацией.

1 486скачиваний за 30 дней2лайкавеса обновлены12 ноя 2026

Бенчмарки

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

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

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

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

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

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

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

GiangSon-5 представляет компактную авторегрессионную языковую модель GPT-2 с 44,91 млн параметров, созданную и обученную с нуля без предварительно обученных весов. Модель использует декодер GPT-2 из 6 блоков, библиотеку Transformers и контекст длиной 512 токенов; веса сохранены в формате safetensors с точностью bfloat16, а вычисления оптимизированы с помощью PyTorch SDPA.

Модель предназначена для продолжения англоязычного текста, учебных и исследовательских экспериментов, а также использования как черновой модели в speculative decoding. Она обучалась пять эпох на англоязычном веб-корпусе C4. По README, тестовая perplexity составляет 96,97; примеры показывают связный английский текст, но при длинной генерации возможны тематический дрейф и повторы. Модель не настроена для следования инструкциям и не использует внешнюю базу фактов. Лицензия — MIT.

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

  • продолжение англоязычного текста по начальной фразе
  • учебные эксперименты с компактной авторегрессионной моделью
  • оценка языковых моделей на англоязычных данных C4
  • черновая генерация токенов для speculative decoding

Ограничения

Компактный размер ограничивает фактические знания и многошаговые рассуждения; длинные генерации могут уходить от темы и повторять фразы. Модель не настроена на инструкции, может галлюцинировать и наследует смещения и артефакты веб-данных C4.

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

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

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

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

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

Открыть на Hugging Face

🧠 c4-gpt-mini-causallm

A 44.91M-parameter GPT-2 Causal Language Model (BF16 + SDPA), designed, tokenized, and trained entirely from scratch on C4.

Params Layers Precision Data License From scratch Hardware

A 44.91M-parameter autoregressive causal language model built and trained 100% from scratch (zero pretrained weights) over 5 Epochs (6,220 steps — 203.74M dataset tokens) on 1× NVIDIA A100-SXM4 (40GB) using Native BF16 + TF32 + PyTorch SDPA, achieving Validation Perplexity 93.52 (Loss 4.5382) and Held-Out Test Perplexity 96.97 (Loss 4.5744).


✨ Highlights

  • 🔨 100% From Scratch: No pretrained checkpoint initialization; all 44,909,056 parameters and the 50,257-token Byte-Level BPE tokenizer (fit strictly on Train split) are learned from scratch.
  • 🎯 Sub-94 Validation & Sub-97 Held-Out Test PPL: Reduced Perplexity by 99.82% vs random initialization (54,773.00 Test PPL), with a small Val-to-Test generalization gap of +0.0362 nats (93.52 Val / 96.97 Test PPL).
  • ⚡ Ampere Native BF16 + SDPA Acceleration: Reached 124,127 tokens/sec (242.44 blocks/sec) at 14.07 GB Peak VRAM, completing all 5 epochs in 27.37 minutes of training (30.37 minutes full end-to-end pipeline).
  • 🪶 Compact 85.66 MB BF16 Footprint: Serialized natively in bfloat16 (model.safetensors: 89,825,728 bytes), well-suited for edge inference or Draft Model experiments in Speculative Decoding.
  • 📚 Boundary-Aware Zero-Padding Packing: Strict non-overlapping 90,000 Train / 5,000 Val / 5,000 Held-Out Test split (seed=42) with explicit </s> (eos_token_id=2) document delimiters and linear-time packing (99.94% token retention, 0% <pad>).
  • 🔓 Permissive Open Source: Released under the MIT License.

🚀 Quick Start

Generate text using PyTorch and 🤗 Transformers (stored natively in bfloat16):

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM

repo = "GiangSon-5/c4-gpt-mini-causallm"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo)

device = "cuda" if torch.cuda.is_available() else "cpu"
model.to(device).eval()

prompt = "Artificial intelligence is transforming"
inputs = tokenizer(prompt, add_special_tokens=False, return_tensors="pt").to(device)

with torch.no_grad():
    outputs = model.generate(
        **inputs,
        max_new_tokens=80,
        do_sample=True,
        temperature=0.8,
        top_k=50,
        top_p=0.92,
        repetition_penalty=1.15,
        pad_token_id=tokenizer.pad_token_id,
        eos_token_id=tokenizer.eos_token_id,
    )

print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Or run via the high-level Hugging Face Pipeline:

from transformers import pipeline

generator = pipeline("text-generation", model="GiangSon-5/c4-gpt-mini-causallm")
result = generator("The future of software engineering lies in", max_new_tokens=60, do_sample=True, temperature=0.8, top_k=50, top_p=0.92)
print(result[0]["generated_text"])

💬 Sample Generations

Verbatim continuations generated after reloading the standalone bfloat16 checkpoint from disk (max_new_tokens=80, temperature=0.8, top_k=50, top_p=0.92, repetition_penalty=1.15):

PromptGenerated Full Text (5 Epochs, Step 6,220)
Artificial intelligence is transformingArtificial intelligence is transforming the human mind. With the help of the film, the story will become a very powerful feature of the film which is used by artists. The show will be available from the original production team in 0000 and will be on sale for the film.
Deep neural networks learn representations byDeep neural networks learn representations by the need of communication, including the user interface that is being performed on a daily basis.
The future of software engineering lies inThe future of software engineering lies in the evolution of its own. The new technology is a great way to communicate the concepts, concepts and experiences that we are faced by problems of human nature, whether or not they relate to humans's ideas. This has been a long way through which we have to see how to control human consciousness through our thinking process. A team of engineers can provide their solutions to customers in the development of AI systems and
Large language models trained on web corporaLarge language models trained on web corpora-based applications. We have worked with the team, to develop a new level of expertise and make sure that it will enable you to develop your skills through the development process. This is the most important part of any application for all types of applications. This program is designed to help improve your application performance while providing you with your knowledge. When you do not have the ability to be able to be able
In scientific computing, parallel matrix multiplicationIn scientific computing, parallel matrix multiplication, we found that the new approaches can be used to make a more efficient solution for all of our technologies. We can also find solutions where and when we need to find ways to create an environment within this context. This method uses an interactive framework to support the different aspects of human interaction with others (or as they are not able to achieve) by understanding their experiences and experiences in order to develop the

Qualitative Critique: The model produces fluent English syntax and demonstrates clean autonomous EOS termination (</s> stop observed naturally in Prompt 2). Consistent with a compact 44.91M-parameter model trained on C4 web crawls, longer completions exhibit topical drift (Prompt 1 shifting into film promotional text with C4 anonymized 0000 year placeholders) and occasional local phrase repetition (to be able to be able, concepts, concepts).


1. Architecture Specs

SpecificationValueArchitecture Details
Model TypeGPT-2 Decoder (sdpa)Autoregressive Causal LM with PyTorch SDPA FlashAttention
Total Parameters44,909,056 (~44.91M)100% randomly initialized (bfloat16 serialized weights: 85.66 MB)
Decoder Layers (n_layer)6 BlocksPre-Layer Normalization + Residual Connections
Attention Heads (n_head)8 HeadsScaled Dot-Product Self-Attention (64 dim / head)
Hidden Dimension (n_embd)512Intermediate hidden representation size
Context Window (n_positions)512 TokensAbsolute learned positional embeddings
Vocabulary & Special IDs50,257 (NFKC + Byte-Level BPE)Train-only fit (73.99s); BOS=0, PAD=1, EOS=2; clean prompt encoding without forced </s>
Activation & DropoutGELU (gelu_new) • Dropout 0.1Exact match to serialized config.json (resid_pdrop, embd_pdrop, attn_pdrop)
Weight TyingEnabled (tie_word_embeddings: true)Input wte weights shared with output lm_head

2. Training Data & Procedure

Data Engineering

  • Dataset: datablations/c4-filter-small (100,000 quality-filtered English web documents from the Colossal Clean Crawled Corpus — C4).
  • Non-Overlapping 3-Way Split (seed=42):
    • Train: 90,000 documents → 79,585 packed 512-token blocks (40,747,520 tokens/epoch; 99.94% retention from 40,773,413 raw tokenized+EOS tokens).
    • Validation: 5,000 documents → 4,623 packed 512-token blocks (2,366,976 tokens).
    • Held-Out Test: 5,000 documents → 4,535 packed 512-token blocks (2,321,920 tokens).
  • Total Tokens Trained Across 5 Epochs: 203,737,600 dataset tokens (79,585 × 512 × 5; 203,816,960 batch step-slot tokens across 6,220 steps × 64 blocks × 512 tokens).
  • Preprocessing Strategy: Boundary-Aware Zero-Padding Sequence Packing. Each document ends with explicit </s> (eos_token_id=2) before linear concatenation (itertools.chain) into uniform 512-token chunks, completely eliminating <pad> tokens.

Training Configuration

HyperparameterValueTechnical Notes
Optimizeradamw_torch_fusedβ₁ = 0.9, β₂ = 0.95, ε = 1e-8, Weight Decay = 0.1, Max Grad Norm = 1.0
Peak Learning Rate6e-4Cosine Annealing schedule with 5% linear warmup
Effective Batch Size64 (32 × 2 grad accum)32,768 tokens per optimizer update
Epochs / Total Steps5.0 Epochs / 6,220 StepsUninterrupted full 5-epoch convergence (EarlyStopping patience=4 active)
Compute PrecisionBF16 + TF32 (bfloat16)Native Ampere bf16=True, allow_tf32=True; serialized model.safetensors: 85.66 MB (89,825,728 bytes)
Hardware & Peak VRAM1× NVIDIA A100-SXM4 (40GB)Peak allocation 14.07 GB / 39.49 GB
Throughput124,127 tokens/sec242.44 context blocks/sec (2.13× faster than FP32+TF32 baseline)
Training Duration1,642.00 seconds (~27.37 min)Pure training runtime on 1× A100; total end-to-end pipeline: 30.37 min (1,822.29s)
FrameworksPyTorch 2.14.1+cu130, 🤗 Transformers 5.22.1SDPA FlashAttention + Fused AdamW stack

3. Evaluation

MilestoneStepEpochTrain Loss (Nearest Step)Eval / Test LossPerplexity (PPL)Learning RateTechnical Notes
Random-Init Test Baseline00.00—10.9110 (Test)54,773.00—Uninitialized baseline on 4,535 unseen Test blocks
Warmup & Early Decay5000.406.23696.1483467.935.91e-04>100× initial Perplexity drop in ~0.4 epoch
Early Epoch 21,5001.215.41975.3513210.875.18e-04Grammar and basic phrase structure emergence
Midpoint (Epoch 2)2,5002.015.02844.9271137.983.91e-04Steady monotonic decrease without overfitting
Late Epoch 33,5002.814.80444.7013110.092.41e-04Surpasses prior 3-epoch baseline trajectory
Sub-100 PPL Crossing4,5003.624.64004.590398.521.06e-04Crosses sub-100 Validation PPL before Epoch 4
Final Annealing Phase5,5004.424.56584.543594.021.97e-05Cosine LR decay refines flat optimum
★ Best Checkpoint (Validation)6,2205.004.5455 (step 6200)4.5382 (Val)93.52 (Val)1.69e-08 (step 6200)5-epoch avg Train Loss = 5.0975; best Validation checkpoint
★ Held-Out Test Evaluation6,2205.00—4.5744 (Test)96.97 (Test)—Val-to-Test Generalization Gap Δ = +0.0362 nats (+3.45 PPL)

Training Convergence Dashboard

Data Distribution Analysis


4. Limitations & Ethical Considerations

  • Model Capacity (~45M): Generates grammatically coherent English prose, yet remains constrained on multi-step factual reasoning, exhibits topical drift over longer generations, and shows occasional local phrase repetition.
  • C4 Anonymization & Web Bias: Clean C4 crawl data contains numeric anonymization artifacts (e.g., 0000 replacing years or phone digits) and inherits societal biases from public web pages.
  • Hallucination: Generates next-token continuations purely probabilistically without factual memory or external retrieval grounding.
  • Intended Use: Base English (en) causal language model for research, educational benchmarking, and lightweight speculative decoding drafts; not aligned (no SFT/RLHF) and unsuitable for medical, legal, or financial advice.

5. Google Colab & Reproducibility

Open In Colab


6. Citation & References

  • 📄 C4 Dataset (Google Research): Colin Raffel et al., Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer (JMLR 2020). arXiv:1910.10683 | PDF Link
  • 📄 Data-Constrained Scaling (Hugging Face / Harvard): Niklas Muennighoff et al., Scaling Data-Constrained Language Models (NeurIPS 2023). arXiv:2305.16264 | PDF Link
  • 📄 GPT-2 Architecture (OpenAI): Alec Radford et al., Language Models are Unsupervised Multitask Learners (OpenAI Technical Report 2019). OpenAI PDF

7. License & Author

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

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

GPU в ailist

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

Можно запустить

Подбираем GPU…

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

0 моделей