Tokenizer Fertility and Zero-Shot Performance of Foundation Models on Ukrainian Legal Text: A Comparative Study
This study benchmarks seven foundation models on Ukrainian legal text, revealing that tokenizer efficiency significantly impacts API costs, the 120B-parameter NVIDIA Nemotron Super 3 outperforms the larger Mistral Large 3 at a fraction of the cost, and zero-shot prompting is superior to few-shot prompting for this morphologically rich language.
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 are running a massive library of Ukrainian court decisions. You want to hire a team of super-smart AI librarians (Foundation Models) to read these documents, sort them into categories, decide who won the case, and pull out the specific laws mentioned.
This paper is like a report card comparing seven different AI librarians to see which one works best, costs the least, and makes the fewest mistakes when dealing with the Ukrainian language.
Here is the breakdown of their findings, using simple analogies:
1. The "Word-to-Token" Tax (Tokenizer Fertility)
Think of an AI model like a translator that doesn't read whole words. Instead, it breaks every word into tiny puzzle pieces called "tokens."
- The Problem: Some AIs are terrible at this. They chop Ukrainian words into way too many tiny pieces. The paper calls this "fertility" (how many pieces a word produces).
- The Finding: One family of AIs (Llama) is very efficient. It breaks a word into about 2.4 pieces. Another family (Qwen) is wasteful, breaking the same word into 3.9 pieces.
- The Analogy: Imagine you are paying for a taxi ride based on how many steps you take. The "wasteful" AI takes 60% more steps to get to the same destination. This means you pay 60% more money just to read the same document.
- Takeaway: Before you pick an AI, check how many "steps" (tokens) it takes to read Ukrainian. It directly impacts your wallet.
2. Bigger Isn't Always Better
In the world of AI, people often assume the model with the most "brain power" (parameters) is the smartest.
- The Finding: The paper tested a giant model (Mistral Large 3) with 675 billion parameters against a smaller one (NVIDIA Nemotron Super 3) with only 120 billion parameters.
- The Result: The smaller model (Nemotron) actually won. It got higher scores on all three tasks and cost one-third as much to run.
- The Analogy: It's like hiring a 675-person construction crew to build a small shed when a highly skilled 12-person team with better tools can do the job faster, cheaper, and with higher quality. The size of the team didn't matter; the training and the tools did.
3. The "Example" Trap (Few-Shot vs. Zero-Shot)
Usually, when you teach a human a new task, you give them a few examples first. In AI, this is called "few-shot prompting."
- The Finding: For Ukrainian legal text, giving the AI examples often made it dumber. In some cases, performance dropped by 26 percentage points!
- The Analogy: Imagine you are teaching a chef to cook a specific Ukrainian dish. If you show them a picture of a slightly different version of the dish, they might get confused and forget the original recipe. The AI got "anchored" by the examples and stopped using its own knowledge of the language.
- The Twist: The paper tested if this was because the examples were unbalanced (too many of one type) or if the prompt was written poorly. It wasn't. Even when they fixed the examples and the prompts, the AI still got worse.
- Conclusion: For Ukrainian, it's often better to just say, "Here is the document, tell me the result," without showing examples first.
4. The Best Strategy: The "Specialist Team"
Since no single AI was perfect at everything, the authors proposed a "routing" system, like a hospital triage nurse.
- Task 1 (Sorting cases): Use the cheapest, fastest AI (Llama 4 Maverick). It's great at simple sorting and costs almost nothing.
- Task 2 (Deciding winners): Use the smartest AI (NVIDIA Nemotron). This is the hard part, so you pay a bit more for the best brain.
- Task 3 (Finding laws): Use a different AI (Llama 3.3) that is really good at spotting specific patterns in text.
- The Result: By mixing and matching, they got the highest quality results for 37% less money than using just the "best" single AI for everything.
5. The Bottom Line for Practitioners
If you are building a legal tech tool for Ukraine:
- Check the "step count" first: Don't just look at the model's size; check how efficiently it reads Ukrainian words.
- Don't trust the "bigger is better" myth: A smaller, well-trained model can beat a giant one.
- Skip the examples: For Ukrainian legal text, asking the AI to work without examples (Zero-Shot) is usually more reliable than giving it examples.
- Mix your team: Use different AIs for different jobs to save money and get better results.
The Cost: The entire study, testing seven models on hundreds of documents, cost the researchers only about $60 in total API fees. This proves you don't need a massive budget to do serious, high-quality testing on language models.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.