Saved in:
Bibliographic Details
Main Authors: Yugeswardeenoo, Dharunish, Nukala, Harshil, Shah, Ved, Blondin, Cole, Brien, Sean O, Sharma, Vasu, Zhu, Kevin
Format: Preprint
Published: 2025
Subjects:
Online Access:https://arxiv.org/abs/2510.13908
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866918181418827776
author Yugeswardeenoo, Dharunish
Nukala, Harshil
Shah, Ved
Blondin, Cole
Brien, Sean O
Sharma, Vasu
Zhu, Kevin
author_facet Yugeswardeenoo, Dharunish
Nukala, Harshil
Shah, Ved
Blondin, Cole
Brien, Sean O
Sharma, Vasu
Zhu, Kevin
contents Large Language Models (LLMs) have demonstrated impressive reasoning capabilities but continue to struggle with arithmetic tasks. Prior works largely focus on outputs or prompting strategies, leaving the open question of the internal structure through which models do arithmetic computation. In this work, we investigate whether LLMs encode operator precedence in their internal representations via the open-source instruction-tuned LLaMA 3.2-3B model. We constructed a dataset of arithmetic expressions with three operands and two operators, varying the order and placement of parentheses. Using this dataset, we trace whether intermediate results appear in the residual stream of the instruction-tuned LLaMA 3.2-3B model. We apply interpretability techniques such as logit lens, linear classification probes, and UMAP geometric visualization. Our results show that intermediate computations are present in the residual stream, particularly after MLP blocks. We also find that the model linearly encodes precedence in each operator's embeddings post attention layer. We introduce partial embedding swap, a technique that modifies operator precedence by exchanging high-impact embedding dimensions between operators.
format Preprint
id arxiv_https___arxiv_org_abs_2510_13908
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Interpreting the Latent Structure of Operator Precedence in Language Models
Yugeswardeenoo, Dharunish
Nukala, Harshil
Shah, Ved
Blondin, Cole
Brien, Sean O
Sharma, Vasu
Zhu, Kevin
Computation and Language
Large Language Models (LLMs) have demonstrated impressive reasoning capabilities but continue to struggle with arithmetic tasks. Prior works largely focus on outputs or prompting strategies, leaving the open question of the internal structure through which models do arithmetic computation. In this work, we investigate whether LLMs encode operator precedence in their internal representations via the open-source instruction-tuned LLaMA 3.2-3B model. We constructed a dataset of arithmetic expressions with three operands and two operators, varying the order and placement of parentheses. Using this dataset, we trace whether intermediate results appear in the residual stream of the instruction-tuned LLaMA 3.2-3B model. We apply interpretability techniques such as logit lens, linear classification probes, and UMAP geometric visualization. Our results show that intermediate computations are present in the residual stream, particularly after MLP blocks. We also find that the model linearly encodes precedence in each operator's embeddings post attention layer. We introduce partial embedding swap, a technique that modifies operator precedence by exchanging high-impact embedding dimensions between operators.
title Interpreting the Latent Structure of Operator Precedence in Language Models
topic Computation and Language
url https://arxiv.org/abs/2510.13908