Qwen 2.5 Coder - amosproj/amos2025ss04-ai-driven-testing GitHub Wiki
Qwen 2.5 Coder is an open-source large language model developed by Alibaba Cloud, specifically optimized for code generation, understanding, and reasoning tasks. It is released under the permissive Apache 2.0 license, enabling free use for both research and commercial purposes.
🔍 Overview
Qwen 2.5 Coder is a specialized version of the broader Qwen 2.5 family, fine-tuned to excel in programming tasks. It is trained on a mixture of code and natural language datasets, providing strong capabilities in code generation, code completion, error analysis, and explanation of programming concepts.
🔧 Key Features
Code Optimization Focus:
Designed specifically to understand, complete, and generate code snippets in a variety of programming languages.
Multi-Language Support:
Can handle Python, C++, JavaScript, Java, Go, Rust, and many other popular languages.
Large Context Window:
Supports context windows of up to 32K tokens (depending on fine-tuning and deployment settings), enabling effective work with large codebases and long function chains.
Model Sizes Available:
The Qwen 2.5 family includes multiple variants, but Qwen 2.5 Coder itself is primarily based on mid-to-large models suitable for high-quality code generation.
- 7B parameters
- 14B parameters (expected)
- There exist versions from 0.5B to 32B parameters [4]
- Extensions are possible with quantization for lighter setups
Instruction Tuning:
Fine-tuned with code-centric instructions, allowing it to follow developer prompts intuitively and output syntactically and semantically correct code.
Open Source and Modifiable:
Distributed under Apache 2.0, allowing full freedom for modification, fine-tuning, and commercial deployment.
Note: Model versions 3B is under Qwen Research Licence and 72B Qwen Licence and are not useful for our purposes[4]
Benchmarks In the HumanEval, MBPP and BigCodeBench, the Qwen2.5-Coder versions perform on par with other similarly sized models The models have chunk completion and function completion capabilities Further comparisons of this model to others can be found in the technical report [4]
🧠 Architecture
Qwen 2.5 Coder follows a standard transformer-based architecture with optimisations tailored for coding tasks:
- Multi-head self-attention layers
- Enhanced positional encoding for longer sequences
- Improved tokenisation for programming languages
- Instruction-tuned via supervised fine-tuning (SFT)
It aims to balance high performance, scalability, and practical deployment for coding-related workloads.
🎯 Relevance for Our Project
Qwen 2.5 Coder is particularly well-suited for our project's goals of automatic test code generation and local on-premise execution for several key reasons:
-
Code-Specialized Training:
Qwen 2.5 Coder has been fine-tuned specifically for code understanding and generation tasks, making it highly effective at producing syntactically correct and logically sound test cases. -
Instruction Following:
The model is optimised to follow complex prompts accurately, allowing it to generate different types of tests (unit tests, integration tests, etc.) based on developer instructions. -
Local Deployment:
Thanks to its open-source license and compatibility with local model runners like Ollama, Qwen 2.5 Coder can be easily deployed on standard laptops and workstations without relying on cloud services — a strict requirement for our on-premise project setup. -
Efficiency with Medium Hardware:
With quantization and lightweight model versions (e.g., 7B), it can run efficiently on normal developer machines, enabling fast testing cycles without specialized infrastructure. -
Open Source Freedom:
Being released under Apache 2.0 ensures that we can freely modify, fine-tune, and extend the model for custom use cases in our project, such as adapting it to specific programming languages or test frameworks.
▶️ How to use:
In general: With Ollama, create a client over the terminal and give it a prompt and/or file.
In our code: Run "qwen/script.py". Qwen2.5-coders response will be recorded in response.txt, and the generated test will appear in generated_test.py We extended the general use to give the client a role in modelfile and hand over the file's location code_to_test.py for which the LLM creates a test.