Learn how to fine-tune language models to automatically generate high-quality docstrings across multiple programming languages.
- Multi-task Fine-tuning: Train models to generate docstrings across multiple programming languages simultaneously
- LLM Fine-tuning Techniques: Instruction fine-tuning and RL fine-tuning using GRPO
- Hands-on Experience: Work with different fine-tuning libraries (PEFT, TRL, Unsloth)
- Cloud Infrastructure: Deploy scalable training with Modal
- Performance Evaluation: Compare models using automated metrics and evaluation frameworks
# Clone and install git clone https://github.com/fastbatchai/docstring-generation.git cd docstring-generation uv pip install -e . # Setup Modal modal setup # Run training modal run -i -m autoDoc.train --training-type sft --use-unsloth
- Lesson 1: Introduction to LLM Fine-tuning - Fine-tuning fundamentals
- Lesson 2: Data Preparation - Multi-language dataset preprocessing and prompt engineering
- Lesson 3: Instruction Fine-tuning - SFT implementation with Alpaca format, Modal infrastructure, and monitoring
- Lesson 4: RL Fine-tuning - GRPO implementation, reward functions, and preference learning
- Lesson 5: Evaluation and Comparison - Automated metrics and model comparison (Coming Soon)
| Language | CodeGemma | CodeGemma+LoRA | Improvement |
|---|---|---|---|
| Python | 0.47 | 0.52 | +11% |
| Java | 0.57 | 0.55 | -4% |
| JavaScript | 0.43 | 0.48 | +12% |
| Go | 0.49 | 0.54 | +10% |
| PHP | 0.42 | 0.63 | +50% |
| Ruby | 0.52 | 0.60 | +15% |
NOTE: These are preliminary results based on training with a small subset (1K samples for each programming language).
More results are available in Lesson 5: Evaluation and Comparison
- Discussions: GitHub Discussions
- Issues: Report bugs
- Newsletter: Subscribe for updates
MIT License - see LICENSE file for details.
β Star this repository if you found it helpful!