On Distribution: A Term for What Rails Has Been Doing All Along
Every so often, you stumble on a phrase that puts words to something you’ve felt for years.
For me, that’s on distribution.
I first saw it in Gergely Orosz’s piece about how Claude Code was built. My immediate reaction:
- “Oh, new power phrase unlocked.”
- “Wait… this perfectly explains why Rails and AI coding assistants pair so well together.”
I’ve been feeling this for a long time, but didn’t have the words for it until now.
What does “on distribution” mean?
In machine learning, on distribution means the AI is working in a domain it’s been trained on.
Off distribution is when you ask it to operate in a space that looks unfamiliar.
Couple mental models
🎶 A classically trained pianist can shred through Mozart, Chopin, Bach—pattern match after pattern match. But drop them into a jazz improv session and suddenly they’re sweating, because the rules are looser and the muscle memory doesn’t transfer 1:1.
🏀 Kobe on a basketball court? Completely on distribution. It’s his home turf. Switch him to baseball or golf? That’s off distribution. He can still compete, but it’s not the same fluid mastery.
That’s the difference. On distribution is home court advantage. Off distribution is when you’re out of your lane.
Why it matters for coding assistants
Coding assistants thrive when your code looks like the billions of examples they’ve already seen in training.
That’s when they autocomplete migrations, controllers, and background jobs with eerie accuracy.
But wander into bespoke territory—custom DSLs, edge-case architecture, “this is how our team does it” configs—and suddenly you’re off distribution. The AI starts to guess, sometimes confidently wrong, and the magic fades.
Rails: the ultimate “on distribution” framework
Rails is convention over configuration.
For 20+ years, Rails apps have followed the same predictable patterns: models, controllers, migrations, routes.
That means LLMs have been trained on mountains of Rails code that all looks and feels the same.
So when you fire up a coding assistant in a Rails project, it’s like a pianist sight-reading Mozart, or Kobe shooting a 3. The AI is so on distribution it feels like cheating.
Buzzword sidebar
My bet is this becomes a strong new pseudo-technical buzzword like "forcing function" and "non trivial". Just look at this google trends chart:
Takeaway
So yeah, I just learned the term. But honestly? I’ve been thinking about this for years.
Rails + AI doesn’t feel smooth by accident—it’s smooth because Rails has kept us on distribution all along.
Conventions don’t just help us Rails devs. They’re for for AI, too.