Skip to main content
QUICK REVIEW

[Paper Review] Analyzing Chain-of-Thought Prompting in Large Language Models via Gradient-based Feature Attributions

Skyler Wu, Eric Meng Shen|arXiv (Cornell University)|Jul 25, 2023
Topic ModelingComputer Science8 citations
TL;DR

The paper uses gradient-based saliency methods to analyze how chain-of-thought prompting affects input-token importances in open-source LLMs, finding CoT does not boost saliency magnitudes but improves robustness to prompt perturbations and output randomness.

ABSTRACT

Chain-of-thought (CoT) prompting has been shown to empirically improve the accuracy of large language models (LLMs) on various question answering tasks. While understanding why CoT prompting is effective is crucial to ensuring that this phenomenon is a consequence of desired model behavior, little work has addressed this; nonetheless, such an understanding is a critical prerequisite for responsible model deployment. We address this question by leveraging gradient-based feature attribution methods which produce saliency scores that capture the influence of input tokens on model output. Specifically, we probe several open-source LLMs to investigate whether CoT prompting affects the relative importances they assign to particular input tokens. Our results indicate that while CoT prompting does not increase the magnitude of saliency scores attributed to semantically relevant tokens in the prompt compared to standard few-shot prompting, it increases the robustness of saliency scores to question perturbations and variations in model output.

Motivation & Objective

  • Motivate responsible deployment by understanding why Chain-of-Thought prompting helps or hurts model behavior.
  • Investigate whether CoT prompting changes token-level importances and model robustness in few-shot QA tasks.
  • Assess if effects are consistent across models with 1–6B parameters and across multiple QA datasets.

Proposed method

  • Apply regular and contrastive gradient-based saliency methods (gradient x input and L1 norm) to prompt-question inputs.
  • Compare standard vs. CoT prompting on GPT-J (6B), GPT-Neo (2.7B), and GPT-2 XL (1.5B) across four datasets.
  • Evaluate saliency of tokens labeled as semantically relevant to questions.
  • Examine robustness to question rewordings and to stochastic variations in model output by repeated runs.
  • Use 50-question subsets from GSM8K, CoinFlip, CSQA, SST, with eight-shot prompts.
  • Report saliency magnitudes and their variability across conditions.
Figure 1: Mean absolute saliency scores of relevant tokens on all four original datasets using GPT-J, with and without CoT prompting.
Figure 1: Mean absolute saliency scores of relevant tokens on all four original datasets using GPT-J, with and without CoT prompting.

Experimental results

Research questions

  • RQ1Does CoT prompting increase the saliency magnitudes of semantically relevant question tokens?
  • RQ2Does CoT prompting make model saliency responses more robust to question rewordings?
  • RQ3Does CoT prompting stabilize saliency scores across stochastic variations in model output?
  • RQ4Do effects of CoT prompting on saliency generalize across multiple open-source LLMs and QA datasets?

Key findings

  • CoT prompting does not increase the saliency magnitudes of relevant input tokens across datasets and methods.
  • CoT prompting makes saliency scores of relevant tokens more robust to question perturbations and rewordings.
  • CoT prompting yields more stable gradients for relevant tokens across different model outputs (lower variance).
  • Accuracy gains from CoT prompting are not observed at the 6B parameter scale, with SST as a notable exception where accuracy increases.
  • Different gradient-based attribution methods produce substantially different values, indicating methodological sensitivity.
  • The study suggests interpretability tools can illuminate mechanistic aspects of CoT prompting beyond final explanations.
Figure 2: GPT-J mean absolute saliency scores of relevant tokens on GSM8K (Original) and (Reworded), with / without CoT.
Figure 2: GPT-J mean absolute saliency scores of relevant tokens on GSM8K (Original) and (Reworded), with / without CoT.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.