RE2: The "Stupidest" AI Breakthrough That Actually Works
RE2 (prompt repetition) is a simple technique that significantly improves LLM performance by duplicating the input prompt. This workaround addresses causal masking in transformer architectures, where models can't see the end of a prompt while processing the beginning. By pasting the prompt twice, the second copy can attend to all tokens in the first copy, simulating bidirectional attention. Google research tested this across seven models (Gemini 2, GPT-4, Claude 3.7, DeepSeek) and seven benchmarks, showing consistent improvements—particularly dramatic in retrieval tasks (21.3% to 97.3% on name index tests). Unlike chain-of-thought methods that generate expensive output tokens sequentially, RE2 uses cheap input tokens processed in parallel, providing attention benefits without latency costs.