PAMPAr-o1 Logo

🐰 PAMPAr-o1 v9

Cerebral Language Model with Territorial Architecture

License: AGPL-3.0-or-later Python PyTorch DOI

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

πŸ—οΈ Architecture

Architecture EN

Arquitectura ES

Territorial architecture with LLAVES routing

πŸ“Š Benchmarks

Benchmark EN

Benchmark ES

14M params vs LSTM, Transformer-XL, GPT-2

πŸ“ Research Paper

arXiv Paper

Brain-Inspired Territorial Architecture for Language Modeling


🎯 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"

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support