970 points · by mdp2021 · 2y ago · 136 comments
Anyway I will watch it tonight before bed. Thank you for sharing.
https://www.manning.com/books/build-a-large-language-model-f...
(I've taken it from the footnotes on the article)
how Llama and OpenAI could be cleaning and structuring their training data
If you're interested in this, there are several sections in the Llama paper you will likely enjoy:https://ai.meta.com/research/publications/the-llama-3-herd-o...
edit: grammar
What turned GPT into chatGPT was a lot of structured training with human feedback.
It's a fine PyTorch tutorial but let's not pretend it's something low level.
Like driving a car, you don't need to understand what's under the hood you start driving, but eventually understanding it makes you a better driver.
But it doesn’t start there. It uses top-down pedagogy, instead of bottom up.
Never had a piano, not even a fortepiano .. though reportedly he played one once.
At least when i saw the "Building LLMs from the Ground Up" what i expected was someone to open vim, emacs or their favorite text editor and start writing some C code (or something around that level) to implement, well, everything from the "ground" (the operating system's user space which in most OSes is around the overall level of C) and "up".
To a statistician or a practitioner approaching machine learning from a mathematical perspective, the computational details are a distraction.
Yes, these models would not be possible without automatic differentiation and massively parallel computing. But there is a lot of rich detail to consider in building up the model from first mathematical principles, motivating design choices with prior art from natural language processing, various topics related to how input data is represented and loss is evaluated, data processing considerations, putting things into context of machine, learning more broadly, etc. You could fill half a book chapter with that kind of content (and people do), without ever talking about computational details beyond a passing mention.
In my personal opinion, fussing over manual memory management is far afield from anything useful unless you want to actually work on hardware or core library implementations like Pytorch. Nobody else in industry is doing that.
To someone who already knows excel, from scratch with excel sheets instead of python may work with them.
Calling that from scratch is like saying "Just go to the store and tell them what you want" in a series called: "How to make sausage from scratch".
When I want to know how to do X from scratch I am not interested in "how to get X the fastest way possible", to be frank I am not even interested in "How to get X in the way others typically get it", what I am interested in is learning how to do all the stuff that is normally hidden away in dependencies or frameworks myself — or, you know, from scratch. And considering the comments here I am not alone in that reading.
For example, building a web server from scratch - I’d probably assume the presence of a sockets library or at the very least networking card driver support. For logging and configuration I’d assume standard I/o support.
It probably comes down to what you think makes LLMs interesting as programs.
NVDIA value lies only in pytorch and cuda optimizations with respect with pure c implementation, so saying that you need go lower level than cuda or pytorch means simply reinventing Nvidia. Good luck with that
2. I didn't say CUDA wouldn't be ground up or low level (please re-read) (I say in another comment about a no-code guide with CUDA, but it's obviously a joke)
3. And finally, I think your comment comes out as holier than thou and finger pointing and making a huge deal out of a minor semantic observation.
Pytorch is low level enough to understand and interpret each and every passage. In pytorch, you can use builtin transformers, or code them yourself down to the "lowest" level in which there's still a theoretical meaning. So pytorch is just a tool and your comment was just pompous and empty.
It’s definitely out there and in productive use.
Which engines in particular? I never found especially flexible ones.
Unfortunately, your argument is a well known fallacy and carries no weight.
E.g.
1. Programming basics
2. How to manipulate text using programs (reading, writing, tokenization, counting words, randomization, case conversion, ...)
3. How to extract statistical properties from texts (ngrams, etc, ...)
4. How to generate crude text using markov chains
5. Improving on markov chains and thinking about/trying out different topologies
Etc.
Sure markov chains are not exactly LLMS, but they are a good starting point to byild a intuition how programs can extract statistical properties from text and generate new text based on that. Also it gives you a feeling how programes can work on text.
If you start directly with a framework there is some essential understanding missing.
https://16x.engineer/2023/12/29/nanoGPT-azure-T4-ubuntu-guid...
What sort of things could you do with it? How do you train it on current events?
Beyond learning how it all works and demo, there is not much practical usage. You can train it on current events if you feed that corpus during training instead of just OpenWebText. Shouldn't be hard.
Now: "code" is something you establish - as the content of the codex medium (see https://en.wikipedia.org/wiki/Codex for its history); from the field of law, a set of rules, exported in use to other domains since at least the mid XVI century in English.
"Program" is something you publish, with the implied content of a set of intentions ("first we play Bach then Mozart" - the use postdates "code"-as-"set of rules" by centuries).
"Develop" is something you unfold - good, but it does not imply "rules" or "[sequential] process" like the other two terms.
ChatGPT doesn't know either.
Also in my ears coder always sounded cooler than programmer and it wasn't until a few years ago i first heard that to some people it has negative connotations. Too late to change though, it still sounds cooler to me :-P.
I also dislike software development as it reminds me of developing a photograhic negative – like "oh let's check out how the software we developed came out".
It should be software engineering and it should be held to a similar standard as other engineering fields if it isn't done in a non-professional context.
I do agree that a "coder" creates code, and a programmer creates programs. I expect more of a complete program than of a bunch of code. If a text says "coder", it does set an expectation about the professionalism of the text. And I expect even more from a software solution created by a software engineer. At least a specification!
Still, I, a professional software engineer and programmer, also write "code" for throwaway scripts, or just for myself, or that never gets completed. Or for fun. I will read articles by and for coders too.
The word is a signal. It's neither good nor bad, but If that's not the signal the author wants to send, they should work on their communication.
Wrong angle. There is a problem, your consideration of the problem, the refinement of your solution to the problem: the solution gradually unfolds - it is developed.
https://developer.nvidia.com/cuda-downloads?target_os=Linux&...
Your resource is really bad.
"We'll then load the trained GPT-2 model weights released by OpenAI into our implementation and generate some text."
Next-token prediction: https://github.com/bennyschmidt/next-token-prediction
Good for auto-complete, spellcheck, etc.
AI chatbot: https://github.com/bennyschmidt/llimo
Good for domain-specific conversational chat with instant responses that doesn't hallucinate.
However, currently there is some language-specific stuff in Transformer that should be moved to Language :) I'm focusing first on language models, and getting into image generation next.
https://github.com/bennyschmidt/next-token-prediction
^ If you look at this GitHub repo, should be obvious it's a token prediction library - the video of the browser demo shown there clearly shows it being used with an <input /> to autocomplete text based on your domain-specific data. Is THAT a Markov chain, nothing more? What a strange question, the answer is an obvious "No" - it's a front-end library for predicting text and pixels (AKA tokens).
https://github.com/bennyschmidt/llimo
This project, which uses the aforementioned library is a chat bot. There's an added NLP layer that uses parts-of-speech analysis to transform your inputs into a cursor that is completed (AKA "answered"). See the video where I am chatting with the bot about Paris? Is that nothing more than a standard Markov chain? Nothing else going on? Again the answer is an obvious "No" it's a chat bot - what about the NLP work, or the chat interface, etc. makes you ask if it's nothing more than a standard [insert vague philosophical idea]?
To me, your question is like when people were asking if jQuery "is just a monad"? I don't understand the significance of the question - jQuery is a library for web development. Maybe there are some similarities to this philosophical concept "monad"? See: https://stackoverflow.com/questions/10496932/is-jquery-a-mon...
It's like saying "I looked at your website and have concluded it is nothing more than an Array."
So Markov chains