/ Модель

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

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

Custom-GPT-40M-Base

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

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

379скачиваний за 30 дней0лайковвеса обновлены25 сен 2026

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Custom GPT 40M Base — англоязычная авторегрессионная языковая модель, обученная с нуля автором sraivante и экспортированная в архитектуру GPT-2 для Transformers. Она содержит около 39,85 млн параметров, использует 10 слоёв трансформера и 8 голов внимания, принимает текстовый промпт и продолжает его. Модель предназначена для экспериментов с небольшими языковыми моделями, предсказанием следующего токена и конвейерами обучения и инференса.

Контекст модели ограничен 256 токенами. Веса обучены на англоязычном подмножестве корпуса AI4Bharat Sangraha; релиз содержит веса FP32 в формате Safetensors. Модель не проходила дообучение для инструкций или диалога, а её качество ограничено небольшим размером и коротким обучением. Надёжные ответы на вопросы, рассуждения, обучение, генерация кода и качество на других языках не подтверждены.

Валидационная потеря лучшего чекпойнта рассчитана по случайной выборке батчей, а обучающая и валидационная выборки разделяют граничный документ и токенизатор был обучен до разделения данных, что ограничивает независимость оценки. Генерации могут быть несвязными, повторяться, содержать выдуманные утверждения, предвзятости или воспроизводить обучающие материалы, поэтому требуют проверки. Веса, код обучения и документация распространяются по Apache License 2.0; обучающие данные — по CC BY 4.0 с требованиями атрибуции.

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

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

Ограничения

Контекст ограничен 256 токенами; качество генерации ограничено размером и объёмом обучения, а надёжность фактов, следование инструкциям, кодогенерация и работа на других языках не оценивались. Валидационная оценка получена на случайных батчах при пересечении граничного документа между выборками и не является полностью независимой.

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

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

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

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

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

Открыть на Hugging Face

Custom GPT 40M Base

A 39,847,936-parameter English causal language model trained from scratch by sraivante. This release exports the best checkpoint from the CUSTOM_LLM3 + CUSTOM_LLM_OLLAMA_IMPORT project into standard Transformers GPT-2 architecture and Safetensors files.

It learns to continue English text from a short prompt. It is useful for studying small language models, experimenting with next-token prediction, and developing training or inference pipelines. It has a 256-token context window and limited generation quality. It has no instruction/chat fine-tuning or task-specific evaluation, so reliable tutoring, reasoning, factual question answering and code generation have not been demonstrated.

This model uses randomly initialized, project-trained weights. The GPT-2 architecture identifier provides library compatibility; no pretrained OpenAI GPT-2 weights were used.

Load and generate

pip install "torch>=2.6" "transformers>=4.56.2,<5" "safetensors>=0.6.2"
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM

repo = "sraivante/Custom-GPT-40M-Base"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo).eval()

prompt = "The future of artificial intelligence"
inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False)
remaining = model.config.n_positions - inputs["input_ids"].shape[1]
if remaining < 1:
    raise ValueError("Use a prompt shorter than 256 tokens.")

torch.manual_seed(42)
with torch.inference_mode():
    output = model.generate(
        **inputs,
        max_new_tokens=min(80, remaining),
        do_sample=True,
        temperature=0.8,
        top_k=50,
        eos_token_id=tokenizer.eos_token_id,
        pad_token_id=tokenizer.pad_token_id,
    )
print(tokenizer.decode(output[0], skip_special_tokens=True))

Keep prompt tokens + generated tokens <= 256 for this Transformers export. It uses learned absolute positions. The original native generation code supports a sliding context by recomputing a cropped window; standard Transformers generation here uses the fixed position limit.

The tokenizer is a custom 16,000-token byte-level BPE with add_prefix_space=True. No chat template or automatic BOS/EOS insertion is used. Some characters absent from its learned vocabulary can map to <unk>. English is the only intended language; other languages were not evaluated.

See example_generate.py for a runnable command-line example. Safetensors and the built-in Transformers architecture load without trust_remote_code. No GGUF export or Ollama integration is included or verified.

Architecture and training

