ReleaseInsight · On RadarHabr: MTS AI→ original

MWS AI Builds 153,000 Russian Docstring Examples for Coding Models

Coding models make mistakes when writing Russian comments for functions: they slip into English and break the docstring format, so the IDE no longer recognizes it. MWS AI built StRuCom, a dataset of 153,000 code-comment pairs across five languages. After fine-tuning on it, every Qwen2.5-Coder size improved, and the small 0.5B and 1.5B models gained the most. For Russian documentation, fine-tuning a compact model is the better deal.

AI-processed from Habr: MTS AI; edited by Hamidun News
MWS AI Builds 153,000 Russian Docstring Examples for Coding Models
Source: Habr: MTS AI. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceHabr: MTS AI ↗
Editor-in-Chief
5 standardsGoogleDoc, Javadoc, GoDoc, XML for C#, JSDoc
No machine translationreal GitHub comments plus synthetic data
Key metric #3Automatic evaluation matched human experts' judgment in 80% of cases

Ask a coding model to write a function comment in Russian, and you will most likely get one of three outcomes. The model suddenly switches to English, produces a calque such as a word-for-word translation of "deploy" and "commit", or breaks the docstring structure. A docstring is the standard comment block above a function: a description, parameters, the return value (return) and exceptions.

If the format is broken, the IDE stops picking up the documentation, and the comment turns into plain text. The MWS AI team tackled the problem through data: it built StRuCom, a set of 153,000 Russian code-comment pairs for five programming languages. After fine-tuning on it, models from the Qwen2.

5-Coder family wrote better comments, and the smallest ones, at 0.5B and 1.5B parameters, improved the most.

What's inside the dataset

StRuCom covers Python, Java, Go, C# and JavaScript. The authors deliberately avoided machine translation. The set contains real Russian-language comments from open repositories, plus synthetic examples written by a strong open LLM that understands Russian well.

Existing datasets did not fit. CodeSearchNet and The Vault either contain no Russian or, like MCoNaLa, are built for code search rather than documentation generation.

Each comment was checked against the standard of its language: GoogleDoc for Python, Javadoc for Java, GoDoc for Go, XML for C# and JSDoc for JavaScript. The team wrote a separate tool for this, which looks for descriptions of arguments, the return value and exceptions. Only complete comments and valid partial ones made it into the final set.

How it was collected: GitHub, junk and language

The GitHub API cannot return "repositories with Russian comments". So the researchers downloaded repositories with Russian-language descriptions and open licenses. They extracted functions with parsers: function parser for Python, Java and Go, and Code-Text for JavaScript and C#.

The most labor-intensive part was cleaning. Third-party library code is almost always in English, so it had to be removed. The comment language was detected with the Lingua library. One practical finding: it is more accurate when fed cleaned text without code markup.

Real data was still not enough, especially for Python and JavaScript, where developers rarely write full docstrings. So the team brought in an LLM in two scenarios. In the first, the model filled in the missing fields of an incomplete comment (types, return) without changing the author's text. In the second, for code with no comments at all, it wrote a docstring from scratch. Go saw the easiest improvement, with an efficiency of 84%, because its documentation standard is minimalist. Python and JavaScript were the hardest because of their requirements for specifying types.

What fine-tuning showed

To test the dataset's value, the authors fine-tuned Qwen2.5-Coder at 0.5B, 1.5B, 3B and 7B parameters and compared the results with the base versions. The quality gain was statistically significant for all sizes. The smallest models benefited the most: they began producing comments close in quality to what larger models write.

Generations were compared with reference comments automatically. In 80% of cases, this evaluation matched the judgment of human experts. That is not ideal, but it is enough for large-scale runs.

What this means in practice

For teams that write documentation in Russian, the takeaway is simple: you do not need to run a large model just to get clean docstrings. A small model can be fine-tuned on StRuCom and run locally, cheaply and without sending code outside. This matters for internal repositories that cloud APIs are not allowed to touch.

The second lesson concerns validation. If you generate comments automatically, add a format check to your pipeline: the presence of parameters, return and exceptions according to your language's standard. This is exactly the kind of tool the authors developed alongside the dataset.

There are limitations too. Part of the data is synthetic, the evaluation is partly automatic, and the results were obtained only on models from the Qwen2.5-Coder family. The work does not show how other models, or private codebases full of slang, would behave. Still, as a starting point for Russian-language code documentation, StRuCom looks useful. The paper was presented at ACL 2025; its authors are Valentin Malykh and Maria Dziuba.

Story

Key Questions Answered

What's inside the dataset?

StRuCom covers Python, Java, Go, C# and JavaScript. The authors deliberately avoided machine translation. The set contains real Russian-language comments from open repositories, plus synthetic examples written by a strong open LLM that understands Russian well. Existing datasets did not fit. CodeSearchNet and The Vault either contain no Russian or, like MCoNaLa, are built for code search rather than documentation generation.

How it was collected: GitHub, junk and language?

The GitHub API cannot return "repositories with Russian comments". So the researchers downloaded repositories with Russian-language descriptions and open licenses. They extracted functions with parsers: function parser for Python, Java and Go, and Code-Text for JavaScript and C#. The most labor-intensive part was cleaning. Third-party library code is almost always in English, so it had to be removed. The comment language was detected with the Lingua library.

What fine-tuning showed?

To test the dataset's value, the authors fine-tuned Qwen2.5-Coder at 0.5B, 1.5B, 3B and 7B parameters and compared the results with the base versions. The quality gain was statistically significant for all sizes. The smallest models benefited the most: they began producing comments close in quality to what larger models write. Generations were compared with reference comments automatically. In 80% of cases, this evaluation matched the judgment of human experts.

ZK
Zhemal Khamidun — CPO at Alpina Digital, product manager of AlpinaGPT. Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Unified AI Workspace · Nomad

Test Frontier LLMs & Autonomous Agents in One Workspace

Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.

Try Nomad AI →Launch Nomad Agent
What do you think?
Loading comments…