- 𝗗𝗮𝘁𝗮 𝗖𝗼𝗹𝗹𝗲𝗰𝘁𝗶𝗼𝗻 & 𝗣𝗿𝗲𝗽𝗿𝗼𝗰𝗲𝘀𝘀𝗶𝗻𝗴 Prepare large amounts of high-quality data for training.
Step-by-step:
• 𝗖𝗼𝗹𝗹𝗲𝗰𝘁 𝗗𝗮𝘁𝗮: Gather text from websites, books, documents, code, articles, etc.
• 𝗘𝘅𝘁𝗿𝗮𝗰𝘁 → 𝗧𝗲𝘅𝘁: Convert PDFs, HTML, and other sources into usable text.
• 𝗙𝗶𝗹𝘁𝗲𝗿 & 𝗖𝗹𝗲𝗮𝗻: Remove toxic, private, low-quality, and irrelevant content.
• 𝗗𝗲𝗱𝘂𝗽𝗹𝗶𝗰𝗮𝘁𝗲: Remove repeated documents, paragraphs, and lines.
• 𝗧𝗼𝗸𝗲𝗻𝗶𝘇𝗲: Convert text into smaller units called 𝘁𝗼𝗸𝗲𝗻𝘀.
You now have clean, tokenized training data.
- 𝗣𝗿𝗲-𝗧𝗿𝗮𝗶𝗻𝗶𝗻𝗴 Teach the model language patterns by predicting the next token.
Step-by-step:
• 𝗜𝗻𝗽𝘂𝘁 𝗧𝗼𝗸𝗲𝗻𝘀: Feed token sequences into the model.
• 𝗧𝗿𝗮𝗻𝘀𝗳𝗼𝗿𝗺𝗲𝗿: Pass them through a decoder-only Transformer.
• 𝗡𝗲𝘅𝘁 𝗧𝗼𝗸𝗲𝗻 𝗣𝗿𝗲𝗱𝗶𝗰𝘁𝗶𝗼𝗻: Predict what token comes next.
• 𝗨𝗽𝗱𝗮𝘁𝗲 𝗪𝗲𝗶𝗴𝗵𝘁𝘀: Use the prediction error to adjust model parameters.
• 𝗥𝗲𝗽𝗲𝗮𝘁: Train across massive amounts of data.
The model learns language patterns, concepts, and relationships.
- 𝗦𝘂𝗽𝗲𝗿𝘃𝗶𝘀𝗲𝗱 𝗙𝗶𝗻𝗲-𝗧𝘂𝗻𝗶𝗻𝗴 (𝗦𝗙𝗧) Turn the pretrained model into an instruction-following assistant.
Step-by-step:
• 𝗜𝗻𝘀𝘁𝗿𝘂𝗰𝘁𝗶𝗼𝗻: Give the model a task or prompt.
• 𝗛𝘂𝗺𝗮𝗻 𝗔𝗻𝘀𝘄𝗲𝗿: Provide a high-quality example response.
• 𝗧𝗿𝗮𝗶𝗻: Show the model many instruction-answer examples.
• 𝗙𝗶𝗻𝗲-𝗧𝘂𝗻𝗲: Update its weights using these examples.
The raw predictor becomes a helpful assistant.
- 𝗔𝗹𝗶𝗴𝗻𝗺𝗲𝗻𝘁 Make responses more helpful, safe, and aligned with human preferences.
Step-by-step:
• 𝗚𝗲𝗻𝗲𝗿𝗮𝘁𝗲: Produce multiple possible responses.
• 𝗛𝘂𝗺𝗮𝗻 𝗥𝗮𝗻𝗸𝗶𝗻𝗴: Humans compare and rank them.
• 𝗟𝗲𝗮𝗿𝗻 𝗣𝗿𝗲𝗳𝗲𝗿𝗲𝗻𝗰𝗲𝘀: Learn which responses are better.
• 𝗢𝗽𝘁𝗶𝗺𝗶𝘇𝗲: Use methods such as RLHF or DPO.
The model becomes more helpful, safe, and aligned.
- 𝗜𝗻𝗳𝗲𝗿𝗲𝗻𝗰𝗲 𝗢𝗽𝘁𝗶𝗺𝗶𝘇𝗮𝘁𝗶𝗼𝗻 & 𝗗𝗲𝗽𝗹𝗼𝘆𝗺𝗲𝗻𝘁 Make the model efficient enough for real-world use.
Step-by-step:
• 𝗤𝘂𝗮𝗻𝘁𝗶𝘇𝗲 / 𝗖𝗼𝗺𝗽𝗿𝗲𝘀𝘀: Reduce model size and compute requirements.
• 𝗢𝗽𝘁𝗶𝗺𝗶𝘇𝗲: Improve speed, latency, and cost.
• 𝗔𝗣𝗜 𝗗𝗲𝗽𝗹𝗼𝘆𝗺𝗲𝗻𝘁: Make the model available through an API or application.
• 𝗚𝘂𝗮𝗿𝗱𝗿𝗮𝗶𝗹𝘀: Add safety controls and access policies.
• 𝗠𝗼𝗻𝗶𝘁𝗼𝗿𝗶𝗻𝗴: Track performance, failures, and safety issues.
• 𝗖𝗼𝗻𝗻𝗲𝗰𝘁 𝗧𝗼𝗼𝗹𝘀: Add RAG, memory, tools, and external systems when needed.
The LLM is ready for real-world applications.
𝗜𝗻 𝘀𝗶𝗺𝗽𝗹𝗲 𝘁𝗲𝗿𝗺𝘀:
𝗗𝗮𝘁𝗮 → 𝗣𝗿𝗲-𝗧𝗿𝗮𝗶𝗻𝗶𝗻𝗴 → 𝗙𝗶𝗻𝗲-𝗧𝘂𝗻𝗶𝗻𝗴 → 𝗔𝗹𝗶𝗴𝗻𝗺𝗲𝗻𝘁 → 𝗗𝗲𝗽𝗹𝗼𝘆𝗺𝗲𝗻𝘁
That's the basic journey from raw data to a production-ready LLM.
Top comments (0)