Prompt Perturbation in Retrieval-Augmented Generation based Large Language Models

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Hu, Zhibo, Wang, Chen, Shu, Yanfeng, Helen, Paik, Zhu, Liming
Natura: Preprint
Pubblicazione: 2024
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866915295238553600
author Hu, Zhibo
Wang, Chen
Shu, Yanfeng
Helen
Paik
Zhu, Liming
author_facet Hu, Zhibo
Wang, Chen
Shu, Yanfeng
Helen
Paik
Zhu, Liming
contents The robustness of large language models (LLMs) becomes increasingly important as their use rapidly grows in a wide range of domains. Retrieval-Augmented Generation (RAG) is considered as a means to improve the trustworthiness of text generation from LLMs. However, how the outputs from RAG-based LLMs are affected by slightly different inputs is not well studied. In this work, we find that the insertion of even a short prefix to the prompt leads to the generation of outputs far away from factually correct answers. We systematically evaluate the effect of such prefixes on RAG by introducing a novel optimization technique called Gradient Guided Prompt Perturbation (GGPP). GGPP achieves a high success rate in steering outputs of RAG-based LLMs to targeted wrong answers. It can also cope with instructions in the prompts requesting to ignore irrelevant context. We also exploit LLMs' neuron activation difference between prompts with and without GGPP perturbations to give a method that improves the robustness of RAG-based LLMs through a highly effective detector trained on neuron activation triggered by GGPP generated prompts. Our evaluation on open-sourced LLMs demonstrates the effectiveness of our methods.
format Preprint
id arxiv_https___arxiv_org_abs_2402_07179
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Prompt Perturbation in Retrieval-Augmented Generation based Large Language Models
Hu, Zhibo
Wang, Chen
Shu, Yanfeng
Helen
Paik
Zhu, Liming
Computation and Language
Information Retrieval
I.2.7; H.3.3
The robustness of large language models (LLMs) becomes increasingly important as their use rapidly grows in a wide range of domains. Retrieval-Augmented Generation (RAG) is considered as a means to improve the trustworthiness of text generation from LLMs. However, how the outputs from RAG-based LLMs are affected by slightly different inputs is not well studied. In this work, we find that the insertion of even a short prefix to the prompt leads to the generation of outputs far away from factually correct answers. We systematically evaluate the effect of such prefixes on RAG by introducing a novel optimization technique called Gradient Guided Prompt Perturbation (GGPP). GGPP achieves a high success rate in steering outputs of RAG-based LLMs to targeted wrong answers. It can also cope with instructions in the prompts requesting to ignore irrelevant context. We also exploit LLMs' neuron activation difference between prompts with and without GGPP perturbations to give a method that improves the robustness of RAG-based LLMs through a highly effective detector trained on neuron activation triggered by GGPP generated prompts. Our evaluation on open-sourced LLMs demonstrates the effectiveness of our methods.
title Prompt Perturbation in Retrieval-Augmented Generation based Large Language Models
topic Computation and Language
Information Retrieval
I.2.7; H.3.3
url https://arxiv.org/abs/2402.07179