SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.12288 · ACL · 2024

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

Ziyu Yao, Daking Rai

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 36 functions out of this paper's own repositories and ran 34 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

FunctionStatusWhere it lives
apply_rotary_emb Ran dakingrai/neuron-analysis-cot-arithmetic-reasoning/llama/model.py
pointer only (licence: NONE) · get_code("d7b6dcfe63bfe59b")
condition_has_like Ran dakingrai/ood-generalization-semantic-boundary-techniques/evaluations/evaluation.py
code served (permissive licence) · get_code("8231e3fdffa9c8ee")
condition_has_or Ran dakingrai/ood-generalization-semantic-boundary-techniques/evaluations/evaluation.py
code served (permissive licence) · get_code("f2d76234528d3b57")
convert_fk_index Ran dakingrai/ood-generalization-semantic-boundary-techniques/evaluations/src/get_tables.py
code served (permissive licence) · get_code("64dd3849a251a1bf")
dump_db_json_schema Ran dakingrai/ood-generalization-semantic-boundary-techniques/evaluations/src/get_tables.py
code served (permissive licence) · get_code("992c7947d4eb2bb1")
extract_answers Ran dakingrai/neuron-analysis-cot-arithmetic-reasoning/gsm8k_inference.py
pointer only (licence: NONE) · get_code("86934d817edfb0b2")
filter_neurons Ran dakingrai/neuron-analysis-cot-arithmetic-reasoning/experiments/neuron_discovery/prompt_gpt.py
pointer only (licence: NONE) · get_code("f538f708c101a742")
get_concept_token Ran dakingrai/neuron-analysis-cot-arithmetic-reasoning/experiments/neuron_discovery/prompt_gpt.py
pointer only (licence: NONE) · get_code("5dfbf88ad85ff847")
get_intervene_dict Ran dakingrai/neuron-analysis-cot-arithmetic-reasoning/experiments/ablation_study/corrupt_inference.py
pointer only (licence: NONE) · get_code("f585b2c1cb9db5ed")
get_random_neurons Ran dakingrai/neuron-analysis-cot-arithmetic-reasoning/experiments/ablation_study/corrupt_inference.py
pointer only (licence: NONE) · get_code("79c240794dbedd88")
get_schema Ran dakingrai/ood-generalization-semantic-boundary-techniques/evaluations/src/process_sql.py
code served (permissive licence) · get_code("0992d2a47ae733fa")
get_schema_from_json Ran dakingrai/ood-generalization-semantic-boundary-techniques/evaluations/src/process_sql.py
code served (permissive licence) · get_code("c4dcaf29b663a364")
insert_from_natsql Ran dakingrai/ood-generalization-semantic-boundary-techniques/utils.py
code served (permissive licence) · get_code("1e399f0027148c73")
insert_from_natsql Ran dakingrai/ood-generalization-semantic-boundary-techniques/evaluations/inference.py
code served (permissive licence) · get_code("06ac1db87dec5a08")
insert_from_natsql_all Ran dakingrai/ood-generalization-semantic-boundary-techniques/utils.py
code served (permissive licence) · get_code("d12e4d909a954372")
insert_from_natsql_single Ran dakingrai/ood-generalization-semantic-boundary-techniques/evaluations/inference.py
code served (permissive licence) · get_code("817623d12e3dc619")
is_commonword Ran dakingrai/ood-generalization-semantic-boundary-techniques/evaluations/src/bridge_content_encoder.py
code served (permissive licence) · get_code("b724cc2d4066a429")
is_number Ran dakingrai/ood-generalization-semantic-boundary-techniques/evaluations/src/bridge_content_encoder.py
code served (permissive licence) · get_code("f39fdc1ce6cffe08")
is_stopword Ran dakingrai/ood-generalization-semantic-boundary-techniques/evaluations/src/bridge_content_encoder.py
code served (permissive licence) · get_code("d56a1f9221823a48")
join_tokens Ran dakingrai/ood-generalization-semantic-boundary-techniques/evaluations/src/parse.py
code served (permissive licence) · get_code("2178b95c919ae420")
load_data Ran dakingrai/neuron-analysis-cot-arithmetic-reasoning/experiments/neuron_discovery/prompt_gpt.py
pointer only (licence: NONE) · get_code("c09cd334d12700d3")
load_data Ran dakingrai/ood-generalization-semantic-boundary-techniques/evaluations/inference.py
code served (permissive licence) · get_code("e2470d9fb45b08bf")
normalize Ran dakingrai/ood-generalization-semantic-boundary-techniques/evaluations/src/dataset.py
code served (permissive licence) · get_code("448eab4c7249a72c")
permute_tuple Ran dakingrai/ood-generalization-semantic-boundary-techniques/evaluations/src/exec_eval.py
code served (permissive licence) · get_code("f23d6ff3772963bc")
postprocess Ran dakingrai/ood-generalization-semantic-boundary-techniques/evaluations/src/parse.py
code served (permissive licence) · get_code("58e472cff9780d63")
precompute_freqs_cis Ran dakingrai/neuron-analysis-cot-arithmetic-reasoning/llama/model.py
pointer only (licence: NONE) · get_code("04a1fa63d6d4b8e4")
quick_rej Ran dakingrai/ood-generalization-semantic-boundary-techniques/evaluations/src/exec_eval.py
code served (permissive licence) · get_code("a40510ba6a37f798")
read_data Ran dakingrai/neuron-analysis-cot-arithmetic-reasoning/gsm8k_inference.py
pointer only (licence: NONE) · get_code("396741975c6b6994")
read_data Ran dakingrai/ood-generalization-semantic-boundary-techniques/evaluations/evaluation.py
code served (permissive licence) · get_code("63fda278334d1f2e")
read_json Ran dakingrai/ood-generalization-semantic-boundary-techniques/evaluations/src/token_preprocessing.py
code served (permissive licence) · get_code("fde2a650a2455e30")
remove_from_clause Ran dakingrai/ood-generalization-semantic-boundary-techniques/utils.py
code served (permissive licence) · get_code("4bb08893ae4be14f")
reshape_for_broadcast Ran dakingrai/neuron-analysis-cot-arithmetic-reasoning/llama/model.py
pointer only (licence: NONE) · get_code("5a639d78ada17fee")
sample_top_p Ran dakingrai/neuron-analysis-cot-arithmetic-reasoning/llama/generation.py
pointer only (licence: NONE) · get_code("e28848558038eee4")
unorder_row Ran dakingrai/ood-generalization-semantic-boundary-techniques/evaluations/src/exec_eval.py
code served (permissive licence) · get_code("afc8ef89576ef2aa")
prepare_splits Not yet run dakingrai/ood-generalization-semantic-boundary-techniques/evaluations/src/dataset.py
code served (permissive licence) · get_code("d3c1fa9d710cc4ff")
tokenize Not yet run dakingrai/ood-generalization-semantic-boundary-techniques/evaluations/src/process_sql.py
code served (permissive licence) · get_code("a906f5de1f5971b0")

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

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 (Madaan and Yazdanbakhsh, 2022;Wang et al., 2023; Ye et al., 2023). 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 (Touvron et al., 2023) 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. 1

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2406.12288")
get_code_for_paper("2406.12288")
have("2406.12288")

Connect an agent — have() is free.