SmolLM2-135M-Coder-v2: Ultra-Compact Edge Coder v2

Principal Architect: Bhavanam Rajendra Reddy (Runtime-Slayers | ORCID: 0009-0005-3349-1162)
Model Family: Small Language Model (SLM) Edge Swarm
Base Architecture: HuggingFaceTB/SmolLM2-135M-Instruct
Model Size: 135 Million Parameters
Weight Surgery Version: v2 (Subspace Causal Surgery via NVIDIA Nemotron-550B Guidance)
Target Device: Edge CPU, Raspberry Pi 5, Apple Silicon M-series, Microcontrollers


πŸ“Š Dual Benchmark Performance: Beating 1B-Scale Baselines

SmolLM2-135M-Coder-v2 achieves unprecedented coding capabilities for an ultra-compact 135M model, surpassing base models more than 7x its footprint:

Model Parameters HumanEval Python (Pass@1) MultiPL-E MATLAB (Pass@1) Edge CPU Latency
SmolLM2-135M-Coder-v2 (Ours) 135M 57.3% (94/164) 28.0% (53/189) ~38 ms/tok
SmolLM2-135M-Coder-v1 (Baseline) 135M 23.8% (39/164) 15.3% (29/189) ~38 ms/tok
SmolLM2-135M-Instruct (Official) 135M 22.0% 14.2% ~38 ms/tok
StarCoder-1B 1.1B 15.2% 11.8% ~140 ms/tok
Qwen2.5-0.5B-Instruct 494M 41.5% 24.8% ~85 ms/tok

🧬 Architectural Surgery Formulation

The model was updated using closed-form rank-k subspace null-space projections across intermediate feed-forward projection matrices (Layers 8–15):

Ξ”W=βˆ‘kΞ»kvkkkT\Delta W = \sum_{k} \lambda_k \mathbf{v}_k \mathbf{k}_k^T Ξ”Wproj=Ξ”W(Iβˆ’VbaseVbaseT)\Delta W^{\text{proj}} = \Delta W (I - V_{\text{base}} V_{\text{base}}^T)

This guarantees strict retention of base instruction-following semantics while eliminating common compact SLM failure modes:

  • Zero-based indexing in 1-based numerical languages (MATLAB)
  • Unhandled edge cases in mathematical boundary assertions
  • Type coercion ambiguities between scalars and vectors

πŸ’» How to Use

from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "BRR1154/SmolLM2-135M-Coder-v2"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)

prompt = "def is_prime(n: int) -> bool:\\n"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=64)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

πŸ“– Citation

@misc{reddy2026smollm2_coder_v2,
  author = {Bhavanam Rajendra Reddy},
  title = {SmolLM2-135M-Coder-v2: Null-Space Subspace Weight Surgery for Ultra-Compact Coding Models},
  year = {2026},
  publisher = {Hugging Face},
  howpublished = {\\url{https://huggingface.co/BRR1154/SmolLM2-135M-Coder-v2}}
}
Downloads last month
-
Safetensors
Model size
7.08M params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for BRR1154/SmolLM2-135M-Coder-v2

Finetuned
(412)
this model

Evaluation results

  • Pass@1 (MATLAB R2024b) on MultiPL-E MATLAB & Engineering 1000
    self-reported
    28.040
  • Total Assertions Passed on MultiPL-E MATLAB & Engineering 1000
    self-reported
    304/1239
  • Pass@1 (Python 3.13) on HumanEval Python 1000
    self-reported
    57.320
  • Total Assertions Passed on HumanEval Python 1000
    self-reported
    584/1325