Self- AMPLIFY : Improving Small Language Models with Self Post Hoc Explanations (2024)

Abstract: Incorporating natural language rationales in the prompt and In-Context Learning (ICL) have led to a significant improvement of Large Language Models (LLMs) performance. However, generating high-quality rationales require human-annotation or the use of auxiliary proxy models. In this work, we propose Self-AMPLIFY to automatically generate rationales from post hoc explanation methods applied to Small Language Models (SLMs) to improve their own performance. Self-AMPLIFY is a 3-step method that targets samples, generates rationales and builds a final prompt to leverage ICL. Self-AMPLIFY performance is evaluated on four SLMs and five datasets requiring strong reasoning abilities. Self-AMPLIFY achieves good results against competitors, leading to strong accuracy improvement. Self-AMPLIFY is the first method to apply post hoc explanation methods to autoregressive language models to generate rationales to improve their own performance in a fully automated manner.

## introduction autoregressive large language models (llms) such as gpt-3 @xcite , palm @xcite or lamda @xcite , have made significant advancements in a wide range of nlp tasks. these models have demonstrated so-called "emergent abilities" @xcite , including in-context learning (icl), instruction following and reasoning @xcite . icl (see @xcite for a recent survey) involves learning from a few examples integrated into the prompt without fine tuning the model. llms' emergent abilities have been leveraged to enhance performance by incorporating humanannotated intermediate reasoning steps within the context, called rationales @xcite . by learning to sequentially generate (1) the reasoning figure 1 : example of four responses to a question from the snarks dataset, generated from different icl prompting strategies. traditional input-output (io) prompting, auto-cot @xcite and amplify @xcite ) fail to answer properly, whereas self-amplify generates important tokens as a rationale before correctly answering. recently, small autoregressive lms (slms), with fewer than 14 billion parameters, have emerged, such as mistral @xcite , zephyr @xcite or gemma @xcite . they achieve performance sometimes approaching that of llms' on common benchmarks: their smaller size makes them computationally efficient while maintaining a high level of accuracy. in particular, classical post hoc attribution methods such as @xcite or deeplift @xcite become affordable to explain slms' prediction, despite their high computational cost of these methods. in this paper, we propose self-amplify, an extension of the amplify framework for slms that does not need an auxiliary model nor human annotations. the main contributions of the self-amplify framework are as follows: (i) promising instances to be integrated into the final prompt are targeted only using the considered slm's prediction, (ii) post hoc explanation methods are applied to the slm itself to automatically generate rationales as a selfimproving signal, (iii) three types of post hoc explanations methods are implemented: post hoc attributions, self topk explanations and self free text rationales. as an illustration, figure 1 shows three responses to a question from the snarks @xcite dataset respectively obtained using the proposed self-amplify, a classical prompting approach, io, a rationale enhanced approach, auto-cot @xcite and amplify. self-amplify succeeds to generate the good answer whereas its three competitors fail. experimental results discussed in section 4 show that self-amplify leads to a performance gain on a wide range of datasets as compared to io, auto-cot and amplify. as a result, we show that post hoc explanation methods of various kinds can be directly applied to the slm to generate automatically rationales to self-improve. unlike the original amplify framework, proxy fine tuned models are no longer needed to increase lms' performance, making self-amplify more autonomous and flexible. ## background and related work in this work, we consider in-context learning (icl), where a few samples are provided to an autoregressive lm within the prompt to perform a particular nlp task. in this section we recall some basic principles of post hoc explanations and existing methods that generate rationales to enhance lms' performance by enriching prompts. ## proposed approach: self-amplify this section describes the architecture of self-amplify, an extension of the amplify @xcite framework. as sketched in figure 2 and detailed in the next subsections, this framework enriches prompts with self-generated rationales in a fully automated manner to enhance slms' performance in icl settings. by generating rationales directly from the slm, self-amplify differs from amplify in that it does not depend on any auxiliary fine-tuned proxy model and the data used to train it. therefore, post-hoc explanation methods are leveraged to self-improve slm fully automatically. ## experimental settings this section presents the experimental study conducted across five datasets and three autoregressive slms of various size. we start by running two versions of self-amplify on two 7 billion parameters, respectively based on two post hoc explainers (deeplift and ph-cot). we compare these two versions of self-amplify to auto-cot and amplify, two competitors automatically generating rationales and io (input-output), a traditional prompting setup baseline. next, we deeply assess the impact of the topk post hoc explainers on self-amplify performance through an ablation study. finally, we run self-amplify and the gemma slm in its 2 and 7 billion parameter versions and highlight the limits of our approach on tiny models. ## discussion the self-amplify framework is versatile and can work with any other post hoc attribution methods, such as integrated gradient or lime. we recommend as self-amplify default setting ph-cot rationales if the aim is only to obtain the most accurate results. however, a framework user might expect the generated rationales to be faithful to build trust with self-amplify @xcite . free text rationale faithfulness evaluation is a difficult task and there is no consensus in the way to measure it @xcite . faithfulness assessment is easier with topk rationales by computing common metrics such as stability @xcite and self-consistency @xcite . therefore, kernelshap, deeplift or other post hoc attribution explainer should be preferred if rationale faithfulness evaluation is needed. the appropriate topk explainer can then be chosen depending on the level of information available about the model as stated in the previous section. as a future work, self-amplify could be improved by generating other types of rationales to enrich the prompt such as counterfactual examples (see @xcite for a recent method). a deeper analysis of the link between task complexity, selection strategy and self-amplify performance would also provide information on how to better generate valuable rationales. finally, it would be enlightening to assess the faithfulness of self-amplify generated rationales. for instance, icl generated rationales could be compared to ground truth explanations obtained in a post hoc manner. we see these perspectives as promising paths towards a better understanding of lms' ability to faithfully learn to self-explain. ## conclusion we introduced self-amplify, an extension of the amplify framework, automatically generating rationales to enrich the prompt in icl settings for slms. self-amplify is the first approach enriching the prompt without human-annotated rationales or the use of auxiliary models, but only with the slm itself. self-amplify implements 2 selection strategies and 4 post hoc explanation methods, making it versatile and flexible. self-amplify results in performance gain compared to its competitors in the considered tasks for 7 billion parameters models. finally, this work sheds light on the interest of using post hoc explanations to enhance slm's performance.