From Language Modeling to Instruction Following: Understanding the Behavior Shift in LLMs after Instruction Tuning

Xuansheng Wu, Wenlin Yao, Jianshu Chen, Xiaoman Pan, Xiaoyang Wang +2 more
9/30/2023
cs.CLcs.AIcs.LG

Official code: JacksonWuxs/Interpret_Instruction_Tuning_LLMs (25 stars, GPL-3.0, last commit 2024-03-18).

Abstract

Large Language Models (LLMs) have achieved remarkable success, where instruction tuning is the critical step in aligning LLMs with user intentions. In this work, we investigate how the instruction tuning adjusts pre-trained models with a focus on intrinsic changes. Specifically, we first develop several local and global explanation methods, including a gradient-based method for input-output attribution, and techniques for interpreting patterns and concepts in self-attention and feed-forward layers. The impact of instruction tuning is then studied by comparing the explanations derived from the pre-trained and instruction-tuned models. This approach provides an internal perspective of the model shifts on a human-comprehensible level. Our findings reveal three significant impacts of instruction tuning: 1) It empowers LLMs to recognize the instruction parts of user prompts, and promotes the response generation constantly conditioned on the instructions. 2) It encourages the self-attention heads to capture more word-word relationships about instruction verbs. 3) It encourages the feed-forward networks to rotate their pre-trained knowledge toward user-oriented tasks. These insights contribute to a more comprehensive understanding of instruction tuning and lay the groundwork for future work that aims at explaining and optimizing LLMs for various applications. Our code and data are publicly available at https://github.com/JacksonWuxs/Interpret_Instruction_Tuning_LLMs.

View on arXivView PDF

Code Implementations(1)

GPL-3.0

Understanding Why and How Instruction Tuning Changes Pre-trained Models

253PythonMar 16, 20242 years agoGPL-3.0

Similar Papers

Cite this paper

@article{wu2023from,
  title  = {From Language Modeling to Instruction Following: Understanding the Behavior Shift in LLMs after Instruction Tuning},
  author = {Xuansheng Wu and Wenlin Yao and Jianshu Chen and Xiaoman Pan and Xiaoyang Wang and Ninghao Liu and Dong Yu},
  year   = {2023},
  eprint = {2310.00492},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2310.00492v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2310.00492.svg)](https://codeofpaper.com/paper/2310.00492)

Discussion