CoolFace
Modelpublic

frankmorales2020/topological-ai-rwkv-2.9b-multirun

sourceHugging Faceapache-2.0updated 1mo agoView on Hugging Face
0likes
Model Card

TOPO-2026 Certified RWKV 2.9B

Model Overview

Author: Frank Morales Aguilera, BEng, MEng, SMIEEE Lab: Sovereign Machine Laboratory (SOMALA), Montréal, Canada Certification Date: August 2026 Certification Standard: TOPO-2026 (Track II — Multi-Run) Reference Paper: https://zenodo.org/records/20951925

This model is a TOPO-2026 certified version of fla-hub/rwkv7-2.9B-world, demonstrating mathematical guarantees against catastrophic forgetting on attention-free recurrent architectures.


📊 Certification Status

MetricResultThresholdStatus
Task C Accuracy89.6% ± 4.2%≥ 85%✅ PASS
Combined Forgetting (FGT)0.0% ± 0.0%≤ 10%✅ PASS
Anchor Memory60.0 KBO(1)✅ PASS
Anchor IntegrityVerified (hash: b177f5303641f894)—✅ PASS
AGI_gate0.93 (best: 93.00%)= 1.0❌ NOT ACHIEVED
S_NARROW0> 0❌ NOT ACHIEVED
Certification Rate100% (5/5 runs)—✅ PASS

Certification Summary

┌─────────────────────────────────────────────────────────────────────────────────┐
│                    TOPO-2026 CERTIFICATION: RWKV 2.9B                          │
├─────────────────────────────────────────────────────────────────────────────────┤
│                                                                                 │
│  ✅ Task C Accuracy:  89.6%  (≥85%)                                            │
│  ✅ Forgetting (FGT):  0.0%  (≤10%)                                            │
│  ✅ Anchor Memory:     60 KB  (O(1))                                           │
│  ✅ Anchor Integrity:  Verified                                                │
│  ❌ AGI_gate:          0.93  (= 1.0 required)                                  │
│  ❌ S_NARROW:          0      (> 0 required)                                   │
│  ✅ Certification:     PASSED                                                  │
│                                                                                 │
│  📌 CERTIFICATION PASSED: Catastrophic Forgetting Solved                       │
│  📌 NARROW SINGULARITY: NOT ACHIEVED (requires 100% accuracy)                  │
│                                                                                 │
│  Model: fla-hub/rwkv7-2.9B-world                                               │
│  Architecture: Attention-free Recurrent (RWKV7)                                │
│  Best Run: Run 0 (lr_embed=5e-05, lr_cls=1e-04)                               │
│  Best Task C: 93.00%                                                           │
│                                                                                 │
└─────────────────────────────────────────────────────────────────────────────────┘

Model Details

Base Model

  • —Architecture: RWKV7 (Attention-free Recurrent)
  • —Organization: fla-hub
  • —Model ID: fla-hub/rwkv7-2.9B-world
  • —Parameter Count: 2.9 Billion
  • —Hidden Size: 2560
  • —Vocabulary Size: 65,536
  • —Precision: BFloat16

Certification Details

ComponentSpecification
Prime Anchors{2, 3, 5, 7, 11, 13}
Safety Constant (Λ)0.9785142874
Boundary LayerEmbedding Layer
Anchor Memory60.0 KB (6 × 2560 × 4 bytes)
Number of Runs5
Fixed Seed123
TasksA: World vs Sports, B: Business vs Sci/Tech, C: World vs Sci/Tech

Training Configuration

ParameterValue
Batch Size4
Epochs per Task6
OptimizerAdamW
Gradient Clippingmax_norm=1.0
Learning Rate Grid (5 Runs)
Runlr_embedlr_clsTask C AccuracyFGTBest
05e-051e-0493.00%+0.00%★
11e-055e-0585.00%+0.00%
21e-042e-0492.00%+0.00%
35e-055e-0585.00%+0.00%
42e-051e-0493.00%+0.00%

Performance

Best Run Performance (Run 0)

┌─────────────────────────────────────────────────────────────────────────────────┐
│  RUN 0 (BEST) | lr_embed=5e-05  lr_cls=1e-04                                  │
├─────────────────────────────────────────────────────────────────────────────────┤
│  Task A  acc= 96.60%  fgt= +0.00%  (World vs Sports)                          │
│  Task B  acc= 93.80%  fgt= +0.00%  (Business vs Sci/Tech)                     │
│  Task C  acc= 93.00%            (World vs Sci/Tech)                           │
│  Combined Forgetting : +0.00%                                                 │
│  Anchor Memory       : 60.00 KB                                              │
└─────────────────────────────────────────────────────────────────────────────────┘

