Creating 'Optical Illusions' for LLMs by Mixing Token Hidden States

matthen2 · x · 2026-08-02

A developer successfully created an 'optical illusion' for large language models by mixing the hidden states of different tokens within Qwen2.5-7B-Instruct.

Technical details: At the mixed position in the prompt, the model uses hidden states from one token up to layer 20, and from the other token for the last 8 layers. If the model generates one of the mixed tokens, both are run, and the KV cache is substituted with their mean.

Quirky behavior: This manipulation causes severe conceptual confusion. For instance, mixing 'bird' and 'stone' makes the model invent 'a hard egg-like thing that lays itself.' Mixing 'Rome' and 'Delhi' results in the model claiming 'The capital of India is located on the Tiber River.'

Original post →

More from Fun

Fun channel →