GitHub - safety-research/false-facts (original) (raw)

Modifying LLM Beliefs with Synthetic Document Finetuning

Repository Structure

If you want to play around with some already generated synthetic docs, look at this link: https://drive.google.com/drive/folders/1Aj64__CnJiRveAx5IUOXotPSeX0EXH5f

Installation

To set up the project, follow these steps:

  1. Clone the repository:
    gh repo clone safety-research/false-facts
    cd false-facts
  2. Install the required Python packages:
  3. Set up environment variables: Ensure you have a .env and SECRETS file with necessary API keys and configurations. This repo uses safety-tooling, so go there to look up how to set it up: https://github.com/safety-research/safety-tooling

Running the Streamlit App

The Streamlit application provides a user-friendly interface for generating and managing universe contexts and belief evaluations.

  1. Navigate to the Streamlit app directory:
    cd universe_creation_streamlit
  2. Run the Streamlit app:
  3. Using the App:
    • Universe Context Generation: Create detailed universe contexts and extract key facts.
    • Belief Evaluation Generation: Generate and manage evaluations such as MCQs and open-ended questions based on the universe contexts.

Synthetic Document Generation

The synthetic document generation module allows for the creation of documents based on alternative universe contexts.

  1. Generate Documents: Use the synth_doc_generation.py script to generate documents. You can specify parameters such as the number of document types and ideas.
    Example command:
    uv run false_facts/synth_doc_generation.py abatch_generate_documents --universe_contexts_path "path/to/universe_contexts.jsonl" --output_path "path/to/output"