(this is a bonus post for a friend who says I say this often but haven’t written it down)
What is a schema? It’s a mapping from the real world into some kind of regular structure that is usable by a computer. That last bit “usable by a computer” is the important bit - schemas, like many other things in programming, are a form of mediation between the complex, chaotic, messy real world and the binary, limited, deterministic digital one.
Schemas also help with performance. If you don’t have fast enough hardware, then organizing your data in a regular way lets you make use of optimization techniques like indexing, that make access and use much faster. This was the standard technique for decades - SQL and other forms of regular databases, and it’s still used extensively today. In many cases, being able to have a stable, structured format is helpful - not just for performance but also organization and quality control.
But the scale of the web taught us that schemas also start to break down at some scales. One of the new techniques invented in that era was “No SQL” - databases that didn’t have the same kind of regular indexing and structure of schema, but rather were focused on being able to scale large amounts of parallel access in a cost effective way. The mediation was now in the way.
Something similar is starting to happen again with the rise of LLMs. Part of what schemas do is to map the world in a predictable way. But they necessarily involve choices, and sometimes those choices are ambiguous. Is a hotdog a sandwich? for example. Forcing things into a schema is often the source of bugs and edge cases in more complex code.
LLMs are a different kind of mediation with the real world - a little more direct. Now the computer can mediate itself. If you ask whether a hotdog is a sandwich, you get a more complex answer1, one that can be tuned or used for different purposes. It’s less deterministic but it’s more flexible and possibly more useful.
Often in human culture, we form an adaptation to some limit, that then becomes accepted practice even after the limit is removed. Schemas are an example - still useful in many ways, but the original limits that led to them have evolved. Rethinking that kind of reflex is always a good thing.
I asked:
If you go by a strict structural definition—bread on two sides with filling in between—a hot dog qualifies as a sandwich. But most people treat it as its own category, the way a taco isn’t usually called a sandwich even though it’s food in a folded carbohydrate wrapper.
The U.S. Department of Agriculture has even weighed in: for labeling purposes, they’ve called hot dogs “sandwiches.” Culturally, though, the consensus leans toward “no, it’s its own thing.”
So technically yes, socially no. Kind of like how Pluto is technically still a planet to some people, but not to the International Astronomical Union.
I think in many cases a schema is useful for deciding not just what matters, but what doesn't. I was experimenting with using AI to create a json object from a webpage. I had tried to use a complex schema (via schema.org) and I kept getting errors because the AI wouldn't understand all the schema fields.
I wanted to know the author and title. Maybe number of pages. Maybe the publication year. But I don't care about the mailing address of the publisher.
Schemas help the engineer, and the LLM by proxy, to focus on what really matters to solve the given task.