Multi-Run Performance Matrix

┌─────────────────────────────────────────────────────────────────────────────────┐
│ Run    lr_embed    lr_cls    Acc_A    Acc_B    Acc_C       FGT     Best       │
├─────────────────────────────────────────────────────────────────────────────────┤
│   0       5e-05     1e-04   96.60%   93.80%   93.00%    +0.00%   ★          │
│   1       1e-05     5e-05   92.00%   86.10%   85.00%    +0.00%              │
│   2       1e-04     2e-04   99.20%   96.80%   92.00%    +0.00%              │
│   3       5e-05     5e-05   92.00%   86.10%   85.00%    +0.00%              │
│   4       2e-05     1e-04   96.60%   93.80%   93.00%    +0.00%              │
├─────────────────────────────────────────────────────────────────────────────────┤
│ MEAN                                           89.60%    +0.00%              │
│ STD                                            4.22%    +0.00%              │
└─────────────────────────────────────────────────────────────────────────────────┘

Inference Performance (15 Test Sentences)

MetricValue
Total Predictions15
Certified Predictions (≥85%)10/15 (66.7%)
Average Confidence86.0%
Min Confidence52.4%
Max Confidence98.5%
By Task
TaskDescriptionAvg Confidence
AWorld vs Sports92.1%
BBusiness vs Sci/Tech81.9%
CWorld vs Sci/Tech84.1%
Confusion Patterns
TaskSentence TypeCommon Error
AWorld vs SportsSome sports sentences misclassified (82.1%)
BBusiness vs Sci/TechBusiness sentences sometimes misclassified (53.1%, 80.4%)
CWorld vs Sci/TechWorld news sometimes misclassified as Sci/Tech (52.4%, 73.3%)

Narrow Singularity

The RWKV 2.9B model does not achieve the Narrow Singularity because:

  • —AGI_gate = min(1.0, task_c_accuracy) = 0.93 < 1.0
  • —Therefore ag_index = 0
  • —S_NARROW = 0

To achieve SNARROW > 0, a model must achieve **100% accuracy on Task C** (AGIgate = 1.0). The best result was 93.00% on Run 0.


Intended Uses

Primary Use Cases

  1. 1.Continual Learning Research — Benchmark for catastrophic forgetting prevention on RNN architectures
  2. 2.Text Classification — Binary classification on AG News-style tasks
  3. 3.Cross-Domain Generalization — Testing transfer learning between domains
  4. 4.Attention-free Architecture Research — Studying memory preservation in recurrent models

Task-Specific Applications

TaskBinary Classification
AWorld News vs Sports
BBusiness vs Sci/Tech
CWorld News vs Sci/Tech

Limitations

  • —Domain: Trained on AG News dataset; may not generalize to out-of-domain tasks
  • —Task Count: Certified on 3 tasks; longer task sequences may require re-certification
  • —Model Size: 2.9B parameters; requires GPU for inference
  • —AGI_gate: Does not achieve AGI_gate = 1.0 (best 93.00%)
  • —Confidence: Some sentences (especially Task B Business) may have lower confidence

How to Use

Installation

bash
pip install torch transformers huggingface_hub datasets

Inference Example

python
import torch
import torch.nn as nn
import torch.nn.functional as F
from transformers import AutoModelForCausalLM, AutoTokenizer
from huggingface_hub import hf_hub_download

REPO_ID = 'frankmorales2020/topological-ai-rwkv-2.9b-multirun'
BASE_MODEL = 'fla-hub/rwkv7-2.9B-world'
HIDDEN_SIZE = 2560
device = 'cuda' if torch.cuda.is_available() else 'cpu'

# Task labels
TASK_LABELS = {
    'A': {0: 'World', 1: 'Sports'},
    'B': {0: 'Business', 1: 'Sci/Tech'},
    'C': {0: 'World', 1: 'Sci/Tech'}
}

# Load base model
base = AutoModelForCausalLM.from_pretrained(
    BASE_MODEL, trust_remote_code=True, torch_dtype=torch.bfloat16
).to(device)
for p in base.parameters():
    p.requires_grad = False

