frankmorales2020/topological-ai-lfm-1.2b-multirun
TOPO-2026 Certified LFM2-1.2B
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 LiquidAI/LFM2-1.2B, demonstrating mathematical guarantees against catastrophic forgetting through prime-anchored embedding invariants.
📊 Certification Status
Certification Summary
┌─────────────────────────────────────────────────────────────────────────────────┐
│ TOPO-2026 CERTIFICATION: LFM2-1.2B │
├─────────────────────────────────────────────────────────────────────────────────┤
│ │
│ ✅ Task C Accuracy: 90.0% (≥85%) │
│ ✅ Forgetting (FGT): 0.3% (≤10%) │
│ ✅ Anchor Memory: 48 KB (O(1)) │
│ ✅ Anchor Integrity: Verified │
│ ❌ AGI_gate: 0.935 (= 1.0 required) │
│ ❌ S_NARROW: 0 (> 0 required) │
│ ✅ Certification: PASSED │
│ │
│ 📌 CERTIFICATION PASSED: Catastrophic Forgetting Solved │
│ 📌 NARROW SINGULARITY: NOT ACHIEVED (requires 100% accuracy) │
│ │
│ Model: LiquidAI/LFM2-1.2B │
│ Best Run: Run 0 (lr_embed=5e-04, lr_cls=1e-03) │
│ Best Task C: 93.50% │
│ │
└─────────────────────────────────────────────────────────────────────────────────┘Model Details
Base Model
- Architecture: Liquid Foundation Model (LFM2)
- Organization: Liquid AI
- Model ID:
LiquidAI/LFM2-1.2B - Parameter Count: 1.2 Billion
- Hidden Size: 2048
- Vocabulary Size: 65,536
- Precision: BFloat16
Certification Details
Training Configuration
Learning Rate Grid (5 Runs)
Performance
TOPO-2026 Certification Results
Best Run Performance (Run 0)
┌─────────────────────────────────────────────────────────────────────────────────┐
│ RUN 0 (BEST) | lr_embed=5e-04 lr_cls=1e-03 │
├─────────────────────────────────────────────────────────────────────────────────┤
│ Task A acc=100.00% fgt= +0.00% (World vs Sports) │
│ Task B acc= 99.90% fgt= +0.00% (Business vs Sci/Tech) │
│ Task C acc= 93.50% (World vs Sci/Tech) │
│ Combined Forgetting : +0.00% │
│ Anchor Memory : 48.00 KB │
└─────────────────────────────────────────────────────────────────────────────────┘Multi-Run Performance Matrix
┌─────────────────────────────────────────────────────────────────────────────────┐
│ Run lr_embed lr_cls Acc_A Acc_B Acc_C FGT Best │
├─────────────────────────────────────────────────────────────────────────────────┤
│ 0 5e-04 1e-03 100.00% 99.90% 93.50% +0.00% ★ │
│ 1 1e-04 5e-04 100.00% 100.00% 86.00% +0.00% │
│ 2 1e-03 2e-03 98.20% 99.40% 90.50% +1.15% │
│ 3 5e-04 5e-04 99.60% 99.90% 90.50% +0.20% │
│ 4 2e-04 1e-03 100.00% 100.00% 89.50% +0.00% │
├─────────────────────────────────────────────────────────────────────────────────┤
│ MEAN 90.00% +0.27% │
│ STD 2.69% +0.50% │
└─────────────────────────────────────────────────────────────────────────────────┘Inference Confidence (9 Test Sentences)
🔬 Narrow Singularity
The LFM2-1.2B model does not achieve the Narrow Singularity because:
AGI_gate = min(1.0, task_c_accuracy) = 0.935 < 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.50% on Run 0.
Comparison with Gemma-4-E4B-Vision
Note: Gemma-4-E4B-Vision was the first model to achieve S_NARROW > 0 [14]. The LFM2-1.2B model demonstrates TOPO-2026 certification for catastrophic forgetting prevention on the Liquid Foundation Models architecture.
Intended Uses
Primary Use Cases
- Continual Learning Research — Benchmark for catastrophic forgetting prevention
- Text Classification — Binary classification on AG News-style tasks
- Cross-Domain Generalization — Testing transfer learning between domains
- AI Safety Research — Studying deterministic memory preservation
Task-Specific Applications
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: 1.2B parameters; requires GPU for inference
- AGI_gate: Does not achieve AGI_gate = 1.0 (best 93.50%)
How to Use
Installation
pip install torch transformers huggingface_hubInference Example
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
# Configuration
REPO_ID = 'frankmorales2020/topological-ai-lfm-1.2b-multirun'
BASE_MODEL = 'LiquidAI/LFM2-1.2B'
HIDDEN_SIZE = 2048
TASK_LABELS = {
'A': {0: 'World', 1: 'Sports'},
'B': {0: 'Business', 1: 'Sci/Tech'},
'C': {0: 'World', 1: 'Sci/Tech'}
}
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
# Model wrapper (matches training architecture)
class LFMTaskAwareModel(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):
outputs = self.base_model(
input_ids=input_ids,
attention_mask=attention_mask,
output_hidden_states=True
)
hidden_states = outputs.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)
last_hidden = hidden_states[batch_idx, seq_lens, :]
else:
last_hidden = hidden_states[:, -1, :]
head = getattr(self, f'classifier_{self.current_task}')
return head(last_hidden)
def switch_task(self, task):
self.current_task = task
# Load model
def load_certified_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
tok = AutoTokenizer.from_pretrained(BASE_MODEL, trust_remote_code=True)
if tok.pad_token is None:
tok.pad_token = tok.eos_token
model = LFMTaskAwareModel(base)
weights_path = hf_hub_download(
repo_id=REPO_ID,
filename='certified_topological_best.pt'
)
model.load_state_dict(torch.load(weights_path, map_location='cpu'), strict=False)
model.to(device).eval()
return model, tok
# Predict
def predict(sentence, task='C'):
model, tokenizer = load_certified_model()
inputs = tokenizer(
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(probs.argmax())
confidence = float(probs[pred_class])
label = TASK_LABELS[task][pred_class]
return {
'task': task,
'prediction': label,
'confidence': confidence,
'certified': confidence >= 0.85
}
# Usage
result = predict("The national team won the championship.", task='A')
print(f"{result['prediction']} ({result['confidence']*100:.1f}%)")Technical Details
Topological Governor Mechanism
The model uses a Topological Governor implementing a three-step mechanism:
- Snapshot: Save prime-anchored embedding values before training
- Gradient Zeroing: Zero gradients at anchor positions during backpropagation
- Anchor Enforcement: Restore anchor values after each optimization step
This provides a mathematical guarantee of memory preservation with O(1) memory overhead.
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
Narrow Singularity
The LFM2-1.2B model does not achieve the Narrow Singularity because AGI_gate < 1.0.
To achieve S_NARROW > 0, a model must achieve:
AGI_gate = 1.0(100% accuracy on Task C)ag_index = 1
The best Task C accuracy was 93.50%, so S_NARROW = 0.
Environmental Impact
Citation
@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{morales2026lfmcert,
author = {Morales Aguilera, Frank},
title = {TOPO-2026 LFM Certification: Liquid Foundation Models},
year = {2026},
howpublished = {Hugging Face},
url = {https://huggingface.co/frankmorales2020/topological-ai-lfm-1.2b-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.
---
## How to Use
1. **Copy the entire markdown content above**
2. **Paste it into your `README.md` file** in the model repository
3. **Save and commit** to Hugging Face
The model card will automatically render on:https://huggingface.co/frankmorales2020/topological-ai-lfm-1.2b-multirun
