Skip to content

jash0803/LLM4MUN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LLM4MUN: Fine-tuning Language Models for Model United Nations

This repository contains code and resources for fine-tuning language models specifically for Model United Nations (MUN) scenarios. The project uses QLoRA (Quantized Low-Rank Adaptation) to efficiently fine-tune large language models on MUN-specific data.

Dataset

The project uses two main data sources:

  1. Model United Nations Dataset

  2. Reddit MUN Community Data

    • Source: r/MUN subreddit
    • Contains real-world MUN discussions, advice, and experiences
    • Provides contemporary and practical insights into MUN practices

Project Structure

LLM4MUN/
├── data/               # Raw and processed data files
├── dataset/           # HuggingFace dataset storage
├── scripts/           # Utility scripts
├── train_qlora.py     # Main training script
├── push_df_hf.py      # Script for pushing data to HuggingFace
└── requirements.txt   # Project dependencies

Setup

  1. Create a virtual environment:
python -m venv myenv
source myenv/bin/activate  # On Unix/macOS
# or
.\myenv\Scripts\activate  # On Windows
  1. Install dependencies:
pip install -r requirements.txt

Training Process

The project uses QLoRA to fine-tune the Meta-Llama-3-8B-Instruct model with the following specifications:

  • 4-bit quantization for memory efficiency
  • LoRA configuration:
    • Rank (r): 16
    • Alpha: 32
    • Target modules: q_proj, v_proj
    • Dropout: 0.05

Training parameters:

  • Batch size: 2 (per device)
  • Gradient accumulation steps: 4
  • Learning rate: 2e-4
  • Number of epochs: 3
  • Mixed precision training (FP16)

Process Flow

graph TD
    A[Data Collection] --> B[Data Preprocessing]
    B --> C[Dataset Creation]
    C --> D[Model Selection]
    D --> E[QLoRA Configuration]
    E --> F[Training Setup]
    F --> G[Fine-tuning Process]
    G --> H[Model Evaluation]
    H --> I[Model Deployment]

    subgraph "Data Sources"
        A1[Harvard Dataverse] --> A
        A2[r/MUN Reddit] --> A
    end

    subgraph "Training Configuration"
        E1[4-bit Quantization] --> E
        E2[LoRA Parameters] --> E
        E3[Training Parameters] --> E
    end

Loading

About

Fine-tuning Llama-3-8B-instruct with QLoRA for Model United Nations(MUN) debates

Topics

Resources

Stars

Watchers

Forks

Languages