Contrastive Instruction Tuning

Tianyi Lorena Yan, Fei Wang, James Y. Huang, Wenxuan Zhou, Fan Yin +3 more
2/17/2024
cs.CLcs.AIcs.LG

Official code: luka-group/CoIN (14 stars, Apache-2.0, last commit 2024-06-11).

Abstract

Instruction tuning has been used as a promising approach to improve the performance of large language models (LLMs) on unseen tasks. However, current LLMs exhibit limited robustness to unseen instructions, generating inconsistent outputs when the same instruction is phrased with slightly varied forms or language styles. This behavior indicates LLMs' lack of robustness to textual variations and generalizability to unseen instructions, potentially leading to trustworthiness issues. Accordingly, we propose Contrastive Instruction Tuning, which maximizes the similarity between the hidden representations of semantically equivalent instruction-instance pairs while minimizing the similarity between semantically different ones. To facilitate this approach, we augment the existing FLAN collection by paraphrasing task instructions. Experiments on the PromptBench benchmark show that CoIN consistently improves LLMs' robustness to unseen instructions with variations across character, word, sentence, and semantic levels by an average of +2.5% in accuracy. Code is available at https://github.com/luka-group/CoIN.

View on arXivView PDF

Code Implementations(1)

luka-group/CoINOfficial100%
Apache-2.0
140Shell, PythonApr 1, 20242 years agoApache-2.0

Cite this paper

@article{yan2024contrastive,
  title  = {Contrastive Instruction Tuning},
  author = {Tianyi Lorena Yan and Fei Wang and James Y. Huang and Wenxuan Zhou and Fan Yin and Aram Galstyan and Wenpeng Yin and Muhao Chen},
  year   = {2024},
  eprint = {2402.11138},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2402.11138v2}
}

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/2402.11138.svg)](https://codeofpaper.com/paper/2402.11138)

Discussion