/ Модель

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

Лицензия
MIT
Опубликована
14 ноя 2026

NCM-Sume-Portuguese-Instruct

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

Экспериментальная компактная модель Next-Concept Modeling для диалогов и выполнения инструкций на бразильском португальском языке.

214скачиваний за 30 дней1лайквеса обновлены14 ноя 2026

Бенчмарки

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

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

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

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

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

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

NCM Sumé — экспериментальная адаптация архитектуры Next-Concept Modeling, созданная сообществом для выполнения инструкций и диалога на бразильском португальском языке. Модель использует отдельные иерархический токенизатор Residual VQ-VAE и параллельный трансформер-генератор: текст формируется через последовательные уровни абстрактных концептов, а предсказания на каждом уровне выполняются параллельно. В README указано около 125 млн параметров суммарно: 88,61 млн у генератора и 36,43 млн у токенизатора; словарь содержит 8192 токена и четыре уровня кодовых книг.

Модель предназначена для диалогов, ответов на инструкции и кратких объяснений на португальском; обучение также включало примеры кода и англоязычные данные. README приводит тест непрерывного диалога на 8 ходов и время генерации 0,37–0,98 секунды на ход на RTX 4060 Laptop GPU, однако это экспериментальная демонстрация, а не широкая оценка качества. Репозиторий использует формат PyTorch и лицензию MIT.

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

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

  • ответы на инструкции на бразильском португальском
  • короткие диалоги и повседневное общение на португальском
  • объяснение простых вопросов на португальском
  • эксперименты с параллельной генерацией текста на потребительском GPU

Ограничения

Генератор содержит около 88,61 млн параметров, поэтому модель ограничена в хранении фактов и решении многошаговых математических задач; README рекомендует подключать поиск по источникам. Представленная оценка диалога ограничена тестом на восемь ходов.

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

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

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

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

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

Открыть на Hugging Face

NCM Sumé (Next-Concept Modeling in Portuguese)

NCM Sumé is an experimental adaptation and proof-of-concept of the Next-Concept Modeling (NCM) architecture, trained to follow instructions and converse in Brazilian Portuguese.

The model is named after Sumé, an ancestral figure in Tupi mythology associated with transmitting practical knowledge, agricultural techniques, and law to indigenous peoples.

🇧🇷 Nota em Português: A documentação completa em português está disponível no arquivo README_pt.md e na seção expansível ao final desta página.


1. Motivation and The 8 GB VRAM Constraint

Standard autoregressive language models generate text token by token. For a 300-word response, the GPU must perform 300 sequential forward passes, creating a structural latency bottleneck. The Next-Concept Modeling framework (introduced by Stanford's Hazy Research group) alters this mechanism: text is first drafted as high-level abstract concept codes, which are then refined in parallel across discrete hierarchical passes.

The question behind this project was simple:

Can we take the NCM architecture from scratch and train it within the constraints of a single consumer laptop GPU (an NVIDIA GeForce RTX 4060 Laptop GPU with 8 GB VRAM) to converse in Portuguese, similar to small quantized open models?

This repository documents the training pipeline, datasets, parameter counts, and benchmarks to serve as a reference for anyone exploring coarse-to-fine discrete text modeling on personal hardware.


2. Research Foundation and Attribution

This work is a community adaptation grounded in:

  • Paper: "Next-Concept Modeling: Fast, Parallel Coarse-to-Fine Text Generation" (arXiv:2610.14162)
  • Authors: Stanford Hazy Research Group (Hermann Kumbong et al.)
  • Official Repository: https://github.com/HazyResearch/ncm
  • Base Code License: MIT License

3. Training Data and Ingestion Strategy

To avoid exhausting local disk space (since raw code repositories easily exceed tens of gigabytes), data was ingested using memory streaming:

  1. BigCode StarCoder (bigcode/starcoderdata):
    • Python slice: extracted standalone functions, algorithms, and classes with docstrings.
    • Enforced strict 4-space indentation to preserve Python block structure.
  2. Everything Instruct Multilingual (rombodawg/Everything_Instruct_Multilingual):
    • Portuguese slice (pt): instructional prompt-response pairs focused on logic, explanations, and general conversation.
  3. Boakpe Historinhas (Boakpe/historinhas):
    • ~6,000 short story samples in Brazilian Portuguese to reinforce vocabulary and grammatical cohesion.
  4. Teacher Distillation (Qwen 2.5 3B):
    • Generated 1,500 instruction-response pairs locally to transfer conversational tone and empathetic response patterns to the NCM instruction format.

4. Architecture and Parameter Count

The system consists of two decoupled components:

A. Hierarchical Tokenizer (Residual VQ-VAE)

  • Weight file size: 222 MB
  • Parameter count: 36.43 million parameters
  • Vocabulary: Custom BPE with 8,192 tokens (including Portuguese diacritics and Python syntax tokens).
  • Residual Codebooks: 4 hierarchical abstraction levels:
    • Level 1: Broad discourse intent and global topic outline.
    • Level 2: Syntactic structure of phrases and code blocks.
    • Level 3: Lexical subword refinements.
    • Level 4: Surface tokens, accentuation, and punctuation.

B. Parallel Transformer Generator (NextConcept Transformer)

  • Weight file size: 356 MB
  • Parameter count: 88.61 million parameters
  • Inference mechanism: Conditioned on the prompt context and decoded concept levels, it evaluates and predicts concept tokens in parallel per level, requiring only a small, fixed number of forward passes on the GPU.

Total System Parameters: approximately 125 million parameters (88.61M in the generator + 36.43M in the tokenizer).


5. Training Pipeline on 8 GB VRAM

The primary operational constraint was avoiding out-of-memory (OOM) errors on 8 GB of VRAM. Key implementation decisions included:

  • Isolated Runtime: Docker container on WSL2 using pytorch/pytorch:2.4.0-cuda12.4-cudnn9-runtime.
  • Native bfloat16 Precision: torch.amp.autocast('cuda', dtype=torch.bfloat16) reduced tensor memory usage by over 50% compared to float32.
  • Gradient Accumulation: Micro-batches of 2 to 4 samples accumulated across 8 to 16 steps, yielding an effective batch size of 32 to 64 samples.
  • Memory Management: Configured PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True alongside explicit VRAM cache clearing between steps.

6. Practical Benchmark: 8-Turn Continuous Dialogue

The model was evaluated on a continuous 8-turn conversational flow in Portuguese. All responses were generated on the RTX 4060 Laptop GPU in 0.37s to 0.98s per turn:

TurnUser Message (Portuguese)IntentModel BehaviorEvaluation
1"Oi, tudo bem com você?"GreetingCordial greeting, asked about the user's day.Natural & Friendly
2"O que você mais gosta de fazer?"Personal queryStated interest in learning and logic, asked about user hobbies.Empathetic & Reciprocal
3"Hoje meu dia foi bem corrido no trabalho, estou bem cansado."Venting / FatigueValidated exhaustion, suggested winding down.Grounded & Supportive
4"O que você acha de tomar café para espantar o sono?"Daily habitExplained caffeine's adenosine receptor blocking and night sleep impact.Factual & Practical
5"Que tipo de música você acha bom para relaxar depois de um dia pesado?"RelaxationSuggested quiet genres (Lo-Fi, Bossa Nova, Piano) and asked preferences.Useful & Direct
6"Por que o céu fica avermelhado no final da tarde?"Science inquiryExplained atmospheric Rayleigh scattering in accessible language.Clear & Accurate
7"Me dá uma dica rápida para não acordar atrasado amanhã?"Practical tipProvided 3 practical habits (alarm distance, night prep, light gap).Concrete Advice
8"Valeu pela conversa, boa noite e até amanhã!"FarewellPolite sign-off, wished rest, left the channel open for the next day.Courteous & Closing

7. Repository Files

FileDescription
ncm_sume_generator.ptTransformer Generator weights (88.61M parameters, ~340 MB)
ncm_sume_tokenizer.ptMultiscale Residual VQ-VAE weights (36.43M parameters, ~211 MB)
bpe_vocab_8192.pickleBPE tokenizer vocabulary (8,192 tokens)
bpe_merges_8192.pickleBPE merges table
config.json / config.yamlArchitecture configuration and codebook hyperparameters
generate.pyStandalone PyTorch inference script
requirements.txtRuntime dependencies
README_pt.mdFull documentation in Portuguese

8. Quickstart & Inference

1. Clone and Install Dependencies

git clone https://huggingface.co/jpnmnb/NCM-Sume-Portuguese-Instruct
cd NCM-Sume-Portuguese-Instruct
pip install -r requirements.txt
pip install git+https://github.com/HazyResearch/ncm.git

2. Run Inference

python generate.py --prompt "Olá, o que você sabe sobre a chuva?"

CLI flags:

  • --device cuda or --device cpu
  • --precision bfloat16 or --precision float32
  • --max_length 128

9. Current Limitations & Roadmap

  • Parametric Capacity: With ~88M parameters in the generator, the model is a compact proof-of-concept. Dense historical facts and multi-step math require pairing with retrieval (RAG) to avoid hallucinations.
  • Future Work:
    • Training with explicit thinking tags (<think>...</think>).
    • Tool-calling integration for code execution and live search.
    • Exploring NCM concept planning on top of larger pre-trained backbones (1.5B or 3B) via QLoRA.
  • License: MIT License (consistent with the upstream NCM project).

Resumo em Português

O NCM Sumé é uma prova de conceito baseada no artigo de Stanford "Next-Concept Modeling: Fast, Parallel Coarse-to-Fine Text Generation" (arXiv:2610.14162). O objetivo foi treinar e adaptar a arquitetura para responder comandos e conversar em português usando apenas uma GPU doméstica de 8 GB (NVIDIA RTX 4060 Laptop).

  • Gerador: 88,61 milhões de parâmetros.
  • Tokenizador VQ-VAE: 36,43 milhões de parâmetros (BPE de 8.192 tokens).
  • Datasets: BigCode StarCoder (Python), Everything Instruct Multilingual (Português), Boakpe Historinhas e destilação de 1.500 pares com Qwen 2.5 3B.
  • Latência medida: 0,37s a 0,98s por turno em conversação cotidiana.
  • Licença: MIT.

Para conferir o texto completo em português com o relato detalhado das decisões técnicas, consulte o arquivo README_pt.md no repositório.

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

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

GPU в ailist

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

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

Не удалось определить, чем загружать веса модели (нет library_name и architectures).

Ревизия весов
10a4752

0 моделей