BWSK Mamba-130M
Mamba-130M (130M params) trained in 6 variants (3 BWSK modes x 2 experiments) on WikiText-2 with full convergence training and early stopping.
This repo contains all model weights, configs, and training results in a single consolidated repository.
What is BWSK?
BWSK is a framework that classifies every neural network operation as S-type (information-preserving, reversible, coordination-free) or K-type (information-erasing, synchronization point) using combinator logic. This classification enables reversible backpropagation through S-phases to save memory, and CALM-based parallelism analysis.
Model Overview
| Property | Value |
|---|---|
| Base Model | state-spaces/mamba-130m-hf |
| Architecture | Ssm (ssm_lm) |
| Parameters | 130M |
| Dataset | WikiText-2 |
| Eval Metric | Perplexity |
S/K Classification
| Type | Ratio |
|---|---|
| S-type (information-preserving) | 86.0% |
| K-type (information-erasing) | 0.0% |
| Gray (context-dependent) | 14.0% |
Fine-tune Results
| Mode | Final Loss | Val Perplexity | Test Perplexity | Peak Memory | Time | Epochs |
|---|---|---|---|---|---|---|
| Conventional | 2.2904 | 15.75 | 15.30 | 3.0 GB | 11.6m | 3 |
| BWSK Analyzed | 3.0122 | 15.76 | 15.27 | 3.0 GB | 7.7m | 2 |
| BWSK Reversible | 3.0290 | 15.76 | 15.27 | 3.0 GB | 8.0m | 2 |
Memory savings (reversible vs conventional): 0.0%
From Scratch Results
| Mode | Final Loss | Val Perplexity | Test Perplexity | Peak Memory | Time | Epochs |
|---|---|---|---|---|---|---|
| Conventional | 5.5343 | 443.75 | 453.48 | 3.0 GB | 19.6m | 5 |
| BWSK Analyzed | 6.7067 | 627.40 | 643.69 | 3.0 GB | 19.6m | 5 |
| BWSK Reversible | 6.3691 | 648.40 | 666.03 | 3.0 GB | 19.7m | 5 |
Memory savings (reversible vs conventional): 0.0%
Repository Structure
βββ README.md
βββ results.json
βββ finetune-conventional/
β βββ model.safetensors
β βββ config.json
β βββ training_results.json
βββ finetune-bwsk-analyzed/
β βββ model.safetensors
β βββ config.json
β βββ training_results.json
βββ finetune-bwsk-reversible/
β βββ model.safetensors
β βββ config.json
β βββ training_results.json
βββ scratch-conventional/
β βββ model.safetensors
β βββ config.json
β βββ training_results.json
βββ scratch-bwsk-analyzed/
β βββ model.safetensors
β βββ config.json
β βββ training_results.json
βββ scratch-bwsk-reversible/
β βββ model.safetensors
β βββ config.json
β βββ training_results.json
Usage
Load a specific variant:
from transformers import AutoModelForCausalLM, AutoTokenizer
# Load fine-tuned conventional variant
model = AutoModelForCausalLM.from_pretrained(
"tzervas/bwsk-mamba-130m", subfolder="finetune-conventional"
)
tokenizer = AutoTokenizer.from_pretrained(
"tzervas/bwsk-mamba-130m", subfolder="finetune-conventional"
)
# Load from-scratch BWSK reversible variant
model = AutoModelForCausalLM.from_pretrained(
"tzervas/bwsk-mamba-130m", subfolder="scratch-bwsk-reversible"
)
Training Configuration
| Setting | Value |
|---|---|
| Optimizer | AdamW |
| LR (fine-tune) | 3e-05 |
| LR (from-scratch) | 2e-04 |
| LR Schedule | Cosine with warmup |
| Max Grad Norm | 1.0 |
| Mixed Precision | AMP (float16) |
| Early Stopping | Patience 3 |
| Batch Size | 2 |
| Sequence Length | 256 |
Links
Citation
@software{zervas2026bwsk,
author = {Zervas, Tyler},
title = {BWSK: Combinator-Typed Neural Network Analysis},
year = {2026},
url = {https://github.com/tzervas/ai-s-combinator},
}
License
MIT
Model tree for tzervas/bwsk-mamba-130m
Base model
state-spaces/mamba-130m-hfDataset used to train tzervas/bwsk-mamba-130m
Evaluation results
- perplexity on wikitextself-reported15.305
- perplexity on wikitextself-reported15.272
- perplexity on wikitextself-reported15.268
- perplexity on wikitextself-reported453.478
- perplexity on wikitextself-reported643.686
- perplexity on wikitextself-reported666.030