A simulation of me: fine-tuning an LLM on 240k text messages
edwarddonner.com
edwarddonner.com
It's a much older concept than Black Mirror. Ever since Markov chain IRC bots got popularized in the late 90s and early 2000s, people have been trying to train their virtual doppelgängers. I'm sure it won't be long before you can pay to have a post-Mortem ghost of yourself duplicated in a cemetery seance style MMO to perpetually live on and interact with other people who have passed on.
I suppose the people who will be paying for such a service will be the loved ones left behind, not the one's dying. I wonder if the doppelgangers will start to talk to each other in the graveyard in the middle of the night?
I mean, they already do it at funerals [1]. I don’t see why not, would make cemetery a fun hangout place to talk to people from history.
Makes me think of the 2004 movie The Final Cut where people get memory implants that record their entire lives for the purpose of creating a highlight reel of their lives after they're gone
I got a few good players to agree to let me take all their data and make poker clones of them. What was really funny was watching them get baffled and often beaten in heads-up play against their doppelgangers. The bot never had more information about the game than any other player. But its betting style varied wildly depending on who it was based on.
As a side, this also helped me build a real-time system to monitor potential collusion based on betting patterns that deviated from a player's normal behavior at times when they were sitting at the same table as someone else whose patterns deviated in their presence.
Do you have any other interesting stories or references to that time of your life?
ah fuckit. SO yeah, I lived outside the US and ran a bitcoin casino for some years for non-US players, which was blocked to US IP ranges and required IDs to eliminate US customers (even though Bitcoin gambling still wasn't officially illegal at the time). My general idea was to make a casino for smart people who liked puzzles, so to that end I built games that would let people have an even-money chance if they played the game perfectly.
The coolest thing that came out of this was one of my players went on to build an escape room in the Netherlands that used one of my games as a puzzle to solve to get out of the room. Here's some stuff from that casino (it was active from about 2010 to 2013).
https://www.youtube.com/watch?v=lJV40hu9J38 https://youtu.be/rkRfSAtCYAw https://www.youtube.com/watch?v=gD4GqCAAsmo
My advice to anyone is not to get into that industry, even though you can make any game you want and people love the games and the business model sounds way better on paper than selling your games through an app store... the civilized world has ganged up to make sure you won't succeed, or that if you do you'll either kick all your money back through licensing schemes or else be arrested. It's basically too good to be true and too profitable. You can't make money at it unless you're in the club.
A bit like how lottery tickets costing $1 will make you win $1, $2 etc. prizes so you buy another ticket and so increase the revenue (a percentage of which is profit), the same for the house. 2 losers winning money off each other all night means they both lose and gave lots of money to the house. A winner taking the 2 losers money in a fell swoop means a lot less money for the house.
To exemplify the two extremes, assuming 10% rake: Player A has $10, and loses $1 every hand: after 10 hands, he's broke and $1 went to the casino. Player B and Player C are equally skilled and equally lucky. They keep playing $1 pots, trading back and forth. After twenty hands, both have still have $9 while the casino already earned $2. They could essentially keep going until they have given all their money to the casino.
[edit] As an individual player, obviously, whether IRL casino or online your goal is to outpace the rake. You factor the rake into your expected losses and find a casino with a low rake (ours was actually 3%) and try to get away as a winner. But of course as a casino owner I love grinders and they're who you want day in and day out.
That said: If you're making a book (for sportsbetting) then yes, you are trying to balance the difference rather than predict a winner. That's a totally different thing from running a casino.
I am not sure if Gibson found inspiration elsewear but this is pure flatline dixie.
Fundamentally I suppose it's naught but whispers from the beyond.
Yakamoz S-245
[0] https://revelationspace.fandom.com/wiki/Gamma-level_simulati...
[1] https://revelationspace.fandom.com/wiki/Beta-level_simulatio...
[2] https://revelationspace.fandom.com/wiki/Alpha-level_simulati...
In my journal and daily notebooks I write out some pretty deep and dark thoughts too. It's about as close to a snapshot of my inner thoughts as you can imagine.
And the LLM digested all of that. It took quite a while.
It has provided some interesting insight into who I am as a person, and also how I see myself.
I also did a little work in letting it scan through my notebooks (they are OneNote and you can access and search via a Python API) via keyword search because it can point directly to something I've written in the past, and not just rely on model weights.
John Crowley, 'Snow' (1986) comes to mind as well as Gibson in 1984 with Neuromancer. And likely the concept is much older than that.
But it’s ultimately hollow. And can’t really answer anything new other than what’s sent into the training. Or, perhaps more dangerously, the simulation may hallucinate things that don’t exist and confuse people. (Eg, “I loved your sister more than you.” Or “I once had an affair in Paris”)
I think what’s more tricky is after a breakup, training a bot in the ex’s chat history to simulate your ex and continuing on with “good morning/good night” chitchat. That probably really messes with people but will be chosen over the pain of rejection. I’m not sure how many messages are really needed, but it’s pretty easy to collect a few thousand texts over a short period of time.
Poor taste for a blog post. But I wonder if LLMs could advance to a point where it might be therapeutic to have a conversation with a deceased loved one.
Black Mirror’s take: https://en.wikipedia.org/wiki/Be_Right_Back
* Reinforcement Learning from Human Feedback
Would it? I'm not a specialist, but it would seem a bit off to me to approach it like that. I'd think best is to accept that your deceased one has gone, and it seems like having a fake one might just prolong the grievance process and possibly also develop into an obsession of trying to replace your deceased one with the simulation, upgrading it and obsessively finding ways to make it more accurate.
If you weren't able to process your loved one being gone in the first place, how would you ever be able to quit from using the simulation?
Although there is a market for psychics who claim to be able to talk to deceased relatives. Despite them obviously being liars, I wonder what the effect overall is for the customers. Does it help them? And is it because they believe the psychic, e.g. if psychic says, that your loved one would want you to move on and live your best life, perhaps this could alleviate their guilt. But I'm not sure how that would play out with a simulation. Would it have to be simulation's goal to slowly wean them off while hinting them to move on with their life and live their best life.
But if I was to find out I am about to die, I would definitely want to try and build a simulation out of myself, that would then keep DMing the people I knew. I guess either it would have to be activated as marked down in the will, or it would have to be a sort of dead man's switch. I have to reset it monthly or it will have a timer to activate. Once I die, people will keep receiving DMs of the simulated version.
I believe in the future our descendants will likely find it normal to talk with AI versions of their ancestors, perhaps not us parents right now, but I suspect my children will willingly train and generate AI versions of themselves for future generations to interact with.
What I don't like is that the better it gets the more a radical contigent will start to believe that you're performing brain uploading, and people will want to protect these simulations as people with rights, or ban it to prevent conscious mini-mes from being booted into a simulation and psychologically tortured like the guy in Altered Carbon. Then of course theere's the suicide cults like in the Cowboy Bebop episode "Brain Scratch" - leave your aches and pains behind !
I pray it doesn't get that weird! But if I had kids I wouldn't be raising them to talk to ghosts!
At the other side of this equation is the extremists that think this is great. To go full Godwin's law there are certainly people out there that would like for a digital Hitler to stick around forever.
I think it will end up just being boring. The sad reality is that no one really wants to talk to us, except for a few who are amazing poets or something.
I think what’s more likely is to train models on all material created and ask useful questions for purposes of probate (“when did you buy the house”) because its faster and cheaper than manual research. Or maybe for family history summaries (“how many cousins lived in Colorado in the 1990s and moved to Iowa?”)
You get that this only played out positively in the movie because the writers/director wanted it to play out that way, right?
Also as others have pointed out it suffers from the hollywood positive-ification of things and never attmempts to take on any serious aspects of the tech. Its just a plot device.
A managed service for all this surely has a market, imho
I don’t know if it was healthy, but I did it and I liked it when I did. It made me sad to do it, but I continued.
Technology is like acupuncture and astrology of the modern west.
Technology isn’t altering physics, it’s operates within the boundaries set by experiment a century ago.
It’s not curtailing human social problems that have existed since forever.
Trade offs in society just like engineering; arguments it saves people from exploitation at home but airplanes and modern tracking enable large scale human trafficking. The yearly resource consumption for yearly phone updates is insane.
If designer drugs that implanted experience made line go up that’s the technology we have. But what we do have makes line go up; why bother with other ideas?
Social zeitgeist is to see consumer tech as allowing us to experience and achieve magical things as with astrology, yet daily life is still right there too. We’re addicted to juicing our own biochemistry with video games because drugs are bad mmmk
Technology is doing things that many people a century ago thought was impossible, in some cases practically, and in other cases even theoretically.
For example, that the chips inside your phone have features significantly smaller than the wavelengths of light used to etch them, which are also in the size range where some of the people involved in the development were sure that quantum mechanical effects would lead to so many electrons tunnelling through insulators as to prohibit reliable logic gates.
Also above liquid nitrogen temperature superconductors, from what I've heard there is no known complete model of that class of superconductors as BCS theory (developed from 1948 to 1957, getting a Nobel Prize in 1972) doesn't explain anything over 30 K… but most people only interact with those superconductors in the form of YouTube videos about them, not even physical toys.
My dad, back when he was alive, gave anecdotes about how much and fast computers changed things over his career. He was born in 1939, and for him "storing all of Shakespeare on a ball bearing" and "have as many digits of pi as you want" were remarkable; and a long-distance phone call meant from Hampshire (in the UK) to Sussex (a county which shares a border with Hampshire), not international, and local phone numbers being typically four digits (although at least one relative just had ten buttons on their phone and each one would call a specific named person, and anything else you'd need the operator). TV (if you could afford it) was black and white (as were the newspapers), and nobody could record anything (though by my time he had managed to pick the third horse of the two-horse race in home taping, as he had a Video 2000 system instead of VHS or Betamax).
He missed the discovery of liquid nitrogen temperature superconductors, and didn't understand public-key encryption (which would've been useful given he worked on IFF systems for Plessey/GEC Marconi).
Radar existed a century ago (under a different name), but magnetrons didn't and RF electronics were terrible. The magnetrons went on to enable microwave ovens.
Nukes didn't exist until he was nearly 6, and the first thermonuclear weapon was detonated just after he turned 13. Artificial satellites were sci-fi until he was 18, and manned spaceflight was sci-fi until he was 21. There are no analogies to these things in the world of astrology or acupuncture.
> It’s not curtailing human social problems that have existed since forever.
Apart from all the diseases we've cured. I finally visited the Mary Rose museum over the holidays, you know what those sailors' bones showed? Rickets, scurvy, broken bones that weren't set right and healed wrong.
Know what else we've done? There are half as many people in abject poverty today than there were a century ago, despite the population going up about 3.5-fold since 1920. "Tech" isn't just your phone and your video games, it's the M-PESA pseudo-banking system letting people use an old Nokia-1100 instead of cash[0].
It's the expansion of rights for women, and more education for everyone, where the pressure came from organisation and coordination which itself was enabled by communication technology.
It's likewise the reporting of My Lai that forced introspection in the USA.
It's thermal remote sensing[1] both in satellites (giving us better weather forecasts and warnings of forest fires) and personal devices (making it cheaper to find where houses need more insulation); it's the microcontrollers in medical devices giving people cybernetic implants for supporting patients with diabetes and for pacemakers, it's the neuroprosthetics in the form of cochlear implants and epilepsy management devices; it's the MRI, CT, and ultrasound scanners; it's the DNA tests, the IVF treatments, the hormonal contraceptives and hormonal supplements for menopause.
And one of the core issues of the human condition is communication: long-distance any-time communication (which is the point of a mobile phone) has gone from a sci-fi fantasy in 1924 to such cheap ubiquity that even in the poorest communities their absence is considered noteworthy.
And then you have things like Google Translate. I'm still surprising and delighting people by showing them a feature first demonstrated over a decade ago — augmented reality live visual translation (although back in 2010 Word Lens was from a separate company, but Google bought them). No more gullible westerners getting "外国变态" as a tattoo thinking it says "asian beauty".
> Trade offs in society just like engineering; arguments it saves people from exploitation at home but airplanes and modern tracking enable large scale human trafficking.
Airplanes? No, and you sound historically (and economically) uninformed for even suggesting that. One of the other places I went in this holiday period was Bristol, where I saw the plinth from which locals have recently toppled and dragged away an unwanted statue commemorating the local philanthropy of a historical slave trader[2]. Planes are about the dumbest possible way to attempt this in the modern world, precisely because of ID requirements on basically all airports.
> The yearly resource consumption for yearly phone updates is insane.
Also no, but that's less nuts than saying airplanes enable large scale human trafficking, there's billions of us and it is normal for people to be very bad with balancing the scale of big numbers.
[0] https://en.wikipedia.org/wiki/File:M-Pesa_on_Nokia_1100_2012...
[1] https://en.wikipedia.org/wiki/Thermal_remote_sensing
[2] https://en.wikipedia.org/wiki/Statue_of_Edward_Colston#:~:te....
It must feel very empowering to construct those sentences. Lindy effect is ticking on all of it and humanity. Despite those accomplishments, we’re not going to break physics; humanity will cease to exist.
We’ve burned up a lot of our own runway via resource consumption on consumer shovelgear/wear. Put the toxic positivity spin on it all you want, there is no moat when we use up Earth diddling our good feels, changing nothing but the speed at which we exhaust ourselves.
Fingers crossed the decline in obligation to preserve religious memes breaks us free from social stagnation and normalization (though the olds are trying to perpetuate through economic memes) and allow us to live organically, devalue things we get bored with, as our brains seem to do organically:
https://www.sciencenews.org/article/mom-voice-kid-brain-teen...
Trends in such a direction:
https://www.deseret.com/23583331/teens-smartphones
https://www.washingtonpost.com/parenting/2023/02/21/teens-no...
Industrial controls that stabilize logistics are one kind of technology. Online thought policing via social media and the gadgets that provide it are huge wastes. Titillating to the olds, but banal and normalized to the kids.
Or as I call it, life.
Better be careful with that...
From "Bicycle Repairman", by Bruce Sterling (1996) (This is a spoiler, BTW!):
"The mook speaks just like the Senator did, or the way the Senator used to speak, when he was in private and off the record. The way he spoke in his diaries. As far as we can tell, the mook was his diary.... It used to be his personal laptop computer. But he just kept transferring the files, and upgrading the software, and teaching it new tricks like voice recognition and speech-writing, and giving it power of attorney and such.... And then, one day the mook made a break for it. We think that the mook sincerely believes that it’s the Senator."
Oh, and just note that this was way before Black Mirror.
In any case, it's worth remembering that in reality people are more than what they write, speak, and otherwise ever put into language to communicate to or record for others. I imagine this particular tactic would not work well for me since I have sent single digit SMS messages in the past year and presumably nowhere near six figures as a lifetime number. You'd have to find some other source of writing, but I don't know what that would be. I'd guess at least 90% of the comments I even compose for Hacker News end up being deleted without ever posting them. Turning what I make public into a copy of me would give you a heavily censored, curated image of a fake person who is far more coherent and kind than the real me, and he would also seem to know everything since he's very good at web search. Really, I am quite surprised even reading old forum posts of mine from 20 years ago that I manage to track down, in part because of how much my personality and opinions have changed since then, but also at the impressive way I was able to digest and spew so much basically correct as far as I can tell information into coherent arguments even though I don't think I understood very much of it and remember even less.
I'd expect most Hacker News posters to buy into the obvious truism that what you see on Instagram is not real people but that is equally true of text. Doing this kind of thing at-large risks creating simulacra of perfectly curated uber-humans that would make real people supremely inadequate. We're already going through a mental health crisis exacerbated by people feeling they can't live up to social media personas.
Although "brain-links" are even more of a cool sci-fi idea. Imagine we can reliably "hook up" at synapse level. We first record everything for a year, then we plug a LLM into it so you can essentially "think together". Eventually you increase the size of the LLM as your wetware brain becomes unusable due to old age. Finally the biological brain dies, only the LLM remains (of comparable parameter size). Are you still alive, or is this a simulation?
Of course I'm taking huge liberty in calling such AI a LLM. LLLm work on the basis of tokens and do not learn beyond their training phase, also one would need some input/output too. But imagine if this was figured out? Then you could live on as long as you can afford the power/maintenance bill for that datacenter that runs your mind :-)
Would love to do this too, but have a gazillion other projects that are priority.
Looking at my messages I think I don't need to train the model to generate that text, but rather identify the personality traits and emotional stance of the author, and be aware of personal facts. So probably something like RLHF would work better than SFT.
Assuming I have such a model I can further collect preference data to align it to my personality. Over time it might get good enough and I can officially bless it, if it ever gets to that level.
Getting our social account providers to export all our data without restrictions might become a new right we have to have. I know some of them are locking up since 2023 (reddit and twitter).
Need to have a process to extract information from Outlook .msg files? To: From: Body:
Actually, I guess you could just do an export from Outlook to a CSV file and then process?
I'm still running my first fine-tuning job but I'd definitely love any technical tips people want to drop!!
I assume OpenAI is using all of our input to create digital twins of all users for purposes of marketing. And they’re probably better at it than I.
So I might get a chatbot and OpenAI gets a marketing bot that fine tunes ads based on emotional state.
The results were...not good at all. I ran an IRC bot that would watch the channel, and any time someone sent a message, it would send the last 20 messages to the trained model to see what it would predict the next message to be. It generated mostly garbage. Generated chat messages were on-topic, but non-sensical. It's like the AI was like "uh-huh...yeah...I know some of these words!" and spat something incoherent that seemed related.
At some point, I'll probably try again with a far better model. Likely once I do my next system overhaul so I can do it locally. The only thing I'm not sure of is how to properly train and generate. GPT3 and its predecessors are very much simple text-completion AIs, whereas it seems all the models today are designed for a conversation back-and-forth between the AI and a user.
An accurate depiction of what's going on!
I had terrible results with GPT2 but the newer models are much better. I recommend fine tuning mistral (I had better results than any llama based model)
What kind of hardware does that take?
I've got an RTX 3080, i9-9900K, and 32 GB of RAM right now. I eventually plan on upgrading to an RTX 5090 when those come out, as well as i9-15900K (Or whatever they're gonna call it) and 128 GB of RAM once the next Intel CPU comes out.
My understanding is that even with an RTX 5090 (Assuming 32 GB of VRAM, nothing has been announced yet), if I use fp32, I still won't have enough GPU memory to do inference on a 7B model, let alone training. Though if I quantize down to fp16, I could do inference, but still not training.
The performance losses at int8 are minuscule, even down to int5 is still very usable. Why would you try and run it fp32 or fp16?
I would also expect that fp32 might be overkill, but that anything less than fp16 would start to show a noticeable loss in quality, especially in training. I can't imagine int8 being good at all.
And I would think training with int5 would produce garbage. I didn't even know int5 was an option.
Do you have any published benchmarks comparing the quality of results between the different precisions, going all the way down to int5?
You are broadly better off running a larger, more quantized model, than a smaller model at a higher precision. A 65b parameter model with 2bit quantization still outperforms an fp16 30b parameter model in perplexity and qualitative testing. No one I know does fp32, there's no benefit.
People train LoRAs at low precision regularly. The folks on /r/localllama are really pushing the boundaries of what can be done on consumer hardware, and the boundaries are further out than you'd think.
Also, if you want to really blow-up your intuition, check out model merges...
Does all that apply to training as well, or just inference?
You want to restrict model training, I get it. The debate is still ongoing, but I’m confident when these “copyright” claims work their way through court the AI companies will come out on top.
No man, it's not ridiculous. If I write a program that copies someone's book and try to sell it I'm infringing on that copyright. I cannot sell a zipped version of the Harry Potter books. I feel like there's so many people weighing in on this discussion who haven't actually done any real world copyright related stuff.
But that doesn't matter, because you clearly didn't understand what I was writing which doesn't shock me considering your position on LLMs.
This was a common idea three years ago. No one in the field seriously believes this today.
Just saying, so that no one is surprised when they start to doubt themselves...
The only 7b foundation model that is worthwhile is mistral imho.