my_ml_notes

Large Language Models

[TOC]

Background

image-20240412113329172

Ref. from Yann Leccun video

example.png

Figure by UbiquitousLearning/Efficient LLM and Foundation Models

image-20240312162920195

Picture from: Training Large Foundation Models Using SageMaker HyperPod by Ian Gibbs - Senior PMT-ES in AI/ML - Gen AI Enablement Weekly Series

1. Generative AI investment skyrockets

image-20240502125431084

By IEEE Spectrum https://spectrum.ieee.org/ai-index-2024

LLM Models

Llama 3:

Prompt versus Fine Tune versus Pre-training

Guide to when to prompt versus fine tuning considering different organizations?

image-20230526134156518

Parameter Efficient Fine Tuning

PEFT, or Parameter Efficient Fine-tuning, is a Hugging Face open-source library to enable efficient adaptation of pre-trained language models (PLMs) to various downstream applications without fine-tuning all the model’s parameters. PEFT currently includes techniques for:

LoRA: Low-Rank Adaptation of LLMs

QLORA:

Reference:

[1] LoRA Serving on Amazon SageMaker — Serve 100’s of Fine-Tuned LLMs For the Price of 1

[2] LoRA by HuggingFace

[3] Github example: Fine-tune LLaMA 2 on Amazon SageMaker

[4] GitHub example: Fine-tune LLaMA 2 models on SageMaker JumpStart

[5] GitHub example: Fine-tune and deploy LLaMA V2 models on AWS Trainiumhttps://aws.amazon.com/ec2/instance-types/trn1/ and AWS Inferentiahttps://aws.amazon.com/ec2/instance-types/inf2/ based instances in SageMaker JumpStart

[6] Ref.scaling down to scale up a guide to parameter-efficient fine-tuning

[7] LoRA Paper

[8] LoRA Land: Fine-Tuned Open-Source LLMs that Outperform GPT-4

Price of Training LLMs

License

image-20230524081841634

Ref. The Ultimate Battle of Language Models: Lit-LLaMA vs GPT3.5 vs Bloom vs …

Commercial versus Licensed Models in HuggingFace

RLHL: Reinforcement Learning Human in the Loop

Policy

Proximal Policy Optimization (PPO): reinforcement learing algorithm

Deepracer PPO:

Batch size:

Epochs:

Learning rate:

Entropy:

Discount Factor:

Loss type:

Responsible AI

Responsible Generative AI: A Code of Ethics for the Future

References: