Training Inkling 2 Mini on a Novel Programming Language
We trained 31 adapters on Tinker's free tier to teach Inkling 2 Mini a programming language it had never seen. It went from 9.6% to 77.2% on hembench, and a one-page cheat sheet in the prompt got almost as far as training did.
Hemlock is our own systems scripting language: manual memory, no garbage collector, async with real threads. Models have essentially never seen it. Ask base Inkling 2 Mini for FizzBuzz and it writes Python with Hemlock's name on it:
for i in 1..20:
if i % 15 == 0:
print("FizzBuzz")
...
[line 1:5] Error at 'i': Expect '(' after 'for'
When Tinker made Inkling 2 Mini (26.4B parameters, 3.4B active, mixture of experts) free to train and sample, we used the free tier to ask one question as many ways as we could: what does it take to teach a model a language it doesn't know? We trained 31 LoRA adapters and scored 39 configurations, and the whole thing cost nothing.
The scoreboard
hembench has 38 tasks in six levels: syntax, the standard library, algorithms, systems work (memory, threads, channels), translating from other languages, and debugging given code. Every answer is run by the Hemlock 2.16 interpreter and judged on what it prints, not on how it looks. Each configuration got three full runs (114 graded answers) with reasoning switched off. Scores below are tasks passed out of 38.
For reference, base Inkling scores 9.6%. Our B4-27B, a dense 27B model trained on Hemlock earlier, scores 73.7%.
Bars are the mean of three runs; dots are single runs. Purple is supervised fine-tuning, blue is help in the prompt with no training, orange is RL after fine-tuning, grey is the base model and training that started from it.
The training data was 5,179 rows of Hemlock: documentation and semantics notes, execution-checked programs, and C and Python programs translated to Hemlock and checked against the original's output. None of it shares a prompt with hembench. Our reference run, hem1, is one epoch of LoRA SFT at rank 32, learning rate 2e-4, batch 32: about 160 steps.
What we found
A cheat sheet does what an epoch of training does
Base Inkling with a 6.7 KB Hemlock cheat sheet in its prompt, and no training at all, scores 71.9%. Few-shot examples (71.9%) and our full 20 KB language guide (71.1%) land in the same place. One epoch of SFT scores 69.3%.
Inkling isn't missing the ability to program here. It's missing the syntax and the standard library, and a page of reference supplies most of that. Training still earns its keep: the trained model doesn't need those 6.7 KB in every prompt, and training plus the cheat sheet together reach 74.6%.
RL after SFT is the one clear step up
We ran 74 steps of GRPO-style RL on top of hem1. The reward was binary: does the program run and print exactly the expected output? That run scores 77.2% (29, 29 and 30 tasks), the best of the 39 and above B4-27B, a dense model with about eight times the active parameters.
The same RL from the base model scored 12.3%. In 74 steps its samples never passed once, so every group of answers got the same reward and there was nothing to learn from. RL needs a model that can already write some working Hemlock.
| level | base | base + cheat sheet | hem1 | hem1 + RL |
|---|---|---|---|---|
| L1 syntax (9) | 0.3 | 8.0 | 6.3 | 6.7 |
| L2 standard library (5) | 0.0 | 2.3 | 2.0 | 2.7 |
| L3 algorithms (7) | 0.0 | 6.7 | 6.3 | 6.7 |
| L4 systems (7) | 0.3 | 4.3 | 5.3 | 5.7 |
| L5 translation (5) | 0.0 | 1.3 | 2.3 | 4.0 |
| L6 debugging (5) | 3.0 | 4.7 | 4.0 | 3.7 |
Mean tasks passed per run, by level.
Most of RL's gain is in translation, where the reward checks the exact output of a program the model has to rewrite. Algorithms transfer almost whole from what Inkling already knows. The standard library is the hard part: no configuration passes more than 3 of its 5 tasks. The RL result is one seed, so we would repeat it before calling 77.2% settled, but it is the only result clearly outside the seed range below.
Most training knobs are noise
The hem1 config on three seeds scored 69.3%, 71.1% and 73.7%, and single runs of the same adapter swing by up to six tasks. Against that, almost nothing we varied mattered:
- LoRA rank 8, 32 or 64
- batch 8 or 32
- learning rate from 1e-4 to 1e-3
- two or three epochs
- dropping the 89 reference programs (3.6%) that no longer pass under the current interpreter
All of these land between 66.7% and 72.8%. Two things clearly hurt: a cosine learning-rate schedule (62.3%, mostly by losing the standard-library tasks) and a learning rate of 3e-5 (35.1%), too low to learn much in one epoch. A constant schedule tied the best SFT result at 74.6%.
Data: both halves count, and more keeps helping
Training on only the documentation rows scored 51.8%; only the code rows, 63.2%; both, 69.3%. Cutting the full mix to an eighth, a quarter and a half gives 29.8%, 45.6% and 66.7%. The curve is flattening, but it hasn't stopped.
Training on the model's own passing answers helps once: hem1 answered every code prompt, and adding its 1,754 passing answers to the mix scores 72.8%. A second round (1,785 more) scores 67.5%, no better than hem1.
DPO teaches nothing here
We tried six DPO runs straight from the base model: 852 off-policy pairs, then pairs built from base Inkling's own failing answers with four settings of beta and learning rate. All six score between 9.6% and 14.9%, against base's 9.6%. DPO on top of hem1, with its own failures as the rejected side, scores 69.3%, the same as hem1.
The on-policy pairs show why. 4,808 of base Inkling's 4,818 answers fail to run at all. Preference pairs can tell a model which of two answers is better, but they can't teach a language the model can't yet write.
Training without thinking switched thinking off
We trained with reasoning effort set to none, so the targets had no thinking in them. Afterwards, asked to think at high effort, the model produced reasoning on 0 of 2,409 code prompts. Its high-effort (65.8%) and low-effort (64.9%) scores match its none score because they are the same mode. A planned arm, training on its own reasoning, had nothing to train on.
How it ran
Everything ran on Tinker's free tier for Inkling 2 Mini: training, sampling and prefill cost $0. LoRA rank is capped at 64, and only about three training clients run at once. The rest pause and resume by themselves, which set the pace: about ten hours of wall clock for the whole sweep.
One bug is worth passing on. Our eval scripts started a local model server, ran the benchmark jobs and then waited for all their child processes, the server included, so finished evals never wrote a score until we noticed. Wait on the jobs you mean to wait on.
What we'd tell someone teaching a model a new language
- Try the cheat sheet first. A page of syntax and library reference in the prompt got an untrained model within a few points of a trained one.
- Use both docs and working code, and more of it than feels necessary.
- Measure the noise before tuning: three seeds of one config spanned 4.4 points, wider than most of the effects we tested.
- Get the model writing working code with SFT before reaching for preferences or rewards, then use RL with a reward that actually runs the code.
The best adapter (hem1 + RL) is on Hugging Face as hemlang/Hemlock-Inkling2-Mini-LoRA.