π° PAMPAr-o1 v9
Cerebral Language Model with Territorial Architecture
EspaΓ±ol | Technical Paper | Architecture | Benchmarks | Academia.edu
π€ For Recruiters / Employers
TL;DR: This is an original AI architecture developed from scratch by a self-taught developer, achieving results competitive with published research while using minimal resources.
| What This Demonstrates |
|---|
| β Independent Research β Novel architecture designed without academic supervision |
| β Full-Stack ML β Data processing, model design, training infrastructure, evaluation |
| β Resource Optimization β 14M params trained on 4GB VRAM consumer GPU |
| β Documentation β Technical papers, diagrams, reproducible code |
| β Software Engineering β Clean Python, modular design, tests, CI-ready |
Key Achievement: Outperforms LSTM (24M params) and Transformer-XL Small (24M params) with 42% fewer parameters.
π Highlights
β οΈ Experimental Research: This is a work-in-progress exploring brain-inspired architectures. Results are preliminary and require further validation.
| 14M Parameters |
~45 Perplexity* |
250M+ Tokens trained |
4GB VRAM (GTX 1650) |
*Single run on WikiText-103. See limitations for caveats.
Experimental architecture that shows promising results compared to LSTM and Transformer-XL (24M params) with 42% fewer parameters.
Trained entirely on consumer hardware β no cloud, no A100s.
π Documentation
π― What is PampaR?
"PampaR is an artificial brain where the thalamus orchestrates tokens toward specialized territories (Expressive, Contextual, Formal, Structural) that collaborate via bidirectional frontiers, combining explicit rules (LLAVES 70%) with learned attention (30%) to generate language."
PAMPAr-o1 v9 reimagines neural language models through a brain-inspired territorial architecture. Instead of uniform transformer layers, it uses 4 specialized territories connected by 6 bidirectional frontiers, coordinated by a central tΓ‘lamo (thalamus) that routes tokens using hybrid rule-based + learned attention.
π§ Architecture v9 β Territorial
Input β Embedding β [BloqueTerrritorial ΓN] β LM Head β Output
β
TΓ‘lamo (LLAVES 70% + AtenciΓ³n 30%)
β
βββββββββββββββββββββββ΄ββββββββββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββ βββββββββββββββββ
β EXPRESIVO ββββββββ Frontera βββββββΊβ CONTEXTUAL β
β Lang + Creat β β Contexto β
βββββββββ¬ββββββββ βββββββββ¬ββββββββ
β β
βββββββββ Fronteras Bidirec βββββββββββββΊβ
β β
βββββββββΌββββββββ βββββββββΌββββββββ
β FORMAL ββββββββ Frontera βββββββΊβ ESTRUCTURAL β
β LΓ³gica β β PatrΓ³n + Mat β
βββββββββββββββββ βββββββββββββββββ
β
Axiomas (reasoning)
4 Territories
| Territory | Modules | Function |
|---|---|---|
| Expresivo | Lenguaje + Creatividad | Fluent text generation, novel ideas |
| Contextual | Contexto | Working memory, coherence |
| Formal | LΓ³gica | Logical reasoning, rules |
| Estructural | Patrones + MatemΓ‘ticas | Sequences, numbers, patterns |
6 Bidirectional Frontiers
All territories connect to each other through learned bidirectional gates:
- Expresivo β Contextual (0.8 strength)
- Expresivo β Formal (0.5 strength)
- Expresivo β Estructural (0.4 strength)
- Contextual β Formal (0.6 strength)
- Contextual β Estructural (0.5 strength)
- Formal β Estructural (0.7 strength)
TΓ‘lamo β The Orchestrator
The tΓ‘lamo routes tokens using a hybrid system:
- 70% LLAVES (explicit rules): Pattern matching for known token types
- 30% Learned attention: Neural network for novel patterns
This provides interpretability (you can inspect which territory processes each token) while maintaining flexibility (the model learns to route unknown patterns).
π Performance
Trained on WikiText-103 with 14M parameters on a GTX 1650 4GB:
| Metric | Value |
|---|---|
| Parameters | 14,069,410 |
| Best Loss | 3.81 |
| Perplexity | ~45.3 |
| Training Tokens | 250M+ |
| Training Time | ~70 hours |
| Hardware | GTX 1650 4GB VRAM |
Comparison with Other Models (WikiText-103)
| Model | Parameters | Perplexity | Notes |
|---|---|---|---|
| LSTM (Merity et al.) | 24M | 69.1 | AWD-LSTM, 2018 |
| Transformer-XL (Small) | 24M | 54.5 | Recurrent memory, 2019 |
| PAMPAr-o1 v9 | 14M | ~45* | Territorial arch., 2026 |
| GPT-2 Small | 125M | 35.1 | Standard Transformer, 2019 |
*Single training run. Comparison has limitations β see Technical Paper.
Preliminary observations:
- β οΈ PampaR shows promising efficiency with 42% fewer parameters than comparable baselines
- β οΈ Results require validation with multiple runs and additional datasets
- β Trained entirely on consumer hardware (4GB VRAM)
β οΈ Limitations {#limitations}
This is experimental research with important caveats:
- Single dataset: Only evaluated on WikiText-103
- Single run: No confidence intervals or statistical analysis
- Limited baselines: Comparison with 2018-2019 models only
- No ablations: Individual component contributions not isolated
- No downstream tasks: Only perplexity evaluation, no GLUE/reasoning benchmarks
- Interpretability claims: Qualitative only, not formally validated
See the full limitations section in the technical paper.
π Quick Start
Installation
# Clone the repo
git clone https://github.com/lucasmella-stack/PAMPAr-o1.git
cd PAMPAr-o1
# Install dependencies
pip install -r requirements.txt
# Download training data (WikiText-103)
python scripts/download_corpus.py
Training
# Basic training
python scripts/train.py --tokens 10M --epochs 5
# Full training (50M tokens, ~70 hours on GTX 1650)
python scripts/train.py --tokens 50M --epochs 10 --batch-size 4 --accum 8
# Resume from checkpoint
python scripts/train.py --resume
Inference
import torch
from pampar.cerebro import PampaR
from pampar.config import LOCAL_4GB
import sentencepiece as sp
# Load tokenizer and model
tok = sp.SentencePieceProcessor()
tok.Load('data/tokenizer/llarri_bpe.model')
model = PampaR(LOCAL_4GB).cuda()
ckpt = torch.load('checkpoints/pampar_best.pt', weights_only=False)
model.load_state_dict(ckpt['model'])
model.eval()
# Generate
prompt = "The history of"
ids = tok.Encode(prompt)
x = torch.tensor([ids]).cuda()
with torch.no_grad():
for _ in range(50):
out = model(x)
logits = out['logits']
next_id = logits[0, -1].argmax().item()
x = torch.cat([x, torch.tensor([[next_id]]).cuda()], dim=1)
print(tok.Decode(x[0].tolist()))
π Model Configurations
PampaR scales from 4GB to 80GB+ VRAM:
| Config | VRAM | Params | Dim | Layers | Heads |
|---|---|---|---|---|---|
| LOCAL_4GB | 4GB | ~7M | 128 | 3 | 4 |
| LOCAL_4GB_MAX | 4GB | ~14M | 160 | 4 | 4 |
| SERVER_8GB | 8GB | ~25M | 256 | 4 | 8 |
| SERVER_24GB | 24GB | ~100M | 512 | 6 | 8 |
| SERVER_80GB | 80GB | ~300M | 768 | 8 | 12 |
ποΈ Architecture v9
Input β Embedding β [BloqueTerrritorial ΓN] β Axiomas β LM Head β Output
β
TΓ‘lamoTerritorial
(LLAVES 70% + AtenciΓ³n 30%)
β
ββββββββββββββββββββ΄βββββββββββββββββββ
βΌ βΌ
βββββββββββββββ βββββββββββββββ
β EXPRESIVO ββββββ Frontera βββββββΊβ CONTEXTUAL β
β Lang+Creat β β Contexto β
ββββββββ¬βββββββ ββββββββ¬βββββββ
ββββββββ Fronteras Bidirec ββββββββββΊβ
ββββββββΌβββββββ ββββββββΌβββββββ
β FORMAL ββββββ Frontera βββββββΊβESTRUCTURAL β
β LΓ³gica β β PatrΓ³n+Mat β
βββββββββββββββ βββββββββββββββ
π Project Structure
pampar/
βββ __init__.py # Main exports
βββ config.py # ConfigPampaR + presets
βββ cerebro/
βββ model.py # Re-exports from model_v9.py
βββ model_v9.py # PampaR main class, BloqueTerrritorial
βββ talamo.py # TalamoTerritorial with LLAVES
βββ territorio.py # 4 Territories + GestorTerritorios
βββ frontera.py # 6 Bidirectional Frontiers
βββ neurona.py # Base neuron class
βββ modulos/ # 6 specialized neurons
β βββ especializados.py
βββ razonamiento/ # Axiomas engine
β βββ axiomas.py
βββ memoria/ # Experience memory
scripts/
βββ train.py # Training script
βββ chat.py # Interactive inference
βββ test_v9.py # Test v9 architecture
βββ server.py # API server
βββ download_corpus.py # Download WikiText-103
diagrams/
βββ v9-territorial/
βββ arquitectura_v9.txt
βββ PampaR_v9_Arquitectura_Territorial.pdf
βββ PampaR_v9_Benchmarks_Comparacion.pdf
π¬ Innovations
1. Hybrid Routing (LLAVES + Attention)
Unlike pure neural routers (MoE), PampaR uses 70% explicit rules for known patterns + 30% learned routing for novel inputs. This provides interpretability while maintaining flexibility.
2. Territorial Processing
Instead of 18 pairwise synaptic connections (O(nΒ²)), v9 uses 4 territories with 6 bidirectional frontiers. Modules within a territory share a buffer, reducing communication overhead.
3. Bidirectional Frontiers
Frontiers are NOT unidirectional. Information flows both ways with learned gates, mimicking biological inter-cortical connections.
4. Deductive Reasoning (Axiomas)
Built-in logical reasoning with modus ponens, syllogism, and other deductive rules. The model can explain its reasoning chain.
π§ Requirements
- Python 3.10+
- PyTorch 2.0+
- CUDA 11.8+ (for GPU)
- 4GB+ VRAM (minimum)
π License
AGPL-3.0-or-later β See LICENSE for details.
Note: This is copyleft. If you modify and distribute PampaR, you must also release your source code under AGPL.
π Citation
@software{pampar_v9,
author = {Mella Chillemi, Lucas Ricardo},
title = {PampaR: Cerebral Language Model with Territorial Architecture},
year = {2026},
version = {9.0.0},
organization = {Independent Researcher},
url = {https://github.com/lucasmella-stack/PAMPAr-o1},
note = {14M parameters, PPL ~45 on WikiText-103, trained on GTX 1650 4GB}
}
π€ Author
- Lucas Ricardo Mella Chillemi β Architecture & Development
Made with β€οΈ in Argentina π¦π·
"An artificial brain where territories collaborate through frontiers"