Skip to content

Gemini 3.5 Flash/Flash-Lite: single-token cross-script substitution inside Norwegian compound words (REST-level, seed-reproducible) #2831

Description

@Apaaaaaaaaaa

Note: This is a model/API-level report, filed here because #1969 tracked the same defect class (spurious foreign-script characters in output) and went stale-closed. Everything below was reproduced with raw REST calls to generativelanguage.googleapis.com/v1beta — no SDK involved — so this is not an SDK decoding artifact. Seed-based deterministic reproductions are included.

Summary

gemini-3.5-flash-lite and gemini-3.5-flash occasionally replace ONE subword token inside a Norwegian compound word with a single vocabulary token from an unrelated script, then recover immediately. Observed across seven scripts (Devanagari, Arabic, Telugu, Hiragana, Cyrillic, Greek, Han) in 14 controlled hits (16,000 seeded calls) + 1 production hit. Surrounding text — including Norwegian ø/æ/å — is always intact, ruling out charset/transport issues.

Key characteristics:

  • Single-token substitution, verified at token level. The observed sequences are exact single tokens in the Gemma 3 (262k) vocabulary, which countTokens confirms matches this model's tokenizer (identical counts on all probe strings, including Gemma-2-vs-3 discriminators): ंजनों = id 195032, منى = id 101260. Both are continuation pieces (no leading ), which is why they splice seamlessly mid-word. In the clearest case the intended token is provably (id 45520) — every plausible continuation of "K…" (Kjøleanlegg/Kjølebatteri) tokenizes K + + … — and the model emitted id 101260 instead, at one step, then recovered.
  • The substitute tokens are cross-lingually aligned twins of the intended text: semantic — drens排水 (排水 = "drainage"; the model wrote "drainage" twice, once per language); morphological — hastighetsreguler + μένη (Greek passive-participle suffix where Norwegian "-te" belongs); phonetic — pumpesum + पान + legg for "pumpesumpanlegg" (पान transliterates "pān"). Others are high-frequency fragments (स्वामी, стьян, わたし). This points at multilingual embedding alignment supplying the wrong candidate at uncertain steps.
  • Reproducible via seed. Fixed seed → corrupted output in 5/6 replays over time; one seed (819) is byte-identical 3/3. Seed table below.
  • Not mitigable client-side. On gemini-3.5-flash-lite, temperature/topK/topP are accepted (HTTP 200) but ignored — empirically verified: temperature=0 yields 8/8 unique outputs, indistinguishable from temperature=2.0. There is therefore no generationConfig that prevents the substitution.
  • Trigger: positions inside rare Norwegian compounds, where the vocabulary has no dedicated Norwegian tokens and the intended continuation is a low-information glue piece (, anns, …). A compound-dense prompt raises the rate ~2.5x.
  • Unlike Gemini outputs spurious CJK characters at string boundaries (tokenization artifact) #1969 (single CJK chars at string boundaries), these substitutions occur mid-word and are linguistically coherent pieces — possibly a related but distinct failure mode.

Environment

  • API: generativelanguage.googleapis.com/v1beta, generateContent (raw REST/curl)
  • Models: gemini-3.5-flash-lite (GA), gemini-3.5-flash (GA)
  • Dates: 2026-08-06 (production), 2026-08-07 (controlled, 16,000 seeded calls)

Rates (temperature param 0.7 — ignored by lite; seeds 1..N; same prompts)

cell hits
function-call args, flash-lite 5/5000
plain-text JSON, flash-lite 1/5000
function-call args, flash-lite, compound-dense prompt 5/2000
structured output (responseSchema), flash-lite 0/2000
function-call args, gemini-3.5-flash 3/2000

Minimal reproduction

System instruction:

Du er en norsk VVS-fagassistent i TechCheck. Mangler du informasjon, spør du
brukeren med konkrete alternativer i stedet for å gjette.

User message:

Jeg skal velge pumpe til et anlegg, men er usikker. Kan du stille meg noen spørsmål først?

One function declaration ask_user_questions(question: string, options: {id,label}[], total_steps: integer); generationConfig: {"temperature":0.7,"maxOutputTokens":2048,"seed":<SEED>}.

seed model surface corrupted fragment script
624 flash-lite tool args Avløps- eller spillvannsस्वामी Devanagari
820 flash-lite tool args Ventilasjons- og స్తోందిrlegg Telugu
3774 flash-lite tool args Avløp-/spilleevannsстьян Cyrillic
4369, 4492 flash-lite tool args Ventilasjons- og స్తోంది… Telugu
819 flash-lite plain text (same prompt + "Svar KUN med JSON …") Avløps- og pumpesumपानlegg Devanagari
602, 1258 flash-lite tool args (dense prompt) tappeわたしvarmtvann… Hiragana
1300 flash-lite tool args (dense prompt) kondensvannsreturまったpumpe Hiragana
1758 flash-lite tool args (dense prompt) hastighetsregulerμένη Greek
1423 flash-lite tool args (dense prompt) tappe牠vannspumpe Han
1293, 1643, 1895 flash (non-lite) tool args drens排水 Han

Ablation on failing seeds (one variable changed at a time): corruption persists under topK=1, temperature 0.1/1.0, topP 0.9/0.8 (all ignored/ineffective); disappears on model swap and with thinkingConfig.thinkingBudget=512 (different generation path).

Related public reports (same class)

Impact

User-facing chat labels in a Norwegian B2B application intermittently contain foreign-script fragments. Since sampling parameters are ignored on flash-lite, the only downstream defenses are output post-processing or switching models. Happy to provide the full self-contained repro harness (PHP/curl, no deps) and raw API responses for all hit seeds.

Metadata

Metadata

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions