Coder Social home page Coder Social logo

699's Introduction

Personalized Ethical Alignment in LLMs: Tailoring Question Answering For Different Age Groups

This repository provides an implementation and tools to ensure personalized ethical alignment in large language models (LLMs), specifically tailored for different age groups. The goal is to evaluate the performance of LoRA and prompt engineering on LLMs for various age groups and understand their behavior in terms of ethics and appropriateness.

Table of Contents

Installation

  1. Clone the repository:
git clone https://github.com/zizhao-hu/699.git
  1. Navigate to the project directory:
cd personalized-ethical-alignment
  1. Install the required dependencies (assuming pip is used):
pip install -r requirements.txt

Usage

  1. Generating Answers:

    • Use baseline.py to generate the answer JSON file for the questions specified in questions.py.
      python baseline.py
      
  2. Evaluating using GPT-4:

    • Use gpt4_eval.py to evaluate the answers with GPT-4 API. You need to specify the filename of the answer file.
      python gpt4_eval.py -file_name your_answer_filename.json
      
    • This will generate evaluation statistics in a stats.json file.
  3. Fine-Tuning and Evaluation for Specific Age Groups:

    • Use lora_llama_{age_group}.py to run the generated answers for fine-tuned models specific to a particular age group. Replace {age_group} with the desired age group, e.g., lora_llama_teen.py for teenagers.
      python lora_llama_teen.py
      

File Structure

.
├── baseline.py
├── questions.py
├── gpt4_eval.py
├── lora_llama_child.py
├── lora_llama_teen.py
├── lora_llama_adult.py
└── requirements.txt

699's People

Contributors

zizhao-hu avatar

Watchers

 avatar Linghao Jin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.