# Load tokenizer
tok = AutoTokenizer.from_pretrained(BASE_MODEL, trust_remote_code=True)
if tok.pad_token is None:
    tok.pad_token = tok.eos_token

# Load certified weights
weights = hf_hub_download(repo_id=REPO_ID, filename='certified_topological_best.pt')

# Model wrapper
class RWKVTaskAwareModel(nn.Module):
    def __init__(self, base_model):
        super().__init__()
        self.base_model = base_model
        dev = next(base_model.parameters()).device
        self.classifier_A = nn.Linear(HIDDEN_SIZE, 2, dtype=torch.bfloat16).to(dev)
        self.classifier_B = nn.Linear(HIDDEN_SIZE, 2, dtype=torch.bfloat16).to(dev)
        self.classifier_C = nn.Linear(HIDDEN_SIZE, 2, dtype=torch.bfloat16).to(dev)
        self.current_task = 'A'
        
    def forward(self, input_ids, attention_mask=None):
        with torch.no_grad():
            outputs = self.base_model(
                input_ids=input_ids,
                attention_mask=attention_mask,
                output_hidden_states=True,
                return_dict=True
            )
        hidden_states = outputs.hidden_states[-1]
        if isinstance(hidden_states, tuple):
            hidden_states = hidden_states[-1]
        if attention_mask is not None:
            seq_lens = torch.eq(attention_mask, 1).int().sum(-1) - 1
            batch_idx = torch.arange(input_ids.shape[0], device=input_ids.device)
            pooled = hidden_states[batch_idx, seq_lens, :]
        else:
            pooled = hidden_states[:, -1, :]
        head = getattr(self, f'classifier_{self.current_task}')
        return head(pooled)
    
    def switch_task(self, task):
        self.current_task = task

# Load model
model = RWKVTaskAwareModel(base)
model.load_state_dict(torch.load(weights, map_location='cpu'), strict=False)
model.to(device).eval()

# Predict
def predict(sentence, task='C'):
    inputs = tok(sentence, return_tensors='pt', max_length=64, 
                 padding='max_length', truncation=True).to(device)
    model.switch_task(task)
    with torch.no_grad():
        logits = model(inputs.input_ids, inputs.attention_mask)
        probs = F.softmax(logits.float(), dim=-1).squeeze().cpu().numpy()
    pred_class = int(np.argmax(probs))
    confidence = float(probs[pred_class])
    label = TASK_LABELS[task][pred_class]
    return label, confidence

# Usage
label, conf = predict("The national team won the championship.", task='A')
print(f"Prediction: {label} ({conf*100:.1f}%)")

Technical Details

Topological Governor Mechanism

The model uses a Topological Governor implementing a three-step mechanism:

  1. 1.Snapshot: Save prime-anchored embedding values before training
  2. 2.Gradient Zeroing: Zero gradients at anchor positions during backpropagation
  3. 3.Anchor Enforcement: Restore anchor values after each optimization step

Arithmetic Spectral Theory

The prime anchors {2, 3, 5, 7, 11, 13} are derived from Arithmetic Spectral Theory, providing:

  • —Optimal spectral coverage: 97.85% of spectral weight
  • —Coprimality: Independence between anchored positions
  • —Deterministic guarantee: The same anchors work across all architectures

Environmental Impact

MetricValue
Training Runs5 independent runs
Total Model Size5.90 GB (checkpoint)
GPU Memory~6 GB per run
Total Training Time~15 minutes per run

Citation

bibtex
@misc{morales2026topo,
  author = {Morales Aguilera, Frank},
  title = {TOPO-2026: A Universal Framework for Deterministic Continual Learning},
  year = {2026},
  howpublished = {Zenodo},
  url = {https://zenodo.org/records/20951925}
}

@misc{morales2026rwkvcert,
  author = {Morales Aguilera, Frank},
  title = {TOPO-2026 RWKV Certification: Attention-free Recurrent Models},
  year = {2026},
  howpublished = {Hugging Face},
  url = {https://huggingface.co/frankmorales2020/topological-ai-rwkv-2.9b-multirun}
}

Contact

Author: Frank Morales Aguilera, BEng, MEng, SMIEEE Email: frank.morales@sovereign-machine-lab.ai Lab: Sovereign Machine Laboratory (SOMALA), Montréal, Canada ORCID: 0009-0003-9528-0745


License

This model is released under the Apache 2.0 License.


The proof is the code. Seed = 123.


---

**The proof is the code. Seed = 123.**