Blog

Notes on the work.

Recent technical notes on AI engineering, models, and production systems.

  1. Small modelsSmall-Model DistillationI wanted to see whether a very small language model could learn to act inside a real SQL tool-use loop, not just write a final answer. It went from 1/220 to 46/220 solved tasks.2h 11m
    7 parts
    1. Part 1: Offline Teacher-Trace SFT for a 0.8B SQL Agent25 min
    2. Part 2: Off-Policy Soft-Label KD for a 0.8B SQL Agent23 min
    3. Part 3: DAgger-Style Expert-Correction SFT for a 0.8B SQL Agent28 min
    4. Part 4: On-Policy Probability Distillation for a 0.8B SQL Agent21 min
    5. Part 5: Training a 0.8B SQL Model with Its Own Feedback12 min
    6. Part 6: Training a 9B Model to Fix SQL Queries12 min
    7. Part 7: Training a 4B Model for Customer Support10 min
  2. AgentsBefore an AI agent touches customer data: six production gatesA demo shows that an agent can complete a task. These six gates ask for evidence that it can operate within a bounded workflow, with limited authority and a recovery path.10 min
  3. AgentsContext Compaction in LLM AgentsA practical introduction to context capacity, context degradation, and the main families of compaction methods used with language-model agents.19 min
    4 parts
    1. Part 1 - The Fundamentals4 min
    2. Part 2 - Learning to Compact4 min
    3. Part 3 - Post-Hoc Compilation5 min
    4. Part 4 - Theory and Safety6 min
  4. AgentsWhen One AI Agent Optimizes Another Agent's MemoryA measured experiment in which an AI coding agent changed the prompts, schemas, and modules of a memory system and evaluated the results.7 min
  5. AgentsAgent teams in Claude Code, and subagents in the Agent SDKHow interactive Claude Code teams differ from focused programmatic subagents, with current lifecycle and message-handling examples.4 min
  6. RAGBuilding a multi-agent RAG system with DSPy and GEPAA walkthrough of two retrieval agents, a coordinating agent, and prompt optimization with DSPy and GEPA.6 min
  7. LLM internalsChain of Draft Prompting: Shorter Reasoning TracesHow Chain of Draft prompting changes the length of intermediate reasoning, and what the reported evaluations show for accuracy and token use.2 min
  8. LLM internalsReinforcement Learning in Large Language Models: Rewards, Credit, and ExplorationHow PPO, RLHF, and GRPO use feedback to update language models, and what SFT followed by reinforcement learning can and cannot establish.6 min
  9. Agentssmolagents: planning, tools, and delegationA focused guide to MultiStepAgent, CodeAgent, and ToolCallingAgent using the current smolagents interfaces.4 min
  10. LLM internalsDeepSeek-R1 and Reinforcement Learning for ReasoningHow DeepSeek-R1-Zero and DeepSeek-R1 use different post-training stages, reward signals, and GRPO training for reasoning tasks.4 min
  11. RAGRDF, Labeled Property Graphs, and RetrievalA practical comparison of RDF and labeled property graphs, their reasoning models, and how structured and vector retrieval can support RAG systems.7 min
  12. RAGHybridRAG: Knowledge Graphs and Vector RetrievalHow HybridRAG combines vector retrieval with graph retrieval, and what its financial-document evaluation measured.2 min
  13. AgentsThe AI Scientist: Towards Fully Automated Open-Ended Scientific DiscoveryWhat The AI Scientist framework automates in a machine-learning research workflow, and what its paper reports about cost and automated review.3 min
  14. RAGSelf-RAG: self-reflective retrieval-augmented generationHow Self-RAG trains a language model to retrieve evidence when needed and evaluate the relevance, support, and usefulness of that evidence.3 min
  15. AgentsAgents Are Not EnoughWhat the Agents Are Not Enough paper proposes beyond individual autonomous programs: private agents, user representations, and communication between agents.2 min
  16. Small modelsMedusa: Faster LLM text generationHow Medusa adds multiple decoding heads, tree attention, and acceptance rules to reduce generation latency.6 min
  17. Small modelsSpeculative decoding and self-speculative decodingHow draft models or partial model passes can reduce the cost of autoregressive LLM generation.5 min
  18. LLM internalsREFT: Reasoning with Reinforced Fine-TuningHow the ReFT paper combines supervised warm-up with on-policy PPO to train language and program reasoning traces.3 min
  19. RAGText splitting techniques for LLMsA practical guide to character, recursive, document-specific, semantic, and agentic text splitting for retrieval.4 min
  20. AgentsVerifying LLM Outputs: From Consensus to Process ScoresHow majority voting, outcome reward models, and process reward models select among model-generated solutions, with the benchmarks and metrics behind their reported results.3 min
  21. RAGReference architecture for an enterprise support chatbot with RAGA reference architecture for customer support retrieval, generation, access control, and human handoff using AWS services and LlamaIndex.8 min
  22. LLM internalsReinforcement Fine-Tuning by OpenAIHow OpenAI's reinforcement fine-tuning uses custom graders to adapt a reasoning model to a defined task.2 min
  23. LLM internalsExpert Gate: Lifelong Learning with a Network of ExpertsHow Expert Gate adds specialist models for sequential tasks and uses reconstruction error to choose which expert to activate.3 min
  24. LLM internalsKolmogorov-Arnold NetworksHow KANs use learned univariate functions on edges, B-spline parameterizations, and small experimental comparisons with MLPs.4 min
  25. LLM internalsMixture of Memory Experts: Lamini Memory TuningHow Lamini describes a frozen Transformer backbone with trainable memory experts for recalling domain-specific facts.2 min
  26. LLM internalsInside TransformersAn introduction to the original Transformer encoder-decoder architecture, its attention mechanism, and the difference between training and generation.16 min
    5 parts
    1. Part 1: Encoder, Decoder, and Attention4 min
    2. Part 2: Positional information3 min
    3. Part 3: Scaled dot-product attention4 min
    4. Part 4: Multi-head and masked attention3 min
    5. Part 5: Layer normalization and residual connections2 min
  27. Small modelsKnowledge Distillation: Foundations and a Reproducible Iris ExampleAn introduction to knowledge distillation, with a reproducible Iris example and a careful account of its tradeoffs.10 min
  28. MLOpsMLOps ProjectHow to use MLflow for experiment tracking in machine learning model development, the first step in an end-to-end MLOps pipeline.28 min
    5 parts
    1. Part 1: Machine Learning Experiment Tracking Using MLflow4 min
    2. Workflow orchestration with Prefect5 min
    3. MLOps: Workflow Orchestration with ZenML6 min
    4. Part 3: Machine Learning Model Deployment6 min
    5. Part 4a: Machine learning model monitoring7 min
  29. MLOpsSetting Up MLflow on GCP for Experiment TrackingA complete authenticated example of running an MLflow tracking server on Google Cloud with Cloud SQL metadata and Google Cloud Storage artifacts.5 min
  30. MLOpsData Engineering: Week 3a: Data WarehouseBuilding a data warehouse with BigQuery: OLTP and OLAP, storage layout, partitioning, clustering, and ingestion.6 min
  31. MLOpsData Engineering: Week 3b: Data Warehouse and BigQuery MLBigQuery ML in practice, model export, and a focused comparison with Amazon Redshift ML.4 min
  32. MLOpsData Engineering: Week 2a: Data IngestionData ingestion fundamentals: data lakes, data warehouses, processing, and workflow orchestration.7 min
  33. MLOpsData Engineering: Week 2b: Data Ingestion with AirflowA current Airflow Docker Compose walkthrough for loading public data into Google Cloud Storage and BigQuery, with a separate local Postgres example.6 min
  34. MLOpsData Engineering: Week 1: Introduction and PrerequisitesIntroduction to the Data Engineering Zoomcamp: Docker, PostgreSQL, Terraform, and Google Cloud Platform for building data pipelines.7 min

Work with Nazmi

Build your AI system with Nazmi.

Tell us what you are building, what exists today, and where your team needs help.

Start a conversation or book a 20-minute call →