How Language Models Pick Words (Softmax & Temperature)

youtube
How Language Models Pick Words (Softmax & Temperature) In this video, I explain the softmax function and the concept of temperature in the context of language models and neural networks. I start by revisiting the Markov chain coding challenge, then break down how softmax converts raw neural network outputs (logits) into probabilities, and how temperature can be used to adjust those probabilities making outputs more random (higher temperature) or more deterministic (lower temperature). I also briefly cover top-K and top-P sampling. Everything is demonstrated with p5.js sketches and a transformers.js language model running in the browser. Code: 🚀 Watch this video ad-free on Nebula p5.js Web Editor Sketches: 🕹️ Softmax and Temperature Visualization: 🕹️ Markov Chain with Temperature: 🕹️ Markov Chain with Softmax and Temperature: 🕹️ LLM with Temperature: 🎥 Previous: 🎥 Next: References: 📓 Softmax function on Wikipedia: 📓 Markov Chains explained visually: 📓 Web Trigrams by Chris Harrison: 📓 Euler's number on Wikipedia: 📓 p5.js exp() reference: 💻 Transformers.js Documentation: 🤗 SmolLM2 1.7B on Hugging Face: 📕 Nature of Code: Genetic Algorithms: Videos: 🚂 🚂 🚂 🚂 Related Coding Challenges: 🚂 🚂 Timestamps: 0:00:00 Hello! 0:02:50 Markov chains as language models 0:07:48 From logits to probabilities 0:10:47 The softmax formula 0:14:18 Implementing softmax in p5.js 0:15:59 Weighted selection (sampling) 0:20:20 Temperature 0:23:02 Applying softmax and temperature to the Markov chain 0:28:01 Temperature with a Transf
  2026/08/03      youtube

Our Tag

最近投稿されたプログラミング学習動画

Generators (Technique of the Week)

Generators docs → Save time AND memory...

  2026/08/04

Firebase Crash Course (Auth & Firestore) #10 - Realtime Firestore Subs

firebase

In this Firebase Crash Course, you'll le...

  2026/08/04

Amadeus Transforms Travel CX with Amazon Connect Customer | Amazon Web

Amazon

What makes the travel industry unique is...

  2026/08/03

Assisted Maintenance & Agentic Workflows for Industrial Equipment Flee

Amazon

This demo showcases how AWS combines IoT...

  2026/08/03

Amazon GuardDuty Malware Protection for AWS Backup | Amazon Web Servic

Amazon

This 8-minute video is a beginner-friend...

  2026/08/03

Scrum Master Roadmap 2026 | How to Become a Scrum Master | #Shorts #Si

🔥Professional Scrum Master (PSM) Certifi...

  2026/08/03

How Language Models Pick Words (Softmax & Temperature)

In this video, I explain the softmax fun...

  2026/08/03

Google Pixel 11 Pro Fold | Open

Google

Ask more of your phone. August 12. #Made...

  2026/08/03

Top 3 Data Analyst Skills | Skills to Become a Data Analyst | #Shorts

🔥Data Analyst Masters Program (Discount ...

  2026/08/03

Comprehensive LLM Observability On AWS | Amazon Web Services

Amazon

Discover how to setup in-depth, end-to-e...

  2026/08/03

How AI Tutors Are Grading Exams | AI in Education Explained | #Shorts

🔥Generative AI, Machine Learning, And In...

  2026/08/03

IC Design Engineer Roadmap 2026 | IC Design EngineerCareer Roadmap For

Design

🔥IIITB - Advanced Certification in UI/UX...

  2026/08/03

UI/UX Full Course 2026 In 48 Hours | Excel Basics to Advanced Tutorial

🔥IIITB - Advanced Certification in UI/UX...

  2026/08/03

Best Online AI Courses 2026 | Online AI Courses for Beginners | #Short

🔥Michigan Engineering - Professional Cer...

  2026/08/03

【OpenAI Codex超入門】ChatGPTとの違いから使い方まで初心者向けに解説|議事録・データ分析の自動化デモつき

━━━━━━━━━━━━ プロモーション:OpenAI ━━━━━━━━━━━━...

  2026/08/01

Send this to your homies as a reminder to catch up over chai 💖 Audio C

Relive your favourite memories with a si...

  2026/08/01