I wrote a 4-book series on technical interviews, one concept per letter A–Z:
🔹 Coding
🔹 System Design
🔹 Machine Learning
🔹 LLMs & Transformers
Many chapters have free interactive demos (consistent hashing, FlashAttention, N-Queens, speculative decoding…) 👇
https://t.co/Jv0X1FlJN4
Prepping for interviews? The LLM volume of my Technical Interview Essentials A–Z series is free on Kindle through Thu, Nov 12. 📘 Paperback also available.
https://t.co/gjRgLpeMOn
I just published in @gitconnected "Understanding Forward Checking with N-Queens" https://t.co/KXlUNd49mE
This is the second part in a three-part series on using the classic n-queens problem to explore variants of DFS.
@PythonPr Of course 11, but each of min and max costs O(n).
Far more elegant solution in one pass: 😜
from functools import reduce
print(
sum(
reduce(
lambda a, v: (min(a[0], v), max(a[1], v)),
x,
(x[0], x[0])))
Full walkthrough, from disk seeks to B-trees to the Bloom filter: https://t.co/bBrudj338H
Try it yourself: insert UUIDs and catch a false positive → https://t.co/HU0sqzSdDg
Interview question: 1 billion users, and most lookups are for keys that don't exist. How do you avoid a disk read for every "no"?
A Bloom filter. About 10 bits per key → 1% false positives.
1B keys = 1.12 GiB of RAM, k = 7 hashes.
Watch it work 👇
I wrote a 4-book series on technical interviews, one concept per letter A–Z:
🔹 Coding
🔹 System Design
🔹 Machine Learning
🔹 LLMs & Transformers
Many chapters have free interactive demos (consistent hashing, FlashAttention, N-Queens, speculative decoding…) 👇
https://t.co/Jv0X1FlJN4
Medium> This guy is pasting a bunch of code samples …
Medium> No matter what we auto-detect, he always sets the syntax highlighting to "Python."
Medium> Oh wait, he just pasted some more code. You think that's Python?
Also Medium> Fuck him, that's SCSS.
Excited to get my first article published in https://t.co/VjVo5s6hFF!
"Understanding Medusa and Tree Attention." https://t.co/VWT4emwR9c
This is part 4 of my series on accelerating LLMs:
Part 1: Intro to FlashAttention
Part 2: Speculative Decoding
Part 3: Multi-Token Prediction (MTP)
Part 4: Medusa and Tree Attention
Part 5: EAGLE & EAGLE-2 (pending)
Start here if you want a step-by-step walkthrough of LLM acceleration techniques.
Running out of Claude quota reminds me of when Netflix first started streaming but limited you to only 19 hours a month. I rationed those hours carefully.
Nowadays everyone is streaming 24/7 and the Internet doesn't blink. Eventually tokens will reach the same level of abundance.
After we repeat this sampling procedure 1,000 times, we see how it converges to generating a probability distribution that matches our original target model p(t).
https://t.co/bNykvm8L5J
https://t.co/WiCEZ8vhcD
Speculative decoding is a technique for accelerating decoding tokens from a target LLM. We find a smaller, similar model (the “draft” model) and extract several tokens in sequence, then we pass all these draft tokens through the target model in parallel to “verify” if they were generated by the target LLM.
But if the draft model generates token according to one distribution q(t) and the target model generates tokens according to a different distribution p(t), how can the tokens generated by the draft model behave as if they were generated by the target model? 🧵
But if the draft token t fails the r < p(t)/q(t) chance, then we reject it (and all following draft tokens). To replace it we resample a new token from the modified distribution max(0, p(t) - q(t)). This distribution has the effect of accounting for all the probability that we haven’t explored yet where the distribution p(t) is more likely than q(t):