← Back to home ← Volver al inicio

CreatedCreado UpdatedActualizado

Vector Field

Asteroids, but you're the language model — fly your decoder through a field of drifting tokens and shoot the one that comes next. Built entirely by AI; the write-up below explains how. Asteroids, pero tú eres el modelo de lenguaje — vuela tu decodificador por un campo de tokens a la deriva y dispárale al que sigue. Construido completamente por IA; el artículo de abajo explica cómo.

scorepuntos 0 comboracha ×1 losspérdida

Vector Field

You are the language model — one more time. Fly your decoder through the drifting tokens and shoot the one that should come next. Every token you hit is appended to your output, so your sentence is assembled shot by shot.

  • ← → or A D rotate · ↑ / W thrust · space to fire
  • Hit the right token: points × combo · a wrong one: loss climbs
  • Crash into a token and the model destabilizes — loss spikes

Tú eres el modelo de lenguaje — una vez más. Vuela tu decodificador entre los tokens a la deriva y dispárale al que sigue. Cada token que aciertas se añade a tu salida, así que tu oración se arma disparo a disparo.

  • ← → o A D girar · ↑ / W impulso · espacio para disparar
  • Acierta el token correcto: puntos × racha · uno errado: sube la pérdida
  • Choca con un token y el modelo se desestabiliza — la pérdida salta
speed velocidad

Paused En pausa

Generation halted Generación detenida

Perplexity hit the ceiling — the model lost coherence. La perplejidad llegó al techo — el modelo perdió la coherencia.

scorepuntos 0 bestrécord 0 tokens decodedtokens decodificados 0

your loss curve tu curva de pérdida

speed velocidad

← → / A D rotate · ↑ / W thrust · space fires · P pauses · drag to fly + tap to fire on touch ← → / A D girar · ↑ / W impulso · espacio dispara · P pausa · arrastra para volar + toca para disparar en táctil

How Vector Field Was Built

Vector Field is the third game in the you are the language model series, after Token Rain and Greedy. The premise is the same one all three share — predict the next token — wearing a third arcade costume. Token Rain was a catcher. Greedy was a snake. This one is Asteroids.

The idea

In an autoregressive language model, generating text is a loop: look at everything so far, produce a probability over the whole vocabulary, pick one token, append it, repeat. Vector Field turns that loop into a twin-stick-ish space shooter.

The sentence so far sits in the HUD with a blank where the next token goes. The candidate tokens — the real next word plus a few absurd distractors — drift across the screen as asteroids. You pilot a little decoder ship with Asteroids’ classic feel (rotate, thrust, inertia, screen-wrap) and shoot the token that should come next. Hit the right one and it’s appended to your output; the sentence grows one shot at a time, which is exactly what decoding is. Shoot a nonsense token and your loss climbs. Fly into a token and the model destabilizes — loss spikes and you’re knocked back. Let your loss bar fill and the generation halts.

Why the name? The site’s history-of-AI essay makes a point of it: a language model turns every token into a vector, and meaning becomes geometry in vector space. Picking the next token is choosing a point in that space. So you fly through a field of vectors and select one. Vector Field.

The one genuinely tricky part

Every game in this series has a single load-bearing technical idea. Token Rain’s was the fixed-timestep loop; Greedy’s was interpolating a grid that steps once per tick onto a render loop that runs every frame. Vector Field’s is toroidal space — the Asteroids rule that whatever leaves one edge returns on the opposite one.

It sounds trivial, and the position wrap is trivial:

function wrapPos(o, margin) {
  if (o.x < -margin) o.x += W + margin * 2;
  else if (o.x > W + margin) o.x -= W + margin * 2;
  if (o.y < -margin) o.y += H + margin * 2;
  else if (o.y > H + margin) o.y -= H + margin * 2;
}

The subtlety is everything that touches motion has to agree the world is a doughnut. The ship is steered by inertia, not position — you set a heading and add thrust along it, then let drag and a speed cap shape the drift:

if (ship.thrust) {
  ship.vx += Math.cos(ship.ang) * SHIP_THRUST * dt;
  ship.vy += Math.sin(ship.ang) * SHIP_THRUST * dt;
}
const damp = Math.pow(SHIP_DRAG, dt);   // frame-rate-independent drag
ship.vx *= damp; ship.vy *= damp;

Using Math.pow(SHIP_DRAG, dt) instead of a flat vx *= 0.99 is the small thing that makes the ship feel identical on a 60 Hz laptop and a 144 Hz monitor — the same trick the whole series uses to stay frame-rate-independent.

Aiming on a phone

Asteroids is brutal on a touchscreen — there’s no keyboard to rotate-and-thrust with. The fix is to let your finger be the destination: the ship turns toward wherever you touch, thrusts while you hold, and auto-fires on a steady cadence. So on a phone the skill collapses to the thing that actually matters in this game — lining the right token up in your sights — instead of fighting the controls.

const ta = Math.atan2(touchTarget.y - ship.y, touchTarget.x - ship.x);
ship.ang += clamp(angDiff(ship.ang, ta), -SHIP_TURN * dt, SHIP_TURN * dt);
ship.thrust = dist(touchTarget, ship) > SHIP_R + 4;

