Wednesday, August 19, 2026

Attention Is All You Need, Explained Simply

We published a plain-language walkthrough of the 2017 transformer paper — queries, keys, values, multi-head attention, and why no-recurrence mattered — with a companion animated explainer.

Tuesday, August 4, 2026

How Virtual Memory Works — LearningTechBasics

LT LearningTechBasics @amtocbot

How Virtual Memory Works

Why every program thinks it owns all of RAM.

๐Ÿ“… 2026-08-04⏱️ ~6 min read๐Ÿท️ Systems · OS

Every process runs in its own private address space, as if it had the whole machine to itself. The OS and CPU maintain that illusion by mapping virtual addresses to physical ones, page by page.

Legend — how to read this diagram

A–EComponentsthe parts involved, labelled in the diagram
1 2 3Walkthroughnumbered steps below run in order

Translating an address

  1. Virtual address. Your program uses addresses that mean nothing to the hardware directly.
  2. Page table. The OS keeps a map from virtual pages to physical frames.
  3. TLB. A small cache of recent translations avoids walking the table every time.
  4. Page fault. If a page isn't in RAM, the OS loads it from disk and retries.

What the illusion buys you

Isolation. One process can't read another's memory — different maps.

Overcommit. Programs can use more address space than physical RAM, backed by disk.

Sharing. Read-only pages (like libraries) map into many processes once.

One-line mental model:

Give each program a fake, private map of memory — and the OS quietly translates it to the real thing.

Found this useful? Three ways to go deeper — start free.
Free · Weekly One tech idea, in your inbox

The same clear explainers, delivered weekly. No spam, unsubscribe anytime.

Subscribe free →
Guide · $39 The Open-Source AI Stack

120+ page production guide: local LLMs, fine-tuning, RAG, and domain-specific AI.

Get the guide →
Consulting Need this built properly?

AI implementation, fine-tuning and RAG done right. Free 30-minute strategy call.

Book a call →

Thursday, July 30, 2026

How Race Conditions Happen — LearningTechBasics

LT LearningTechBasics @amtocbot

How Race Conditions Happen

Two threads, one variable, and a bug that only shows up sometimes.

๐Ÿ“… 2026-07-30⏱️ ~5 min read๐Ÿท️ Concurrency · Systems

A race condition is a bug where the result depends on the exact timing of concurrent operations. It hides in the gap between reading a value and writing it back.

Legend — how to read this diagram

A · BPartiesthe two sides of the exchange
1–nOrdereach message, numbered in sequence
1 2 3Walkthroughnumbered steps below run in order

The classic lost update

  1. Both read. Thread A and Thread B both read count = 5.
  2. Both compute. Each independently decides the new value is 6.
  3. Both write. They both store 6 — but two increments happened, so it should be 7.
  4. Non-determinism. Whether it breaks depends on scheduling, so it passes tests and fails in production.

How to prevent them

Locks. A mutex makes read-modify-write atomic, one thread at a time.

Atomics. Hardware atomic operations do increment as a single indivisible step.

Avoid shared state. Message passing and immutability sidestep the problem entirely.

One-line mental model:

When correctness depends on who wins a timing race, you don't have a program — you have a coin flip.

How CDNs Work — LearningTechBasics

LT LearningTechBasics @amtocbot

How CDNs Work

Why a site loads fast whether you're in Tokyo or Toronto.

๐Ÿ“… 2026-07-30⏱️ ~5 min read๐Ÿท️ Networking · Performance

A Content Delivery Network puts copies of your content in hundreds of locations worldwide, so users are served from a nearby edge instead of your single origin server far away.

Legend — how to read this diagram

A–DComponentsthe parts involved, labelled in the diagram
Requestdata travelling outward
Responsedata returning
1 2 3Walkthroughnumbered steps below run in order

How a request is served

  1. Anycast routing. The user's request goes to the nearest edge point of presence automatically.
  2. Cache hit. If the edge already has the file, it returns it immediately.
  3. Cache miss. Otherwise the edge fetches from origin, stores it, and serves it.
  4. TTL & purge. Cached copies expire on a TTL or can be purged when content changes.

Beyond speed

Offload. The origin handles a fraction of traffic, saving cost and load.

Resilience. Edges absorb spikes and shield the origin from DDoS.

Dynamic too. Modern CDNs run code at the edge, not just cache static files.

One-line mental model:

Move the content close to the user, and distance stops being the bottleneck.

Wednesday, July 29, 2026

How Compilers Work — LearningTechBasics

LT LearningTechBasics @amtocbot

How Compilers Work

From text you wrote to instructions a CPU runs.

๐Ÿ“… 2026-07-29⏱️ ~6 min read๐Ÿท️ Languages · Systems

A compiler is a translator with several passes. It reads your source, checks it makes sense, and lowers it step by step into machine code — optimizing along the way.

Legend — how to read this diagram

1–nStagesthe ordered steps of the process
1 2 3Walkthroughnumbered steps below run in order

The classic phases

  1. Lexing. Break the source into tokens: keywords, identifiers, literals.
  2. Parsing. Assemble tokens into an abstract syntax tree following the grammar.
  3. Semantic analysis. Type-check, resolve names, catch misuse.
  4. IR. Lower the tree into a simpler intermediate representation.
  5. Optimize. Fold constants, inline, remove dead code on the IR.
  6. Codegen. Emit machine instructions for the target CPU.

Why the middle exists

Separation. A shared IR lets one backend serve many languages and one language target many CPUs.

Optimization surface. The IR is where most speedups happen, independent of syntax.

JIT vs AOT. Some compile ahead of time; others compile hot paths while the program runs.

One-line mental model:

Compiling is a staircase: each pass lowers your code to something simpler until only machine instructions remain.

Tuesday, July 28, 2026

How OAuth Works — LearningTechBasics

LT LearningTechBasics @amtocbot

How OAuth Works

"Log in with Google" — without Google ever seeing the other site's password.

๐Ÿ“… 2026-07-28⏱️ ~6 min read๐Ÿท️ Security · WebDev

OAuth lets one app act on your behalf at another service without ever handling your password. Instead of credentials, apps get a scoped, revocable token.

Legend — how to read this diagram

A · BPartiesthe two sides of the exchange
1–nOrdereach message, numbered in sequence
1 2 3Walkthroughnumbered steps below run in order

The authorization-code flow

  1. Redirect. The app sends you to the provider with the scopes it wants.
  2. Consent. You authenticate with the provider and approve (or deny) those scopes.
  3. Code. The provider redirects back to the app with a short-lived authorization code.
  4. Token exchange. The app's server swaps the code (plus its secret) for an access token.
  5. Use & refresh. The app calls APIs with the token, refreshing it as needed.

Why it's safer than sharing a password

Scoped. A token grants only the permissions you approved, not full account access.

Revocable. You can revoke one app without changing your password.

PKCE. Public clients add a proof step so an intercepted code alone is useless.

One-line mental model:

Hand out a narrow, revocable token — never the password itself.

How LLMs Generate Text — LearningTechBasics

LT LearningTechBasics @amtocbot

How LLMs Generate Text

One token at a time — a very well-read autocomplete.

๐Ÿ“… 2026-07-28⏱️ ~6 min read๐Ÿท️ AI · Machine Learning

A large language model doesn't plan a whole answer up front. It predicts the next token from everything so far, appends it, and repeats — with attention letting it weigh which earlier words matter most.

Legend — how to read this diagram

1–nStagesthe ordered steps of the process
1 2 3Walkthroughnumbered steps below run in order

How each token appears

  1. Tokenize. Text is split into subword tokens and mapped to numbers.
  2. Embed. Each token becomes a vector encoding meaning and position.
  3. Attention. Every token looks at the others and decides what to focus on.
  4. Predict. The model outputs a probability for every possible next token.
  5. Sample. Temperature and top-p pick one; append it and feed the whole thing back in.

Why it feels coherent

Context window. The model sees thousands of prior tokens at once, keeping track of the thread.

Scale of training. Patterns from vast text let it continue in-style and on-topic.

It's still prediction. No lookup of facts — which is why it can sound confident yet be wrong.

One-line mental model:

Generation is autocomplete with attention: predict the next token, append, repeat.

Attention Is All You Need, Explained Simply

We published a plain-language walkthrough of the 2017 transformer paper — queries, keys, values, multi-head attention, and why no-recurrence...