CoolFace
Modelpublic

alex2110/qwen2.5-0.5b-code-bcp-v2

sourceHugging Faceapache-2.0updated 9mo agoView on Hugging Face
0likes30downloads
Model Card

๐Ÿš€ Qwen2.5-0.5B-Code-BCP-V2

๐Ÿ“ Overview

This model is a fine-tuned version of Qwen2.5-0.5B-Instruct, specialized for real-time code refactoring, logging injection, and algorithmic optimization. It is designed to power VSCode extensions where low latency and local execution are critical.

Compared to the base model, BCP-V2 demonstrates an emergent understanding of time complexity (O(n) awareness) and strictly follows developer-centric instructions without unnecessary conversational filler ("Zero-Yapping").

Key Capabilities:

  • โ€”Optimization: Identifying and refactoring nested loops into Hash Map lookups.
  • โ€”Structured Logging: Injecting custom-formatted logs (e.g., [MONITOR] templates).
  • โ€”Logic Transformation: Converting recursive functions to iterative patterns.
  • โ€”IDE Ready: Optimized for GGUF format for seamless integration with Ollama or llama.cpp.

๐Ÿ“Š Training Details

  • โ€”Base Model: Qwen2.5-0.5B-Instruct (4-bit quantized)
  • โ€”Framework: Unsloth
  • โ€”Dataset: iamtarun/python_code_instructions_18k_alpaca
  • โ€”Method: LoRA (Low-Rank Adaptation)
  • โ€”Steps: 600 steps (~4,800 examples processed)
  • โ€”Batch Size: 8 (2 per device ร— 4 accumulation steps)
  • โ€”Scheduler: Cosine learning rate decay
  • โ€”Optimizer: AdamW 8-bit

๐Ÿ“ˆ Evaluation: V1 vs. V2 Comparison

During development, we analyzed the impact of training duration on algorithmic reasoning.

FeatureBase Model (0.5B)BCP-V1 (150 steps)**BCP-V2 (600 steps)**
Response SpeedInstantInstantInstant
Instruction AdherenceMediumHighStrict
Algorithmic ReasoningLowLowHigh (O(n) intent)
Explanations (Yapping)HighLowMinimal (Zero-Yapping)

Notable Improvements in V2:

  • โ€”Test Case (Hash Map): While V1 failed to optimize nested loops, V2 correctly identified the need for a lookup dictionary to improve performance from $O(n^2)$ to $O(n)$.
  • โ€”Test Case (Logging): V2 handles complex string interpolation (e.g., using **locals()) while maintaining strict template formatting.

๐Ÿ’ป Usage

Prompt Format:

text
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.

### Instruction:
{instruction}

### Input:
{code_snippet}

### Response:
{code_snipped_refactored}

Running with Ollama:

  1. 1.Download the .gguf file from this repository.
  1. 1.Create a Modelfile: FROM ./qwen2.5-0.5b-instruct.Q4KM.gguf TEMPLATE "{{ .Prompt }}"
  1. 1.Run: ollama create bcp-v2 -f Modelfile

โš ๏ธ Limitations

As a 0.5B parameter model, BCP-V2 is highly efficient but may occasionally produce minor syntax errors in very complex logic. It is best used for refactoring snippets of up to 50 lines and as a high-speed coding assistant.

๐Ÿค Collaboration

This model was developed as part of a project to create an intelligent local-first VSCode extension chatbot.

Lead Fine-tuning Engineer: Alex (alex2110)