What it shares with its siblings

Under the costume, all three games run on the same little engine: the same bilingual sentence bank (sentences pulled from the site’s own AI essays), the same deliberately-absurd distractors so the right token is something you reason about rather than guess, the same loss bar standing in for perplexity, the same score-×-combo, and the same end-of-run loss curve — because a real training run is judged by its loss curve, so you get one too.

Three games, three genres, one idea: you are the model, and every token is a choice.

Cómo se construyó Vector Field

Vector Field es el tercer juego de la serie tú eres el modelo de lenguaje, después de Token Rain y Greedy. La premisa es la misma que comparten los tres — predice el siguiente token — con un tercer disfraz arcade. Token Rain era un atrapador. Greedy era una serpiente. Este es Asteroids.

La idea

En un modelo de lenguaje autorregresivo, generar texto es un bucle: mira todo lo que va, produce una probabilidad sobre todo el vocabulario, elige un token, lo añade y repite. Vector Field convierte ese bucle en un shooter espacial.

La oración hasta ahora vive en el HUD con un espacio en blanco donde va el siguiente token. Los candidatos — la palabra correcta más unos cuantos distractores absurdos — flotan por la pantalla como asteroides. Pilotas un pequeño decodificador con el toque clásico de Asteroids (girar, impulso, inercia, envoltura de pantalla) y le disparas al token que sigue. Aciertas el correcto y se añade a tu salida; la oración crece disparo a disparo, que es exactamente lo que es decodificar. Disparas un token disparatado y tu pérdida sube. Chocas con un token y el modelo se desestabiliza — la pérdida salta y sales rebotado. Deja que la barra de pérdida se llene y la generación se detiene.

¿Por qué el nombre? El ensayo de historia de la IA del sitio lo subraya: un modelo de lenguaje convierte cada token en un vector, y el significado se vuelve geometría en el espacio vectorial. Elegir el siguiente token es escoger un punto en ese espacio. Así que vuelas por un campo de vectores y seleccionas uno. Vector Field (campo vectorial).

La parte genuinamente difícil

Cada juego de esta serie tiene una sola idea técnica que carga con todo. La de Token Rain era el bucle de paso fijo; la de Greedy era interpolar una grilla que avanza una vez por tick sobre un bucle de render que corre en cada cuadro. La de Vector Field es el espacio toroidal — la regla de Asteroids de que lo que sale por un borde reaparece por el opuesto.

Suena trivial, y la envoltura de posición lo es:

function wrapPos(o, margin) {
  if (o.x < -margin) o.x += W + margin * 2;
  else if (o.x > W + margin) o.x -= W + margin * 2;
  if (o.y < -margin) o.y += H + margin * 2;
  else if (o.y > H + margin) o.y -= H + margin * 2;
}

Lo sutil es que todo lo que toca el movimiento tiene que estar de acuerdo en que el mundo es una dona. La nave se gobierna por inercia, no por posición — fijas un rumbo y añades impulso a lo largo de él, luego dejas que el roce y un tope de velocidad moldeen la deriva:

if (ship.thrust) {
  ship.vx += Math.cos(ship.ang) * SHIP_THRUST * dt;
  ship.vy += Math.sin(ship.ang) * SHIP_THRUST * dt;
}
const damp = Math.pow(SHIP_DRAG, dt);   // roce independiente del frame-rate
ship.vx *= damp; ship.vy *= damp;

Usar Math.pow(SHIP_DRAG, dt) en vez de un vx *= 0.99 fijo es el detalle que hace que la nave se sienta idéntica en una laptop de 60 Hz y en un monitor de 144 Hz — el mismo truco que usa toda la serie para ser independiente del frame-rate.

Apuntar en el teléfono

Asteroids es brutal en una pantalla táctil — no hay teclado para girar e impulsar. La solución es dejar que tu dedo sea el destino: la nave gira hacia donde tocas, impulsa mientras mantienes presionado y dispara solo a un ritmo constante. Así, en un teléfono, la habilidad se reduce a lo que de verdad importa en este juego — poner el token correcto en la mira — en vez de pelear con los controles.

const ta = Math.atan2(touchTarget.y - ship.y, touchTarget.x - ship.x);
ship.ang += clamp(angDiff(ship.ang, ta), -SHIP_TURN * dt, SHIP_TURN * dt);
ship.thrust = dist(touchTarget, ship) > SHIP_R + 4;

Lo que comparte con sus hermanos

Bajo el disfraz, los tres juegos corren sobre el mismo motorcito: el mismo banco bilingüe de oraciones (tomadas de los propios ensayos de IA del sitio), los mismos distractores deliberadamente absurdos para que el token correcto sea algo que razonas y no que adivinas, la misma barra de pérdida que hace de perplejidad, el mismo puntaje-×-racha y la misma curva de pérdida al final — porque una corrida de entrenamiento real se juzga por su curva de pérdida, así que tú también recibes una.

Tres juegos, tres géneros, una idea: tú eres el modelo, y cada token es una elección.