No Resource, No Benchmarks, No Problem? Evaluating and Improving LLMs for Code Generation in No-Resource Languages
This paper addresses the challenge of code generation in no-resource programming languages by introducing new benchmarks and demonstrating that a cost-effective strategy of further pre-training a base model on target language data followed by injecting instruction-following capabilities via weight diff transfer significantly outperforms direct fine-tuning of instruction-tuned models.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you have a brilliant, super-smart robot assistant (a Large Language Model, or LLM) that is an expert programmer. You can ask it to write code in Python or Java, and it's like asking a master chef to cook a classic Italian dish—it knows the recipe by heart because it has read millions of cookbooks (training data) about those specific languages.
But what happens if you ask this robot to cook a dish from a brand-new, obscure cuisine that no one has ever written a cookbook for? Maybe it's a language invented by a company just yesterday, or a specialized tool for a specific industry that hasn't been shared on the internet yet.
This paper is about teaching that robot how to cook these "no-resource" dishes.
The Problem: The Robot is Clueless
The researchers found that when they asked top-tier AI models to write code in these brand-new languages (they tested Gleam and MoonBit), the robots were almost completely lost.
- High-Resource Languages (Python/Java): The robot got it right about 80–90% of the time.
- Low-Resource Languages (like Lua or R): The robot was okay, getting it right about 50–60% of the time.
- No-Resource Languages (Gleam/MoonBit): The robot failed almost 100% of the time.
The Analogy: It's like asking a chef who has only ever cooked with a knife to suddenly use a brand-new, weirdly shaped tool they've never seen. They don't just make a small mistake; they often don't even know how to hold the tool correctly. The errors weren't just "bad cooking"; they were "syntax errors"—the robot couldn't even write the basic structure of the code because it didn't know the grammar of the new language.
The Experiment: How do we teach the robot?
The team tried four different ways to help the robot learn these new languages, treating the new languages like a new subject the robot needs to study for a test.
- The "Cheat Sheet" (Few-Shot & RAG): They gave the robot a few examples of code written in the new language or a snippet from the manual right before asking it to write.
- Result: It helped a little bit, like giving a student a few practice problems. The robot got a bit better, but it was still struggling with the basics.
- The "Crash Course" (Fine-Tuning): They took the robot and fed it every single piece of code and documentation they could find for the new language, forcing it to relearn everything.
- Result: This worked well. The robot learned the language much better.
- The "Deep Dive" (Pre-Training): They took a raw version of the robot (one that hasn't been taught how to follow instructions yet) and fed it all the available data—every code file and every manual page.
- Result: This was the winner. Because they used all the data (not just the neat, organized examples used for fine-tuning), the robot learned the language more deeply. It got the best scores.
The Catch: The "Smart" Robot vs. The "Raw" Robot
Here is the twist. The "Deep Dive" (Pre-Training) worked best, but it had a side effect.
- The robot that learned the language deeply was a "raw" model. It knew the language perfectly, but it had forgotten how to listen to human instructions. If you asked it, "Write a function to add two numbers," it might just stare at you or write gibberish because it wasn't trained to follow commands.
- The "Smart" robots (Instruction-Tuned models) could follow commands perfectly, but they were terrible at the new language.
The Solution: The "Skill Transfer" (Instruction Transferring)
The researchers came up with a clever hack to get the best of both worlds without spending a fortune on training.
The Metaphor: Imagine you have two twins.
- Twin A is a master chef who knows the new cuisine perfectly but is rude and doesn't listen to orders.
- Twin B is a polite, obedient waiter who doesn't know the new cuisine at all.
Instead of hiring a new chef or retraining the waiter from scratch, the researchers figured out a way to copy the "politeness" and "listening skills" from Twin B and paste them onto Twin A.
They calculated the "difference" between the polite waiter and the raw chef, and then added that "difference" to the new, language-expert robot.
- The Result: They created a robot that is an expert in the new language AND knows how to follow instructions perfectly.
- The Bonus: This trick worked so well that a smaller, cheaper robot (8 billion parameters) with this "skill transfer" actually performed better than a much larger, more expensive robot (32 billion parameters) that was just fine-tuned normally.
The Bottom Line
If a company invents a new programming language today, they can't just buy an off-the-shelf AI assistant and expect it to work. The AI will fail.
However, this paper shows a path forward:
- Gather whatever tiny bit of code exists for that new language.
- Teach a raw AI model that language (Pre-training).
- Use a "skill transfer" trick to give that model the ability to listen to instructions.
This allows companies to build their own specialized AI coding assistants for their unique, proprietary languages without needing to spend millions of dollars on massive training runs. They can take a small, smart model and make it a language expert for pennies.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.