Results (held-out test, 205 functions)
Each function was attempted up to 6 times, with checker feedback between attempts. Sampling used
temperature 1.0 and top_p 0.95, with thinking off. A match counts only when the official checker
reports a byte-exact match. Test functions and their near-duplicates were excluded from training.
Table with columns: Base Granite 4.2 8B, This adapter | Base Granite 4.2 8B | This adapter |
|---|
| Exact byte match | 7 (3.4%) | 26 (12.7%) |
| Compiled at least once | 53 (26%) | 131 (64%) |
| Compiled on first attempt | 9 (4%) | 62 (30%) |
| Output tokens used | 1.76M | 0.62M |
The adapter is strong on small functions: 26 of 84 functions under 64 bytes matched.
It did not match any test function of 64 bytes or larger.
Training
- QLoRA (NF4 base, bf16 compute), rank 64, alpha 64, all attention and MLP projections
- 1 epoch, learning rate 2e-4 with cosine decay
- 1,449 generation examples and 1,037 repair examples, about 13.8M tokens
- Every target answer was a contributed source that passed a fresh official byte-match check
- Loss was computed on the answer only
- Prompts are rendered with Granite's chat template and
enable_thinking=False
- Trained on one RTX 3090 Ti in about 6 hours
Usage (vLLM)
vllm serve ibm-granite/granite-4.2-8b --enable-lora --max-lora-rank 64 \ --lora-modules granite-msvc-decomp=<this-repo>
Send chat requests with chat_template_kwargs: {"enable_thinking": false}. Give the target's assembly,
calling-convention hint, compiler flags and the surrounding declarations, and ask for one complete
C++ definition in a ```cpp block.
Limitations
- Generated code must be checked by recompiling it. A compiling answer is often not an exact match.
- It is tuned for one compiler (VC++ 2008 SP1) and one prompt format, so other setups will do worse.