Prompts for generating and detecting misinformation using Llama, Vicuna, and OpenAI models.
This repository contains prompt engineering scripts designed for generating and detecting misinformation using Llama, Vicuna, and OpenAI models. These scripts demonstrate how to design prompts to generate a dataset of misinformation using large language models (LLMs) and how to leverage LLMs for misinformation detection. The repository provides a foundation for studying AI-generated misinformation and developing improved detection strategies.
Description:
- Uses Meta's Llama-2-7b and LMSYS's Vicuna-7b-v1.3 to generate misinformation by paraphrasing misleading content.
- The script loads both models, tokenizes an input passage, and generates new text while keeping the original message intact.
Dependencies:
transformerstorchacceleratehuggingface_hub
Usage:
- Install dependencies:
pip install transformers torch accelerate huggingface_hub
- Set up your huggingface client login token in the script:
huggingface-cli login --token "?" - Run the script:
python prompts/Prompt-using-Llama-and-Vicuna.py
- Output is saved in Generated-Misinfo.txt
Description:
- Uses OpenAI's GPT-4o to generate misinformation and then detects whether a given passage is misinformation.
- The script also prompts ChatGPT to determine if a passage is misinformation, returning either "YES" or "NO".
Dependencies:
- openai
- python-dotenv (optional for API key management)
Usage:
- Install dependencies:
pip install --upgrade openai python-dotenv
- Set up your OpenAI API Key in the script:
OPEN_API_KEY = "your_openai_api_key" - Run the script:
python prompts/Prompt-using-OpenAI.py
- Outputs are the misinformation generation and the misinformation detection result for the given text.
This project is licensed under the MIT License. See the LICENSE file for details.