
Tech with Mak
@techNmak • 47,550 subscribers
AI, coding, software, and whatever’s on my mind.
Shorts
Videos

You can literally type a sentence and watch a Transformer process it. This interactive explainer runs a GPT-style model in the browser and lets you follow the whole path: tokenization → embeddings → Q/K/V → attention → MLP → logits → next-token probabilities You can inspect attention maps, intermediate values, and change temperature, top-k and top-p to see how generation changes. If Transformers still feel like boxes connected by arrows, this is worth opening.
Tech with Mak133,209 views • 7 days ago

The easiest way to misunderstand KV cache is to assume every token goes through an LLM in the same way. It doesn’t. Take a decoder-only Transformer and a four-token prompt: x1, x2, x3, x4. During the prefill phase, the prompt is processed and each self-attention layer computes the keys and values for its prompt positions. Those K/V states are stored in that layer’s KV cache. The representation at the final prompt position produces the logits used to select the first generated token, y1. Here is the part that is easy to miss => Selecting y1 does not mean y1 is already in the KV cache. On the next forward step, y1 enters the model as position 5. At each self-attention layer, its Q, K and V are computed. Its query attends to the cached K/V from positions 1-4 plus its own current K/V at position 5. Its K/V then become part of that layer’s cache. The resulting final-layer representation produces logits for y2. Then y2 is processed as position 6, its K/V extend the cache, and the process continues. So for standard single-token, KV-cached autoregressive decoding: > prompt → prefill phase > new token → process one new position > past K/V → reuse them instead of recomputing them > KV cache → grows as new positions are processed One subtle distinction matters a lot and I want to highlight it => a token can be generated before it has been processed into the KV cache.
Tech with Mak12,211 views • 1 month ago

Unpopular opinion: VS Code is holding back AI coding. I’ve been spinning up multiple Cline instances across tmux panes and terminal tabs. Each agent has its own isolated state and can run a different task, branch, or idea in parallel. They just keep going while I focus on something else, no context collisions, no babysitting a single chat thread. You can pipe input, chain output, or run them headless in CI/CD. It fits into the workflow I already use in the terminal. Getting started literally took me 30 seconds: npm install -g cline AI is finally just another process in my workflow, instead of a panel or plugin.
Tech with Mak43,106 views • 8 months ago

Most people first see Euler’s Formula as a strange equation in a textbook. Then years later, they realize it quietly powers the modern world. Leonhard Euler discovered that these seemingly unrelated mathematical ideas: → exponential growth → imaginary numbers → sine waves → cosine waves → rotation … are all deeply connected through one identity: e^(iθ) = cos(θ) + i·sin(θ) At first glance it looks impossible. How can an exponential function suddenly produce circles and waves? The key insight is that multiplying by a complex exponential creates rotation. As the angle θ changes: - the cosine term tracks horizontal motion - the sine term tracks vertical motion - together they trace a perfect circle in the complex plane Euler showed that waves and rotation are mathematically the same phenomenon viewed differently. That single idea changed science and engineering forever. Today, Euler’s Formula sits underneath: → Fourier Transforms → signal processing → wireless communication → MRI scanners → quantum mechanics → electrical engineering → audio compression → radar systems → GPS → neural network frequency analysis Even modern AI systems indirectly rely on mathematics built on top of these foundations. The famous special case is Euler’s Identity: e^(iπ) + 1 = 0 Richard Feynman reportedly called it: "our jewel." Because it revealed that mathematics is not a collection of separate topics. It is one connected language describing reality itself.
Tech with Mak25,504 views • 5 months ago
No more content to load