“天天彩票” in your code: why OpenAI's models keep spitting out lottery spam
Since January, the names of Chinese gambling and porn sites have kept appearing in Codex output, tool calls and ChatGPT chat titles. Since the GPT-6.2 update, new reports are coming in. We pulled the scattered reports into a timeline and checked the three explanations doing the rounds. The trail leads to the tokenizer. If your agents commit their own code, this is more than a cosmetic glitch.

What's going on
A developer asks Codex about a file called events.json and gets this back: </Users前assistant to=functions.exec_command code 代大小规律 变态另类 1103 ынӡа 天天彩票怎么? Wait malformed. Need not. Let's continue manually. That one line holds a lottery term (“天天彩票”, roughly “daily lottery”), a porn category (“变态另类”), Cyrillic characters and an internal OpenAI control command. A user posted it on November 25 on the Chinese developer forum V2EX, shortly after the GPT-6.2 update. In the web interface, the same user asked about the Japanese nine-key keyboard and got the chat title “日语九键用法彩票娱乐”, which translates literally as “Japanese nine-key usage lottery entertainment.”
This isn't a one-off. For ten months, users have reported the same pattern across several model generations. We collected the reports and checked which explanation holds up.
The timeline: ten months, six model generations
| Date (2026) | Model / interface | Reported text | Source |
|---|---|---|---|
| Jan 27 | Codex CLI, model not specified | “天天中彩票有”, “qq彩票” in broken apply_patch calls |
OpenAI forum |
| Feb 20 | GPT-5.3-Codex ExtraHigh, 258,400-token context window | “天天中彩票不能json” | OpenAI forum |
| Feb 26 | GPT-5.2-chat-latest via the API | Endless loop of to=functions.create_hypothesis with lottery and Thai ads |
OpenAI forum |
| Feb 28 | GitHub Copilot Agent Mode, gpt-5.3-codex | Explicit sex ads in the middle of a team presentation | GitHub Discussion #188235 |
| Mar 10 | GPT-5.4 xhigh | Lottery terms plus Cyrillic, Armenian, Malayalam | Codex issue #14214 |
| Jul 24 | GPT-5.6 Terra, Codex heartbeats | “天天彩票app” after <automation_id> |
OpenAI forum |
| Aug 14 | ChatGPT Android, reasoning summary | “申博太阳城” | OpenAI forum |
| Sep 10 | GPT-5.6 Sol, chat title | “Analyze STNG 彩神争霸怎么样” | OpenAI forum |
| Sep 12 to Nov 20 | ChatGPT web, iOS, Windows, macOS | “马会”, “天天彩票提现”, “热久久精品” and others | Codex issue #45061 |
| Nov 25 | After the GPT-6.2 update, Codex and web | “天天彩票怎么”, “彩票娱乐” | V2EX |
According to the tech magazine ifanr, starting in mid-August the spam migrated from Codex output into the auto-generated chat titles of regular ChatGPT users. Since September, it has reportedly become rarer in the actual response text. English, Russian and Indonesian conversations are affected too. One user got a contaminated title for a US stock analysis, identical in Chrome and in the iOS app. He concludes that the title is stored on the server.
OpenAI's responses follow a pattern. On March 2, OpenAI employee etraut-openai wrote in Codex issue #13260:
“Yes, this is a known issue. We plan to address it in the next model generation.”
At least four generations have shipped since. Support replied in similar terms in July, October and November: the behavior is “not expected,” a future update should fix it, please send screenshots. On October 15, support stressed that the phenomenon alone doesn't prove any data leakage between users. Issue #45061 has been open since September 12. OpenAI still hasn't responded there.
Explanation 1: a hack or prompt injection
Many affected users first suspected an attack. One forum thread is literally titled “Is ChatGPT hacked?” What people usually mean is prompt injection: outside text, say from a web page, smuggles instructions into the model's context. Several findings argue against this. The spam shows up in titles for questions about coffee beans or keyboards, with no web search and no outside content. One user in the GitHub issue ruled out browser extensions, the hosts file and proxies. The V2EX user runs his own proxy and saw the problem in the official web interface too.
One caveat: on V2EX and LINUX DO, several users suspect some cases come from third-party relays, known as “中转站”. These are unofficial API resellers that could inject text. That doesn't explain the cases in the official apps. Our take: A hack is unlikely to be the main cause. An attacker would hardly plant the same handful of spam brands across every platform for ten months.
Explanation 2: polluted training data
The second theory says the model saw spam during training and is regurgitating it. There's solid evidence for this. In September 2025, researcher Lennart Finke examined the open weights of gpt-oss on LessWrong. He then used membership inference, a test of whether a model knows a text from its training data, to probe GPT-5, GPT-5 Mini, GPT-5 Nano and both gpt-oss variants with 50 Chinese spam tokens. GPT-5, for example, correctly translated “毛片免费观看” (“watch porn videos for free”). Other tokens, like “彩娱乐彩票”, weren't recognized by any model. How often a token appears on GitHub correlated moderately with the hit rate (Spearman ρ = 0.448). Finke reads this as strong evidence that GPT-5 saw such phrases in training, and as weak evidence that GitHub was the source. Commenters on Hacker News pushed back: the phrases also turn up en masse in link farms and pirated subtitles, not just on porn sites.
Explanation 3: the spam tokens in the o200k tokenizer
The strongest trail leads to the tokenizer, the tool that chops text into pieces before the model reads it. Since GPT-4o, every OpenAI model has used the o200k vocabulary, with roughly 200,000 entries. In May 2024, Princeton PhD student Tianle Cai pulled out the 100 longest Chinese tokens. According to MIT Technology Review, 97 of them were gambling or porn terms. A Tsinghua study published at EMNLP 2025 measured it again: more than 40 percent of Chinese tokens longer than two characters fall into these categories. According to the study's table, 27.7 percent are gambling and 13.2 percent are adult content.
That gives us our cross-check against other vendors:
| Vocabulary | Share of problematic long Chinese tokens |
|---|---|
| GPT-4o / o1 / o3 / 4.1 (o200k) | 46.6% |
| LLaMA-3, MiniCPM | approx. 5.8% |
| Qwen | 1.0% |
| DeepSeek | 0.17% |
| GPT-4 / GPT-3.5 (cl100k) | 0% |
Claude's tokenizer isn't public. In Finke's test, Claude 4 translated every token correctly. We found no reliable reports of comparable output from Qwen, DeepSeek or Claude. One forum poster claims Gemini is affected too, but offers no evidence.
The reported strings match the vocabulary strikingly well. In his analysis of o200k, developer Han Lee listed tokens including “微信的天天中彩票”, “qq的天天中彩票”, “中国福利彩票天天”, “彩神争霸邀请码” and “彩神争霸电脑版”. Finke found “天天买彩票” and “北京赛车怎么”. The Codex outputs read “天天中彩票”, “qq彩票”, “彩神争霸怎么样” and “天天彩票怎么”, so they follow the same building-block pattern of brand name plus suffix. The foreign scripts line up too. Among the anomalous tokens, Finke found Abkhaz, Armenian and Thai. The reports feature Armenian, Thai gambling ads and, in the V2EX example, “ынӡа”. The “ӡ” is a letter of the Abkhaz alphabet.
We didn't run our own full count with the tiktoken tokenizer tool. The comparisons rely on the published lists.
Whether these tokens are “undertrained” is disputed. Classic glitch tokens from the GPT-2 era sat close to the average of all embeddings, the numeric vectors a model uses to represent each token. In gpt-oss, by contrast, the Chinese spam tokens have especially large vectors, sit far from the average and resemble each other. In other words, they form their own cluster. Finke himself cautions that vector magnitude is only a proxy.
ifanr has put forward a plausible hypothesis: the small model that generates the titles sometimes misses the stop signal and then slides into tokens it doesn't understand. Because so many of those are spam, an ad fragment ends up in the title. Our take: That fits where the spam shows up. It almost always appears at transitions: at the end of a title, after automation tags or in broken tool calls. It also fits that internal format commands like assistant to=functions.exec_command slip out along with it. That's what tool calls look like in OpenAI's internal Harmony format. Reasoning fragments like “Wait malformed” leak out too, even though OpenAI's own docs say that reasoning channel is never meant for users. Two reports also name long contexts as a trigger. OpenAI hasn't confirmed any of these explanations.
What developers can actually do
- Scan diffs for CJK characters: A pre-commit hook with
git diff --cached -U0 | grep -nP '^\+.*\p{Han}'catches newly added Chinese characters. In projects that legitimately contain Chinese, check against a blocklist instead, with terms like 彩票, 彩神争霸, 申博, 太阳城, 马会, 久久, 提现. It's also worth searching forto=functions.,+#+#+#and characters from Unicode's Private Use Area. - logit_bias, with limits: The parameter lowers the probability of individual token IDs. At −100, OpenAI says it blocks them “in most cases.” But it only works via the API. According to Microsoft's Azure docs, reasoning models don't support it, with the exception of GPT-6 Astra. And every spam phrase comes in dozens of variants. In ChatGPT and Codex subscriptions, you can't set logit_bias at all.
- Keep context short: One affected user only saw the spam with GPT-5.3-Codex on long contexts; Codex 5.2 stayed clean on the same task. Starting fresh sessions instead of endless threads costs you nothing. Support also recommends regenerating, opening a new chat and explicitly setting the output language.
- Skip unofficial resellers: If you use official endpoints, you rule out the hack scenario. Report cases with the
request_id, which OpenAI has explicitly asked for.
The bigger picture
In a chat title, the bug is embarrassing. In an agent that patches files, runs commands and writes commits on its own, it's a quality and security problem. Broken apply_patch and exec_command calls show that the spam emerges exactly where the model drives tools. One user had to restart his server because of an endless loop. Another got sex ads during a presentation livestream. If a string like that slips unnoticed into a public repository, it could end up in the training data for the next models. Our take: That would be a feedback loop, and the GitHub correlation in Finke's data makes it plausible.
The tokenizer explanation has the best evidence: it's measurable, stable across model generations and matches the specific strings. What remains open is why the problem waxes and wanes, and what role the title model plays. In ifanr's view, the root cause can only be fixed with a clean tokenizer, and that's tied to the base model. That would mean retraining the model. Until then, output filters and human code review are the only reliable safeguards. Four generations later, developers are still waiting for the “next model” OpenAI promised in March.
Sources
- GitHub: openai/codex Issue #45061 github.com
- GitHub: openai/codex Issue #13260 github.com
- GitHub: openai/codex Issue #14214 github.com
- GitHub: openai/codex Issue #55713 github.com
- GitHub Community Discussion #188235 github.com
- V2EX: GPT 最近好像很容易输出一些博彩相关的内容啊 v2ex.com
- OpenAI-Forum: Chinese gambling characters in Codex CLI output community.openai.com
- OpenAI-Forum: Is ChatGPT hacked? community.openai.com
- OpenAI-Forum: Random Chinese Lottery and Gambling references (5.6 Terra) community.openai.com
- OpenAI-Forum: Codex Automations leak heartbeat metadata community.openai.com
- OpenAI-Forum: Android reasoning summary community.openai.com
- OpenAI-Forum: Chattitel mit „申博太阳城“ community.openai.com
- OpenAI-Forum: Chattitel serverseitig auf zwei Plattformen community.openai.com
- OpenAI-Forum: Fall vom 4. November 2026 community.openai.com
- LessWrong: What GPT-oss leaks about OpenAI's training data lesswrong.com
- fi-le.net: GPT-oss-Analyse (Originalfassung) fi-le.net
- Hacker News-Diskussion zur gpt-oss-Analyse hn.svelte.dev
- MIT Technology Review: GPT-4o's Chinese token-training data is polluted technologyreview.com
- arXiv 2406.11214: Problematic Tokens arxiv.org
- arXiv 2508.17771: Speculating LLMs' Chinese Training Data Pollution from Their Tokens (EMNLP 2025) arxiv.org
- Han Lee: NSFW: GPT-4o Tokenizer leehanchung.github.io
- Language Log: OpenAI's Chinese problem languagelog.ldc.upenn.edu
- ifanr: 为什么 ChatGPT 总爱在标题里塞色情赌博小广告? ifanr.com
- AI-Talks: The Chinese Characters That Should Not Have Been There ai-talks.org
- OpenAI Cookbook: Harmony-Format developers.openai.com
- Microsoft Learn: Azure OpenAI reasoning models learn.microsoft.com
- OpenAI Help: Using logit bias help.openai.com
- 9to5Mac: GPT-6.2 Astra und Sol 9to5mac.com
Ask the AI assistant
Questions about this article, installation or background? Our assistant knows this page and runs on our own machine, not in someone else's cloud.
The Assistant is an AI (Gemma 4) and can make mistakes – please check important details against the source. Questions are used only to generate an answer and are deleted after one hour. Please don't enter any personal data.
Comments
What do you think? Already tried it? Write it here, no sign-up needed.
Comments are public. Links aren't allowed, and we delete abusive posts. You can delete your own comment at any time in this browser. Learn more in the Privacy Policy.