/ Модель

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

Контекст
262 144 токена
Лицензия
Своя лицензия
Архитектура
forth_lightning · dense
Базовая модель
rpn-gpt-lightning
Библиотека
transformers
Опубликована
6 ноя 2026

rpn-gpt-lightning-Forth

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

Модель генерирует ответы на арифметические задачи, используя встроенную машину Forth для точных вычислений целых чисел.

589скачиваний за 30 дней0лайковвеса обновлены6 ноя 2026

Бенчмарки

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

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

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

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

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

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

markab/rpn-gpt-lightning-Forth — производная модель markab, созданная на основе markab/rpn-gpt-lightning. Она предназначена для генерации ответов на арифметические задачи с точными вычислениями: языковая модель формирует программу на Forth, а встроенная вычислительная машина выполняет её и генерирует блок с результатом в ходе того же прохода генерации. Взаимодействие рассчитано на обычный чат-запрос, без отдельного вызова инструмента или клиентского цикла.

В репозитории находятся вычислительное ядро, дополнительные строки эмбеддингов и выходного слоя, а также код модели; базовые веса загружаются отдельно и остаются неизменными. Ядро описано как сеть с 3,7 млрд вычисленных, а не обученных весов. Модель поддерживает генерацию текста и рассчитана на английский язык. В метаданных указана лицензия other; конкретные условия следует сверять с лицензией репозитория и базовой модели.

Вычислительная машина работает с целыми числами и имеет ограничения на длину чисел и операнды умножения и остатка от деления. Она может быть медленной: например, деление чисел до шести цифр требует около 115 скрытых токенов. В README приведён пример корректного вычисления и указаны результаты ограниченного тестирования; это не устанавливает надёжность для всех задач.

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

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

Ограничения

Вычислительная машина поддерживает только целые числа, ограничивает длину чисел 20 цифрами и верхний операнд умножения или mod — 10 цифрами. Вычисления могут быть медленными; описанный в README тест охватывает ограниченное число примеров.

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

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

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

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

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

Открыть на Hugging Face

rpn-gpt-lightning-Forth

rpn-gpt-lightning with an exact Forth machine compiled into the network. The model writes a ```forth block; when it closes the block, a second, hand-built network (the kernel, 3.7B parameters whose weights were computed, not trained) writes the ```output block token by token in the same forward passes. No tool call, no client loop: a plain chat request gets the program, its exact output and the answer. Code and the full story: github.com/markab21/rpn-gpt, kernel/README.

This repository holds the kernel (7.4 GB), 453 embedding rows and 31 head rows for the words the model writes, and the modeling code. The language model itself is read from config.base_model = markab/rpn-gpt-lightning (63 GB, downloaded on first use) and stays byte-identical.

A real turn of the round-7 model (the adapter on the NVFP4 base) with the kernel in the weights (full example). The problem: "Calculate the remainder when 779951090558722902 is divided by 112974328."

After a short thinking part, the model writes:

779951090558722902 112974328 mod .
89002478

The remainder is 89002478.

\boxed{89002478}

The kernel inside the model wrote the output block. Before it, the kernel ran 348 hidden tokens. A hidden token is a reserved special token that decodes to an empty string. All 361 kernel-owned positions (348 hidden, 13 in the output block) were equal to the spec, kernel/text_vm.py. The answer is correct.

transformers (batch 1, reference)

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
m = AutoModelForCausalLM.from_pretrained("markab/rpn-gpt-lightning-Forth", trust_remote_code=True,
                                         dtype=torch.bfloat16, device_map="cuda").eval()
tok = AutoTokenizer.from_pretrained("markab/rpn-gpt-lightning-Forth")
card = open("reference_v4.txt").read()
msgs = [{"role": "system", "content": card}, {"role": "user", "content": "What is 123456789 * 987654321?"}]
x = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt", return_dict=True).to("cuda")
out = m.generate(**x, max_new_tokens=6000, do_sample=True, temperature=1.0, top_p=0.95, pad_token_id=0)
print(tok.decode(out[0, x["input_ids"].shape[1]:], skip_special_tokens=True))

Tested (local copy, transformers 5.16.1, one RTX PRO 6000): 3 of 3 problems correct, and all 1431 kernel-written tokens equal to the spec, kernel/text_vm.py (one turn sent a block that failed, read the error and fixed it). About 35 tokens/s. skip_special_tokens=True hides the kernel's internal tokens (they decode to empty strings anyway).

vLLM (batched, OpenAI server)

The vLLM model class is a plugin in the GitHub repository, for vLLM 0.29.0 only:

git clone https://github.com/markab21/rpn-gpt && cd rpn-gpt
FORTH_VISIBLE=1 VLLM_DISABLE_COMPILE_CACHE=1 PYTHONPATH=$PWD/kernel/composite \
  vllm serve markab/rpn-gpt-lightning-Forth --served-model-name forth --max-model-len 65536 \
  --no-enable-flashinfer-autotune --no-enable-prefix-caching --no-async-scheduling -cc '{"cudagraph_mode": "FULL_DECODE_ONLY"}'

Then send an ordinary chat request ("model": "forth", the card as the system message, temperature 1.0, top-p 0.95, max_tokens 24000). Tested from this repository with an empty Hugging Face cache (vLLM 0.29.0, one RTX PRO 6000): the server downloaded this repository and its base, and 4 of 4 chat answers were correct with no client. Three of them used the machine: all 6 output blocks that the kernel wrote (one error message, then the fixed program) were equal to the spec. The fourth answered by hand. The flags are the ones the kernel was verified with; playbooks/deploy.md has the batched checker (kernel/composite/e2e_vllm.py).

Limits of the machine: integers only, 20 digits a number, at most 10 digits for the top operand of * and mod; the kernel is slow (one forward pass per kernel step: a / on 6-digit numbers takes about 115 hidden tokens). The Forth page lists every limit.

License

NVIDIA Nemotron 3.5 Lightning is under the OpenMDW License Agreement, version 1.1: full text and NVIDIA's notice in LICENSE. Our parts (the fine-tune, the card, the code) are MIT, Copyright (c) 2026 Mark Berry and rpn-gpt contributors (LICENSE-MIT). Please credit rpn-gpt with a link to github.com/markab21/rpn-gpt.

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

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

GPU в ailist

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

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

Модели нужен код из репозитория; запуск откроется после проверки совместимости.

Класс архитектуры
ForthLightning
Ревизия весов
9d1efb9

0 моделей