logoalt Hacker News

I were 17, I'd learn how to build LLMs from scratch

492 pointsby bilsbieyesterday at 8:38 PM587 commentsview on HN

https://xcancel.com/paulg/status/2091544343589060625


Comments

mattlutzetoday at 10:19 AM

A lot of people here are responding to the message but not to the meaning.

It would be a good idea for young people to deeply know how these programs work. Not so that they can spend their career building them, but so that they can approach the next class of problems we'll all start trying to solve, with intuition all the way down to the weights and underlying mathematics. And also, to develop a healthy intuition of when "Just LLM it" will not be the right choice.

"Build an OS" wasn't a common university project because we were all expected to go out and work on Windows, but because understanding the bare-metal firmware for a computer helps you deeply understand how to intuit building for a whole class of problems.

show 7 replies
oerstedtoday at 6:50 AM

There's this dilemma where in theory there's a ton of demand for engineers that can do real LLM machine-learning, but in practice there are very few available positions and entrepreneurship opportunities.

The reality is that an incredibly small minority of companies in the world do any real training or optimisation. It's unnecessary and inefficient for most purposes unless you are fully dedicated to being an LLM company, and still then it's a struggle. Those few that do train, they spend most of their budget on compute and have relatively small teams.

Getting experience in this field requires having access to very expensive hardware to begin with. And the skills will be quite hard to convert into any real value for someone, leading to a decent income, unless you have a ton of funding from patient investors, or you have decent contacts in Bay Area networks to get hired at the right place.

With all due respect, paulg is in somewhat of a bubble, this is not congruent with the global situation.

show 47 replies
fancyfredbottoday at 7:47 AM

I'm (more than) twice that age, but I've spent time learning this exactly this from videos by Andrej Karparthy and from books by Sebastian Raschka.

I didn't do it because it was useful to me in a practical sense. It's because LLMs are fascinating and I want to know how they work. From that perspective it's been a great experience. I have afirm grasp of the basics. This makes it much easier to understand frontier concepts like compressed latent attention. I can follow the field and understand it.

Not sure I would have got as much out of it at seventeen. I have a lot of background and experience which made it much easier to learn. I wasn't struggling with the linear algebra or with python. I already knew pytorch and neural networks. That helped a lot and I covered these tutorials fast and could skip over large sections. A few evenings and the odd weekend day over a couple of months was enough for me.

For seventeen year olds the tutorials are good enough to make it possible to learn this but it would have taken a lot longer to understand. On the other hand I would have learned a lot more. I think I would have learned a lot of valuable stuff.

However I also think 17 year old me was studying for his A levels and probably this was right choice in terms of maximising future opportunities. I'm not sure I think learning about LLMs instead is sensible. Indeed it might be bad advice. But I can absolutely agree with the sentiment.I think 17 year old me would have wanted to do this too.

show 3 replies
Isaackoztoday at 10:02 PM

If I were 61, I'd learn to not be so out of touch with the younger generation

koe123today at 7:05 AM

While knowledge is always great, I would encourage people not to seek advice from successful people like this (survivorship bias).

Moreover I am not sure it is even good advice? Would you advise a 17 y.o. to learn how transistors work or how to code (i.e. is LLM training the right level in the stack)? LLM training, a discipline where relevant work is already out of reach for 99.999% of budgets really as essential as this post implies?

show 12 replies
LarsDu88today at 5:42 PM

I agree more with Yann LeCunn's salty reply. Over long run, knowing how autoregressive language models work from scratch will be just one step in having foundational understanding, and they might become dated... like knowing how a CRT monitor work. Something of historical interest and good for learning, but not crucial to being well-rounded.

There are other types of models like diffusion models right now that are showing more efficiency and have a higher ceiling for improvement. Understanding math and fundamentals are more important.

mrwaffletoday at 8:17 PM

I'd say, if you were 17, you'd probably be better off learning how to socialize or at least gracefully approach and relate to people your own age. That's probably the greatest challenge of the near future, sadly.

felixriesebergtoday at 7:14 AM

