khtst-multimodal-ptbr is an open-weight model from Anderson, released under MIT License. Its published files total 4.1 MB.
KHTST é a evolução do projeto AURORA (renomeação integral AURORA → KHTST, pedido do projeto) — um modelo multimodal compacto para PT-BR com roteamento por S-SOM, punição SGDR, punição de novidade restrita a empates de Voronoi, controle…
Model Card
By Anderson, published under mit, revision bc52c85abc1c.
KHTST é a evolução do projeto AURORA (renomeação integral AURORA → KHTST, pedido do projeto) — um modelo multimodal compacto para PT-BR com roteamento por S-SOM, punição SGDR, punição de novidade restrita a empates de Voronoi, controle Reward/Punishment/Penalty (RPP) e janela de contexto 256K tokens (compressão indexada, doc 13). 14,89M (lm/noticia/pontuacao/ instrucao/tts/vqa/ocr/imagemcaption/asr) · encoders imagem/áudio/vídeo. Todas as perdas por tarefa foram avaliadas no MESMO protocolo do baseline (3.548 registros PT-BR reais, mesmas sementes, mesmo tokenizador BPE 16k). Como a autorregulação atuou NESTA corrida (evidência real, resumotreinov9.json): 1. Gate DPO: ROLLBACK. A fase DPO…
Read Anderson's full model card
KHTST — modelo multimodal PT-BR (v9: estado integral + autorregulação)
KHTST é a evolução do projeto AURORA (renomeação integral AURORA → KHTST, pedido do projeto) — um modelo multimodal compacto para PT-BR com roteamento por S-SOM, punição SGDR, punição de novidade restrita a empates de Voronoi, controle Reward/Punishment/Penalty (RPP) e janela de contexto 256K tokens (compressão indexada, doc 13).
14,89M parâmetros · vocab 16384 · 9 tarefas (lm/noticia/pontuacao/ instrucao/tts/vqa/ocr/imagem_caption/asr) · encoders imagem/áudio/vídeo.
GATE DE QUALIDADE: APROVADO (todas as métricas). O estado treinado publicado em
estados/fase-v9/superou o AURORA baseline em ppl_lm (2,76 vs 17,09 — −83,9%) e nas 9 perdas por tarefa, com treino em 3,24 h (último tempo registrado: 3,98 h — REDUZIDO em 0,74 h; teto rígido de 5 h respeitado) e RAM pico 3.262 MB ≤ 3.580 MB do AURORA. Tabela completa:comparacao_treino_v9.json(evolucao_integral).
Resultados desta corrida (estado RECARREGADO do disco — Teorema 20.2)
| métrica | AURORA (baseline) | KHTST v9 | Δ |
|---|---|---|---|
| ppl_lm | 17,09 | 2,76 | −83,9% |
| perda lm | 2,838 | 1,015 | −64,2% |
| perda noticia | 2,554 | 0,835 | −67,3% |
| perda instrucao | 2,036 | 0,683 | −66,4% |
| perda pontuacao | 2,648 | 0,923 | −65,1% |
| perda imagem_caption | 2,127 | 0,604 | −71,6% |
| perda vqa | 2,177 | 0,739 | −66,1% |
| perda ocr | 1,418 | 0,333 | −76,5% |
| perda asr | 2,122 | 0,430 | −79,7% |
| perda tts | 1,675 | 0,408 | −75,6% |
| tempo de treino | 3,98 h (último registrado) | 3,24 h | −18,5% |
| RAM pico | 3.580 MB | 3.262 MB | −8,9% |
| testes pós-treino | 48 /0 | 48 /0 + 44 /0 + 21 /0 | — |
| item (b) adhoc | aprovado | APROVADO (teste_item_b_v9.json) |
— |
Todas as perdas por tarefa foram avaliadas no MESMO protocolo do baseline (3.548 registros PT-BR reais, mesmas sementes, mesmo tokenizador BPE 16k).
O que há de novo no v9 (provas em docs/matematica/20)
| inovação | onde | prova |
|---|---|---|
| Estado integral: snapshot fiel de modelo + roteador S-SOM + orquestrador SOM + extras (Teo 20.1) | treino/estado_integral.py, dados/checkpoints.py |
Teos 20.1–20.2 |
| Sonda de fidelidade: max|Δ logits| = 0 medido em cada fase e no estado final | idem | Cor. 20.2.1 |
| Gate de fase com rollback: avaliação do estado RECARREGADO; regressão > 8% ⇒ rollback (não-expansividade) | scripts/04_treinar.py, treino/treinador.py |
Teo 20.3 |
| CIAR: controlador integral de autorregulação do lr (κ ∈ [0,5; 1,5], PI com vazamento) | treino/treinador.py |
Teos 20.4–20.5 |
Correção do bug crítico do v8: estado fora do state_dict (codebook do roteador, 9 variantes SOM) não era salvo ⇒ reload quebrado (ppl 2542) |
— | — |
Bug de digitação corrigido em scripts/01 (bloco try/except des-indentado — SyntaxError) |
scripts/01_verificar_ambiente.py |
— |
Como a autorregulação atuou NESTA corrida (evidência real, resumo_treino_v9.json):
- Gate DPO: ROLLBACK. A fase DPO (93 passos) regrediu o ppl 3,28 → 10,45;
o gate detectou no estado RECARREGADO e restaurou automaticamente o
snapshot
pre-dpo(Teorema 20.3 — o operador é não-expansivo). - Gate SOM: ROLLBACK. A consolidação SOM regrediu 2,44 → 2,74 (além da
tolerância de 8%); rollback automático para
pre-som. - O estado publicado (
estados/fase-v9/) é o estado gate-aprovado, re-serializado com o protocolo integral v9.1 — sonda δ* = 0,0.
Verificações (tudo verde)
- Suítes herdadas v1–v6: 25+36+37+29+48 · v7: 44 · v9 (nova): 21 — captura/restauração bit-exata, sonda, higiene com tags protegidas, CIAR limitado, compatibilidade com snapshots legados.
- Item (b) no modelo treinado: APROVADO — 4 requisições recebidas ANTES
da 1ª resposta, processamento serial, stop (cancelamento) e
pause→continue honrados (
teste_item_b_v9.json).
Treino desta corrida (dentro do teto de 5 h)
| métrica | valor |
|---|---|
| passos | 3192 (8 épocas + DPO 93 passos + consolidação SOM, ambos com gate) |
| tempo (wall, monitor RAM — fonte única) | 3,24 h< 3,98 h (reduzido) · teto 5 h |
| RAM | pico 3.262 MB · média 2.644 MB · mín 547 MB (5.245 amostras) |
| corpus | 3.548 registros PT-BR reais (18 fontes HF; multimodais incluídos) |
| difusão | modo REAL nesta avaliação (gerou pixels; prompt enriquecido) |
| estado publicado | estados/fase-v9/ — modelo + roteador + orquestrador + extras, SHA-256, sonda δ* = 0 |
O que há de novo no v8 (itens a–j, com provas em docs/matematica/19)
| item | melhoria | onde | prova |
|---|---|---|---|
| a | micro buffers anulares em redes recorrentes (0 alocação/passo no decode) | percepcao/microunidades.py |
Teo 19.6 |
| b | canal adhoc I/O + stop/continue durante solicitações ativas | servico/adhoc.py, scripts/09_teste_item_b.py |
Teos 19.14–19.16 |
| c | quantização 8-bit seletiva matematicamente vantajosa (torchao/bnb) | quanta/quantizacao.py §10 |
Teo 19.18 |
| d | anti-vanishing: Leaky ReLU adaptativa + pesos de árvore bidirecionais + skip neutro + BatchNorm | microunidades.py |
Teos 19.7–19.10 |
| e | map-reduce torch.vmap/sum/mean nos experts MoE |
percepcao/moe.py |
Teo 19.11 (diff 0,0) |
| f | atenção árvore bidirecional fora de ordem; raio_janela e kv_max ×4 (128/2048); AtencaoCabecas |
percepcao/atencao.py |
Teos 19.1–19.4 |
| g | MoE 2 encoders + 4 decoders fora de ordem agrupável/desagrupável | percepcao/moe.py |
Teos 19.12–19.13 |
| h | gestão de memória RAM/armazenamento com limiar adaptativo | telemetria/gestor_memoria.py |
Teo 19.17 |
| i | testes em dados reais → bugs latentes corrigidos (v7 e v8) | vários | — |
| j | parâmetros auto-ajustáveis matematicamente + provas conjuntas | treino/treinador.py |
Teos 19.26–19.27 |
ViT (evolução de video.py/blocos.py/microunidades.py): Token
Merging (ToMe) com casamento bipartido único e auto-ajuste da fração de
fusão; LRA-QViT com RB-LRA, WADS e STE — ramificações 1-bit ∥ 4-bit
em paralelo detectando direção vetorial da iluminação (unitária) e
intensidade, mapas 2-D de contorno/área; critério de vantagem da
difusão (vantagem_difusao). Provas: Teos 19.19–19.24, 19.28.
Cython + C/C++: núcleos acelerado/nucleos.pyx (Kohonen sequencial +
entropia/punição) com semântica sequencial exata (Teo 19.25) — speedup
medido 17,89×, fallback puro-torch idêntico.
Gráficos de desempenho desta corrida (publicados apenas no card)
Nota honesta: a curva "AURORA (baseline)" refere-se à avaliação do baseline
publicado (avaliacao_v6_anterior.json), corrida com a política de lr que o
diagnóstico v8/v9 corrige; o KHTST v9 usa a política corrigida (SGDR com
cooldown = T_0, guarda de aquecimento nas duas cláusulas, CIAR, gates).
Reprodução
python3 scripts/01_verificar_ambiente.py
python3 scripts/02_coletar_corpus.py # retomável por fonte
python3 scripts/03_treinar_tokenizador.py
python3 scripts/04_treinar.py --orcamento 420 --teto_horas 5.0
python3 scripts/05_avaliar.py
python3 scripts/09_teste_item_b.py # item (b) com o modelo real
python3 scripts/08_graficos_card.py # gráficos + gates
python3 scripts/06_publicar_hf.py # commit único (gate bloqueia estados)
Núcleos acelerados (Cython+C): o repo inclui nucleos.pyx (fonte),
nucleos.c (C gerado) e o binário pré-compilado
nucleos.cpython-312-x86_64-linux-gnu.so. Sem binário compatível, recompile
ou use o fallback puro-torch (semântica idêntica, Teo 19.25):
cd src/khtst/acelerado && python3 setup.py build_ext --inplace
python3 -c "from khtst.acelerado import status; print(status())"
# {'backend': 'cython_c', 'cython_disponivel': True}
Estrutura
src/khtst/ — núcleo, percepção (atenção/microunidades/moe/vit_lra),
memória (S-SOM + 8 variantes + janela 256K), treino (4 fases + RPP + SGDR +
estado integral + CIAR + gates), servico (canal adhoc), quanta
(8-bit + STE), telemetria (hub + gestor de memória), qualidade (Agente
Engenheiro), acelerado (Cython+C).
docs/matematica/00–20 — fundamentos, teoremas e provas.
graficos/ — desempenho desta corrida (apenas no card).
Licença
MIT (herdada do projeto).
Identity and Version
- Repository
- PowerMachine/khtst-multimodal-ptbr
- Publisher
- Anderson
- Task
- Not stated by the source
- Modality
- Other
- Library
- Not stated by the source
- Parameters
- Not stated by the source
- Languages
- pt
- Revision
- bc52c85abc1c400e64228d93961e79bb2dcf2677
- First published
- 2026-09-18
- Last updated
- 2026-09-20
Files and Weights
136 files, 4.1 MB in total.
Every file
| File | Type | Size | SHA-256 |
|---|---|---|---|
| avaliacao_v7.json | Configuration | 19.4 KB | — |
| avaliacao_v9.json | Configuration | 20.3 KB | — |
| comparacao_treino_v7.json | Configuration | 3.1 KB | — |
| comparacao_treino_v9.json | Configuration | 5.9 KB | — |
| configs/base.json | Configuration | 4.7 KB | — |
| relatorio_agente_engenheiro.json | Configuration | 1.4 KB | — |
| resumo_treino_v7.json | Configuration | 24.4 KB | — |
| resumo_treino_v9.json | Configuration | 27.6 KB | — |
| scripts/01_verificar_ambiente.py | Configuration | 2.5 KB | — |
| scripts/02_coletar_corpus.py | Configuration | 7.0 KB | — |
| scripts/02a_coletar_fonte.py | Configuration | 2.3 KB | — |
| scripts/03_treinar_tokenizador.py | Configuration | 1.6 KB | — |
| scripts/04_treinar.py | Configuration | 20.2 KB | — |
| scripts/05_avaliar.py | Configuration | 32.9 KB | — |
| scripts/06_publicar_hf.py | Configuration | 8.4 KB | — |
| scripts/07_reconsolidar_som.py | Configuration | 3.8 KB | — |
| scripts/08_graficos_card.py | Configuration | 19.0 KB | — |
| scripts/09_teste_item_b.py | Configuration | 5.2 KB | — |
| src/khtst/__init__.py | Configuration | — | |
| src/khtst/acelerado/__init__.py | Configuration | 3.8 KB | — |
| src/khtst/acelerado/setup.py | Configuration | 606 B | — |
| src/khtst/config.py | Configuration | 15.9 KB | — |
| src/khtst/dados/__init__.py | Configuration | — | |
| src/khtst/dados/cache.py | Configuration | 5.0 KB | — |
| src/khtst/dados/checkpoints.py | Configuration | 10.0 KB | — |
| src/khtst/dados/documentos.py | Configuration | 2.5 KB | — |
| src/khtst/dados/streaming.py | Configuration | 23.9 KB | — |
| src/khtst/dados/tokenizador.py | Configuration | 4.2 KB | — |
| src/khtst/geracao/__init__.py | Configuration | 185 B | — |
| src/khtst/geracao/difusao.py | Configuration | 10.4 KB | — |
| src/khtst/memoria/__init__.py | Configuration | — | |
| src/khtst/memoria/atencao_som.py | Configuration | 9.4 KB | — |
| src/khtst/memoria/interna.py | Configuration | 11.9 KB | — |
| src/khtst/memoria/janela_1m.py | Configuration | 6.5 KB | — |
| src/khtst/memoria/orquestrador.py | Configuration | 8.9 KB | — |
| src/khtst/memoria/som_base.py | Configuration | 8.0 KB | — |
| src/khtst/memoria/variantes_crescimento.py | Configuration | 8.0 KB | — |
| src/khtst/memoria/variantes_especiais.py | Configuration | 8.6 KB | — |
| src/khtst/metricas/__init__.py | Configuration | 2.2 KB | — |
| src/khtst/metricas/alinhamento.py | Configuration | 11.4 KB | — |
| src/khtst/metricas/benchmarks.py | Configuration | 11.2 KB | — |
| src/khtst/metricas/geracao_texto.py | Configuration | 8.2 KB | — |
| src/khtst/metricas/som_metricas.py | Configuration | 7.8 KB | — |
| src/khtst/nlg/__init__.py | Configuration | 542 B | — |
| src/khtst/nlg/decodificador_especulativo.py | Configuration | 9.2 KB | — |
| src/khtst/nlg/unidade_nlg.py | Configuration | 5.4 KB | — |
| src/khtst/nlp/__init__.py | Configuration | 255 B | — |
| src/khtst/nlp/unidade_nlp.py | Configuration | 5.2 KB | — |
| src/khtst/nucleo/__init__.py | Configuration | — | |
| src/khtst/nucleo/modelo.py | Configuration | 30.7 KB | — |
| src/khtst/percepcao/__init__.py | Configuration | — | |
| src/khtst/percepcao/atencao.py | Configuration | 15.8 KB | — |
| src/khtst/percepcao/atencao_moe.py | Configuration | 5.2 KB | — |
| src/khtst/percepcao/audio.py | Configuration | 3.9 KB | — |
| src/khtst/percepcao/blocos.py | Configuration | 4.8 KB | — |
| src/khtst/percepcao/escalacao.py | Configuration | 4.4 KB | — |
| src/khtst/percepcao/fusao.py | Configuration | 2.8 KB | — |
| src/khtst/percepcao/imagem.py | Configuration | 2.0 KB | — |
| src/khtst/percepcao/microunidades.py | Configuration | 29.8 KB | — |
| src/khtst/percepcao/moe.py | Configuration | 26.6 KB | — |
| src/khtst/percepcao/ortogonais.py | Configuration | 4.5 KB | — |
| src/khtst/percepcao/roteador_ssom.py | Configuration | 8.8 KB | — |
| src/khtst/percepcao/video.py | Configuration | 4.8 KB | — |
| src/khtst/percepcao/vit_lra.py | Configuration | 17.8 KB | — |
| src/khtst/qualidade/__init__.py | Configuration | 343 B | — |
| src/khtst/qualidade/agente_engenheiro.py | Configuration | 13.5 KB | — |
| src/khtst/quanta/__init__.py | Configuration | — | |
| src/khtst/quanta/quantizacao.py | Configuration | 20.8 KB | — |
| src/khtst/raciocinio/__init__.py | Configuration | — | |
| src/khtst/raciocinio/ciclo.py | Configuration | 7.2 KB | — |
| src/khtst/raciocinio/ferramentas.py | Configuration | 4.0 KB | — |
| src/khtst/servico/__init__.py | Configuration | 296 B | — |
| src/khtst/servico/adhoc.py | Configuration | 11.6 KB | — |
| src/khtst/telemetria/__init__.py | Configuration | — | |
| src/khtst/telemetria/gestor_memoria.py | Configuration | 7.9 KB | — |
| src/khtst/telemetria/hub.py | Configuration | 5.3 KB | — |
| src/khtst/telemetria/indicadores.py | Configuration | 2.6 KB | — |
| src/khtst/treino/__init__.py | Configuration | — | |
| src/khtst/treino/cirurgia_grad.py | Configuration | 2.2 KB | — |
| src/khtst/treino/confianca.py | Configuration | 7.3 KB | — |
| src/khtst/treino/dpo.py | Configuration | 3.3 KB | — |
| src/khtst/treino/duas_fases.py | Configuration | 2.8 KB | — |
| src/khtst/treino/estado_integral.py | Configuration | 13.8 KB | — |
| src/khtst/treino/mtp.py | Configuration | 4.9 KB | — |
| src/khtst/treino/perdas.py | Configuration | 913 B | — |
| src/khtst/treino/prs_v8.py | Configuration | 6.7 KB | — |
| src/khtst/treino/punicao.py | Configuration | 5.9 KB | — |
| src/khtst/treino/rpp.py | Configuration | 5.1 KB | — |
| src/khtst/treino/treinador.py | Configuration | 58.7 KB | — |
| tempo_treino_acumulado.json | Configuration | 134 B | — |
| teste_item_b_v9.json | Configuration | 1.7 KB | — |
| tests/test_khtst.py | Configuration | 8.4 KB | — |
| tests/test_khtst_v2.py | Configuration | 13.0 KB | — |
| tests/test_khtst_v3.py | Configuration | 14.6 KB | — |
| tests/test_khtst_v4.py | Configuration | 12.3 KB | — |
| tests/test_khtst_v5.py | Configuration | 12.1 KB | — |
| tests/test_khtst_v6.py | Configuration | 13.1 KB | — |
| tests/test_khtst_v7.py | Configuration | 11.5 KB | — |
| tests/test_khtst_v9.py | Configuration | 9.4 KB | — |
| LICENSE | Documentation | 1.1 KB | — |
| README.md | Documentation | 9.3 KB | — |
| docs/matematica/00-fundamentos-e-notacao.md | Documentation | 5.3 KB | — |
| docs/matematica/01-som-kohonen-clasico.md | Documentation | 5.3 KB | — |
| docs/matematica/02-growing-grid-e-gcs.md | Documentation | 5.0 KB | — |
| docs/matematica/03-gsom.md | Documentation | 3.7 KB | — |
| docs/matematica/04-hierarchical-som.md | Documentation | 3.2 KB | — |
| docs/matematica/05-tkm-rsom.md | Documentation | 3.4 KB | — |
| docs/matematica/06-cpn-ssom.md | Documentation | 3.8 KB | — |
| docs/matematica/07-atencao-mista-kvcache.md | Documentation | 3.5 KB | — |
| docs/matematica/08-quantizacao-w8a8.md | Documentation | 6.8 KB | — |
| docs/matematica/09-ortogonais-cooperativas-punicao-telemetria-pdca.md | Documentation | 7.0 KB | — |
| docs/matematica/10-moe-foco-denso-som-v2.md | Documentation | 16.5 KB | — |
| docs/matematica/11-composicao-microunidades-v3.md | Documentation | 22.1 KB | — |
| docs/matematica/12-escalacao-computo-e-composicao-otima-v4.md | Documentation | 6.8 KB | — |
| docs/matematica/13-janela-contexto-1m-indexada.md | Documentation | 4.3 KB | — |
| docs/matematica/14-medusa-arvore-especulativa.md | Documentation | 4.3 KB | — |
| docs/matematica/15-nlp-nlg-duas-fases.md | Documentation | 5.2 KB | — |
| docs/matematica/16-atencao-entre-moes-e-som-v5.md | Documentation | 7.0 KB | — |
| docs/matematica/17-difusao-multimodal-v5.md | Documentation | 3.3 KB | — |
| docs/matematica/18-roteamento-ssom-rpp-metricas-v6.md | Documentation | 11.0 KB | — |
| docs/matematica/19-khtst-v8-melhorias.md | Documentation | 15.1 KB | — |
| docs/matematica/20-khtst-v9-autorregulacao.md | Documentation | 10.5 KB | — |
| graficos/graf_alinhamento.png | Other | 37.9 KB | — |
| graficos/graf_curva_perda.png | Other | 55.0 KB | — |
| graficos/graf_perdas_tarefa.png | Other | 54.7 KB | — |
| graficos/graf_ppl_lm.png | Other | 51.9 KB | — |
| graficos/graf_ram.png | Other | 182.6 KB | a7d1718e5c10 |
| graficos/graf_som_roteador.png | Other | 69.1 KB | — |
| requirements.txt | Other | 279 B | — |
| src/khtst/acelerado/nucleos.c | Other | 1.3 MB | — |
| src/khtst/acelerado/nucleos.cpython-312-x86_64-linux-gnu.so | Other | 1.3 MB | 9bc83dceec2d |
| src/khtst/acelerado/nucleos.pyx | Other | 3.5 KB | — |
| test_khtst_v6_pos_treino.txt | Other | 3.4 KB | — |
| test_khtst_v7_pos_treino.txt | Other | 3.4 KB | — |
| test_khtst_v9_pos_treino.txt | Other | 1.5 KB | — |
| .gitattributes | Repository | 1.7 KB | — |
License and Download
- License
- mit
- Access
- Open weights, no gate
Released by Anderson through its official repository on Hugging Face. Read the license.
Questions About khtst-multimodal-ptbr
Can I use khtst-multimodal-ptbr commercially?
Yes. khtst-multimodal-ptbr is released under MIT License. The MIT License is a short permissive license. It permits commercial use, modification and redistribution, provided the copyright notice and permission notice are included.