LLM The Genius Paradox: A Linguistic and Math Expert’s Struggle with Simple Word-based Counting Problems (2025)

Abstract: Interestingly, LLMs yet struggle with some basic tasks that humans find trivial to handle, e.g., counting the number of character r’s in the word “strawberry”. There are several popular conjectures (e.g., tokenization, architecture and training data) regarding the reason for deficiency of LLMs in simple word-based counting problems, sharing the similar belief that such failure stems from model pretraining hence probably inevitable during deployment. In this paper, we carefully design multiple evaluation settings to investigate validity of prevalent conjectures. Meanwhile, we measure transferability of advanced mathematical and coding reasoning capabilities from specialized LLMs to simple counting tasks. Although specialized LLMs suffer from counting problems as well, we find conjectures about inherent deficiency of LLMs invalid and further seek opportunities to elicit knowledge and capabilities from LLMs which are beneficial to counting tasks. Compared with strategies such as finetuning and in-context learning that are commonly adopted to enhance performance on new or challenging tasks, we show that engaging reasoning is the most robust and efficient way to help LLMs better perceive tasks with more accurate responses.We hope our conjecture validation design could provide insights to study future critical failure modes of LLMs. Based on challenges in transferring advanced capabilities to much simpler tasks, we call for more attention to model capability acquisition and evaluation. We also highlight the importance of cultivating consciousness of “reasoning before responding” during model pretraining.

