tkeskin/mistral-7b-v0.3-code-translation
The tkeskin/mistral-7b-v0.3-code-translation model is a 7 billion parameter Mistral-7B-Instruct-v0.3 variant, fine-tuned by tkeskin for code translation. It specializes in accurately translating code between C++, Java, and Python, leveraging a 4096 token context length. This model significantly improves code compilation and translation accuracy compared to its base model, making it suitable for automated code migration and multi-language development workflows.
Loading preview...
Overview
This model, tkeskin/mistral-7b-v0.3-code-translation, is a fine-tuned version of mistralai/Mistral-7B-Instruct-v0.3 specifically designed for translating code between C++, Java, and Python. It was trained using LoRA (Low-Rank Adaptation) on the tkeskin/leetcode-solutions dataset, which consists of directed C++/Java/Python translation pairs derived from LeetCode solutions.
Key Capabilities & Performance
This model demonstrates a substantial improvement in code translation performance, as evaluated by an execution-based translation benchmark using pass@1 (all test cases pass) and compile rate metrics. Compared to its base model, it achieves:
- A
pass@1score of 59.6%, a +47.8% increase from the base model's 11.8%. - A compile rate of 84.7%, a +39.6% increase from the base model's 45.0%.
Performance gains are observed across all language pairs (C++ to Java/Python, Java to C++/Python, Python to C++/Java) and difficulty levels (Easy, Medium, Hard), with particularly strong improvements in C++ to Java translation.
Intended Use
This model is ideal for scenarios requiring the translation of source code from one of C++, Java, or Python into another, while preserving the original logic and structure. It can be integrated into development workflows for automated code migration or to support multi-language projects.