🐦 Twitter Post Details

Viewing enriched Twitter post

@rasbt

Reasoning From Scratch round 8, the finale! This last lecture in the series covers distillation as an efficient alternative to the previous reinforcement learning training runs. (Planning to take a brief break, but I will be back!) 00:00 Introduction and series recap 01:07 Why distill a reasoning model? 02:51 Soft vs. hard distillation 11:06 On-policy vs. off-policy distillation 18:09 Preparing data for reasoning distillation 22:35 Loading the DeepSeek R1 MATH dataset 28:04 Inspecting reasoning traces and final answers 31:27 Tokenization and chat templates 35:58 Pre-tokenizing the training dataset 39:01 Sequence lengths and the 2,048-token limit 42:38 Creating training and validation splits 45:32 Loading the Qwen3-0.6B base model 46:24 Computing answer-token log probabilities 54:10 Cross-entropy loss for distillation 57:25 Training and validation loss helpers 1:02:03 Implementing the distillation training loop 1:07:26 Running the standalone training script 1:09:41 Plotting training and validation losses 1:11:31 Evaluating checkpoints on MATH-500 1:14:09 Comparing teachers and distillation results 1:16:34 Future directions for reasoning models 1:19:41 Bonus exercises and next steps

📊 Media Metadata

{
  "score": 0.42,
  "score_components": {
    "author": 0.09,
    "engagement": 0.0,
    "quality": 0.12,
    "source": 0.135,
    "nlp": 0.05,
    "recency": 0.025
  },
  "scored_at": "2026-10-17T19:07:04.868582",
  "import_source": "api_import",
  "source_tagged_at": "2026-10-17T19:07:04.868593",
  "enriched": true,
  "enriched_at": "2026-10-17T19:07:04.868594",
  "media": [
    {
      "url": "https://video-s.twimg.com/amplify_video/2107292328725491712/vid/avc1/3840x2160/tw7mOGTE90Rb6eC4.mp4?tag=29",
      "type": "video"
    }
  ]
}

🔧 Raw API Response

