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
      102 of 102

      Don’t redo the work

      A model writes one word at a time after a prompt. Every word in the text, the prompt’s and each one the model writes, needs a key and a value worked out once it’s in the text: that’s what later words listen to in “Listen and collect”. Write work_to_write(prompt_length, new_words): how many words’ keys and values it has to work out to write new_words words after the prompt, if it never works anything out twice.

      A 5-word prompt, then 3 words written one at a time. Every word in the text needs its key and value worked out, and each new word listens to all of them. Done the lazy way, every step works them all out again. How many keys and values, if nothing is worked out twice?

      A prompt, then words written one at a time. Each listens to every word before it.the promptwritten one at a timep1p2p3p4p5w1w2w3read the promptword 1 joinsword 2 joinsword 3 joinsworked out for the first timeworked out again: wastedwork_to_write(prompt 5, new words 3), nothing worked out twice →?
      Your functionwork_to_write(prompt_length, new_words)
      prompt_lengthhow many words the prompt hase.g. 5
      new_wordshow many words the model writes after it, one at a timee.g. 0
      returnshow many words' keys and values it works out in all
      solution.pyLoading Python
      Sign in for an AI hint
      ← One outlier ruins it