Target versions
Trained and evaluated against the stable versions available on 2026-11-08: AGP 9.5.1 (built-in Kotlin), Kotlin 2.4.21, Gradle 9.9.0, compileSdk 37, Compose BOM 2026.09.00. The full list is in droidsenior_versions.json. Library releases after this date are unknown to the model.
System prompt
You are DroidSenior, a staff-level Android engineer. Write idiomatic, modern Kotlin (Jetpack Compose, Coroutines/Flow, Hilt, Room) following the official Android architecture guidance. Explain key design decisions and trade-offs briefly, never use deprecated APIs, avoid over-engineering, and include tests when they add value. Answer in the user's language.
Using compiler feedback and API hints
- Repair: send the compiler output back as the next user message, starting with
Checking your answer against the project found: followed by one - line per error. The model was trained on such multi-turn repairs.
- API hints: append a block that starts with
Relevant APIs in this project (current stable versions): and lists - import <path> lines for the APIs named in the question. import_map.json maps API names to import paths.
Training
- SFT: 7614 unique examples (verified 1854, ornith 735, teacher_2026 1851, build 295, mined 1042, teacher_new 128, repair 1627, repair_new 82), LoRA r=64, alpha=128. New 2026 examples were weighted 2x and multi-turn repair examples 3x. In repair examples the loss covers only the corrected final answer.
- GRPO: 150 steps, 8 sampled answers per question, rewarded by the compiler (1.0 clean compile, 0.75 with deprecation warnings, 0.30 only after auto-import, 0.05 code that does not compile, 0 no code).
- Teacher for new data:
Qwen/Qwen2.5-Coder-32B-Instruct, run locally in 4-bit. Every target answer compiled against the target versions with complete imports and no deprecation warnings. Evaluation questions were removed from training data.
Evaluation
Greedy decoding, same system prompt, 368 held-out questions that were never used for training. Rates show 95% bootstrap intervals.
Table with columns: model, pass@1, pass@1 and current, + auto import, + 2 repair rounds, pass@1 with API hints, Kotlin HumanEval| model | pass@1 | pass@1 and current | + auto import | + 2 repair rounds | pass@1 with API hints | Kotlin HumanEval |
|---|
| v4 | 46.2% (41%-51%) | 45.7% (40%-51%) | 54.6% (49%-60%) | 56.2% (51%-61%) | n/a | 72.7% (66%-80%) |
| sft | 64.4% (60%-69%) | 62.8% (58%-68%) | 69.6% (65%-74%) | 79.3% (75%-83%) | 66.3% (61%-71%) | 67.7% (60%-75%) |
| grpo | 67.9% (63%-73%) | 66.6% (61%-71%) | 72.0% (67%-77%) | 82.3% (79%-86%) | 67.9% (63%-73%) | 67.1% (60%-75%) |
- pass@1: the first answer compiles with
:app:compileDebugKotlin in a template project. Room annotation processing (KSP) is checked; Hilt processing is not. Runtime behavior is not tested.
- Current: also no deprecation warnings, no outdated library versions, and migration questions are actually migrated.
- Auto import, repair and API hints are system results with tools around the model.
- v4 was re-scored in the same environment from its stored answers.
- Most common main problem in answers that failed the check: unresolved_reference 53, type_mismatch 16, other 15, wrong_arguments 11, room_ksp 8, suspend_context 5.
Q4_K_M GGUF: 4.68 GB, CPU speed 7.9 tokens/s on Colab.
Best-of-8 with signed repair (system result)
A single greedy answer compiles for 67.9% of the evaluation questions. With the compiler and the library sources around the model, 96.7% of the questions end with code that compiles. This is the recommended way to use the model when a Kotlin compiler is available:
- Sample 8 answers with the system prompt above, temperature 0.8, top_p 0.95.
- Compile them and keep one that compiles without errors.
- If none compiles, take the answer with the fewest errors and send a repair message. Repeat up to 3 rounds.
Repair message with facts from the library sources:
Checking your answer against the project found:- <one line per compiler error> Facts from the source code of the project's libraries (trust them over your memory):- <declaration from the library sources for a name in the errors> Fix every problem and return the complete corrected answer with all code in ```kotlin blocks, including all imports.
The facts block is optional. The facts are public declarations (signatures) read from the source jars of the target library versions in droidsenior_versions.json, chosen for the names that appear in the compiler errors.
Table with columns: setup (same 368 questions), compiles| setup (same 368 questions) | compiles |
|---|
| single greedy answer (pass@1) | 67.9% (63%-73%) |
| greedy + up to 2 repair rounds with library facts | 85.1% (81%-89%) |
| best of 8 samples | 94.6% (92%-97%) |
| best of 8 samples + up to 3 repair rounds with library facts | 96.7% (95%-98%) |
Sampled pass@k at temperature 0.8: k=1 62.2%, k=2 79.5%, k=4 89.6%, k=8 94.6%.
- "Compiles" means
:app:compileDebugKotlin succeeds in the template project (Room KSP checked). The deprecation and version checks of the "current" column and runtime behavior are not part of this number.
- The 368 questions are those a 32B teacher model could answer correctly, so harder real-world questions will score lower.
- The system needs about 8 times the generation of a single answer plus compiler runs.
- A further GRPO round on top of v5 (250 steps) changed no metric significantly and was not released.
Limitations
- Generated code can still be wrong. Review it before use.
- These are self-run tests, not an official Android Bench result.