OrdoPy-Coder-0.5B

OrdoPy-Coder-0.5B is a compact 0.5B parameter specialist model tuned on Qwen/Qwen2.5-Coder-0.5B-Instruct exclusively for Python programming, English instruction following, and step-by-step logical reasoning.

Focusing the full capacity of the 0.5B backbone on a single coherent skill cluster (English + Logic + Verified Python) delivers strong functional code execution accuracy while remaining fast and deployable in < 1.5 GB VRAM (float16).

Official Execution Benchmarks (Pass@1 โ€” 421 Tasks)

Evaluated greedily (do_sample=False) inside isolated 3.0s-timeout sys.executable -I subprocesses against full unit-test suites (openai/openai_humaneval 164 tasks + google-research-datasets/mbpp sanitized 257 test tasks):

Benchmark Suite Baseline (Qwen2.5-Coder-0.5B-Instruct) OrdoPy-Coder-0.5B Gain
HumanEval (164 tasks) 9.76% (16/164) 40.85% (67/164) +31.09% (4.19x)
MBPP Sanitized Test (257 tasks) 36.58% (94/257) 46.30% (119/257) +9.72% (+25 tasks)
Combined (421 tasks) 26.13% (110/421) 44.18% (186/421) +18.05% (+76 tasks)

Official EvalPlus Suite (evalplus Greedy Pass@1)

Benchmark Suite OrdoPy-Coder-0.5B Pass@1 Passed Tasks
HumanEval (base) 48.8% (0.4878) 80 / 164
HumanEval+ (base + extra tests) 46.3% (0.4634) 76 / 164
MBPP (base) 48.4% (0.4841) 183 / 378
MBPP+ (base + extra tests) 42.1% (0.4206) 159 / 378

Held-Out Domain Evaluation

Domain (Held-Out Split) Baseline Loss (PPL / Token Acc) OrdoPy-Coder-0.5B Loss (PPL / Token Acc)
python_code (MBPP Sanitized Val) 1.0226 (2.78 / 76.44%) 0.9843 (2.68 / 78.40%)
logic_math (GSM8K Official Test) 1.4752 (4.37 / 73.21%) 1.4096 (4.09 / 74.68%)
english_debug (Alpaca Held-Out) 1.6227 (5.07 / 59.53%) 1.4409 (4.22 / 61.58%)

Model Details

  • Architecture: Qwen2ForCausalLM (24 layers, hidden_size=896, 494M parameters, 32K context window)
  • Base Model: Qwen/Qwen2.5-Coder-0.5B-Instruct
  • Specialization: Python code generation, algorithmic problem solving, debugging & step-by-step reasoning in English
  • Format: Safetensors (model.safetensors) + Qwen ChatML tokenizer template

Quickstart Usage

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "layer8labs8/OrdoPy-Coder-0.5B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id, torch_dtype=torch.float16, device_map="auto"
)

messages = [
    {
        "role": "system",
        "content": (
            "You are OrdoPy, an expert Python software engineer and logical problem solver. "
            "Think clearly step-by-step in English and write clean, bug-free Python code."
        ),
    },
    {
        "role": "user",
        "content": "Write a Python function `is_palindrome_clean(s: str) -> bool` ignoring spaces and punctuation.",
    },
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer([text], return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=256, do_sample=False)
print(tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Downloads last month
72
Safetensors
Model size
0.5B params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for layer8labs8/OrdoPy-Coder-0.5B

Finetuned
(119)
this model
Quantizations
1 model