إنتقل إلى المحتوى الرئيسي

World Models

A world model is a learned representation of how an environment works. It lets an agent predict outcomes, plan actions, and evaluate results without trial and error in the real environment. Masar is a world model for structured data.

Why Agents Need World Models

An LLM asked to build a complex state machine will generate something. Sometimes it's correct. Often it's not. The LLM has no internal model of how state machines behave. It's pattern-matching against training data, which works for common cases but fails on anything novel or nuanced.

Without a world model, an agent can only verify by running the output and checking for errors. That's slow, expensive, and often destructive (deploying broken code to find out it's broken). With a world model, the agent can predict whether its output will work before executing it.

What a World Model Provides

Prediction: Given a current state and an action, what will the resulting state look like? Masar predicts how each edit changes a schema's validity and structure.

Planning: Given where I am and where I want to be, what sequence of actions gets me there? Masar computes this by navigating its learned representation space.

Evaluation: Is this result good or bad? Masar scores schemas against learned validity criteria without requiring a compiler or runtime.

Memory: What happened last time I was in a similar situation? Masar connects current context to past experiences through structural similarity.

Traditional World Models vs. Masar

In robotics and game AI, world models predict physical dynamics: if I push this object, it will move there. These models work with continuous states (positions, velocities, forces).

Masar works with discrete, structured states: entities, state machines, transitions, effects. The challenge is different. Physical world models deal with noisy continuous signals. Structured world models deal with combinatorial validity constraints. A schema with 10 traits and 50 states has thousands of possible configurations, but only a fraction are valid.

Masar's learned representations compress this combinatorial space into something navigable. Instead of searching through all possible configurations, planning moves through representation space toward the goal.

Schemas as Environments

From the world model perspective, a schema is an environment state:

ConceptPhysical WorldSchema World
StatePosition, velocityEntities, traits, transitions
ActionApply forceAdd entity, add state, add transition
ValidityPhysically possibleCompiles and runs correctly
GoalTarget positionComplete, working application

The agent's job is the same in both cases: navigate from current state to goal state through a sequence of valid actions.

Next Steps