Skip to content
AI & Machine Learning

Qwen3.8 Can't Follow an Arabic Glossary: 3 Fixes

Qwen3.8 followed 26.7% of a 12-term Arabic glossary zero-shot. A glossary prompt raised it to 46.7%, few-shot to 50%, repair to 56.7%. Here is the cost.

Nerd Level TechPublished 10 min readالعربية
Cover image for Qwen3.8 Can't Follow an Arabic Glossary: 3 Fixes

Qwen3.8-27B followed 26.7% of a 12-term Arabic glossary with no glossary in the prompt. Adding the glossary raised that to 46.7%. Two few-shot examples added 3.3 points, which is not statistically significant. A checker-driven repair pass reached 56.7%, but it used 70% more requests and its COMET score moved in the wrong direction.

The cheap fix is the prompt. The expensive fix is not obviously worth it.

This is the same 20-paragraph Arabic test used in the 30B benchmark and the 1.8B follow-up, with the same 12-term glossary and three runs per arm. The question is narrow: if a general model keeps missing your terminology, what actually fixes it?

TL;DR

  • The glossary prompt is the best fix. Strict glossary rose from 26.7% to 46.7% (20.0 points; paired per-segment +19.5, p = 0.006). COMET-Kiwi moved +0.0071 (p = 0.221), so the prompt did not cost measurable raw quality.
  • Few-shot is not worth the extra prompt. It raised the rate to 50.0%, only 3.3 points over the glossary prompt (paired +2.5, p = 0.718). COMET moved -0.0026 (p = 0.320).
  • The repair pass adds points and cost. It reached 56.7% (10.0 points over the glossary prompt; paired +6.7, p = 0.081). It rewrote 42 of 60 outputs, used 102 requests, and raised median latency from 2.46 s to 3.72 s. COMET moved -0.0184 (p = 0.197).
  • Code and placeholders were never the problem here. Code spans, placeholders and URLs pass 100% in every arm. The strict checker is about terminology, not markup.
  • The checker can be gamed. A naive repair prompt produced الوكيل الذكاء الاصطناعي, which satisfies the term check but is not grammatical. The grammar-aware prompt produced وكيل الذكاء الاصطناعي. Read the output, not just the score.
  • The hierarchy is unchanged. On the same corpus: 30B 86.7%, 1.8B Q4 70.0%, 1.8B Q8 60.0%, Haiku 50.0%, Qwen after repair 56.7%. Qwen's raw COMET is high; its glossary discipline is the weak point.
  • The four arms, 240 raw outputs, exact prompts and scores are in the pack index (zip).

What I tested

ItemValue
Modelqwen3.8:27b-mlx in Ollama 0.40.16, NVFP4, 27.8B, 262,144-token context
HostMac Studio, Apple M3 Ultra, 96GB, macOS 15.7.4
Date2026-11-29
Corpus20 paragraphs, 1,432 English words, same as the 30B and 1.8B tests
Glossary12 terms, same list as the 30B test
Runs3 per paragraph per arm = 60 outputs per arm
Decodingtemperature 0, think: false, 8,192 context, 2,048 max tokens
Armszero-shot, glossary prompt, glossary + few-shot, glossary + repair
Gloss baselineReused the Qwen outputs from the 30B test (same prompt, model and settings)
RepairThe model is called only when the strict checker finds a missing term

The prompts are in the pack. The model is a dense vision-language build with a 262,144-token context1, and the corpus comes from the Wikipedia article on AI agents2. The few-shot examples are two short sentences translated by Hy-MT3-30B3, not by Qwen, so the examples are not Qwen grading itself.

Results: the prompt does most of the work

ArmGlossary strictCOMET-Kiwi
Zero-shot26.7%0.7923
Glossary prompt46.7%0.7994
Glossary + few-shot50.0%0.7968
Glossary + repair56.7%0.7810

Requests and median latency: zero-shot 60 / 2.34 s, glossary 60 / 2.46 s, few-shot 60 / 2.35 s, repair 102 / 3.72 s. COMET-Kiwi4 is reference-free, so it scores the Arabic without a reference translation.

Chart of Qwen3.8 Arabic glossary results across four arms. Glossary strict rates are 26.7% zero-shot, 46.7% with the glossary prompt, 50.0% with few-shot and 56.7% with the repair pass. COMET-Kiwi scores are 0.7923, 0.7994, 0.7968 and 0.7810.

Fix 1: the glossary prompt

The zero-shot arm is the control. It gets the same translation instruction and the same guard about names, numbers and code, but no glossary. Qwen still renders "AI agent" its own way, and 39 of 90 required terms are missed. The result is unconstrained rather than wrong.

The glossary prompt adds the 12 lines:

Reference the following translations:
AI agent translates to وكيل ذكاء اصطناعي
agentic AI translates to ذكاء اصطناعي وكيلي
large language model translates to نموذج لغوي كبير
...

That single block raises strict glossary from 26.7% to 46.7%. The paired per-segment gain is 19.5 points (p = 0.006). COMET-Kiwi moves +0.0071 (p = 0.221), so there is no evidence of a fluency cost. This is the fix to ship.

The miss profile is consistent. "AI agent" is the biggest miss in every arm: 39 misses zero-shot, 39 with the glossary, 36 with few-shot, 30 after repair. Qwen often writes الوكيل الذكي or وكيل ذكي instead of the glossary's وكيل ذكاء اصطناعي. The glossary prompt reduces the variant, but it does not eliminate it.

Fix 2: few-shot

Two examples cost 60 extra prompt tokens per request. They raise the strict rate by 3.3 points overall, from 46.7% to 50.0%. The paired per-segment difference is 2.5 points (p = 0.718), and COMET moves -0.0026 (p = 0.320).

That is not a result I would build a pipeline around. The examples are useful for showing the terms in context, but Qwen already has the 12-line glossary. A third and fourth example might help, but the marginal return is small and the prompt grows on every request. If you want few-shot, measure it on your own glossary; do not assume it beats the plain glossary prompt.

Fix 3: the repair pass

The repair arm takes the glossary output and checks it. If every required term is present, the draft is kept. If a term is missing, Qwen gets a second prompt with the source, the draft, the glossary and a grammar note. It rewrites the paragraph.

The result is real but expensive:

  • Strict glossary: 46.7% to 56.7% (10.0 points overall; paired +6.7, p = 0.081).
  • Repairs: 42 of 60 outputs.
  • Requests: 102 for 60 outputs, 70% more.
  • Median latency: 2.46 s to 3.72 s.
  • COMET-Kiwi: 0.7994 to 0.7810 (paired -0.0184, p = 0.197).
  • Exact digits: 95.0% to 90.0%.
  • Length check: 100% to 95.0%.

The point estimate on COMET is negative. With 20 paragraphs it is not statistically significant. There is also no evidence that the repair improves raw quality; it improves the checker's terminology count.

The grammar note matters. A simpler repair prompt produced:

الوكيل الذكاء الاصطناعي هو برنامج ذكاء اصطناعي...

That string contains the glossary term, so the strict checker passes it. It is also ungrammatical. The grammar-aware prompt produced:

وكيل الذكاء الاصطناعي هو برنامج ذكاء اصطناعي...

If you use a repair pass, the checker is not enough. You need a grammar check or a human read.

Production checks

  • Code spans, placeholders and URLs: 100% in all four arms.
  • Exact digits: zero-shot 90.0%, glossary 95.0%, few-shot 95.0%, repair 90.0%.
  • Latin names kept: zero-shot 50.0%, glossary 45.0%, few-shot 45.0%, repair 45.0%.

Code and placeholders were never the failure mode for Qwen. The Latin-name row is a brand-script choice, not a translation error: Qwen transliterates more names than the 30B. The "all hard checks" number is 50.0% / 45.0% / 45.0% / 40.0%, but that number is dominated by the name-style check. Do not read it as "half the translations are broken." Read the individual rows.

Terminal capture of the Qwen3.8 Arabic glossary summary: zero-shot 26.7%, glossary prompt 46.7%, few-shot 50.0%, repair 56.7%, with COMET, request counts and latency.

Where this leaves Qwen

ModelGlossaryCOMET-Kiwi
Hy-MT3 30B Q886.7%0.7888
Hy-MT3 1.8B Q470.0%0.7457
Hy-MT3 1.8B Q860.0%0.7617
Qwen + repair56.7%0.7810
Haiku 5.550.0%0.8032
Qwen + glossary46.7%0.7994
Qwen zero-shot26.7%0.7923