SettingValue
Unique parameters39,847,936
Transformer layers10
Attention heads8
Hidden size / feed-forward size512 / 2,048
Context / vocabulary256 / 16,000
PositionsLearned absolute embeddings
Activation / LayerNorm epsilonExact GELU / 0.00001
Token embedding and output headTied
Dropout0.1
Micro-batch / gradient accumulation32 / 2
Effective batch / tokens per update64 sequences / 16,384 tokens
OptimizerAdamW; betas 0.9, 0.95; weight decay 0.1
Learning rate0.0003 peak, 0.00003 minimum; cosine schedule
Warmup / gradient clipping200 steps / 1.0
EvaluationEvery 250 steps; 50 sampled batches per split
Final saved step / selected best step5,000 / 4,750

The training objective is next-token cross entropy, with random 256-token windows sampled with replacement from the token stream. The notebook specifies CUDA bfloat16 autocast. Actual training hardware and installed package versions were not recorded in its saved outputs. Step labels follow the original notebook, whose loop includes step zero.

The complete recorded settings and history are in training/training_config.json and training/training_history.json. The original training notebook is included unchanged. The export contains FP32 model weights; original optimizer state and training-resume checkpoints are not included.

Training and validation data

The accompanying Custom GPT 40M Sangraha Subset contains the raw corpus, exact local training and validation token arrays, original tokenizer, source hashes and attribution. An identical copy is included in training_data/.

The raw files are verified/eng/data-0.parquet and data-1.parquet from AI4Bharat Sangraha at revision 8b813c3f62d37b2fa174d68c31e8b35ae2fe85e8. Both files match the upstream SHA-256 hashes exactly.

DataCount
Raw documents699,050
Total tokens, including document EOS markers457,688,283
Training tokens411,919,454
Validation tokens45,768,829

These are corpus sizes, not counts of tokens actually consumed in training. Raw documents were encoded in file order, separated by EOS, then split at 90% of the total token count. The cut divides document index 629,027 (zero-based): 1,620 tokens are in training and 294 in validation. The splits are not document-disjoint. The tokenizer was fitted before the train/validation split in the notebook.

A deterministic check of 261 documents, including shard endpoints and the split boundary, reproduced the saved token spans exactly. Full re-tokenization of every document was not performed; the exact raw files and token arrays are identified by their complete hashes. These artifacts and checkpoint metadata support the run association, but no external training log records every file opened by the historical run.

Results and limitations

CheckpointStepSampled train lossSampled validation loss
Published best4,7504.1996214.198967
Latest saved5,0004.2108054.211185

The best logged validation loss corresponds to perplexity approximately 66.62. These values come from 50 randomly sampled evaluation batches, not exhaustive evaluation of the validation stream. The shared boundary document and tokenizer fitting procedure limit their interpretation as fully independent held-out performance.

Conversion checks used strict weight loading, finite tensor checks, nine FP32 logit comparisons up to 256 tokens, tokenizer parity, cached greedy generation parity, and a saved AutoModelForCausalLM reload. Maximum observed absolute logit difference was below 0.000003. Details and unedited smoke generations are in training/conversion_validation.json.

Small capacity, brief training, short context and web-heavy data limit coherence and factual accuracy. Generated text can repeat, invent claims, reflect social biases or reproduce training material. No instruction-following, factuality, safety, multilingual or downstream benchmark evaluation is available. Use generated text as an experimental output requiring review.

Files and provenance

  • model.safetensors, configuration and tokenizer files: best-checkpoint Transformers export.
  • training/: original notebook and history, native architecture, conversion script, settings and validation report.
  • training_data/: raw Sangraha shards, saved NumPy token streams, original tokenizer and data provenance.
  • SHA256SUMS and artifact_integrity.json: release file integrity records.

License and attribution

Copyright (c) 2026 sraivante for original model weights, project training code and original release documentation, licensed under Apache License 2.0.

Training data remains under CC BY 4.0, with attribution to AI4Bharat, the Sangraha / IndicLLMSuite authors and underlying content creators. It is not covered by this repository's Apache license. The original texts are not claimed as sraivante's writing. See training_data/ATTRIBUTION.md, training_data/LICENSE, the preserved upstream card and NOTICE.

Release prepared 2026-09-25.

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей