Feature Resemblance: Towards a Theoretical Understanding of Analogical Reasoning in Transformers
Organizations: Department of Information Engineering, The Chinese University of Hong Kong, Hong Kong.
Abstract
Understanding reasoning in large language models is complicated by evaluations that conflate multiple reasoning types. We isolate analogical reasoning, where a model transfers an attribute between entities that share known properties, and study when such transfer can emerge from training. To make the problem analytically tractable, we study a minimal transformer-style abstraction that isolates how learned representations support analogical reasoning. Within this setting, we prove three key results. First, joint training on similarity and attribution premises enables analogical reasoning through aligned representations. Second, sequential training succeeds only when similarity structure is learned before specific attributes, revealing a curriculum asymmetry. Third, in our stylized setting, two-hop reasoning can be viewed as analogical reasoning with identity bridges , which appear explicitly in training data. Together, these results reveal a unified mechanism: entities with shared properties become aligned in representation space, enabling property transfer through feature resemblance. Experiments with architectures up to 8B parameters show qualitative agreement with the theory and suggest that representational geometry plays an important role in analogical reasoning beyond the stylized model.
Figures & tables
| Training tasks for Analogical Reasoning | Architecture | Training loss | Feature similarity | Success rate on |
|---|---|---|---|---|
| Joint training on | GPT-2 | 0.0077 1e-4 | 0.995 6e-4 | 100% 0% |
| Joint training on | One-layer | 0.001 5e-5 | 0.9202 7e-4 | 100% 0% |
| Late training on the attribution premise | GPT-2 | 0.0845 3e-4 | 0.7983 0.027 | 100% 0% |
| Late training on the attribution premise | One-layer | 0.0024 0 | 0.9689 4e-4 | 100% 0% |
| Late training on the similarity premise | GPT-2 | 0.0085 1e-4 | 0.4326 0.012 | 0.7% 0.471% |
| Late training on the similarity premise | One-layer | 0.0061 5e-5 | 0.0014 3.7e-3 | 0% 0% |
| Models | Tasks | Fea. Sim. | Success rate |
|---|---|---|---|
| Llama | Joint training | 0.8174 | 73% |
| Late on attribution | 0.7990 | 86% | |
| Late on similarity | 0.6431 | 53% | |
| Qwen | Joint training | 0.8488 | 85% |
| Late on attribution | 0.7971 | 72% | |
| Late on similarity | 0.7455 | 33% |
| Tasks | Fea. Sim. | Success rate |
|---|---|---|
| Joint training | 0.3785 | 84% |
| Late on Attribution | 0.3757 | 75% |
| Late on Similarity | 0.2704 | 34% |
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
| Training tasks for Analogical Reasoning | Architecture | Training loss | Feature similarity | Success rate on |
|---|---|---|---|---|
| Joint training on | One-layer | 0.0133 2e-4 | 0.9413 3e-4 | 100% 0% |
| Late training on the attribution premise | One-layer | 0.0198 1e-4 | 0.7116 2.2e-3 | 100% 0% |
| Late training on the similarity premise | One-layer | 0.0138 1e-4 | 0.4367 1.2e-3 | 0.67% 0.47% |
| Values of | Architecture | Training loss | Feature similarity | Success rate on |
|---|---|---|---|---|
| GPT-2 | 0.0294 3e-4 | 0.9756 5e-4 | 100% 0% | |
| One-layer | 0.0079 5e-5 | 0.6706 9e-4 | 100% 0% | |
| GPT-2 | 0.0077 1e-4 | 0.995 6e-4 | 100% 0% | |
| One-layer | 0.001 5e-5 | 0.9202 7e-4 | 100% 0% | |
| GPT-2 | 0.0039 5e-4 | 0.9979 3e-4 | 100% 0% | |
| One-layer | 5e-4 1e-4 | 0.9405 2e-4 | 100% 0% |
| Subject 1 | Subject 2 | Aspect | Relation | Category |
|---|---|---|---|---|
| Apple | Pear | Tree | AtLocation | Fruit |
| Ant | Bee | Small | HasProperty | Insect |
| Eagle | Hawk | Hunting | CapableOf | Bird of Prey |
| Bed | Sofa | Resting | UsedFor | Furniture |
| Boots | Sneakers | Outfit | PartOf | Footwear |
| Relation | Natural Language Template |
|---|---|
| AtLocation | [subject] is found in [Aspect] |
| MadeOf | [subject] is made of [Aspect] |
| UsedFor | [subject] is used for [Aspect] |
| CapableOf | [subject] is capable of [Aspect] |
| HasProperty | [subject] is [Aspect] |
| PartOf | [subject] is part of [Aspect] |
Analogical Reasoning
Analogical reasoning studies how systems transfer relations and solutions between situations with shared structure, enabling inference beyond direct examples.
See all 28 papers