# Discourse AI Failing to translate large number of posts and topics

**URL:** https://meta.discourse.org/t/discourse-ai-failing-to-translate-large-number-of-posts-and-topics/385414
**Category:** Support
**Tags:** ai, content-localization
**Created:** [13 באוקטובר,‏ 2025,‏ 7:55am UTC](https://meta.discourse.org/t/discourse-ai-failing-to-translate-large-number-of-posts-and-topics/385414 "2025-10-13T07:55:49Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![panrafal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/panrafal/32/380633_2.png) [@panrafal](https://meta.discourse.org/u/panrafal)
#### Post date: [13 באוקטובר,‏ 2025,‏ 7:55am UTC](https://meta.discourse.org/t/discourse-ai-failing-to-translate-large-number-of-posts-and-topics/385414/1 "2025-10-13T07:55:50Z")

</div>

Hello there,

I’ve enabled Discourse AI on our community forum and started backfilling into multiple languages. Around 60% of posts and topics are translated, but in the process, I’m getting a LOT of errors in the console (`ai_translation_verbose_logs` is enabled) and now backfilling has mostly stalled:

```plaintext
DiscourseAi::Translation: Failed to translate topic 563 to de: Validation failed: Title can't be blank, Fancy title can't be blank /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-8.0.3/

DiscourseAi::Translation: Failed to translate post 582 to pl_PL: Validation failed: Raw can't be blank, Cooked can't be blank /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-8.0.3/lib/a

```

The strange thing about it is:

- Mentioned posts and topics look pretty normal, they have different kinds of title and bodies, both simple and complex. Similar ones got translated successfully
- On a second or third attempt they often get translated successfully
- I’m using a custom persona for Posts, but this happens on a built-in Post Translator persona as well as on the built-in topic title translations one
- It happens on all models I tested: Gemini-2.5-flash (non thinking), Gemini-2.5-flash (thinking), GPT5 and GPT5-mini
- It happens on all locales equally (en, es, pt, de, pl\_PL, fr, nl)

Is it possible to log the full prompts and model responses to debug this further?

I’m testing the same prompts manually on all of these models and they always respond successfully.

---

<div class="post-metadata">

### Author: ![panrafal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/panrafal/32/380633_2.png) [@panrafal](https://meta.discourse.org/u/panrafal)
#### Post date: [13 באוקטובר,‏ 2025,‏ 9:17am UTC](https://meta.discourse.org/t/discourse-ai-failing-to-translate-large-number-of-posts-and-topics/385414/2 "2025-10-13T09:17:40Z")

</div>

I’ve found `ai_api_audit_logs` and I think I’ve found the issue.

When translation is sent, there’s a `get_max_tokens` function which assigns max tokens based on text length.

Problem is, it’s mostly used up by reasoning. See this audit log, the limit was set to 1000, and reasoning took the whole 1000 before it even started generating output.

The limit for reasoning models should be much higher.

```plaintext
data: {"id":"chatcmpl-CQ7XU4Ep16RClb7OZQAxOXN9JWgIG","object":"chat.completion.chunk","created":1760341544,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"dPNNK7ojEf"}

data: {"id":"chatcmpl-CQ7XU4Ep16RClb7OZQAxOXN9JWgIG","object":"chat.completion.chunk","created":1760341544,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"length"}],"usage":null,"obfuscation":"dM2r"}

data: {"id":"chatcmpl-CQ7XU4Ep16RClb7OZQAxOXN9JWgIG","object":"chat.completion.chunk","created":1760341544,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":1075,"completion_tokens":1000,"total_tokens":2075,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":1000,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"j4"}

data: [DONE]

```

> <https://github.com/discourse/discourse/blob/26e5fc0d3f33b3229e0c635c5eb685782b246b09/plugins/discourse-ai/lib/translation/base_translator.rb#L57>

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [13 באוקטובר,‏ 2025,‏ 12:52pm UTC](https://meta.discourse.org/t/discourse-ai-failing-to-translate-large-number-of-posts-and-topics/385414/3 "2025-10-13T12:52:24Z")

</div>

> [@panrafal](#):
>
> Problem is, it’s mostly used up by reasoning.

I simply do not recommend using any type of thinking models for translation tasks.

> **[Nuenki | The more LLMs think, the worse they translate](https://nuenki.app/blog/the_more_llms_think_the_worse_they_translate)**
>
> Testing LLMs across multiple different thinking strategies demonstrated a consistent regression as they thought more, with the exception of Ensemble strategies.

https://embed.reddit.com/r/LocalLLaMA/comments/1g7y74t/adding_a_thinking_turn_to_extend_llms_reasoning/?embed=true&ref_source=embed&ref=share

---

<div class="post-metadata">

### Author: ![panrafal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/panrafal/32/380633_2.png) [@panrafal](https://meta.discourse.org/u/panrafal)
#### Post date: [13 באוקטובר,‏ 2025,‏ 3:10pm UTC](https://meta.discourse.org/t/discourse-ai-failing-to-translate-large-number-of-posts-and-topics/385414/4 "2025-10-13T15:10:18Z")

</div>

> [@Falco](#):
>
> I simply do not recommend using any type of thinking models for translation tasks.

My experience is quite the opposite. I have a set of instructions that I want to be followed that require understanding the context, which are either ignored by non-thinking models, or applied in wrong situations. I’ve just translated a whole application this way - \>3000 strings, with reasoning models giving _much_ better results.

I reduced thinking effort to `low` based on my findings and got all the translations come through. But I believe limiting the output tokens like that is counter-productive, as thinking models are not restricted from being used in translations, and user have no clue why it’s failing.

The solution could be as simple as further multiplying by 2 if the LLM has thinking enabled. Or exposing a multiplier as a config option.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [13 באוקטובר,‏ 2025,‏ 4:16pm UTC](https://meta.discourse.org/t/discourse-ai-failing-to-translate-large-number-of-posts-and-topics/385414/5 "2025-10-13T16:16:22Z")

</div>

> [@panrafal](#):
>
> I reduced thinking effort to `low` based on my findings and got all the translations come through. But I believe limiting the output tokens like that is counter-productive, as thinking models are not restricted from being used in translations, and user have no clue why it’s failing.

We had to limit max\_tokens as our usage of structured outputs meant that many smaller models could easily spiral down into infinite loops during translations.

I believe the newer version of OpenAI Responses API applies max\_tokens without counting the thinking tokens, which solves this issue.

---

<div class="post-metadata">

### Author: ![panrafal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/panrafal/32/380633_2.png) [@panrafal](https://meta.discourse.org/u/panrafal)
#### Post date: [13 באוקטובר,‏ 2025,‏ 5:27pm UTC](https://meta.discourse.org/t/discourse-ai-failing-to-translate-large-number-of-posts-and-topics/385414/6 "2025-10-13T17:27:41Z")

</div>

> [@Falco](#):
>
> I believe the newer version of OpenAI Responses API applies max\_tokens without counting the thinking tokens, which solves this issue.

I’m trying the latest GPT-5. I saw exactly the same issue with Gemini 2.5 Pro and 2.5 Flash. Why not to just increase the limit a bit?

I’ve spent quite a bit on failed tries, which I wouldn’t even know about if I didn’t enable the debug logging, and then had to poke around in the [Data Explorer](https://meta.discourse.org/t/32566?silent=true) to find the logs. All while I’ve used a pre-defined model creator.

---

<div class="post-metadata">

### Author: ![DevTeVe](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/devteve/32/487601_2.png) [@DevTeVe](https://meta.discourse.org/u/DevTeVe)
#### Post date: [27 באוקטובר,‏ 2025,‏ 11:42am UTC](https://meta.discourse.org/t/discourse-ai-failing-to-translate-large-number-of-posts-and-topics/385414/9 "2025-10-27T11:42:05Z")

</div>

I disabled the streaming and it made it much better (and still does thinking)

---

<div class="post-metadata">

### Author: ![nat](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nat/32/235063_2.png) [@nat](https://meta.discourse.org/u/nat)
#### Post date: [6 בנובמבר,‏ 2025,‏ 4:33pm UTC](https://meta.discourse.org/t/discourse-ai-failing-to-translate-large-number-of-posts-and-topics/385414/12 "2025-11-06T16:33:16Z")

</div>

We just merged an update that gives you access to a new setting `ai_translation_max_tokens_multiplier` which defaults to 1.

You should be able to bump this up to any number you like to deal with the limit you’re seeing.

[https://github.com/discourse/discourse/pull/35859](https://github.com/discourse/discourse/pull/35859)

---

<div class="post-metadata">

### Author: ![nat](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nat/32/235063_2.png) [@nat](https://meta.discourse.org/u/nat)
#### Post date: [10 בנובמבר,‏ 2025,‏ 12:00am UTC](https://meta.discourse.org/t/discourse-ai-failing-to-translate-large-number-of-posts-and-topics/385414/13 "2025-11-10T00:00:21Z")

</div>

This topic was automatically closed after 3 days. New replies are no longer allowed.
