← Latest papers
💻 computer science

Leveraging Language Models for Log Statement Generation in Multilingual Scenarios: How Far Are We?

This paper introduces a large-scale multilingual benchmark to evaluate state-of-the-art log generation approaches and large language models across five programming languages, revealing that while UniLog performs best overall, significant language-specific challenges exist that necessitate tailored solutions rather than simply scaling model size or data volume.

Original authors: Kazuki Kusama, Honglin Shu, Masanari Kondo, Yasutaka Kamei

Published 2026-05-26
📖 5 min read🧠 Deep dive

Original authors: Kazuki Kusama, Honglin Shu, Masanari Kondo, Yasutaka Kamei

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 a software engineer building a massive, complex machine. To keep it running smoothly, you need to leave "breadcrumbs" (log statements) throughout the code. These breadcrumbs tell you what the machine is doing, where it might be stuck, or if something is about to break.

However, writing these breadcrumbs by hand is hard work. You have to decide:

  1. Where to put the note (the location).
  2. How urgent the note is (the level, like "Warning" vs. "Critical Error").
  3. What the note actually says (the message).

This paper is like a report card for a new set of "AI assistants" (Large Language Models) that developers are trying to use to write these breadcrumbs automatically. The researchers wanted to see if these AI assistants work well when the machine is built using five different languages (Java, Python, JavaScript, TypeScript, and C#), rather than just one.

Here is the breakdown of their findings, using simple analogies:

1. The Big Test: Can the AI handle a multilingual kitchen?

The researchers built a giant test kitchen with 150,000 recipes (code examples) in five different languages. They asked three types of chefs to write the breadcrumbs:

  • Specialized Chefs: AI models specifically trained to write logs (like UniLog).
  • General Chefs: Powerful, general-purpose AI models (like DeepSeek-V3 or GPT-4) that know a little bit about everything.

The Result:

  • The Specialized Chef Won: The model called UniLog was the best overall. It was like a chef who had a specific recipe book just for writing notes. It got the location, urgency, and message right about 20% of the time.
  • The General Chef Tried Hard: The best general AI (DeepSeek-V3) was good, but it only got it right about 11% of the time.
  • The "One-Size-Fits-All" Problem: The AI didn't perform the same in every language. It was like a chef who is a master at cooking Italian (JavaScript) but struggles with Thai (Python).
    • JavaScript was the easiest for the AI to handle.
    • Python was the hardest. The researchers found this is partly because Python code often has notes inside loops (repeating actions), which is confusing for the AI to predict.

2. The Training Strategy: Should the AI learn one language at a time?

The researchers asked: Is it better to teach the AI one language at a time, or throw all five languages into a blender and teach it everything at once?

The Result:

  • Specialization Wins: Teaching the AI one language at a time (Monolingual training) worked much better than mixing them all together.
  • The "Small Sample" Surprise: The most surprising finding was about UniLog. It didn't need a massive library of 120,000 recipes to learn. It only needed 500 examples to get really good. It's like a student who can master a subject by studying just a few key examples, whereas other students needed to read the whole encyclopedia. This suggests that how you teach the AI (the strategy) matters more than how much you feed it.

3. Why is it hard? (The "Why" behind the scores)

The researchers dug into why the AI struggled more with some languages than others. They found three main culprits:

  • The "Loop" Trap: In Python, code often repeats actions (loops). The AI gets confused about where to put a note inside a loop. It's like trying to write a note in the middle of a spinning carousel; it's hard to know exactly where to stop and write.
  • The "Vocabulary" Mismatch: Even if the AI knows where to put a note, it often gets the wording wrong. In Python, the notes are very diverse and unique (like writing a unique poem every time). In JavaScript, the notes are often repetitive templates (like filling out a form). The AI is great at copying the form (JavaScript) but terrible at writing the unique poem (Python).
  • The "Exact Match" Trap: The researchers realized that the way they were grading the AI was too strict. They were checking if the AI's note was an exact character-for-character match to the human's note.
    • Analogy: If a human writes "The engine is hot," and the AI writes "The engine is overheating," the strict grading says "Wrong!" even though the meaning is perfect.
    • When they used a smarter "judge" (another AI) to check the meaning instead of just the spelling, they found the AI was actually doing much better than the strict scores suggested. It was generating useful notes, just with slightly different words.

The Bottom Line

The paper concludes that we can't just make AI models bigger or feed them more data to solve this problem. It's not about size; it's about fit.

To make these tools work well in a multilingual world, we need to design them to understand the specific "personality" of each programming language. We can't treat Python like JavaScript. The best approach right now is to use specialized tools (like UniLog) that are tuned specifically for the language you are using, rather than relying on a giant, general-purpose AI to do everything.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →