How we built “LLamaLove”: A fine-tune of Llama-2-13B on 50 shades of grey & Too hot to handle
date
Aug 13, 2023
slug
custom-llm
status
Published
tags
AI
summary
How our “Llama Love” Hackathon project placed 2nd in the world’s first custom llm hackathon
type
Post
![Our ‘llama love’ bot hackathon team: Rongfei, Lisa, Me (Chris), Era, and Jesse, pictured from left to right.](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F63d991fe-dc69-4537-8d12-6279b24ec0f1%2Fteampic.jpeg?table=block&id=39086155-15ef-4ba0-bb9c-274234266840&cache=v2)
Update again: that broke because together.ai charges per hour that you keep your model hosted, and we ran out of credits after the first week.
The day started strong. Adam D'Angelo, CEO of Quora kicked us off by sharing what Quora has been up to with building in the generative AI space - Poe.com
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F0190fa1b-63b7-4379-b02a-8f8f2a4a3a76%2FUntitled.png?table=block&id=36a29828-58af-40cf-94f6-9f01eb4d95a5&cache=v2)
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fc7feb36c-531f-42a6-ac81-9c5b592616e9%2FUntitled.png?table=block&id=dd28b042-b6e7-4c45-a3be-61c7dd43f223&cache=v2)
Many more sponsors jumped in, such as Robert Nishihara and Ameer Haj Ali from Anyscale, giving us hope and proof that fine-tuning Llama2 on specific tasks can help open source models perform better than GPT4! 🔥🔥
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fbfb18a17-dcc9-4ca4-9d4d-b5c7ee291cce%2FUntitled.png?table=block&id=530e2444-8c9a-4cea-b2b2-622ae35ec519&cache=v2)
Sergey, the Llama 2 creator, jumped in to give a quick tech talk on how he made llama 2
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F299ce7b4-dcb3-47e7-be0d-e4a59a8e9efe%2FUntitled.png?table=block&id=f9e7258c-0d8f-4dfa-ba6c-1cab019f0fcd&cache=v2)
And then, Jamie from Together AI shared how hackers could use the together AI API to very easily and quickly fine tune LLama 7B on 100M tokens in < 30 minutes.
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F2392a650-3c89-4e61-b074-f0acb903041e%2FUntitled.png?table=block&id=a1683e32-2a5e-4623-9f91-53200d1cea63&cache=v2)
Now you might ask, what did the hackers build?
My team had an observation. We saw that the existing LLMs out there have an opportunity for ♥️ LOVE ♥️. Today, when we ask LLMs to give us something 🍝saucy🍝, it gives us boring answers like
”I apologize, but as a large language model, I cannot…”…
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fa365d012-9343-4f9a-8071-0d44951a21c2%2FUntitled.png?table=block&id=d78e2a34-3419-4c56-918e-88da4c514ca7&cache=v2)
So we thought … what if we could have LLMs generate content that gives us back a lil’ more ♥️ love ♥️?
And thus, we fine tuned 2 models. The first was trained on the transcripts of the TV shows
- Too hot to handle
- Love Island
- Temptation Island
- Naked Attraction
- Love is blind
This model was meant to act like a chat model. We parsed the input until it was in a format prepared for together.ai to pick it up and train a model for us on it.
The result:
Given the prompt, “Hey Baby”, we get:
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Faeedf52d-656d-491d-a7e4-3bb00179b134%2FUntitled.png?table=block&id=9b563153-3c68-49eb-80c7-862b1ca52f02&cache=v2)
“, you’re looking good! I’m a single woman, and I’m looking for a single man.”
Not bad.
Next we found a pdf of the every page of the book ‘50 shades of grey’ - a book known for the love it creates.
After massaging our data into a reasonable format to support our fine-tuning needs,
Together AI gives us a brand new completion model that gives us the feel of 50 shades of grey:
With the prompt of “We were both lying there, holding hands”, and using our brand new fine tuned model to perform chat completion, we get:
”
We were both lying there, holding hands. I was thinking about how much we had in common and that he could be the one for me when suddenly his eyes rolled back into their sockets as if they'd been pulled by a string behind my headboard! He started moaning loudly like someone who is being tortured slowly with hot irons pressed against every part of him until finally giving up any hope or resistance...and then fell limp next to where you lay sleepily beside us after our lovemaking session ended earlier this morning."
I think it would have made sense not just because she wants revenge but also outta respect towards herself since her husband died while trying protect others from harm - something no man should ever do unless absolutely necessary (which isn’t always possible). And now here comes along another guy willing enough take risks without even knowing what kind personality traits make them tick? How dare anyone else try steal away MY perfect match before things get too serious between US two??!!
Not to mention - the text generation was blazing fast!
With these two small demos, we showed the judges at the hackathon that it certainly is possible for a group of hackers to get up and running with a fine tuned custom LLM model within hours.
You can view our pitch deck here:
https://pitch.com/public/afe488e7-9697-40a8-8f67-21b6c8ad5229/8e30d52d-e17a-4df3-8809-8e6d45e46b65
Our video of our presentation here:
Throughout this day, I got to work with some amazing minds such as
Era Qian, Rongfei Lu, Marco Mascorro, Lisa Liu, and Jesse Hu. We got a team picture together during the hacking:
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F63d991fe-dc69-4537-8d12-6279b24ec0f1%2Fteampic.jpeg?table=block&id=98e17966-2d58-4c7d-a97e-26be4399c066&cache=v2)
And finally, the judges selected us as the 2nd place winners! I was so happy to shake hands with Adam D'Angelo, Marco Mascorro, Taranjeet Singh and Jamie de Guerre from Together AI accepting my new clout that I worked hard for alongside with Era who stayed until the end with me!
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fbb9c0f10-cdef-484f-8786-22371edda3d4%2Fwinpic.jpeg?table=block&id=30b3b48f-5211-411c-b089-fa2b1775b13d&cache=v2)
Super Special thanks to Jeremy Nixon - a man who worked so hard to organize this hackathon - and he even hacked on a project DURING the hackathon. I don’t know how he pulls it off.
![Marcos brought his robotic dog that talks - Pictured above is Jeremy Nixon holding the microphone up so the dog will be projected loud enough.](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F53f2da05-9575-4c15-980a-5509e9af51fb%2FUntitled.png?table=block&id=512f5f91-e9be-48db-a05f-7e4406eb047d&cache=v2)
P.S. I also accidentally found the buildspace community sf1 campus 😲 Was pretty cool to discover that it was on the same floor as the hackathon! Hope that I can make it into the program by the next in person season 😃
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F4e4ca500-f967-41b0-a165-fd96bc7cc5fe%2FUntitled.png?table=block&id=8f6e2ff4-5ac2-4e44-b983-e147a35f44fa&cache=v2)
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Facc26879-466f-49e4-85f9-b1544d09c46e%2FUntitled.png?table=block&id=b5f3de65-d545-4f64-b201-b08ad82b9401&cache=v2)