I'll use this post as a shameless opportunity to tell more people about a little side project, I made:

http://languagemodelbuilder.com teaches you (in a few hours to days) how to build an LLM from scratch. It's entirely free, without accounts, and without data collection.

show 5 replies
chris_vatoday at 7:01 AM

I am kind of amazed how negative the comments are here, especially on HN.

Learning to hack something together in high school using the latest technology (vacuum tubes, radios, microprocessors, web/javascript) has been a common theme in the tech world for generations. With LLMs and online tutorials, this isn't even a difficult suggestion. Do people think learning new tech is somehow wasted effort?

show 8 replies
oldsklgdfthtoday at 1:01 PM

I appreciate the sentiment and I'm pretty curious how I could train an LLM, even are really basic one from 5yrs ago without nuts hardware.

That said, I a good starting point for a 17yo is reading about perceptrons[0], then the basics of neural networks[1] (ex. 3-layer perceptron) then writing a program to train a 3-layer perceptron and classifying the MNIST dataset[2] - a dataset of characters.

This can anywhere between a day and a week and you will demystify the basics of neural networks and work your way forward with more advanced contemporary concepts.

Fun fact: any multi-layer perceptron neural net can be reduced to a 3-layer perceptron network.

[0] https://en.wikipedia.org/wiki/Perceptron [1] http://geeksforgeeks.org/deep-learning/neural-networks-a-beg... [2] https://www.kaggle.com/datasets/hojjatk/mnist-dataset/data

loveparadetoday at 7:36 AM

Horrible advice. This may have been good advice 10 years ago, but not today. There are no positions for people who "kind of understand how toy LLMs work" because so many engineers do these days. Most of the real LLM optimization work is at the edge of research and highly proprietary and not something you could ever do without infra that costs millions.

But of course, 10 years ago this wasn't obvious.

show 3 replies
deepllmtoday at 10:00 AM

As someone who's at a similar age and was interested in learning how to do this, there just aren't enough resources to do so. Most LLM research is in the form of academic papers, and there isn't any 'popular' way to learn these things, and besides that all said research assumes you have a B200 cluster ready to go. If you have weaker hardware (say an 8GB nVidia GPU, which is what I have) you're going to be limited to fine tuning small models or torturing yourself working the GPU for days per iteration trying to run things like https://github.com/karpathy/nanochat, which is hardly an educational experience. Renting cloud GPUs is expensive, and at this age the most I could muster up for experimentation is probably $100 or so, which only gets me 25 or so hours on a B200 which just isn't enough. So why would I bother myself with this if I'm already at a disadvantage because of not having access to the right hardware and when surely there are better ways to spend my time? I concluded the only way to learn and be competitive is by finding work at an AI lab somehow (not happening at 17), or studying ML at the right university.

Putting this in contrast with programming, I learned coding when I was 8, and it was incredibly stimulating to learn because you can quickly iterate and there were thousands of books and YouTube tutorials that dumb everything down and teach you fundamentals. All you needed was a $300 computer, and you can learn nearly anything you want, without being gatekept from this or that because you don't have enough vRAM / an sm_100 GPU.

Chance-Devicetoday at 9:49 AM

I think a problem a lot of people are grappling with here is that due to LLMs and AI generally, it’s basically impossible to predict what the future will look like or what jobs will still be around.

I’d probably say something like: do something you enjoy and seems like it might be useful, but accept that the pace of change may mean that whatever you study ends up being irrelevant.

Whatever solution there ends up being to this, it’s not going to be one that an individual 17 year old can implement. We’re past the point where individual good and bad choices matter that much to economic outcomes.

show 1 reply
ameliustoday at 9:47 PM

And what resources would you use for that?

(Besides the obvious nano gpt)

kashnotetoday at 5:05 PM

Don't really understand why people are saying this is terrible advice. If you're 17, you should be learning everything. At that age, your brain is a sponge and your energy levels are the highest they will ever be.

None of us know what the future of work, education, or AI is going to look like. But your best bet is to become a life-long learner. Be it LLMs, musical instruments, physics, or business.

DannyBeetoday at 10:54 AM

I get this is basically advice for young founders and entrepreneurs, but i would ignore that request and encourage 17 year olds to spend time trying to find a happy medium between work and life.

Being a super rich and an unhappy workaholic, or a super-impressive engineer who wakes up one day at 45 and realizes they regret wasting half their life (I ran into way too many of these) is a much worse fate than "not being rich from your startup" and working a relatively regular job while feeling fulfilled and happy by more than just work.

Especially in the US, which is uniquely bad at this and encourages people to work themselves to death, mental health and work life balance are much more valuable things for 17 year olds to focus on than finding good startup ideas.

In case you think i'm being a bit dramatic, let's look at the state of 17 year old mental health in the heart of Silicon Valley:

"The City of Palo Alto and the Palo Alto Unified School District approved a funded contract to place 24/7 human security guards and monitors at all four local Caltrain grade crossings, including the Churchill Avenue crossing directly adjacent to Palo Alto High School."

(in case it's not obvious, it's because of suicides by high school students)

The 17 year olds do not need advice on better startups, and this situation will never get better if we focus our advice on how to be better at work instead of how to be better at life. This will require redirecting the conversations.

show 1 reply
greenowltoday at 12:14 PM

Yeah, no way.

I'd move to the middle of nowhere and work multiple jobs on a farm and in construction. Learn how to grow food, and build things. Meet the farmer's daughter, and marry her. Then, buy my own land, grow my own food, and build my own things.

show 2 replies
agentultratoday at 11:12 AM

Most 17 year olds I know don’t want anything to do with AI and see the entire industry as an existential threat.

Nothing wrong with learning the theory and understanding the papers. Getting to that point you’ll have to get your fundamentals down. Might be an interesting exercise.

But as a future? I guess we’ll see. I suspect the next financial apocalypse will determine if there is one. Another AI Winter that may outlast all others so far.

show 1 reply
danbrookstoday at 8:25 PM

I had the same inspiration!

I spent a days reviewing the lecture notes for CS336: Language Modeling from Scratch - and then trained a nanoGPT-esque model in PyTorch.

I'd recommend trying it for those who are curious. Computational bottlenecks become much more intuitive when you've looked at the overall process.

eloranttoday at 2:21 PM

I built from scratch a sparse text embedding model trained on a 13T token corpus. Not the same as an LLM because there’s no transformer in the mix, but still I learned a shit load of things in order to solve all sorts of problems that emerge when you try to access big datasets and daily update tables with billions of rows. But if it wasn’t for a specific use case that I tried to solve I don’t think that whatever knowledge I gained could be utilized in the market. Sparse models are a very small niche and most people I’ve come across with similar knowledge are in academic circles, not business related ones. So even if LLMs are all the rage these days I doubt the demand for people who know how to build them is that high. Someone who knows how to setup an open weight model and expose an API might be more valuable to a company these days.

hauntertoday at 7:36 AM

If I were 17 again I'd prepare to go for volunteering overseas after high school for 1-2 years (plenty of free options in the EU where you might only need to cover the plane ticket). See the world, you learn a new language, help others and then think about what you want to do.

mcculleytoday at 9:23 PM

What corpus would one be advised to use for training? Should one limit oneself to legally downloadable documents or should one follow the examples of Altman, Amodei, and Zuckerberg and use LibGen and Anna's Archive?

drblasttoday at 5:43 PM

Mr. McGuire: I just want to say one word to you. Just one word.

Benjamin: Yes, sir.

Mr. McGuire: Are you listening?

Benjamin: Yes, I am.

Mr. McGuire: Plastics.

Benjamin: Exactly how do you mean?

Mr. McGuire: There's a great future in plastics. Think about it. Will you think about it?

---

I love this scene because it so perfectly captures what it's like to be young and given advice, however well-meaning, by an older generation living in a world that no longer exists for the young. And it's ambiguous and trite enough to be essentially useless even if the underlying idea isn't terrible.

Lerctoday at 1:20 PM

I'm not sure what 17 year old me would have done with YouTube tutorials for everything under the sun available.

