1.2.3's _LANGUAGE_REMINDER turns English notes full of German terms into German facts (Qwen3.5-397B)
Seen on a self-hosted Hindsight 1.2.3 (API image by digest), compared with the 1.2.1 image on the same server.
Paths are under hindsight_api/; line numbers are those of the 1.2.3 image.
Model and provider: Qwen/Qwen3.5-397B-A17B-FP8 behind an OpenAI-compatible API (Infomaniak), with
HINDSIGHT_API_LLM_PROVIDER=openai, reasoning effort "none", HINDSIGHT_API_LLM_STRICT_SCHEMA_RETAIN=false,
retain_extraction_mode: concise, a bank retain_mission written in English that names no language, and no
HINDSIGHT_API_LLM_OUTPUT_LANGUAGE.
Short
1.2.3 appends one line after the content of every fact-extraction request:
Write each fact in the language the Content above is written in.
(_LANGUAGE_REMINDER, engine/retain/fact_extraction.py line 1070, appended by _build_user_message, lines
1945-1956.) With this model, English notes that are full of German names and terms (legal, administrative and
land-register words, German place and company names) now often come back with every fact in German. The same notes
gave English facts under 1.2.1, and the system prompt's own rule ("Write every fact in the same language and script
as the input text. Never translate.") is unchanged. It is the only language change in the retain prompt between
1.2.1 and 1.2.3.
| Test | Facts in German |
|---|---|
| 1.2.1, 14 Nov: dry runs of 16 English notes full of German terms, 5 prompt variants each (80 runs) | 1 run of 80 (6 facts) |
| 1.2.3: the same kind of note A (about 1,700 characters), 9 dry runs (3 variants of context and metadata, 3 runs each) | 9 of 9 runs, every fact |
| 1.2.3: note B (about 2,400 characters, 10% German words), 9 dry runs | 3 of 9 runs, every fact (one per variant) |
| 1.2.3: one recorded extraction request of note A, replayed as recorded | 2 of 2 replies German |
| 1.2.3: the same recorded request with only the reminder line removed (all else byte for byte) | 1 of 4 replies German, 3 of 4 English |
Note A was English in all 5 of its 1.2.1 runs. In a 20-note test with production settings on 1.2.3, 53 facts came back in German, all from three English notes of this kind. Context and metadata are not the cause: note A came out German with them, without them, and with the context alone. The replay sent the recorded messages and parameters (including reasoning effort "none") straight to the provider, so the only difference between its two rows is the reminder line.
Why it seems to happen
For an English sentence such as "... the Kaution was set off against the Nebenkostenabrechnung that the Hausverwaltung sent ...", "the language the Content above is written in" is ambiguous: the model appears to read the German terms as the content's language. The system prompt's rule already covers this case, and the line right after the content tips it. Without the line, this model still wavers a little on such notes (1 of 4 above), so the terms alone are a weak pull.
No way to turn it off without translating everything
default_language_section() (engine/prompt_utils.py) drops the reminder only when llm_output_language is set.
That setting:
- is server-wide only (
HINDSIGHT_API_LLM_OUTPUT_LANGUAGE). It is not inHindsightConfig._CONFIGURABLE_FIELDS, so a bank cannot set it, andapply_strategy()drops it from a retain strategy; - names one language for every note, and adds "Respond exclusively in X. Translate any source content into X." So a bank that holds German and French notes as well gets them translated (we saw exactly that in a test).
Sentences in the retain_mission that name no language made this worse for us, not better. For example: "Write
every fact in the language of the sentences it is taken from, also when they carry names and terms from another
language; never translate." Under 1.2.1, such sentences also turned these notes German. The workaround in #6843 (a
mission line naming English) does not fit a bank with notes in several languages.
Possible directions
- A switch for the reminder (server-wide or per bank), off or on, defaulting to today's behaviour.
- Make
llm_output_languagea per-bank and per-retain-strategy setting. A bank could then pin the language of each note through a strategy (e.g.de,fr,en) instead of the whole server translating into one language. - Or detect the language in code and name it in the reminder, as #6843 suggests. That also covers the Gemma 4 case the line was added for.
Related: #6843 (English input written in other languages on gpt-6-luna; it mentions the reminder but did not test it).
Thanks for the detailed report and the replay test, it made the cause easy to confirm.
The line after the content is on purpose. It was added in 1.2.2 because without it, some models (Gemma 4) wrote non-English input as English facts. It is dropped when HINDSIGHT_API_LLM_OUTPUT_LANGUAGE is set. For text that mixes languages, a model can read the borrowed terms as the content's language, as you saw with Qwen3.5. We're keeping the current behaviour for now. If more mixed-language reports come in, we'll look at naming the detected language in the line instead.
Closing as working as intended.