Spooky Sale: 10% off Premium yearly · $118.80 for the first year · until Nov 6Get it

Deep-ML
Learn
Problems1,200+ hands-on ML problemsLearning PathA guided route through the fundamentalsLabsInteractive labs on real techniquesProjectsBuild a GPT, an RL agent, CUDA kernelsCollectionsCurated problem sets and videosMathPen-and-paper math for MLIntuitionInvent the idea behind the formula yourselfPlaylistsYour own problem lists, shareableStudy AssistantAn AI teacher that knows your progress
Interview Prep
Compete
ContestsFresh problem sets, ranked liveLeaderboardWhere you stand, globallyBuddiesSolve with a friend: streaks, a weekly board, chat
Discuss
Deep-Path
Premium
      Intuition
      46 of 102

      Never say never

      A tiny language model writes one letter at a time. In its training text, here’s how often each of a, e, h, i, o, u came right after a t. Write next_chances(counts): the chance of each letter coming next after a t, for a model that will be scored on text it has never seen (“How confused is the model?”).

      A tiny model’s training text: each time a t was followed by a, e, h, i, o or u, that pair goes into its letter’s jar. Then the counts have to become chances, and new text arrives.

      the training text: “the tall cat sat with this hat. that time, the table was the stage.”thtathththtithtathta0a0e0h0i0o0ueach letter’s chance of coming next: a share of 100%100%
      Your functionnext_chances(counts)
      countscounts[i]: how often letter i came after a "t" in training letters, in order: a, e, h, i, o, ue.g. [3, 0, 6, 1, 0, 0]
      returnsone chance per letter
      solution.pyLoading Python
      Sign in for an AI hint
      ← How confused is the model?Is it luck? →