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.
AmtocSoft Tech Insights
Expert insights on software engineering, AI, machine learning, LLMs, security, performance optimization, and quantitative computing. Content for every level — from beginners to seasoned professionals. Tips, tutorials, and deep dives by AmtocSoft.
Wednesday, August 19, 2026
Tuesday, August 4, 2026
How Virtual Memory Works — LearningTechBasics
How Virtual Memory Works
Why every program thinks it owns all of RAM.
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
Translating an address
- Virtual address. Your program uses addresses that mean nothing to the hardware directly.
- Page table. The OS keeps a map from virtual pages to physical frames.
- TLB. A small cache of recent translations avoids walking the table every time.
- 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.
Give each program a fake, private map of memory — and the OS quietly translates it to the real thing.
The same clear explainers, delivered weekly. No spam, unsubscribe anytime.
Subscribe free →120+ page production guide: local LLMs, fine-tuning, RAG, and domain-specific AI.
Get the guide →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
How Race Conditions Happen
Two threads, one variable, and a bug that only shows up sometimes.
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
The classic lost update
- Both read. Thread A and Thread B both read
count = 5. - Both compute. Each independently decides the new value is 6.
- Both write. They both store 6 — but two increments happened, so it should be 7.
- 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.
When correctness depends on who wins a timing race, you don't have a program — you have a coin flip.
How CDNs Work — LearningTechBasics
How CDNs Work
Why a site loads fast whether you're in Tokyo or Toronto.
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
How a request is served
- Anycast routing. The user's request goes to the nearest edge point of presence automatically.
- Cache hit. If the edge already has the file, it returns it immediately.
- Cache miss. Otherwise the edge fetches from origin, stores it, and serves it.
- 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.
Move the content close to the user, and distance stops being the bottleneck.
Wednesday, July 29, 2026
How Compilers Work — LearningTechBasics
How Compilers Work
From text you wrote to instructions a CPU runs.
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
The classic phases
- Lexing. Break the source into tokens: keywords, identifiers, literals.
- Parsing. Assemble tokens into an abstract syntax tree following the grammar.
- Semantic analysis. Type-check, resolve names, catch misuse.
- IR. Lower the tree into a simpler intermediate representation.
- Optimize. Fold constants, inline, remove dead code on the IR.
- 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.
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
How OAuth Works
"Log in with Google" — without Google ever seeing the other site's password.
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
The authorization-code flow
- Redirect. The app sends you to the provider with the scopes it wants.
- Consent. You authenticate with the provider and approve (or deny) those scopes.
- Code. The provider redirects back to the app with a short-lived authorization code.
- Token exchange. The app's server swaps the code (plus its secret) for an access token.
- 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.
Hand out a narrow, revocable token — never the password itself.
How LLMs Generate Text — LearningTechBasics
How LLMs Generate Text
One token at a time — a very well-read autocomplete.
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
How each token appears
- Tokenize. Text is split into subword tokens and mapped to numbers.
- Embed. Each token becomes a vector encoding meaning and position.
- Attention. Every token looks at the others and decides what to focus on.
- Predict. The model outputs a probability for every possible next token.
- 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.
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...
-
LT LearningTechBasics @amtocbot How OAuth Works "Log in with Google" — without Google ever seeing the ot...
-
Introduction Imagine leaving your house key taped to your front door with a note that says "key is under here." That would...
-
The first time I tried to get an LLM to return structured data in production, I did what most people do: I wrote a prompt that said ...