Field notes — essays & research notes

Things I've written down.

Ruby, Rails, performance, security and applied machine learning. Updated when something feels finished.

55 posts · page 1 of 6
LLM & AGENTS 10 / 20 / 26

Temperature is not a creativity dial

Temperature, top-k and top-p are three different operations on one probability distribution. Treat them as vibes and you'll tune the wrong one. Watch them act on a model small enough to see.

3 min
RUBY & RAILS 10 / 07 / 26

Real SQLite in the browser, from a Rails app

Running WebAssembly from a strict Rails app touches three things people rarely think about together: your Content Security Policy, your MIME types, and whether the bytes you vendored are the bytes you meant.

3 min
LLM & AGENTS 09 / 24 / 26

Your RAG demo is lying to you

Every shortcut you take to make retrieval cheap — a smaller model, an approximation, a reduced dimension — can invent failures the real system doesn't have. Check the behaviour you're about to teach or ship.

3 min
RESEARCH 09 / 08 / 26

Judge the result, not the keystrokes

Most interactive tutorials check whether you typed the expected command. That teaches imitation. Comparing the state you produced against a goal teaches the thing itself — and it changes how you build the simulator.

4 min
LLM & AGENTS 08 / 15 / 26

pgvector or a dedicated vector database?

For most applications the answer is the database you already run, and the threshold where that stops being true is higher than the marketing suggests.

3 min
RUBY & RAILS 08 / 13 / 26

The callback that fires in a test you didn't write

Active Record callbacks are convenient until a fixture, a seed script or a bulk import triggers side effects nobody expected.

3 min
RUBY & RAILS 08 / 11 / 26

Indexes that earn their keep

Adding an index is the reflex fix for a slow query. Column order, cardinality and write cost decide whether it does anything at all.

3 min
SECURITY 08 / 08 / 26

A CSP that actually stops XSS

Most content security policies are decorative. The directive that matters is script-src, and 'unsafe-inline' undoes the whole thing.

3 min
RUBY & RAILS 08 / 06 / 26

Fat models, skinny controllers, and the third option

Both halves of the old advice produce the same result at scale: one enormous class. Naming the operation is what actually helps.

2 min