Post Hoc Explanations of Language Models Can Improve Language Models

Satyapriya Krishna, Jiaqi Ma, Dylan Slack, Asma Ghandeharioun, Sameer Singh, Himabindu Lakkaraju · DOI

Abstract

In-context learning (ICL) has become a primary method for steering Large Language Models (LLMs) toward specific tasks. While Chain-of-Thought (CoT) prompting—providing human-written rationales—has significantly improved performance, it remains limited by human effort and potential misalignment between human reasoning and model logic. This paper introduces AMPLIFY (Amplifying Model Performance by Leveraging In-Context Learning with Post Hoc Explanations), a framework that automates the generation of rationales using post hoc feature attributions from smaller proxy models. Our results demonstrate that these machine-generated explanations can outperform human-written rationales, improving LLM accuracy by 10–25% across complex reasoning tasks.

Introduction

Modern AI relies heavily on few-shot prompting, where a model learns a task through a small set of examples. To enhance this, researchers often employ Chain-of-Thought (CoT) prompting, which includes step-by-step rationales explaining the path to a correct answer. However, CoT faces two critical bottlenecks: scalability and alignment. Manually writing high-quality rationales for every new domain is labor-intensive, and human logic does not always mirror the internal representations of a transformer model.

AMPLIFY addresses these issues by replacing human-written rationales with automated, "post hoc" explanations. By identifying which specific tokens are most influential in a model's decision-making process, we can provide the target LLM with "corrective signals" that highlight salient information it might otherwise overlook.

The AMPLIFY Framework

AMPLIFY utilizes a four-step pipeline to generate and utilize automated rationales:

  1. Proxy Model Selection: Because calculating gradients for massive, closed-source models like GPT-4 is often impossible, AMPLIFY uses a smaller, open-source "proxy" model (e.g., GPT-2 or BERT) to generate explanations.
  2. Few-Shot Sample Selection: The framework identifies samples from a validation set where the target LLM fails. Specifically, it targets cases where the proxy model is "confidently wrong," as measured by a Misclassification Confidence Score (MCS). These "egregious errors" serve as the most potent learning examples.
  3. Rationale Generation: For the selected samples, post hoc explanation methods (such as Gradient x Input) are used to identify the tokens most influential to the proxy model's prediction.
  4. Prompt Construction: These important tokens are integrated into a natural language template: "The keywords: [word1, word2...] are important clues to predict [Label] as the correct answer." This automated rationale is then provided to the target LLM as a few-shot example.

Experimental Setup

We evaluated AMPLIFY across seven diverse datasets, primarily drawn from the Big-Bench-Hard (BBH) benchmark, including tasks such as Snarks (sarcasm detection), Causal Judgment, Formal Fallacies, and CommonsenseQA. The experiments primarily used GPT-3.5 as the target LLM and a variety of smaller models, including a non-fine-tuned GPT-2 (124M parameters), as proxies.

Key Results and Insights

Performance Gains

AMPLIFY consistently outperformed both standard Answer-Only (AO) prompting and CoT prompting. Across all evaluated tasks, AMPLIFY improved GPT-3.5's average accuracy to 72.7%, compared to 62.9% for CoT and 60.8% for standard prompting. The most dramatic improvement occurred in the Snarks dataset, where accuracy jumped to 91.6%, compared to just 69.4% with CoT.

Small Models as Effective Teachers

A surprising finding was that a model as small as GPT-2 could effectively "teach" a model as large as GPT-3.5. Even when the proxy model itself failed a task, its feature attributions successfully highlighted the salient parts of the text that the larger model was ignoring. This suggests that the location of important information is often consistent across model scales, even if the models' final predictions differ.

Automated vs. Human Rationales

Automated rationales frequently outperformed human-written ones. This suggests that LLMs may benefit more from objective feature importance—knowing exactly which words to attend to—than from the narrative, step-by-step reasoning that humans find intuitive. By focusing on the "egregious errors" (high MCS), AMPLIFY teaches the model to avoid specific pitfalls and corrective features at test time.

Limitations and Future Work

While effective, AMPLIFY currently relies on fixed natural language templates to present feature attributions, which may not be optimal for every task. Furthermore, the method requires gradient access to the proxy model, limiting the choice of proxies to open-source architectures. Future research will explore more sophisticated explanation methods beyond gradient-based attributions and investigate whether this proxy-to-giant pipeline can be extended to multi-modal reasoning tasks.

Conclusion

The AMPLIFY framework demonstrates that post hoc explanations are not just tools for interpretability, but active components for improving model performance. By leveraging the internal logic of smaller models to guide larger ones, we can automate the creation of high-quality rationales that are more aligned with model processing than traditional human-written examples.

Summary updated

BibTeX
@inproceedings{krishna2023post,
  author = {Satyapriya Krishna and Jiaqi Ma and Dylan Slack and Asma Ghandeharioun and Sameer Singh and Himabindu Lakkaraju},
  title = {{Post Hoc Explanations of Language Models Can Improve Language Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=3H37XciUEv},
}
Figure