{
  "type": "tweet",
  "id": "2111448141119856866",
  "url": "https://x.com/rasbt/status/2111448141119856866",
  "twitterUrl": "https://twitter.com/rasbt/status/2111448141119856866",
  "text": "Reasoning From Scratch round 8, the finale!\nThis last lecture in the series covers distillation as an efficient alternative to the previous reinforcement learning training runs.\n\n(Planning to take a brief break, but I will be back!)\n\n00:00 Introduction and series recap\n01:07 Why distill a reasoning model?\n02:51 Soft vs. hard distillation\n11:06 On-policy vs. off-policy distillation\n18:09 Preparing data for reasoning distillation\n22:35 Loading the DeepSeek R1 MATH dataset\n28:04 Inspecting reasoning traces and final answers\n31:27 Tokenization and chat templates\n35:58 Pre-tokenizing the training dataset\n39:01 Sequence lengths and the 2,048-token limit\n42:38 Creating training and validation splits\n45:32 Loading the Qwen3-0.6B base model\n46:24 Computing answer-token log probabilities\n54:10 Cross-entropy loss for distillation\n57:25 Training and validation loss helpers\n1:02:03 Implementing the distillation training loop\n1:07:26 Running the standalone training script\n1:09:41 Plotting training and validation losses\n1:11:31 Evaluating checkpoints on MATH-500\n1:14:09 Comparing teachers and distillation results\n1:16:34 Future directions for reasoning models\n1:19:41 Bonus exercises and next steps",
  "source": "Twitter for iPhone",
  "retweetCount": 44,
  "replyCount": 39,
  "likeCount": 412,
  "quoteCount": 4,
  "viewCount": 17203,
  "createdAt": "Sat Oct 17 13:24:00 +0000 2026",
  "lang": "en",
  "bookmarkCount": 268,
  "isReply": false,
  "inReplyToId": null,
  "conversationId": "2111448141119856866",
  "displayTextRange": [
    0,
    279
  ],
  "inReplyToUserId": null,
  "inReplyToUsername": null,
  "author": {
    "type": "user",
    "userName": "rasbt",
    "url": "https://x.com/rasbt",
    "twitterUrl": "https://twitter.com/rasbt",
    "id": "865622395",
    "name": "Sebastian Raschka",
    "isVerified": false,
    "isBlueVerified": true,
    "verifiedType": null,
    "profilePicture": "https://pbs.twimg.com/profile_images/1661187442043486209/a3E4t1eV_normal.jpg",
    "coverPicture": "https://pbs.twimg.com/profile_banners/865622395/1742309979",
    "description": "",
    "location": "United States",
    "followers": 527375,
    "following": 1225,
    "status": "",
    "canDm": false,
    "canMediaTag": true,
    "createdAt": "Sun Oct 07 02:06:16 +0000 2012",
    "entities": {
      "description": {
        "urls": []
      },
      "url": {}
    },
    "fastFollowersCount": 0,
    "favouritesCount": 26198,
    "hasCustomTimelines": true,
    "isTranslator": false,
    "mediaCount": 2202,
    "statusesCount": 20348,
    "withheldInCountries": [],
    "affiliatesHighlightedLabel": {},
    "possiblySensitive": false,
    "pinnedTweetIds": [
      "2097677950262939931"
    ],
    "profile_bio": {
      "description": "ML/AI research engineer. Ex stats professor.\nAuthor of \"Build a Large Language Model From Scratch\" (https://t.co/O8LAAMRzzW) & reasoning (https://t.co/5TueQKx2Fk)",
      "entities": {
        "description": {
          "urls": [
            {
              "display_url": "amzn.to/4fqvn0D",
              "expanded_url": "https://amzn.to/4fqvn0D",
              "indices": [
                100,
                123
              ],
              "url": "https://t.co/O8LAAMRzzW"
            },
            {
              "display_url": "mng.bz/lZ5B",
              "expanded_url": "https://mng.bz/lZ5B",
              "indices": [
                138,
                161
              ],
              "url": "https://t.co/5TueQKx2Fk"
            }
          ]
        },
        "url": {
          "urls": [
            {
              "display_url": "sebastianraschka.com",
              "expanded_url": "https://sebastianraschka.com",
              "indices": [
                0,
                23
              ],
              "url": "https://t.co/HrtQQ5tgJl"
            }
          ]
        }
      }
    },
    "isAutomated": false,
    "automatedBy": null
  },
  "extendedEntities": {
    "media": [
      {
        "additional_media_info": {
          "monetizable": false
        },
        "allow_download_status": {
          "allow_download": true
        },
        "display_url": "pic.x.com/UMbZBIhvAQ",
        "expanded_url": "https://x.com/rasbt/status/2111448141119856866/video/1",
        "ext_master_playlist_only": [],
        "ext_media_availability": {
          "status": "Available"
        },
        "ext_playlists": [],
        "id_str": "2107292328725491712",
        "indices": [
          280,
          303
        ],
        "media_key": "13_2107292328725491712",
        "media_results": {
          "id": "QXBpTWVkaWFSZXN1bHRzOgwABAoAAR0+mzVDlrAAAAA=",
          "result": {
            "__typename": "ApiMedia",
            "id": "QXBpTWVkaWE6DAAECgABHT6bNUOWsAAAAA==",
            "media_key": "13_2107292328725491712"
          }
        },
        "media_url_https": "https://pbs.twimg.com/amplify_video_thumb/2107292328725491712/img/d8W_oyOVYGNAtmRC.jpg",
        "original_info": {
          "focus_rects": [],
          "height": 2160,
          "width": 3840
        },
        "sizes": {
          "large": {
            "h": 1152,
            "w": 2048
          }
        },
        "type": "video",
        "url": "https://t.co/UMbZBIhvAQ",
        "video_info": {
          "aspect_ratio": [
            16,
            9
          ],
          "duration_millis": 4877076,
          "variants": [
            {
              "content_type": "application/x-mpegURL",
              "url": "https://video-s.twimg.com/amplify_video/2107292328725491712/pl/ZlvovGipHIRrEejq.m3u8?tag=29&v=aaa"
            },
            {
              "bitrate": 256000,
              "content_type": "video/mp4",
              "url": "https://video-s.twimg.com/amplify_video/2107292328725491712/vid/avc1/480x270/Dvg57-hq_hXykA5e.mp4?tag=29"
            },
            {
              "bitrate": 832000,
              "content_type": "video/mp4",
              "url": "https://video-s.twimg.com/amplify_video/2107292328725491712/vid/avc1/640x360/mkF_cxqFewdiYvXa.mp4?tag=29"
            },
            {
              "bitrate": 2176000,
              "content_type": "video/mp4",
              "url": "https://video-s.twimg.com/amplify_video/2107292328725491712/vid/avc1/1280x720/lzwaaPg5t1Q1juOK.mp4?tag=29"
            },
            {
              "bitrate": 10368000,
              "content_type": "video/mp4",
              "url": "https://video-s.twimg.com/amplify_video/2107292328725491712/vid/avc1/1920x1080/_kGWekr3r-xg4gpc.mp4?tag=29"
            },
            {
              "bitrate": 25128000,
              "content_type": "video/mp4",
              "url": "https://video-s.twimg.com/amplify_video/2107292328725491712/vid/avc1/3840x2160/tw7mOGTE90Rb6eC4.mp4?tag=29"
            }
          ]
        }
      }
    ]
  },
  "card": null,
  "place": {},
  "entities": {
    "hashtags": [],
    "symbols": [],
    "timestamps": [
      {
        "indices": [
          234,
          239
        ],
        "seconds": 0,
        "text": "00:00"
      },
      {
        "indices": [
          270,
          275
        ],
        "seconds": 67,
        "text": "01:07"
      },
      {
        "indices": [
          307,
          312
        ],
        "seconds": 171,
        "text": "02:51"
      },
      {
        "indices": [
          340,
          345
        ],
        "seconds": 666,
        "text": "11:06"
      },
      {
        "indices": [
          384,
          389
        ],
        "seconds": 1089,
        "text": "18:09"
      },
      {
        "indices": [
          432,
          437
        ],
        "seconds": 1355,
        "text": "22:35"
      },
      {
        "indices": [
          475,
          480
        ],
        "seconds": 1684,
        "text": "28:04"
      },
      {
        "indices": [
          527,
          532
        ],
        "seconds": 1887,
        "text": "31:27"
      },
      {
        "indices": [
          565,
          570
        ],
        "seconds": 2158,
        "text": "35:58"
      },
      {
        "indices": [
          607,
          612
        ],
        "seconds": 2341,
        "text": "39:01"
      },
      {
        "indices": [
          656,
          661
        ],
        "seconds": 2558,
        "text": "42:38"
      },
      {
        "indices": [
          702,
          707
        ],
        "seconds": 2732,
        "text": "45:32"
      },
      {
        "indices": [
          742,
          747
        ],
        "seconds": 2784,
        "text": "46:24"
      },
      {
        "indices": [
          789,
          794
        ],
        "seconds": 3250,
        "text": "54:10"
      },
      {
        "indices": [
          831,
          836
        ],
        "seconds": 3445,
        "text": "57:25"
      },
      {
        "indices": [
          874,
          881
        ],
        "seconds": 3723,
        "text": "1:02:03"
      },
      {
        "indices": [
          926,
          933
        ],
        "seconds": 4046,
        "text": "1:07:26"
      },
      {
        "indices": [
          973,
          980
        ],
        "seconds": 4181,
        "text": "1:09:41"
      },
      {
        "indices": [
          1021,
          1028
        ],
        "seconds": 4291,
        "text": "1:11:31"
      },
      {
        "indices": [
          1064,
          1071
        ],
        "seconds": 4449,
        "text": "1:14:09"
      },
      {
        "indices": [
          1116,
          1123
        ],
        "seconds": 4594,
        "text": "1:16:34"
      },
      {
        "indices": [
          1163,
          1170
        ],
        "seconds": 4781,
        "text": "1:19:41"
      }
    ],
    "urls": [],
    "user_mentions": []
  },
  "quoted_tweet": null,
  "retweeted_tweet": null,
  "isLimitedReply": false,
  "communityInfo": null,
  "article": null
}