The Emergent Symbolic Structure of Artificial Neural Networks
Organizations: Microsoft Research
Abstract
Modern systems in artificial intelligence (AI) somehow excel in domains for which they seem poorly suited. Intelligence has traditionally been modeled as operating over structured combinations of symbols, such as logical formulas. However, the strongest modern AI systems are based on neural networks, which instead represent information in continuous vectors. Vectors seem inadequate for capturing the structure of language, logic, and other cognitive domains, yet neural networks achieve impressive performance in these areas. How do they do it? In this work, we propose a potential answer: Despite appearances, perhaps the internal representations of neural networks implicitly realize symbolic structure. In support of this hypothesis, we show that the vector representations of a variety of neural networks can be closely approximated with symbolic structures: we can replace the network's entire representation-generating process with a closed-form equation instantiating a symbolic structure, and the network's behavior remains largely unchanged. This finding holds for both small-scale neural networks trained to manipulate lists as well as large language models (LLMs) operating in four domains that are central in symbolic traditions: arithmetic, logic, computer code, and language. Further, our symbolic approximation allows us to modify an LLM's behavior in targeted ways via precise interventions on its internal representations, showing that the LLM's behavior is reliant on the symbolic structures we have identified. This work provides a potential way to reconcile longstanding symbolic conceptions of intelligence with the vector-based nature of modern AI.
Figures & tables
| Task | Example | Answer |
|---|---|---|
| Arithmetic | 7 + -6 * 3 | -11 |
| Syllogisms | We are given two premises: No polite agents are painters. All gamblers are painters. Please return the first conclusion listed below that follows from these premises: All gamblers are polite agents. Some gamblers are polite agents. No gamblers are polite agents. Some gamblers are not polite agents. | No gamblers are polite agents. |
| Code execution | def change(sequence): return [“Q”] + sequence def alter(sequence): return sequence[::-1] y = [“S”, “M”, “V”] x = [“U”, “C”] change(y) | [“Q”, “S”, “M”, “V”] |
| Passivization | Passivize the following sentence: The swimmer who the polite politician advised avoided the accountant near the clever gardener. | The accountant near the clever gardener was avoided by the swimmer who the polite politician advised. |
| Tense reinflection | Convert the following sentence to the present tense: The important detective who recommended the astronauts recognized the tall detective. | The important detective who recommends the astronauts recognizes the tall detective. |
| Question formation | Convert the following sentence to a yes/no question: The professor who the painter will encourage would visit the musician near the famous runner. | Would the professor who the painter will encourage visit the musician near the famous runner? |
| Bag-of-words | Bidirectional | Bidirectional | Task-specific | Task-specific | |
|---|---|---|---|---|---|
| (self) | (all) | (self) | (all) | ||
| The | {present:The} | {(0,0):The} | {(0,0):The} | {subj_det:The} | {subj_det-subj_det:The} |
| spy | {present:The, present:spy} | {(1,0):spy} | {(0,1):The, (1,0):spy} | {subj_n:spy} | {subj_det-subj_n:The, subj_n-subj_n:spy} |
| helped | {present:The, present:spy, present:helped} | {(2,0):helped} | {(0,2):The, (1,1):spy, (2,0):helped} | {verb:helped} | {subj_det-verb:The, subj_n-verb:spy, verb-verb:helped} |
| the | {present:The, present:spy, present:helped, present:the} | {(3,0):the} | {(0,3):The, (1,2):spy, (2,1):helped, (3,0):the} | {obj_det:the} | {subj_det-obj_det:The, subj_n-obj_det:spy, verb-obj_det:helped, obj_det-obj_det:the} |
| poet | {present:The, present:spy, present:helped, present:the, present:poet} | {(4,0):poet} | {(0,4):The, (1,3):spy, (2,2):helped, (3,1):the, (4,0):poet} | {obj_n:poet} | {subj_det-obj_n:The, subj_n-obj_n:spy, verb-obj_n:helped, obj_det-obj_n:the, obj_n-obj_n:poet} |
Appendix figures & tables14 assets
Supplementary material from the paper’s appendix.
Appendix
| LLM | Layers analyzed | Hidden state size |
|---|---|---|
| Gemma-3-27b | 1, 16, 31, 46, 62 | 5376 |
| GPT-2-XL | 1, 12, 24, 36, 48 | 1600 |
| GPT-OSS-20b | 1, 6, 12, 18, 24 | 2880 |
| Pythia-12b | 1, 9, 18, 27, 36 | 5120 |
| Qwen3-14b | 1, 10, 20, 30, 40 | 5120 |
| OLMo-2-13B | 1, 10, 20, 30, 40 | 5120 |
| Original | Edit to make | |
|---|---|---|
| The | {subj_det-subj_det:The} | None |
| spy | {subj_det-subj_n:The, subj_n-subj_n:spy} | subj_n-subj_n:spy subj_n-subj_n:astronaut |
| helped | {subj_det-verb:The, subj_n-verb:spy, verb-verb:helped} | subj_n-verb:spy subj_n-verb:astronaut |
| the | {subj_det-obj_det:The, subj_n-obj_det:spy, verb-obj_det:helped, obj_det-obj_det:the} | subj_n-obj_det:spy subj_n-obj_det:astronaut |
| poet | {subj_det-obj_n:The, subj_n-obj_n:spy, verb-obj_n:helped, obj_det-obj_n:the, obj_n-obj_n:poet} | subj_n-obj_n:spy subj_n-obj_n:astronaut |
| . | {subj_det-punct:The, subj_n-punct:spy, verb-punct:helped, obj_det-punct:the, obj_n-punct:poet, punct-punct:.} | subj_n-punct:spy subj_n-punct:astronaut |
| Architecture | Task | Best | OOD accuracy | |
|---|---|---|---|---|
| Unreg. | Reg. | |||
| MLP | Copying | 0.0 | 1.0 | 1.0 |
| Reversal | 0.0 | 1.0 | 1.0 | |
| Interleaving | 0.0 | 1.0 | 1.0 | |
| GRU | Copying | 0.001 | 0.77 | 0.98 |
| Reversal | 0.00001 | 1.0 | 1.0 | |
| Model | Task | Best | OOD accuracy | |
|---|---|---|---|---|
| Unreg. | Reg. | |||
| Gemma (31) | Sentences | 0.001 | 0.00 | 0.86 |
| Llama-3.1 (16) | Sentences | 0.0005 | 0.00 | 0.90 |
| OLMo-2 (20) | Sentences | 0.001 | 0.00 | 0.86 |
| Role scheme | Number of roles |
|---|---|
| Left-to-right | 6 |
| Right-to-left | 6 |
| Bidirectional | 21 |
| Wickelroles | 729 |
| Bag-of-words | 1 |
Neural Network Interpretability
Neural network interpretability studies how models represent information and make predictions, and how to explain, test, or control their internal computations.
See all 333 papers