Papers › An Investigation of Neuron Activation as a Unified Lens to Explain Chain-of-Thought...

An Investigation of Neuron Activation as a Unified Lens to Explain Chain-of-Thought Eliciting Arithmetic Reasoning of LLMs

18 Jun 2024arXiv:2406.12288archive 2025-07-28

Daking Rai, Ziyu Yao

Large language models (LLMs) have shown strong arithmetic reasoning capabilities when prompted with Chain-of-Thought (CoT) prompts. However, we have only a limited understanding of how they are processed by LLMs. To demystify it, prior work has primarily focused on ablating different components in the CoT prompt and empirically observing their resulting LLM performance change. Yet, the reason why these components are important to LLM reasoning is not explored. To fill this gap, in this work, we investigate ``neuron activation'' as a lens to provide a unified explanation to observations made by prior work. Specifically, we look into neurons within the feed-forward layers of LLMs that may have activated their arithmetic reasoning capabilities, using Llama2 as an example. To facilitate this investigation, we also propose an approach based on GPT-4 to automatically identify neurons that imply arithmetic reasoning. Our analyses revealed that the activation of reasoning neurons in the feed-forward layers of an LLM can explain the importance of various components in a CoT prompt, and future research can extend it for a more complete understanding.

PaperPDFCodeCode Syntology ran

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 36 code samples harvested from 2 repositories linked to this paper: 34 ran (of which 0 constructed an object rather than computing a result; 12 with no instrument failure: 2 honoured, 7 violated, 3 with no contract checked; 22 where Syntology's instrument failed) · 2 unverified. Where Syntology's instrument failed: 19 where our contract draft was wrong; 3 where the contract check could not run; failures of Syntology's instrument, not of the code.

By repository: official repository: 11 samples from 1 repository, 11 ran (4 with no instrument failure; 7 where Syntology's instrument failed); community (archive-listed): 25 samples from 1 repository, 23 ran (8 with no instrument failure; 15 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

Levels written between 2026-09-22 and 2026-09-25 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed.

dakingrai/neuron-analysis-cot-arithmetic-reasoning officialmentioned in papermentioned on GitHubpytorchSyntology: 11 samples, 11 ran (7 instrument-failed) · 0 unverified report
dakingrai/ood-generalization-semantic-boundary-techniques mentioned on GitHubpytorchMITSyntology: 25 samples, 23 ran (15 instrument-failed) · 2 unverified report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

36 samples harvested: 34 ran (of which 0 constructed an object rather than computing a result; 12 with no instrument failure: 2 honoured, 7 violated, 3 with no contract checked; 22 where Syntology's instrument failed) · 2 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page last changed ; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

2ran · honoured contract
7ran · violated contract
19ran · our draft was wrong
3ran; the contract check could not run
3ran
2unverified

Licence: 12 of the 36 samples are pointer only, meaning Syntology does not serve that copy's text. For 1 of them, this paper's copy is under a permissive licence and cleared, but the stored copy of the same code that Syntology serves is not; the licence label's tooltip gives Syntology's recorded reason. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 2 repositories linked to this paper, official or community; the list below is grouped by repository, each group headed by its name and what it is to the paper. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of six reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity. A census tag appears when Syntology's census ran implementations with that name on one shared input per bucket: it gives how many were compared, from how many papers, and how many distinct outputs they produced, and names this sample's bucket when this sample was one of them.

dakingrai/neuron-analysis-cot-arithmetic-reasoning official repository 11 samples, 11 ran (7 instrument-failed) · 0 unverified
apply_rotary_emb in 121 papers llama/model.py ran; the contract check could not run (RAISES) · metamorphic tier: invariant no licence file found · pointer only · d7b6dcfe63bfe59b · report fixture: signature xq:Tensor/4/float, xk:Tensor/4/float, freqs_cis:Tensor/2/complex · returned tuple · level recorded 2026-09-22
extract_answers in 10 papers gsm8k_inference.py ran · honoured contract no licence file found · pointer only · 86934d817edfb0b2 · report fixture: signature data:list/1/dict · returned list · level recorded 2026-09-24
filter_neurons experiments/neuron_discovery/prompt_gpt.py ran no licence file found · pointer only · f538f708c101a742 · report fixture: signature data:list/1/dict, concept_token:list/1/str, threshold:int/0/int · returned list · level recorded 2026-09-24
get_concept_token experiments/neuron_discovery/prompt_gpt.py ran · our draft was wrong no licence file found · pointer only · 5dfbf88ad85ff847 · report fixture: signature concept:str/0/str · returned tuple · level recorded 2026-09-24
get_intervene_dict experiments/ablation_study/corrupt_inference.py ran no licence file found · pointer only · f585b2c1cb9db5ed · report fixture: signature intervene:list/1/str, new_coeff:float/0/float · returned list · level recorded 2026-09-24
get_random_neurons experiments/ablation_study/corrupt_inference.py ran · our draft was wrong no licence file found · pointer only · 79c240794dbedd88 · report fixture: signature num_neurons:int/0/int · returned list · level recorded 2026-09-24
load_data in 700 papers experiments/neuron_discovery/prompt_gpt.py ran · our draft was wrong no licence file found · pointer only · c09cd334d12700d3 · report fixture: signature file_path:str/0/str · returned dict · level recorded 2026-09-24
precompute_freqs_cis in 112 papers llama/model.py ran · violated contract no licence file found · pointer only · 04a1fa63d6d4b8e4 · report fixture: signature dim:int/0/int, end:int/0/int, theta:float/0/float · returned Tensor · level recorded 2026-09-22
read_data in 132 papers gsm8k_inference.py ran · our draft was wrong no licence file found · pointer only · 396741975c6b6994 · report fixture: signature file_path:str/0/str · returned list · level recorded 2026-09-24
reshape_for_broadcast in 90 papers
census: 6 implementations from 10 papers, 1 distinct output on one shared input this sample: bucket 1 of 1, arg 1: rank 2, kind float, dtype float32 · arg 2: rank 3, kind float, dtype float32
llama/model.py ran; the contract check could not run (RAISES) · metamorphic tier: invariant fingerprinted no licence file found · pointer only · 5a639d78ada17fee · report fixture: signature freqs_cis:Tensor/2/float, x:Tensor/3/float · returned Tensor · level recorded 2026-09-22
sample_top_p in 35 papers llama/generation.py ran · our draft was wrong no licence file found · pointer only · e28848558038eee4 · report fixture: signature probs:Tensor/2/float, p:float/0/float · returned Tensor · level recorded 2026-09-25
dakingrai/ood-generalization-semantic-boundary-techniques community (archive-listed) 25 samples, 23 ran (15 instrument-failed) · 2 unverified
condition_has_like in 15 papers evaluations/evaluation.py ran · violated contract MIT (permissive) · 8231e3fdffa9c8ee · report fixture: signature conds:list/1/tuple · returned bool · level recorded 2026-09-22
condition_has_or in 15 papers evaluations/evaluation.py ran · violated contract fingerprinted MIT (permissive) · f2d76234528d3b57 · report fixture: signature conds:list/1/str · returned bool · level recorded 2026-09-22
convert_fk_index in 5 papers evaluations/src/get_tables.py ran · honoured contract MIT (permissive) · 64dd3849a251a1bf · report fixture: signature data:dict/0/? · returned list · level recorded 2026-09-24
dump_db_json_schema evaluations/src/get_tables.py ran fingerprinted MIT (permissive) · 992c7947d4eb2bb1 · report fixture: signature db:str/0/str, f:str/0/str · returned dict · level recorded 2026-09-24
get_schema in 16 papers evaluations/src/process_sql.py ran · our draft was wrong fingerprinted MIT (permissive) · 0992d2a47ae733fa · report fixture: signature db:str/0/str · returned dict · level recorded 2026-09-24
get_schema_from_json in 14 papers evaluations/src/process_sql.py ran · our draft was wrong MIT (permissive) here; the stored copy is pointer only · c4dcaf29b663a364 · report fixture: signature fpath:str/0/str · returned dict · level recorded 2026-09-24
insert_from_natsql utils.py ran · our draft was wrong fingerprinted MIT (permissive) · 1e399f0027148c73 · report fixture: signature raw_data:str/0/str · returned str · level recorded 2026-09-24
insert_from_natsql evaluations/inference.py ran · our draft was wrong MIT (permissive) · 06ac1db87dec5a08 · report fixture: signature data:list/1/str · returned list · level recorded 2026-09-24
insert_from_natsql_all utils.py ran · our draft was wrong MIT (permissive) · d12e4d909a954372 · report fixture: signature data:list/1/str · returned list · level recorded 2026-09-24
insert_from_natsql_single evaluations/inference.py ran · our draft was wrong fingerprinted MIT (permissive) · 817623d12e3dc619 · report fixture: signature raw_data:str/0/str · returned str · level recorded 2026-09-24
is_commonword in 6 papers evaluations/src/bridge_content_encoder.py ran · violated contract MIT (permissive) · b724cc2d4066a429 · report fixture: signature s:str/0/str · returned bool · level recorded 2026-09-24
is_number in 70 papers evaluations/src/bridge_content_encoder.py ran · violated contract MIT (permissive) · f39fdc1ce6cffe08 · report fixture: signature s:str/0/str · returned bool · level recorded 2026-09-24
is_stopword in 8 papers evaluations/src/bridge_content_encoder.py ran · violated contract MIT (permissive) · d56a1f9221823a48 · report fixture: signature s:str/0/str · returned bool · level recorded 2026-09-24
join_tokens in 7 papers evaluations/src/parse.py ran · our draft was wrong MIT (permissive) · 2178b95c919ae420 · report fixture: signature tokens:list/1/Token · returned str · level recorded 2026-09-24
load_data in 700 papers evaluations/inference.py ran · our draft was wrong MIT (permissive) · e2470d9fb45b08bf · report fixture: signature file_path:str/0/str · returned dict · level recorded 2026-09-24
normalize in 638 papers
census: 70 implementations from 82 papers, 51 distinct outputs across 11 buckets, one shared input per bucket
evaluations/src/dataset.py ran · our draft was wrong fingerprinted MIT (permissive) · 448eab4c7249a72c · report fixture: signature query:str/0/str · returned str · level recorded 2026-09-24
permute_tuple in 7 papers evaluations/src/exec_eval.py ran; the contract check could not run (RAISES) MIT (permissive) · f23d6ff3772963bc · report fixture: signature element:tuple/1/int, perm:tuple/1/int · returned tuple · level recorded 2026-09-24
postprocess in 70 papers
census: 5 implementations from 5 papers, 5 distinct outputs across 2 buckets, one shared input per bucket
evaluations/src/parse.py ran · our draft was wrong fingerprinted MIT (permissive) · 58e472cff9780d63 · report fixture: signature query:str/0/str · returned str · level recorded 2026-09-24
quick_rej in 7 papers evaluations/src/exec_eval.py ran · violated contract MIT (permissive) · a40510ba6a37f798 · report fixture: signature result1:list/1/tuple, result2:list/1/tuple, order_matters:bool/0/bool · returned bool · level recorded 2026-09-24
read_data in 132 papers evaluations/evaluation.py ran · our draft was wrong MIT (permissive) · 63fda278334d1f2e · report fixture: signature data_path:str/0/str · returned dict · level recorded 2026-09-24
read_json in 250 papers evaluations/src/token_preprocessing.py ran · our draft was wrong MIT (permissive) · fde2a650a2455e30 · report fixture: signature file_path:str/0/str · returned dict · level recorded 2026-09-24
remove_from_clause utils.py ran · our draft was wrong fingerprinted MIT (permissive) · 4bb08893ae4be14f · report fixture: signature data:str/0/str · returned str · level recorded 2026-09-24
unorder_row in 7 papers evaluations/src/exec_eval.py ran · our draft was wrong MIT (permissive) · afc8ef89576ef2aa · report fixture: signature row:tuple/1/str · returned tuple · level recorded 2026-09-24
prepare_splits evaluations/src/dataset.py unverified MIT (permissive) · d3c1fa9d710cc4ff · report
tokenize in 176 papers evaluations/src/process_sql.py unverified MIT (permissive) · a906f5de1f5971b0 · report

Tasks

Arithmetic Reasoning

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Absolute Position EncodingsAdamAttentionBPEDense ConnectionsDropoutGPT-4Label SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxTransformer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections