Questions and answers
63 questions from the community, answered by the
author in
#book-of-the-week
on Slack.
-
Malik Hebbat asked
Is the book feasible for every stage of experience also for experts? And has it code examples included that can also be used as templates (in specific cases) to modify? Thanks in advance! Malik
-
Avinash More asked
hi Sebastian Raschka What skills would you recommend acquiring to efficiently leverage large language models (LLMs) for solving real-world problems? I believe that while the number of experts building LLMs will be smaller and highly specialized, there will be a large number of developers using these models. What key skills should developers focus on to make the most effective use of LLMs?
-
Low Kim Hoe asked
Sebastian Raschka Nice to meet you! thanks for the great effort here to reply all of us question. Do you think it's necessary to understand deeply the architecture of LLM for the people using the LLM?
-
Chintan Gotecha asked
Sebastian Raschka -- The book's github repo is actively growing super fast; please let know any kind of help is required there.
-
Tim Becker asked
Hi Sebastian Raschka, thank you very much for taking the time to answer our questions. There have already been a lot of good questions. I hope you still have some time to look at mine. I would appreciate it a lot.
- In your opinion, what are the most promising trends in LLM development? Beyond simply increasing model size, what new directions do you see for LLM research? Are there specific areas, like interpretability or reasoning, or domain-specific enhancements that excite you?
- What do you consider the biggest challenges to further improving LLMs? Are there intrinsic limitations that we may never be able to overcome with this technology? For instance, could there be a point where scaling up no longer yields significant gains?
- Do you think LLMs could replace software engineers and data scientists in the near future? Alternatively, could they significantly augment our capabilities, potentially leading to fewer jobs? What role do you see LLMs playing in enabling non-technical roles, like product managers, to handle technical aspects of product development without developer support?
- In your view, are there specific application areas where LLMs are unsuitable or even potentially harmful? For example, would you recommend against their use in certain high-stakes domains, such as medical or legal advising, due to accuracy or ethical concerns?
-
Sebastian Raschka
Author of the book
Hi all, it’s crazy timing but I woke up with a fever today. I appreciate the interest and questions and promise I will get to them when I am feeling a bit better. Please don’t worry and keep the questions coming
-
Rileen Sinha asked
Sebastian Raschka - I'm looking forward to diving into your book, which teaches us how to build a GPT-2 like LLM from scratch. Are there any books you'd recommend for the next stages, i.e. working with the best LLMs of today and tomorrow? Also, are there any books on ML-DL (besides the 4th edition of your own) that you'd recommend? Thanks so much!
-
Abm Adnan Azmee asked
Hi Sebastian Raschka, Since LLM technology is advancing rapidly, what is the best approach for a beginner to get started in this field?
-
Harshit Lamba asked
Hi Sebastian Raschka, hope you are feeling good! I have an application based question - in a corporate setting, we usually do the pilot runs using LLMs to get the clients onboarded and then don't know where to go from there. In traditional and advanced machine learning (for instance, spam detection problem), we still get some pointers regarding the things to try, such as improved pre-processing, n-grams, tuning sequence models etc. But when we use LLMs there is a little scope of tuning the model and clearly we can't think of pre-processing as the model is already that advanced. So what next should we take?
-
RAVI SHEKHAR TIWARI asked
Hi Sebastian Raschka llm are very good at representation of the features by considering global and local features. It this possible we can implement the concept of fine granularity and course granularity inside llm to represent features and then used multi headed attention based on the use case without specifying explicitly
-
Ruslan Nuriev asked
Hello, I couldn't make it to the QA session because of my classes. Is there going to be any event with Sebastian Raschka in the near future?
-
Sebastian Raschka
Author of the book
Hey everyone!
Thank you all so much for participating! The questions were fantastic 😊, and I really appreciated the interest! Unfortunately, I came down with a fever this week, but I did my best to respond to almost everyone. (There are a few questions I haven’t responded to yet, but I will do so in the next few days as I get better.)
Also, big thanks to the organizers Alexey Grigorev and Anj for making this happen! 🙌
And, of course, congratulations to the winners! I hope the book will be a valuable resource for your work and career 🎊. Looking under the hood of an LLM and implementing one from the ground up is a time investment (versus just taking a shortcut and using a third-party service or library).
However, I think that it’s similar to learning math fundamentals if you are a data scientist, for example. Sure, we are not going to implement our own code functions to implement matrix multiplication, hypothesis text, and so forth in our everyday work. But I think that doing it by hand and (/coding it up) once as an exercise can be super useful to really understand how these things work.
Wishing you all a great weekend!
-
Standing-Appa asked
Hi Sebastian Raschka I hope you are feeling better soon. I wanted to ask what you think about Mamba (Jamba) and State-Space Models. Do you think they will scale well and what are their advantages (e.g. Genetic Data) compared to Transformers?
-
Standing-Appa asked
And since you are an expert and maybe a bit out of the scope of just the book:
What is the best embedding model for text, particularly for downstream classification tasks? I've often heard that Transformer embeddings might not be ideal for such tasks, since "they don't mean that much". What are your thoughts on the LLM2Vec approach?
My goal is to embed long clinical texts for classification, but my dataset is relatively small. Would it be more effective to use a pre-trained model and fine-tune it, or is training a Transformer from scratch a viable option? Additionally, would a bidirectional encoder be more suitable (even given the smaller context size) than a decoder-only model for this purpose (and which layer is the most informative and how to some the layers), or is there a different approach that might work better?
-
Pastor Soto asked
Hi. When you wrote this book do you have some profile in mind that you want it to explain the concepts (or did you write thinking about some general practitioners of LLMs)? Also, did you have concepts that were particularly tricky to simplify without losing essential depth?
-
Muneeb Khan asked
Hi, Sebastian Raschka. Thank you so much for your response. I hope you're feeling much better now.
The list is in fact open-ended, and as you mentioned, multi-label classification wouldn't necessarily be appropriate since we may encounter new types of messages in the future. Essentially, my goal is to enable the small LLM to match the performance of the big LLM in summarizing the customer messages into a list of only *the important keywords*. So, the reference keywords I use are just to enable the small LLM to learn to identify the important keywords. I want to be able to use a small LLM in a production setting for doing this task for future customer messages.
-
Howard Ting asked
Hi, Sebastian Raschka, hope you're doing well! I have two questions:
1. Do you think reinforcement learning will play a critical role in training LLMs in the future?
2. Do you think there could be significant breakthroughs in learning theory in the coming years that would allow LLMs to require far less training data while developing reasoning abilities closer to human cognition?
-
Anj asked
Hi everyone,
As we wrap up this Book of the Week event, we want to thank you all for your insightful questions.
A big thanks also goes to Sebastian Raschka for sharing their time and answering our queries.
We appreciate your participation and look forward to seeing you again at the next event!
-
Prajwal Srinivas asked
Sebastian Raschka Hello!
- What are you the most excited for, in the field of LLMs?
- How do you keep up and prioritise all the new stuff happening with ML and LLMs?
- Any suggestions on what has worked the best for you for parsing graphic and table heavy pdfs?
- Any general tips/tricks would be appreciated as well
Thank you 🙂
-
Vivien S. asked
Question for Sebastian Raschka:
- What is the thought process which leads to making a decision that one should build an LLM instead of using an existing LLM + RAG or fine-tuning?
- What are the overheads that one should consider before start building an LLM from scratch?
- How do one evaluate the built LLM? Would you suggest to consider existing benchmarks for evaluation?
-
raki asked
*How do you approach evaluating the performance of the LLM built in your book? What metrics or methods do you find most useful for understanding its strengths and limitations?*
-
raki asked
What datasets are recommended for the pretraining and fine-tuning tasks, and how does dataset selection impact the performance?
-
Evren Unal asked
Which machine do I need to train your LLM?
Can i train it on my local machine?
-
Rafał Szu asked
For readers who are not very familiar with deep learning, how steep is the learning curve when following the steps in your book?
-
Rafał Szu asked
In the book, you guide readers step by step. Which stage do you think is the most critical for understanding how LLMs work?
-
Rafał Szu asked
When coding a language model from scratch, what is the most common mistake people make, and how can it be avoided?
-
Till asked
How to best organize data (getting and storing) for finetuning?
-
Aninda Goswamy asked
Hi Sebastian Raschka
Can you please tell us what criteria or factors to consider for choosing an encoder model like BERT or more recent decoder based LLM architectures during a text classification or other related tasks
-
Ranga Hande asked
Questions for Sebastian Raschka:
-
Ranga Hande asked
1. Does LLM tuning section in the book covers RAG, Graph RAG, agents etc?
-
Ranga Hande asked
2. What are the system requirements to try code from the book? Any free options that beginners can use while learning?
-
Ravi Natukula asked
Is there a start date for the 'Build a Large Language Model (From Scratch)' session? Also, is there a specific structure or process we follow for this? I'm new and trying to understand how the book of the week event works.
-
Juliana Machado asked
Sebastian Raschka following the book, will we build a LLM or a SLM since the computational requirements for SLM is considerable smaller?
-
Juliana Machado asked
Sebastian Raschka In your experience, when adapting large language models for specialized domains what architectural or training strategies have you found most effective in enhancing the model's domain-specific accuracy while still retaining its broader language understanding? Are there specific techniques you've found helpful in balancing the trade-off between specialization and generalization?
-
Juliana Machado asked
Sebastian Raschka Do you think a domain-specific small language model could reach performance levels similar to a general-purpose LLM if the input data were transformed into structured, deterministic features rather than relying on conversational or unstructured text aligning it with desired outcomes ?
-
Antje asked
Sebastian Raschka I have some questions regarding yourself instead of your book 🙂 How did you come up with the idea to write a book? Are you a full-time writer, how much do you write each day, and how long does it take you to finish such a book?
-
Antje asked
Sebastian Raschka What are main differences between your book and Andrej Karpathys "GPT from scratch" videos? Are the approaches comparable (both building an LLM from scratch), or are there fundamental differences in concepts?
-
Juliana Machado asked
Sebastian Raschka Are there specific strategies or techniques you've found to be particularly effective to mitigate potential biases or harmful outputs from LLMs?
-
Mari asked
Sebastian Raschka are there also suggestions/approaches for LLM performance evaluation?
-
Chintan Gotecha asked
👋 Hello, team!
Excited to be part of the effort, look forward to some amazing collaborations!
-
Chintan Gotecha asked
Sebastian Raschka --Please help me with a quick one; what techniques the book recommend for optimizing inference speed and reducing the computational cost of running the trained model?
-
Sebastian Raschka
Author of the book
Hey all,
I just wanted to say THANKS for all these interesting questions so far! When I was asked to join the book-of-the-week DataTalk.club (opens in a new tab), it sounded interesting of course, but I didn’t expect so many super relevant questions to be honest!
And no worries, I will get to them one by one!
-
Moaaz Khokhar asked
Sebastian Raschka Thanks for taking the time out to answer our questions. I have a lot of questions and I would really appreciate if you could be kind to answer some of these. You might find them redundant or vague, I apologize in advance, but since your book has been released I have been trying to acquire it and very excited to learn from it ASAP and did not want to waste the opportunity to get answers from you. 🙂
How can I improve protein language models for specific tasks or design new models effectively?
-
Moaaz Khokhar asked
Sebastian Raschka What role can RAG, agents, or prompt engineering play in enhancing protein modeling in computational biology?
-
Moaaz Khokhar asked
Sebastian Raschka Are there specific resources you'd recommend for learning about building large language models from scratch?
-
Moaaz Khokhar asked
Sebastian Raschka For low-resource languages like Turkish in specialized domains like law, how can we build or improve language models?
-
Moaaz Khokhar asked
Sebastian Raschka Can models like LLaMA (pretrained on English language) serve as a backbone for developing Turkish language models, and what should be considered?
-
Moaaz Khokhar asked
Sebastian Raschka What initial steps do you recommend when starting to solve a problem in the language modeling domain?
-
Moaaz Khokhar asked
Sebastian Raschka How might I collaborate with experts like you on projects related to language models?
-
Moaaz Khokhar asked
Sebastian Raschka In modeling non-natural languages like protein sequences, what indicators are crucial for interpretation?
-
Moaaz Khokhar asked
Sebastian Raschka With so many LLM resources available, how can we stay up-to-date (it's like a jungle and information overflow) and where should we begin when tackling new problems?
-
Moaaz Khokhar asked
Sebastian Raschka As a beginner familiar with terms like RAG and prompt engineering, how can I quickly become proficient in formulating and solving AI problems?
Thank you so much again, in advance. 🙂
-
onyeka okonji asked
Hi Sebastian Raschka thanks for writing this book. i was fortunate to read a few chapters in the beginning and it helped with accurate understanding of the building blocks of LLMs and it helped me when working in my MSc dissertation. I have a few questions:
1. Does the book cover all techniques of parameters efficient fine-tuning other than LoRA and in your opinion, which of these techniques is the best to use especially when working with very small datasets, particularly medical datasets.
2. does the book cover grouped attention, if it doesn’t, do you have any tutorials on the topic? i subscribe to your substack but i’m not sure i’ve seen anything on that from you.
-
Pastor Soto asked
Hi, does the book discuss the benefit of building a LLMs from scratch instead of using a pre-existing solution? I mean, customers might understand that you want to finetune a pre-trained model but I am expecting having troubles to communicate why building something from scratch might be needed. What's your experience in this regard?
-
Nancy Wei asked
Hi Sebastian Raschka! I have been reading all your books since 2017. Your new book is excellent (and I like how it's not 500+ pages)!
My question: if there are limitations to accessing the data (for example, there is personally identifiable information, PII, in the data), would it be better to build an LLM from scratch or use a foundation model and then tune from there?
Thank you!!
-
Nishrin Kachwala asked
hi Sebastian Raschka my questions, apologies if you have covered them before.
1. *What are the ethical considerations of training an LLM from scratch, especially when considering potential biases in the training data?*
2. *What are the challenges and opportunities associated with using human feedback to ensure an LLM follows instructions and aligns with human values?*
-
Roman Zabolotin asked
Hello Sebastian Raschka 👋, thank you for your book and time for answering questions.
Do you cover the Reinforcement Learning from Human Feedback (RLHF) method for model fine-tuning in your book? How would you assess the complexity of implementing this approach for readers following your book's materials?
-
Till asked
Sebastian Raschka How to make a LLM multimodal (video, audio, images)?
-
Omkar Gurav asked
Hello Sebastian Raschka || hope u answer this., I'll not complicate things, just give a clear understanding who should read this book...?, and how one can approach this book.. for Begineers..
Question: also what are you working on currently...? We would love to have some learning insight's on it....
Question: What are the key trade-offs between training a model from scratch versus fine-tuning an existing model?
-
Antje asked
Hi Sebastian Raschka thanks for answering my questions. One more: Which chapters/parts of your book would you recommend for a one-semester graduate student project (or several smaller implementation projects)? I am currently using three of Karpathy's 'Zero to hero'/'GPT from scratch' videos as basis for this course, but this lacks a textbook, so I am looking for an alternative. Any suggestions?
-
Muneeb Khan asked
Hi Sebastian Raschka, I'm relatively new to LLM fine-tuning. I'm working on a project where I have a dataset of customer messages. My goal is to fine-tune a small LLM, say Mistral 7B or even the Llama 3.2 1B/3B, to summarize the customer messages into a set of keywords that best describe the issues raised or the requests. Let's say I also have a set of reference keywords that I've obtained from a bigger model — I want this to serve as my ground truth. I'm following the below approach for fine-tuning:
- Prepare an instruction format dataset by including the prompt with each message, along with the reference keywords. The prompt template is structured somehow like this:
◦ prompt_template =
```### System: You are an expert at extracting keywords from customer messages. Your task is to identify and list the most relevant key terms that summarize the main issues or topics in the given message. Return the key terms as a comma-separated list. Do not include any additional information.
### User:
{}
### Assistant:
Extracted Keywords: {}```
◦ I do this for the training and the validation sets, but exclude the reference keywords for the test set.
Q) Is the data preparation approach I follow correct for the fine-tuning process?
Q) Would it be better to exclude the reference keywords from the instruction-prepared validation set as well to get a better idea of how the model will perform in the wild?
Q) What would be the best evaluation strategy for my use case? Currently, I'm using precision, recall and f1 score between the reference keywords and the keywords generated by the fine-tuned model.
Thank you so much for your time and I'm quite excited to get started with your amazing book to getter better insights into working with LLMs from the ground-up.
-
bryan bai asked
Question: what is the difference between a LLM like gpt-4o and embedding model like ada002 ?
-
bryan bai asked
Question: for RAG workload , I feel finetune an embedding model will have more benefit than finetune a generation model. How should I finetune an embedding model ?
Want the whole story?
The answers above are the short version of Build a Large Language Model (From Scratch).