paper

States Hidden in Hidden States: Implicit Discrete State Representations Emerge in LLMs' Hidden States

arXiv:2407.11421

Abstract

Large Language Models (LLMs) exhibit emergent abilities that may reveal aspects of their internal mechanisms. We study one such capability: directly performing extended sequences of calculations without generating chain-of-thought solutions. The strongest models in our evaluation can directly output sums with up to 15 addends, where operands are sampled from 1 to 100. We hypothesize that models form Implicit Discrete State Representations (IDSRs) within their hidden states and use them for internal symbolic calculation. We test for these representations, characterize their formation from layer, digit, and sequence perspectives, and investigate their use in producing answers. We also find that these state representations are far from lossless in current open-source models, contributing to errors in final outputs. Our work offers an initial exploration of LLMs' symbolic calculation abilities and underlying mechanisms. Code and reproducibility artifacts are available at https://github.com/Junhaoo-Chen/IDSR.

12 pages, 12 figures. Revised manuscript with public code and reproducibility artifacts; clarified the evaluation protocol; corrected figure labels and chance baselines, the attention-bridge description, cross-references, and probe notation. No new experiments

States Hidden in Hidden States: Implicit Discrete State Representations Emerge in LLMs' Hidden States · wovepaper