loader from loading.io

MLG 034 Large Language Models 1

Machine Learning Guide

Release Date: 05/07/2025

MLG 035 Large Language Models 2 show art MLG 035 Large Language Models 2

Machine Learning Guide

At inference, large language models use in-context learning with zero-, one-, or few-shot examples to perform new tasks without weight updates, and can be grounded with Retrieval Augmented Generation (RAG) by embedding documents into vector databases for real-time factual lookup using cosine similarity. LLM agents autonomously plan, act, and use external tools via orchestrated loops with persistent memory, while recent benchmarks like GPQA (STEM reasoning), SWE Bench (agentic coding), and MMMU (multimodal college-level tasks) test performance alongside prompt engineering techniques such as...

info_outline
MLG 034 Large Language Models 1 show art MLG 034 Large Language Models 1

Machine Learning Guide

Explains language models (LLMs) advancements. Scaling laws - the relationships among model size, data size, and compute - and how emergent abilities such as in-context learning, multi-step reasoning, and instruction following arise once certain scaling thresholds are crossed. The evolution of the transformer architecture with Mixture of Experts (MoE), describes the three-phase training process culminating in Reinforcement Learning from Human Feedback (RLHF) for model alignment, and explores advanced reasoning techniques such as chain-of-thought prompting which significantly improve complex...

info_outline
MLA 024 Code AI MCP Servers, ML Engineering show art MLA 024 Code AI MCP Servers, ML Engineering

Machine Learning Guide

Model Context Protocol (MCP) standardizes tool communication, enabling AI coding agents to perform complex tasks like executing commands, interacting with web browsers, and integrating local or cloud resources. MCP servers broaden AI applications beyond coding. In machine learning, use AI tools to help optimizing data engineering, model deployment, and augmenting typical machine learning tasks. Links Notes and resources at  stay healthy & sharp while you learn & code audio/video editing with AI power-tools Tool Use in AI Code Agents File Operations: Agents can read, edit, and...

info_outline
MLA 023 Code AI Models & Modes show art MLA 023 Code AI Models & Modes

Machine Learning Guide

Links Notes and resources at  stay healthy & sharp while you learn & code audio/video editing with AI power-tools Model Current Leaders According to the  (as of April 12, 2025), leading models include for vibe-coding: Gemini 2.5 Pro Preview 03-25: most accurate and cost-effective option currently. Claude 3.7 Sonnet: Performs well in both architect and code modes with enabled reasoning flags. DeepSeek R1 with Claude 3.5 Sonnet: A popular combination for its balance of cost and performance between reasoning and non-reasoning tasks. Local Models Tools for Local...

info_outline
MLA 022 Code AI Tools show art MLA 022 Code AI Tools

Machine Learning Guide

Links Notes and resources at stay healthy & sharp while you learn & code audio/video editing with AI power-tools I currently favor Roo Code. Plus either gemini-2.5-pro-exp-03-25 for Architect, Boomerang, or Code with large contexts. And Claude 3.7 for code with small contexts, eg Boomerang subtasks. Many others favor Cursor, Aider, or Cline. Copilot and Windsurf are less vogue lately. I found Copilot to struggle more; and their pricing - previously their winning point - is less compelling now. Why I favor Roo. The default settings have it as stable and effective as Cline, Cursor....

info_outline
MLG 033 Transformers show art MLG 033 Transformers

Machine Learning Guide

Links: Notes and resources at 3Blue1Brown videos:   stay healthy & sharp while you learn & code  audio/video editing with AI power-tools Background & Motivation RNN Limitations: Sequential processing prevents full parallelization—even with attention tweaks—making them inefficient on modern hardware. Breakthrough: “Attention Is All You Need” replaced recurrence with self-attention, unlocking massive parallelism and scalability. Core Architecture Layer Stack: Consists of alternating self-attention and feed-forward (MLP) layers, each wrapped...

info_outline
MLA 021 Databricks show art MLA 021 Databricks

Machine Learning Guide

to stay healthy while you study or work! Full notes at Raybeam and Databricks: Ming Chang from Raybeam discusses Raybeam's focus on data science and analytics, and how their recent acquisition by Dept Agency has expanded their scope into ML Ops and AI. Raybeam often utilizes Databricks due to its comprehensive nature. Understanding Databricks: Contrary to initial assumptions, Databricks is not just an analytics platform like Tableau but an ML Ops platform competing with tools like SageMaker and Kubeflow. It offers functionalities for creating notebooks, executing Python code, and using a...

info_outline
MLA 020 Kubeflow show art MLA 020 Kubeflow

Machine Learning Guide

to stay healthy while you study or work! Full notes at Conversation with Dirk-Jan Kubeflow (vs cloud native solutions like SageMaker)  - Data Scientist at Dept Agency . (From the website:) The Machine Learning Toolkit for Kubernetes. The Kubeflow project is dedicated to making deployments of machine learning (ML) workflows on Kubernetes simple, portable and scalable. Our goal is not to recreate other services, but to provide a straightforward way to deploy best-of-breed open-source systems for ML to diverse infrastructures. Anywhere you are running Kubernetes, you should be able to...

