Contemplative LLMs: A Viral Prompt Engineering Experiment

Maharshi's experiment on X (formerly Twitter) went viral: a prompt designed to make LLMs like Claude and GPT-4 'contemplate' before answering. Inspired by OpenAI's o1 model, which uses reinforcement learning and 'test-time compute' for enhanced reasoning, the prompt encourages LLMs to explore multiple possibilities, question assumptions, and mimic human thought processes. It emphasizes exploration over immediate conclusions, deep reasoning, showcasing the thinking process, and persistence. While effective for complex tasks, the author cautions against potential hallucinations. The prompt's structure uses XML tags to separate the contemplation phase and the final answer, guiding the LLM with specific phrasing to enhance clarity and accuracy.