crumb-ai/abl_2_1_interleaved
CRUMB abl_2_1_interleaved ⭐ Best in Phase-1 Ablation
Model Overview
abl_2_1_interleaved is the best-performing model in the CRUMB Phase-1 ablation. It is a hybrid decoder-only language model that interleaves Mamba-3 selective state-space layers with GQA (Grouped-Query Attention) layers at a 2:1 Mamba-majority ratio with interleaved placement, and was pre-trained exclusively on Python source code.
Across the eleven ablation variants, this configuration achieves the lowest evaluation perplexity (3.4182), confirming that a moderate Mamba majority (67 % of layers) with attention distributed throughout the stack is the optimal design choice at the 150M-parameter scale.
Architecture
Mamba : Attention ratio — 2 : 1
8 Mamba layers + 4 GQA attention layers (2 Mamba blocks per attention block).
Placement — Interleaved
Mamba and attention layers alternate throughout the network according to a 2:1 schedule. Layer order: M A M M A M M A M M A M
This placement distributes the attention layers as evenly as the 2:1 ratio allows while keeping every attention layer close to a Mamba layer that provides the broad sequential context.
Training
Evaluation Method
Perplexity (primary metric)
Per-token cross-entropy loss with BF16 autocast, computed over the full held-out evaluation set.
Generation-based metrics
- Python syntax validity — 200 free-form completions generated per model from 49 diverse Python prompts at
temperature=0.8,top_k=50,max_new_tokens=128; each completion checked withast.parse(). Implementation:src/evaluation/syntax_validity.py. - Qualitative side-by-side completions — 10 fixed prompts at
temperature=0.6,top_k=50,max_new_tokens=200, identical random seed per prompt. Implementation:src/evaluation/qualitative_comparison.py.
Evaluation Results
Rank Summary
Out of 11 ablation configurations evaluated at the same token budget:
abl_2_1_interleaved is recommended as the base configuration for Phase 2 of the CRUMB project. The overall spread across all 11 configurations is 0.314 perplexity points (9.2 %); this model is 0.176 PPL (4.9 %) better than the worst model (abl_1_1_frontloaded) and 0.105 PPL (3.0 %) better than the best pure baseline (abl_pure_mamba).
Intended Use & Limitations
- Domain: Python source-code language modelling.
- Base model only: no instruction tuning, no chat alignment, no safety filtering. Outputs are unconstrained code completions.
- Repetitive degeneration: all base CRUMB models tend to repeat function signatures / docstrings during free-form generation; this is expected behaviour for unaligned base models.
Citation / Context
This model is part of the CRUMB Phase-1 ablation study:
Efficient Architectural Hybrids for Small-Scale Language Models in Python Program Synthesis — Department of Computer Science and Engineering, Daffodil International University. Findings documented in documents/phase1_ablation_findings.md.How to Load
from tokenizers import Tokenizer
import torch
from src.model.config import CRUMBConfig
from src.model.model import CRUMBModel
config = CRUMBConfig.from_yaml("configs/model/abl_2_1_interleaved.yaml")
model = CRUMBModel(config)
state = torch.load("saved/model/abl_2_1_interleaved/model.pt", map_location="cpu")
model.load_state_dict(state)
model.eval()
tok = Tokenizer.from_file("saved/tokenizer/crumb_tok_hf/tokenizer.json")
ids = tok.encode("def fibonacci(n):\n").ids
x = torch.tensor([ids])
with torch.no_grad():
y = model(x)