info_outline
MLA 019 DevOps show art MLA 019 DevOps

Machine Learning Guide

to stay healthy while you study or work! Full notes at Chatting with co-workers about the role of DevOps in a machine learning engineer's life Expert coworkers at Dept  - Principal Software Developer  - DevOps Lead  (where Matt features often) Devops tools Pictures (funny and serious)

info_outline
MLA 017 AWS Local Development show art MLA 017 AWS Local Development

Machine Learning Guide

to stay healthy while you study or work! Show notes:  Developing on AWS first (SageMaker or other) Consider developing against AWS as your local development environment, rather than only your cloud deployment environment. Solutions: Stick to AWS Cloud IDEs (, ,  Connect to deployed infrastructure via  Infrastructure as Code

info_outline
 
More Episodes

Explains language models (LLMs) advancements. Scaling laws - the relationships among model size, data size, and compute - and how emergent abilities such as in-context learning, multi-step reasoning, and instruction following arise once certain scaling thresholds are crossed. The evolution of the transformer architecture with Mixture of Experts (MoE), describes the three-phase training process culminating in Reinforcement Learning from Human Feedback (RLHF) for model alignment, and explores advanced reasoning techniques such as chain-of-thought prompting which significantly improve complex task performance.

Links

Transformer Foundations and Scaling Laws

  • Transformers: Introduced by the 2017 "Attention is All You Need" paper, transformers allow for parallel training and inference of sequences using self-attention, in contrast to the sequential nature of RNNs.
  • Scaling Laws:
    • Empirical research revealed that LLM performance improves predictably as model size (parameters), data size (training tokens), and compute are increased together, with diminishing returns if only one variable is scaled disproportionately.
    • The "Chinchilla scaling law" (DeepMind, 2022) established the optimal model/data/compute ratio for efficient model performance: earlier large models like GPT-3 were undertrained relative to their size, whereas right-sized models with more training data (e.g., Chinchilla, LLaMA series) proved more compute and inference efficient.

Emergent Abilities in LLMs

  • Emergence: When trained beyond a certain scale, LLMs display abilities not present in smaller models, including:
    • In-Context Learning (ICL): Performing new tasks based solely on prompt examples at inference time.
    • Instruction Following: Executing natural language tasks not seen during training.
    • Multi-Step Reasoning & Chain of Thought (CoT): Solving arithmetic, logic, or symbolic reasoning by generating intermediate reasoning steps.
  • Discontinuity & Debate: These abilities appear abruptly in larger models, though recent research suggests that this could result from non-linearities in evaluation metrics rather than innate model properties.

Architectural Evolutions: Mixture of Experts (MoE)

  • MoE Layers: Modern LLMs often replace standard feed-forward layers with MoE structures.
    • Composed of many independent "expert" networks specializing in different subdomains or latent structures.
    • A gating network routes tokens to the most relevant experts per input, activating only a subset of parameters—this is called "sparse activation."
    • Enables much larger overall models without proportional increases in compute per inference, but requires the entire model in memory and introduces new challenges like load balancing and communication overhead.
  • Specialization & Efficiency: Experts learn different data/knowledge types, boosting model specialization and throughput, though care is needed to avoid overfitting and underutilization of specialists.

The Three-Phase Training Process

  • 1. Unsupervised Pre-Training: Next-token prediction on massive datasets—builds a foundation model capturing general language patterns.
  • 2. Supervised Fine Tuning (SFT): Training on labeled prompt-response pairs to teach the model how to perform specific tasks (e.g., question answering, summarization, code generation). Overfitting and "catastrophic forgetting" are risks if not carefully managed.
  • 3. Reinforcement Learning from Human Feedback (RLHF):
    • Collects human preference data by generating multiple responses to prompts and then having annotators rank them.
    • Builds a reward model (often PPO) based on these rankings, then updates the LLM to maximize alignment with human preferences (helpfulness, harmlessness, truthfulness).
    • Introduces complexity and risk of reward hacking (specification gaming), where the model may exploit the reward system in unanticipated ways.

Advanced Reasoning Techniques

  • Prompt Engineering: The art/science of crafting prompts that elicit better model responses, shown to dramatically affect model output quality.
  • Chain of Thought (CoT) Prompting: Guides models to elaborate step-by-step reasoning before arriving at final answers—demonstrably improves results on complex tasks.
    • Variants include zero-shot CoT ("let's think step by step"), few-shot CoT with worked examples, self-consistency (voting among multiple reasoning chains), and Tree of Thought (explores multiple reasoning branches in parallel).
  • Automated Reasoning Optimization: Frontier models selectively apply these advanced reasoning techniques, balancing compute costs with gains in accuracy and transparency.

Optimization for Training and Inference

  • Tradeoffs: The optimal balance between model size, data, and compute is determined not only for pretraining but also for inference efficiency, as lifetime inference costs may exceed initial training costs.
  • Current Trends: Efficient scaling, model specialization (MoE), careful fine-tuning, RLHF alignment, and automated reasoning techniques define state-of-the-art LLM development.