I'm much older and less wise now, but I still afforded myself the opportunity to follow karpathy's tutorials to build a LLM from scratch. Got to play with a few ideas. Seen similar ideas turn up in frontier model work, which is quite gratifying.

There are so many ideas to try.

Currently playing with autoencoders that takes A and B and produce latents A', B', and C'. Reconstruction of A is from A' and C', B is from B' and C'

The idea is if C' can be made to improve both outputs, it must store as much information as it can about what is common to both inputs.

barbazootoday at 7:30 PM

> Someone asked what I'd do if I were 17. I'd learn how to build LLMs from scratch, and then train ones as powerful as I could with whatever hardware I could get access to.

He's seeing a future for models running on everyday hardware just capable enough to do what the use case requires.

show 1 reply
incanus77today at 5:17 PM

> Notice that what I would not do is try to start a startup. Instead I'd build the foundation of knowledge to base a startup on later.

There's also this little-known concept called learning things for learning's sake and not always trying to capitalize on it.

rmoriztoday at 1:23 PM

The only realistic approach is to train on a limited data set which is probably less usable than the comibnation of a custom RAG + one of the many available LLMs.

Also many people/kids don't have access to proper "productive" systems anymore, since the whole computing and electronics industry shifted to make "consumer"-devices like smartphones or laptops made for netflix, gaming and spotify.

Breaking the barrier to build a custom system, install linux (or developer tools for Windows, MacOS) is already a complex AND costly task. It was just way simpler in the late 90s and 00s to get something working.

hughwtoday at 9:29 PM

If I were 77 I'd do the same

claysmithrtoday at 8:59 PM

The problem is tech moves so fast that by time kid is adult llm are outdated

frabcustoday at 9:49 AM

Oddly, I just remembered I did the nearest possible thing to this when I was 17... back in 1991.

On an Amiga, I took various public domain text documents from cover disks and counted the probability of the next word given the previous word. Then spat out random sequences of words from it and printed them out. It was called "Splurge". Basically a very very simple single layer statistical language model.

Some of the sentences were randomly not bad sentences, which seemed amazing at the time!

That kind of thing (and Core Wars and Tierra etc) did lead me to getting a job at an artificial life startup at the end of the decade. But that was in turn about 10/15 years too early (no GPUs).

There's some lesson from this about timing, but honestly I've gained the most as a person when I did something that was fun, ethical and gained an audience. A tricky combination.

11101010010001today at 2:53 PM

I thought pg was trying to live forever. Has he learned LLMs from scratch?

helloplanetstoday at 1:39 PM

What about doing abliteration, weight pruning, representation engineering, etc, directly to open LLMs instead?

