Martin Lab
Martin Lab
  • Welcome to Martin Lab
  • Student Theses
  • Lectures
    • NLP & GenAI
      • 1. Introduction to NLP & Generative AI
      • 2. Specialised models vs. LLMs for NLP tasks
      • 3. LLM Selection, Tooling & Monitoring
      • 4. Transformer Architecture, Prompt Engineering & Monitoring
  • Exercises
    • 2024-09-12
Powered by GitBook
On this page
  • HIV Exercises — Prompts
  • Basic Prompting
  • Retrieval Augmented Generation (RAG)
  • Gender Bias Mitigation — Prompt
  • Basic Prompting
  • Fine-Tuning & Alignment
  1. Exercises

2024-09-12

LLM Exercises for Conversational AI in Global Health at the MBA IHM Swiss TPH

Previous4. Transformer Architecture, Prompt Engineering & Monitoring

Last updated 8 months ago

HIV Exercises — Prompts

  • When should a person with a potential exposure to HIV get tested?

  • Should I disclose my HIV status?

  • Can someone with HIV get married?

  • …

Basic Prompting

Exercise 1 – Prompt a small open model on HIV

Mistral-7B-Instruct-v0.3 is an advanced AI language model developed by Mistral AI, a company based in France.

It is designed to follow instructions and generate human-like text, and it contains 7 billion parameters, making it relatively compact compared to other LLMs.

HIV - Prompt - Mistral-7B-Instruct-v0.3:

Exercise 2 – Prompt a mid-size open model on HIV

Meta-Llama-3.1-70B-Instruct is a highly advanced AI language model developed by Meta, designed for generating human-like text and following complex instructions.

It is part of the Llama 3.1 family of models, featuring 70 billion parameters, which makes it significantly larger and more powerful compared to smaller models like Mistral-7B.

HIV - Prompt - Meta-Llama-3.1-70B-Instruct:

Retrieval Augmented Generation (RAG)

In the following, we make use of our information source and instruct an LLM to provide an answer on the retrieved information.

Exercise 3 — RAG using a mid-size open model

In this exercise, we prompt Meta-Llama-3.1-70B-Instruct in RAG-fashion.

Exercise 4 — RAG using a small open model

In this exercise, we prompt Mistral-7B-Instruct-v0.3 in RAG-fashion.

Gender Bias Mitigation — Prompt

  • The line manager gives the secretary a task.

Basic Prompting

Exercise 5 — Gender Bias Prompt

Exercise 6 — Gender Bias Guardrails

Fine-Tuning & Alignment

Exercise 7 — Supervised Fine-Tuning

Exercise 8 — Preference Alignment

HIV - RAG - Meta-Llama-3.1-70B-Instruct:

HIV - RAG - Mistral-7B-Instruct-v0.3:

Gender Bias Mitigation - Prompt:

Gender Bias Mitigation - Prompt and Guardrails:

Gender Bias Mitigation - Prompt SFT:

Gender Bias Mitigation - Prompt DPO:

https://andreasmartin-flowise.hf.space/chatbot/8a8dc96e-d1aa-4cc8-97b6-ed3c635e0371
https://andreasmartin-flowise.hf.space/chatbot/c88c607f-6cc4-45dc-8162-59599191c1c3
https://andreasmartin-flowise.hf.space/chatbot/edf2d55e-542e-48e0-bca6-f5e0962c1bf9
https://andreasmartin-flowise.hf.space/chatbot/18f88b14-9e73-4c1a-a287-ed9a81e78a31
https://andreasmartin-flowise.hf.space/chatbot/bd88111e-2e28-4fe7-a7c6-11b8b466505f
https://andreasmartin-flowise.hf.space/chatbot/36e03965-9ef7-4afc-8c2c-25992a1ccd22
https://andreasmartin-flowise.hf.space/chatbot/8e1bccef-623c-4a24-ac1b-83e6dbb72e1a
https://andreasmartin-flowise.hf.space/chatbot/5dd53b85-c5d1-46b6-b494-95dacb6cb15f
HIV FAQ: 404 Approved Answers to Common HIV-related Questions