## introduction recently, large language models (llms) are able to achieve human-level performance on tasks such as complex reasoning, taking proficiency exams, code generation, multilingual understanding, and math problem solving @xcite . they even obtain expert-level performance on more challenging tasks like mathematical olympiad @xcite . surprisingly, llms yet struggle with some basic tasks that are easy or trivial for humans to handle, where no extensive word knowledge or complicated reasoning is required @xcite @xcite . for instance, gpt-4o generates a wrong answer to the questions of counting the number of character r's in the word "strawberry" @xcite . the research community has discussed actively over the mysterious reason for such unexpected failures. the top-voted conjecture attributes such deficiency in counting characters to the subword tokenization algorithm adopted by prevalent llms @xcite . other researchers speculate that llms haven't seen sufficient character-level data during pretraining, hence lack the capability to understand characterlevel relationships @xcite . @xcite theoretically proved that the capability of transformer-based models to count characters is constrained by their embedding size, and the more unique characters in words the worse performance achieved by llms. all the prior conjectures suggest that the deficiency of llms in solving easy word-based counting tasks originates from the design of llm systems (i.e., tokenization or model size) or the pretraining procedure (i.e., lack of character-level training), hence inevitable during model deployment. considering the broader impacts of word-based counting tasks on important research areas such as morphological analysis @xcite , we focus on investigating validity of above conjectures on llm failures by carefully designing multiple evaluation settings: conjecture i: by evaluating llms with character-level perturbation and explicit character tokenization rather than the default subword input, we do not observe noticeable performance improvement of llms, hence invalidating the conjecture regarding subword tokenization. conjecture ii: we consider classification tasks (e.g., sentiment analysis) that llms are proficient in with natural input. with input phrased by rarely seen character format instead, we observe performance well beyond random guess. this implies strong capability of llms in performing characterlevel reasoning, which conflicts with lack of character-level training conjecture. conjecture iii: we conduct comprehensive analysis on the impact of unique characters within queried words, but observe no clear connection to llm performance, implying invalidness of the conjecture regarding model size. we further evaluate specialized models, such as qwen2 math @xcite and codegemma @xcite , aiming to measure transferability of advanced mathematical and coding reasoning capability to simple wordbased counting tasks. unfortunately, neither math nor coding llms are able to improve performance over their base model trained on general domains in the open-ended setting. in contrast, python codes explicitly requested from coding llms can complete counting tasks with perfection. such undesired failure from powerful specialized llms trained on way more challenging task data calls for more research in training strategies for capability acquisition and benchmark construction for comprehensive capability evaluation. motivated by invalidation of prevalent conjectures regarding inherent deficiency of llms, we seek opportunities to elicit knowledge and reasoning capabilities from llms that are beneficial to simple counting tasks. specifically, we evaluate effectiveness of strategies commonly used to enhance llm performance on new or challenging tasks, i.e., widely adopted reasoning methods such as chain-of-thought @xcite and self-consistency @xcite , finetuning on counting data as well as in-context learning (icl) @xcite . compared with the other two directions, we find engaging reasoning is the most robust and efficient way to help llms better perceive the task and enhance final performance. with the aid of reasoning, gpt-4o is able to address all studied counting tasks with perfection, which is consistent with the core idea of "complex reasoning before responding" underlying recently announced model openai o1 @xcite . in summary, we analyze existing conjectures over failure modes of llms on simple word-based counting problems. we hope our conjecture validation procedure could also give insightful guidance in studying other unsolved deficiencies of llms such as the lost-in-the-middle phenomenon @xcite , distraction by irrelevant context @xcite , etc. we also show inability of specialized math or coding llms to transfer advanced capabilities to much simpler tasks, calling for more attention and research in model capability acquisition during training and comprehensive capability evaluation during benchmarking. lastly, we find effectiveness of reasoning strategies to help elicit knowledge and problemsolving capabilities from llms, highlighting importance of cultivating consciousness of reasoning during model pretraining. ## background we introduce related work in appx. §a.1. ## experimental setup motivated by the problem of counting the number of r's in the word "strawberry" (karpathy, 2024a), we randomly sample 500 words from the nltk library @xcite and prompt llms to answer four distinct word-based questions in zeroshot listed as follows, with their statistics listed in tab. 6. task i (char occur): how many {x}'s in the word "{y}"? in this task, x is a character randomly sampled from the word y . for example, given the question "how many r's in the word "strawberry"?", the correct answer should be 3. task ii (substring occur): is the substring "{x}" part of the word "{y}"? in this task, x is composed of a set of characters, and could be present or absent from the word y . for instance, the answer to the question "is the substring "raw" part of the word "strawberry"?" is "yes", while "no" is the answer to the question when the substring is substituted by "rae" foot_1 . task iii (word len): how many characters in the word "y"? this task requires llms to accurately count the number of characters in one word. for example, the ground-truth answer to the question "how many characters in the word "strawberry"?" is 10. task iv (distinct char): how many distinct characters in the word "y"? different from task iii, the llms are examined whether they are able to recognize each character in the word as well as their frequency. for instance, given the question "how many distinct characters in the word "strawberry"?", the correct answer is 8 since r repeats three times and should be considered one single character. we provide detailed introduction to evaluated language models and evaluation metrics in appx. §a.2. in tab. 1, we show evaluation results of different models on four studied tasks and two widely adopted benchmarks for comparison. although the counting problems do not require extensive world knowledge or math problemsolving abilities, all studied llms struggle with these seemingly simple tasks, resulting in similar or even worse accuracy than that on mmlu and in this work, we mainly focus on the english domain, but observe similar issues (shown in tab. 8) when asked character occurrence questions in words from other germanic (i.e., german and swedish) and romance (i.e., french, spanish, italian and portuguese) languages. we leave multilingual analysis for future work. besides static prompts used for four counting tasks, we find that prompt engineering does not enhance llm capabilities to circumvent such failure modes. we study two types of prompts per task conveying similar semantic meanings to evaluate effectiveness of prompt engineering: 1) four paraphrased prompts created by human heuristics and 2) one improved prompt provided by claude 3 . we provide detailed analysis in appx. §b. ## why llms struggle with simple counting problems there are three major conjectures trying to explain llms deficiency in simple word-based counting problems, detailed as follows: conjecture i: tokenization issues as introduced in §2.1, subword tokenization has become the dominant algorithm to convert text into numerical representations, making it challenging to perceive intrinsic characteristics and nuances of individual characters within words @xcite . moreover, the relationship between individual characters within a word can hardly be captured by the attention mechanism. ## whether math/code train data helps recently, many open-resource base llms have been further tuned on billions or trillions math @xcite @xcite or formal theoremproving data @xcite in order to solve advanced mathematical problems that require complex, multi-step logical reasoning. similarly, quite a few code models (qwenlm, 2024a; codegemmateam, 2024; mistralai, 2024a; zhu et al., 2024; 01ai, 2024) have been built on top of base llms and additionally trained on diverse programming language datasets, demonstrating significant advancements in various aspects of coderelated tasks such as code generation @xcite , completion @xcite and insertion @xcite . in this section, we focus on evaluating whether additional training on mathematical or coding data helps llms understand and improve reasoning over word-based counting tasks. ## how to make llms experts again as we have verified in §4, the popular conjectures, such as tokenization and lack of character-level training, are not the true barriers for llms to solve counting tasks. meanwhile, llms achieve competitive performance on far more challenging reasoning @xcite @xcite and mathematical @xcite benchmarks. therefore, we believe llms possess the knowledge and skills to solve counting problems if guided properly. we investigate whether reasoning strategies @xcite @xcite @xcite could elicit strong capabilities from llms to help perceive, reason and finally solve the problem. ## conclusions by carefully designing multiple evaluation settings, we first show that prevalent conjectures regarding such unexpected failures are invalid. we further show that specialized models with advanced mathematical or coding reasoning capabilities also suffer from addressing simple counting problems. we also find that reasoning is the most robust and efficient way to aid models in better perceiving and solving tasks, highlighting more research into "reasoning before responding" during pretraining.