Building an LLM from scratch has a hard split between a tutorial project you can complete in a weekend (that's useless for actual usage) and then a solid 1km high brick wall if you want to create anything actually useful from scratch.

Modified open models have a very active community around them, without the need to look much further than Hugging Face.

vibe_that_workstoday at 2:16 PM

I really don't understand Paul's reasoning here. Does he predict more scarcity on the model-level? That layer seems to be almost a commodity now + training is damn expensive.

If you are really 17, my advice is to identify use-case for AI (ideally relevant for businesses) that work most of the time and find ways to make them work pretty much every time. AI reliability is the scarcity right now.

jadartoday at 1:29 PM

I get it the sentiment behind the post…but it has some “let them eat cake” vibes though.

jcmoscontoday at 6:39 PM

I think learning how to build your own agent harness framework from scratch and really understand each part of it, what are the modern components that a good agent harness are using these days, is more valuable than learn how to build LLMs, but that depends on what you want to do with your career.

wildcatqztoday at 6:13 PM

A teenager in China actually did that and got a paper accepted at ICML. The interview podcast is in Chinese, but you can ask AI to summarize it https://www.xiaoyuzhoufm.com/episode/6a8472b95aeb2a5712e8de7...

sscaryterryyesterday at 9:55 PM

I'd learn a trade in all seriousness.

(Edit: And learn how honest business works)

show 2 replies
excentricustoday at 4:52 PM

Yeah sure, learning the internals of a technology that’s being actively developed will probably teach you things that remain useful for awhile even if your learning outcomes could end up being different than what he’s implying.

Whether that makes a good long-term investment is quite debatable. IMO, LeCun’s take (at the end) is far more forward-looking since it aims to gain more insight into what could come next based on what we know about the current state of the art.

All that being said, the extent to which these people capitalize on our tendency to be blinded by the halo effect is incredible. A constant stream of bite-sized aphorisms…

This is especially at a different level for early startup figures who happened to be in the right place at the right time and usually did little more than digitizing mundane, traditional day-to-day processes. Yet they’re treated as geniuses and prophets, with people hanging on their every word as though everything they say contains some deeper wisdom. PG and the like often strike me as broken clocks and they’re still profiting from having been very early players in the game, who had good instincts for commercialization and capitalism.

————

LeCun’s reply:

> I would try to figure out why LLMs can write my essays but not clean my bedroom. Then I would study topics in college and grad school that could help solve that problem. I'll figure out a set of methods and architectures beyond LLMs that can quickly learn to perform physical tasks as efficiently as humans and animals. That last item is also what I would if I were 30, 40, 50, or 66 years old

nvchtoday at 6:58 AM

When I was not 17 at the times of GPT2, I decided to not bother with learning how to build LLMs because it’s too expensive for an individual. This escalated quickly.

DarmokTanagratoday at 11:08 AM

telling a 17 year old to get into tech right now is horrible advice, literally telling them to get at the back of a line with a better part of a million more experienced people in it.

show 3 replies
chentetoday at 6:46 PM

When I was 17, I made bad cartoons and was in a band. If I were 17, I'd spend more time learning music and design theory. I also learned PHP at this time, but that was low on the list, friendships came first.

onion2ktoday at 7:04 AM

I learned HTML when I was 17 in about 1995 and it's certainly taken me on a pretty fun career path. Less technical than LLMs for sure, but 'figure out where the industry is going and move what you're learning to there' is solid advice.

maxgiraldotoday at 1:39 PM

I'm making an assumption here, but I think paulg is implying that "learning LLMs" today is like the equivalent of "learning computers" in the earlier days. We could even divide civilization into two eras: Before Transformers (BT) and After Transformers (AT).

fnoeftoday at 12:39 PM

If i were 17, I'd try to distinguish who to take advice from, and would definitely learn that VCs have interest to spread a specific agenda in their message. Also, I would get drunk and have as much fun as could, as the misery of working under the treat of being replaced by AI, would simply kill any desire to live past 25.

Kuyawatoday at 2:07 PM

You can build the program, but to train it is another beast, billions of docs, images, videos, which a mere mortal doesn't have access to

Second in line, build your own agent, that's more in our ballpark, then customize it to your needs, both virtual and physical

semiquavertoday at 3:25 PM

https://deeplearningwithpython.io/ is a decent (free) read for anyone looking to follow this advice.

mickeyptoday at 7:21 AM

Writing, supervising and training LLMs are now the purview of... even larger LLMs. Optimising CUDA kernels; hand-writing SIMD assembly to speed up data loading; tinkering with your particular brand of DRAM to see if there's anything to gain from optimising for its memory topology and NUMA --- these are now the job of AI.

There is very little reason for humans to get all too engrossed in this type of work now, today, with the hope of being good enough at it to command a high salary in 3-5 years. AI can already do it incredibly well, and they can do it persistently and doggedly 24 hours a day.

show 1 reply
megadragon9today at 4:43 PM

I think it's more about the scar tissue (a.k.a. intuition) when building LLMs from scratch than whether it's transferable to job search. Maybe the person will decide they don't like LLMs and not develop that into a career, or maybe they become a researcher in another field because that's a better way to solve problems inherent in LLMs.

Tomlmmrstoday at 12:57 PM

This essentially comes down to choosing the search for substance (here in the form of technical depth) over short term gratification and quick wins in life.

I think this kind of mindset should be taught way more in school so that people really appreciate learning a subject deeply.

🔗 View 50 more comments