Abstract
Chain-of-Thought (CoT) prompting has been shown to enhance the multi-step reasoning capabilities of Large Language Models (LLMs). However, debates persist about whether LLMs exhibit abstract generalization or rely on shallow heuristics when given CoT prompts. To understand the factors influencing CoT reasoning we provide a detailed case study of the symbolic reasoning task of decoding shift ciphers, where letters are shifted forward some number of steps in the alphabet. GPT-4 achieves zero accuracy on most shift ciphers with standard prompting, but with CoT its accuracy improves to an average of 32%. By focusing on a single relatively simple task, we are able to identify three factors that systematically affect CoT performance: the probability of the task's expected output (probability), what the model has implicitly learned during pre-training (memorization), and the number of intermediate operations involved in reasoning (noisy reasoning). We show that these factors can drastically influence the task accuracy; e.g., varying the output's probability of occurrence can shift accuracy from 26% to 70%. We also demonstrate that it is essential for the model to explicitly produce intermediate steps as output that can be conditioned on to increase the probability of the correct answer. Our experiments indicate that as long as the model does so, the validity of the demonstrations in the prompt does not matter. Overall, we conclude that CoT prompting performance reflects both memorization and a probabilistic version of genuine reasoning.
Introduction
The AI community is currently debating whether Large Language Models (LLMs) truly "reason" through complex problems or merely employ sophisticated pattern matching. While Chain-of-Thought (CoT) prompting—where models "show their work"—significantly boosts performance, it remains unclear if this reflects genuine abstract generalization. This study isolates reasoning from memorization using shift ciphers (e.g., Caesar ciphers) as a controlled laboratory. Shift ciphers are mathematically precise yet vary in frequency (e.g., ROT-13 is common, while ROT-7 is rare), providing a "clean room" to test the drivers of CoT success.
Methodology
Researchers evaluated GPT-4, Claude 3, and Llama 3.1 on decoding 7-letter words across all 25 possible shift levels. Four prompting styles were tested: Standard (description only), Text-CoT (letter-by-letter decoding), Math-CoT (modular arithmetic), and Number-CoT (isomorphic number sequences).
The dataset consisted of 7-letter words divided into five "probability bins" based on English frequency (using GPT-2 log-probabilities), ranging from common words to nonsense strings. The C4 corpus was used to estimate the training frequency of different shift levels to identify memorization effects.
Analysis of Influencing Factors
The study identified three primary factors that statistically predict model success:
- Output Probability: LLMs exhibit a "probabilistic prior." If a model's step-by-step decoding leads to a nonsense string like "STAZ," but a common word "STAY" exists, the model often ignores its own logic in favor of the high-probability word.
- Noisy Reasoning: Reasoning is modeled as a "noisy" process. Models often attempt the "shortest path" (e.g., shifting back 1 instead of forward 25), but each step introduces potential failure. The more steps required, the higher the noise.
- Memorization: Performance spikes at specific shift levels, notably ROT-13, which is ubiquitous in training data, regardless of the inherent difficulty of the shift.
Key Results
The experimental results confirm that CoT performance is a mixture of these factors rather than pure symbolic logic.
- Probability is King: For GPT-4, simply varying the output word's probability (common word vs. nonsense) shifted accuracy from 26% to 70%.
- The ROT-13 Spike: All models showed a massive accuracy spike at shift level 13, providing clear evidence of memorization.
- Domain Sensitivity: Math-CoT and Number-CoT significantly outperformed Text-CoT, suggesting the "letter domain" is noisier for LLMs than the "number domain."
- Model Fit: A logistic regression model incorporating noisy reasoning and memorization factors closely matched actual GPT-4 performance curves, validating the proposed framework.
Conclusion
The study demonstrates that CoT prompting performance reflects a combination of memorization and a probabilistic form of reasoning. A key finding is the "Show Your Work" requirement: LLMs cannot "think silently" and require explicit intermediate steps to condition future predictions. While limited to shift ciphers, these results suggest that future work should focus on "de-biasing" models to rely more on their own logical chains rather than falling back on the most likely word in their vocabulary.
Summary updated