Glossary is the strict checker. COMET-Kiwi is the paragraph score. The 30B is still the glossary specialist. The 1.8B Q8 beats Qwen after repair with one call, 60.0% to 56.7%. Haiku 5.55 is 50.0%. Qwen's COMET is high, but COMET does not enforce your terminology.

The practical read:

  • If you already use Qwen: add the glossary prompt. It is one prompt edit, 20 points, no measurable quality cost. Do not bother with few-shot unless your own test says otherwise.
  • If the glossary is critical: use Hy-MT3-30B, or the 1.8B if memory is tight. The repair pass does not close the gap to the 30B.
  • If you need a repair pass: budget 70% more calls, check the grammar, and measure COMET. A checker-only pass can produce grammatical nonsense.

Limitations

  • No human evaluation. COMET-Kiwi and the strict checker are automatic. The grammar example is a concrete failure, but a native editor would catch more.
  • One article. The paragraph test uses a single Wikipedia article on AI agents. It is rich in terminology, but it is not a legal contract or a marketing landing page.
  • MSA only. The glossary and references are Modern Standard Arabic. Do not generalize to Egyptian, Gulf or Levantine dialects.
  • One prompt design. The glossary prompt is not the only possible prompt. A different wording, ordering or example set could do better or worse.
  • The repair arm is a pipeline, not a model result. It uses the glossary draft plus a second call. Compare it to the other arms as a pipeline.

Frequently Asked Questions

Is the glossary prompt enough?

For many pipelines, yes. It raises strict glossary from 26.7% to 46.7% and does not hurt COMET. It is not enough for a glossary-critical product: the 30B is still 40 points ahead.

Why did few-shot not help more?

Two examples add context, but Qwen already has the 12-line glossary. The gain is 3.3 points overall and is not statistically significant (p = 0.718). The prompt grows on every request for a marginal return.

Does the repair pass hurt quality?

The point estimate is negative: COMET 0.7994 to 0.7810 (paired -0.0184, p = 0.197). At 20 paragraphs the difference is not statistically significant. There is also no evidence of improvement. It reduces exact-digit and length pass rates. Read the repaired text.

Can the repair pass cheat the checker?

Yes. A naive prompt produced الوكيل الذكاء الاصطناعي, which contains the term but is ungrammatical. The grammar-aware prompt produced وكيل الذكاء الاصطناعي. The checker measures term presence, not grammar.

Can I use the same prompt with Hy-MT3?

The 30B and 1.8B tests use the same glossary prompt format. Hy-MT3 is a translation specialist, so it already follows the terms better. The 30B reaches 86.7% without a repair pass.

What does this cost?

The local API bill is $0. The repair pass costs requests and latency: 102 calls for 60 outputs, median 3.72 s instead of 2.46 s. There is no per-token API fee on this machine.

Can I reproduce it?

Yes. The pack index has the four prompts, 240 raw outputs, per-output scores and the repair flags. The 30B pack and 1.8B pack have the comparison rows.

Footnotes

  1. Qwen, "Qwen3.8-27B-FP8" model card: 27B dense vision-language model, 262,144-token context, Apache 2.0. https://huggingface.co/Qwen/Qwen3.8-27B-FP8 ↩

  2. Wikipedia, "AI agent," revision 1387610875, 2026-11-24. CC BY-SA 4.0. https://en.wikipedia.org/wiki/AI_agent ↩

  3. Tencent, "Hy-MT3-30B-A3B-GGUF" model card: 30B total / 3B active, 102 languages, Apache 2.0. https://huggingface.co/tencent/Hy-MT3-30B-A3B-GGUF ↩

  4. Unbabel, "wmt22-cometkiwi-da" reference-free quality estimation. https://huggingface.co/Unbabel/wmt22-cometkiwi-da ↩

  5. Anthropic, "Pricing," Claude Haiku 5.5: $0.10 input / $0.50 output per million tokens up to 100K-token prompts. https://platform.claude.com/docs/en/about-claude/pricing ↩

Stay on the Nerd Track

One email a week: a Thursday issue with one system teardown, three remote jobs, one workflow and one Arabic takeaway.

No spam. Unsubscribe anytime.