Open vDesign

Infographics

How a language model reads a sentence

A 1080 × 2160 infographic on one page that shows how a language model reads the sentence the cat sat on the: cut into tokens, stamped with numbers, then three guesses for the next piece. The sentence, the five pieces, their numbers and the guess slips are plain text, and each piece is one component, so changing a word and its number edits the whole row.

Science · 1080 × 2160, 1 page

Infographic titled How a language model reads a sentence on a green cutting mat. A paper strip reads the cat sat on the with red dashed cuts, five paper pieces are stamped 1169, 3797, 3332, 319 and 262, and three paper slips of different lengths show guesses mat, floor and sofa.
Free. Opens in the desktop app if you have it, and in your browser if not.

How it was made

An AI agent connected to vDesign drafted it from this prompt:

An infographic from Brindley Science Centre: how a language model reads the sentence the cat sat on the, cut into pieces, turned into numbers and a guess for what comes next.

A first draft is rarely the best one. It was then refined, by asking again and by small edits:

  1. Made the scissors larger and set them over the third cut so they read as scissors.
  2. Shortened the second heading and the note under the pieces so each fits on one line.
  3. Tightened the gaps between the three steps to leave a clear margin at the foot of the page.
  4. Reworded the note about the two the pieces so it says what the space does.

Remix it with your assistant

With Claude, ChatGPT or another assistant connected to vDesign, paste this and finish the sentence:

Open the vDesign file at https://getv.design/library/token-explainer-infographic.vd as a new design in vDesign, then change it for me: [say what it is for, and what should be different].

Things to ask for:

  • Make an infographic explaining how large language models work for a school lesson.
  • Change the sentence to the dog ran across the and update the pieces.
  • Add a second example sentence under the guesses.

The source

The design is a .vd file: text that you and any model can read. Sizes and positions are written as relationships, so one change moves everything that depends on it.

Show the .vd source
version 12kind designtitle "Language model explainer infographic"$m = 60$cw = 960$mat = #2F6B4F$paper = #F7F4EA$red = #D1495B$ink = #1E1E1E$sz = 72$adv = 39.31$sx = 187font hand = "Reenie Beanie"  fallback "cursive"  face asset=reenie-beanie-400 weight=400font mono = "Anonymous Pro"  fallback "ui-monospace, monospace"  face asset=anonymous-pro-400 weight=400  face asset=anonymous-pro-700 weight=700asset reenie-beanie-400 = font/woff2 hash=sha256-f86de18375e3edba402d39ff85030e270f724d7af865f74a74c92f34a947072c bytes=28512 license=OFLasset anonymous-pro-400 = font/woff2 hash=sha256-148b358d5c6a32ff44aa901fdd583519210675846edb6ccf8913a402054196a0 bytes=17528 license=OFLasset anonymous-pro-700 = font/woff2 hash=sha256-375e14fc0e64a2339788b0e6cf9a7b2ac9eef20314cfab80373eded4708f7dfc bytes=16180 license=OFLframe piece x=0 y=2400 w=168 h=180 component  rect piece.bg x=0 y=0 w=168 h=180 fill=paper radius=3 shadow="0 3 0 0 #00000038"  text piece.word x=14 y=22 w=148 h=64 font=mono size=50 fill=ink    "the"  rect piece.stamp x=24 y=104 w=120 h=56 fill=none stroke=red strokeWidth=4 radius=8 rotation=-5  text piece.num x=24 y=104 w=120 h=56 font=mono size=36 weight=700 fill=red align=center valign=middle rotation=-5    "1"frame page x=0 y=0 w=1080 h=2160 background=mat  group page.grid    connector grid.v1 x1=60 y1=0 x2=60 y2=2160 stroke=paper strokeWidth=2 opacity=0.09    connector grid.v2 x1=120 y1=0 x2=120 y2=2160 stroke=paper strokeWidth=2 opacity=0.09    connector grid.v3 x1=180 y1=0 x2=180 y2=2160 stroke=paper strokeWidth=2 opacity=0.09    connector grid.v4 x1=240 y1=0 x2=240 y2=2160 stroke=paper strokeWidth=2 opacity=0.09    connector grid.v5 x1=300 y1=0 x2=300 y2=2160 stroke=paper strokeWidth=2 opacity=0.09    connector grid.v6 x1=360 y1=0 x2=360 y2=2160 stroke=paper strokeWidth=2 opacity=0.09    connector grid.v7 x1=420 y1=0 x2=420 y2=2160 stroke=paper strokeWidth=2 opacity=0.09    connector grid.v8 x1=480 y1=0 x2=480 y2=2160 stroke=paper strokeWidth=2 opacity=0.09    connector grid.v9 x1=540 y1=0 x2=540 y2=2160 stroke=paper strokeWidth=2 opacity=0.09    connector grid.v10 x1=600 y1=0 x2=600 y2=2160 stroke=paper strokeWidth=2 opacity=0.09    connector grid.v11 x1=660 y1=0 x2=660 y2=2160 stroke=paper strokeWidth=2 opacity=0.09    connector grid.v12 x1=720 y1=0 x2=720 y2=2160 stroke=paper strokeWidth=2 opacity=0.09    connector grid.v13 x1=780 y1=0 x2=780 y2=2160 stroke=paper strokeWidth=2 opacity=0.09    connector grid.v14 x1=840 y1=0 x2=840 y2=2160 stroke=paper strokeWidth=2 opacity=0.09    connector grid.v15 x1=900 y1=0 x2=900 y2=2160 stroke=paper strokeWidth=2 opacity=0.09    connector grid.v16 x1=960 y1=0 x2=960 y2=2160 stroke=paper strokeWidth=2 opacity=0.09    connector grid.v17 x1=1020 y1=0 x2=1020 y2=2160 stroke=paper strokeWidth=2 opacity=0.09    connector grid.h1 x1=0 y1=60 x2=1080 y2=60 stroke=paper strokeWidth=2 opacity=0.09    connector grid.h2 x1=0 y1=120 x2=1080 y2=120 stroke=paper strokeWidth=2 opacity=0.09    connector grid.h3 x1=0 y1=180 x2=1080 y2=180 stroke=paper strokeWidth=2 opacity=0.09    connector grid.h4 x1=0 y1=240 x2=1080 y2=240 stroke=paper strokeWidth=2 opacity=0.09    connector grid.h5 x1=0 y1=300 x2=1080 y2=300 stroke=paper strokeWidth=2 opacity=0.09    connector grid.h6 x1=0 y1=360 x2=1080 y2=360 stroke=paper strokeWidth=2 opacity=0.09    connector grid.h7 x1=0 y1=420 x2=1080 y2=420 stroke=paper strokeWidth=2 opacity=0.09    connector grid.h8 x1=0 y1=480 x2=1080 y2=480 stroke=paper strokeWidth=2 opacity=0.09    connector grid.h9 x1=0 y1=540 x2=1080 y2=540 stroke=paper strokeWidth=2 opacity=0.09    connector grid.h10 x1=0 y1=600 x2=1080 y2=600 stroke=paper strokeWidth=2 opacity=0.09    connector grid.h11 x1=0 y1=660 x2=1080 y2=660 stroke=paper strokeWidth=2 opacity=0.09    connector grid.h12 x1=0 y1=720 x2=1080 y2=720 stroke=paper strokeWidth=2 opacity=0.09    connector grid.h13 x1=0 y1=780 x2=1080 y2=780 stroke=paper strokeWidth=2 opacity=0.09    connector grid.h14 x1=0 y1=840 x2=1080 y2=840 stroke=paper strokeWidth=2 opacity=0.09    connector grid.h15 x1=0 y1=900 x2=1080 y2=900 stroke=paper strokeWidth=2 opacity=0.09    connector grid.h16 x1=0 y1=960 x2=1080 y2=960 stroke=paper strokeWidth=2 opacity=0.09    connector grid.h17 x1=0 y1=1020 x2=1080 y2=1020 stroke=paper strokeWidth=2 opacity=0.09    connector grid.h18 x1=0 y1=1080 x2=1080 y2=1080 stroke=paper strokeWidth=2 opacity=0.09    connector grid.h19 x1=0 y1=1140 x2=1080 y2=1140 stroke=paper strokeWidth=2 opacity=0.09    connector grid.h20 x1=0 y1=1200 x2=1080 y2=1200 stroke=paper strokeWidth=2 opacity=0.09    connector grid.h21 x1=0 y1=1260 x2=1080 y2=1260 stroke=paper strokeWidth=2 opacity=0.09    connector grid.h22 x1=0 y1=1320 x2=1080 y2=1320 stroke=paper strokeWidth=2 opacity=0.09    connector grid.h23 x1=0 y1=1380 x2=1080 y2=1380 stroke=paper strokeWidth=2 opacity=0.09    connector grid.h24 x1=0 y1=1440 x2=1080 y2=1440 stroke=paper strokeWidth=2 opacity=0.09    connector grid.h25 x1=0 y1=1500 x2=1080 y2=1500 stroke=paper strokeWidth=2 opacity=0.09    connector grid.h26 x1=0 y1=1560 x2=1080 y2=1560 stroke=paper strokeWidth=2 opacity=0.09    connector grid.h27 x1=0 y1=1620 x2=1080 y2=1620 stroke=paper strokeWidth=2 opacity=0.09    connector grid.h28 x1=0 y1=1680 x2=1080 y2=1680 stroke=paper strokeWidth=2 opacity=0.09    connector grid.h29 x1=0 y1=1740 x2=1080 y2=1740 stroke=paper strokeWidth=2 opacity=0.09    connector grid.h30 x1=0 y1=1800 x2=1080 y2=1800 stroke=paper strokeWidth=2 opacity=0.09    connector grid.h31 x1=0 y1=1860 x2=1080 y2=1860 stroke=paper strokeWidth=2 opacity=0.09    connector grid.h32 x1=0 y1=1920 x2=1080 y2=1920 stroke=paper strokeWidth=2 opacity=0.09    connector grid.h33 x1=0 y1=1980 x2=1080 y2=1980 stroke=paper strokeWidth=2 opacity=0.09    connector grid.h34 x1=0 y1=2040 x2=1080 y2=2040 stroke=paper strokeWidth=2 opacity=0.09    connector grid.h35 x1=0 y1=2100 x2=1080 y2=2100 stroke=paper strokeWidth=2 opacity=0.09  text page.title x=$m y=64 w=$cw h=262 font=hand size=128 lineHeight=1 fill=paper    "How a language model\nreads a sentence"  text page.sub x=$m y=(prev.bottom + 8) w=$cw h=40 font=mono size=30 fill=paper    "Brindley Science Centre schools programme"  text s1.head x=$m y=(prev.bottom + 60) w=$cw h=92 font=hand size=84 lineHeight=1 fill=paper    "1. Lay it on the mat and snip"  text s1.body x=$m y=(prev.bottom + 8) w=$cw h=80 font=mono size=28 lineHeight=1.35 fill=paper    "The model starts with the sentence below. It cuts it into pieces called tokens, usually a word with the space before it."  rect s1.strip x=$m y=(prev.bottom + 104) w=$cw h=140 fill=paper radius=3 shadow="0 3 0 0 #00000038"  text s1.text x=$sx y=@s1.strip.y w=720 h=@s1.strip.h font=mono size=$sz fill=ink valign=middle    "the cat sat on the"  connector s1.cut1 x1=($sx + 3 * $adv) y1=(@s1.strip.y - 20) x2=($sx + 3 * $adv) y2=(@s1.strip.bottom + 20) stroke=red strokeWidth=4 dash="10 7" cap=round  connector s1.cut2 x1=($sx + 7 * $adv) y1=(@s1.strip.y - 20) x2=($sx + 7 * $adv) y2=(@s1.strip.bottom + 20) stroke=red strokeWidth=4 dash="10 7" cap=round  connector s1.cut3 x1=($sx + 11 * $adv) y1=(@s1.strip.y - 20) x2=($sx + 11 * $adv) y2=(@s1.strip.bottom + 20) stroke=red strokeWidth=4 dash="10 7" cap=round  connector s1.cut4 x1=($sx + 14 * $adv) y1=(@s1.strip.y - 20) x2=($sx + 14 * $adv) y2=(@s1.strip.bottom + 20) stroke=red strokeWidth=4 dash="10 7" cap=round  group s1.scissors    vector s1.blades x=(@s1.cut3.cx - 31) y=(@s1.strip.y - 92) w=62 h=78 view="0 0 48 60" d="M14 16 L34 58 M34 16 L14 58" fill=none stroke=paper strokeWidth=5 cap=round    ellipse s1.ring1 x=(@s1.cut3.cx - 36) y=(@s1.strip.y - 87) w=32 h=32 fill=red stroke=paper strokeWidth=3    ellipse s1.ring2 x=(@s1.cut3.cx + 4) y=(@s1.strip.y - 87) w=32 h=32 fill=red stroke=paper strokeWidth=3  text s2.head x=$m y=(@s1.strip.bottom + 52) w=$cw h=92 font=hand size=84 lineHeight=1 fill=paper    "2. Stamp each piece"  text s2.body x=$m y=(prev.bottom + 8) w=$cw h=80 font=mono size=28 lineHeight=1.35 fill=paper    "Computers work with numbers, not letters. Each piece is found in a long list of pieces and stamped with its place in it."  instance s2.p1 component=piece x=($m + 0 * 198) y=(@s2.body.bottom + 30 + 6)    override piece.word      "the"    override piece.num      "1169"  instance s2.p2 component=piece x=($m + 1 * 198) y=(@s2.body.bottom + 30 + 1)    override piece.word      " cat"    override piece.num      "3797"  instance s2.p3 component=piece x=($m + 2 * 198) y=(@s2.body.bottom + 30 + 6)    override piece.word      " sat"    override piece.num      "3332"  instance s2.p4 component=piece x=($m + 3 * 198) y=(@s2.body.bottom + 30 + 0)    override piece.word      " on"    override piece.num      "319"  instance s2.p5 component=piece x=($m + 4 * 198) y=(@s2.body.bottom + 30 + 5)    override piece.word      " the"    override piece.num      "262"  text s2.note x=$m y=(@s2.p1.bottom + 30) w=$cw h=40 font=mono size=26 fill=paper    "Same word, two numbers: only the last the has a space in front."  text s2.seen x=$m y=(prev.bottom + 26) w=$cw h=68 font=mono size=54 weight=700 fill=paper    "1169 3797 3332 319 262"  text s2.seen.label x=$m y=(prev.bottom + 2) w=$cw h=36 font=mono size=26 fill=paper    "This string of numbers is all the model ever sees."  text s3.head x=$m y=(prev.bottom + 48) w=$cw h=92 font=hand size=84 lineHeight=1 fill=paper    "3. Guess the next piece"  text s3.body x=$m y=(prev.bottom + 8) w=$cw h=80 font=mono size=28 lineHeight=1.35 fill=paper    "The model scores every piece in its list for how likely it is to come next. The longer the slip, the likelier the guess."  text s3.word1 x=$m y=(@s3.body.bottom + 30) w=170 h=76 font=mono size=40 weight=700 fill=paper valign=middle    "mat"  vector s3.slip1 x=250 y=@s3.word1.y w=769 h=76 view="0 0 769 76" d="M0 0 H757 L769 6.3 L757 12.7 L769 19.0 L757 25.3 L769 31.7 L757 38.0 L769 44.3 L757 50.7 L769 57.0 L757 63.3 L769 69.7 L757 76.0 H0 Z" fill=paper  text s3.pct1 x=262 y=@s3.word1.y w=(769 - 36) h=76 font=mono size=36 weight=700 fill=ink align=right valign=middle    "62%"  text s3.word2 x=$m y=(@s3.slip1.bottom + 14) w=170 h=76 font=mono size=40 weight=700 fill=paper valign=middle    "floor"  vector s3.slip2 x=250 y=@s3.word2.y w=260 h=76 view="0 0 260 76" d="M0 0 H248 L260 6.3 L248 12.7 L260 19.0 L248 25.3 L260 31.7 L248 38.0 L260 44.3 L248 50.7 L260 57.0 L248 63.3 L260 69.7 L248 76.0 H0 Z" fill=paper  text s3.pct2 x=262 y=@s3.word2.y w=(260 - 36) h=76 font=mono size=36 weight=700 fill=ink align=right valign=middle    "21%"  text s3.word3 x=$m y=(@s3.slip2.bottom + 14) w=170 h=76 font=mono size=40 weight=700 fill=paper valign=middle    "sofa"  vector s3.slip3 x=250 y=@s3.word3.y w=112 h=76 view="0 0 112 76" d="M0 0 H100 L112 6.3 L100 12.7 L112 19.0 L100 25.3 L112 31.7 L100 38.0 L112 44.3 L100 50.7 L112 57.0 L100 63.3 L112 69.7 L100 76.0 H0 Z" fill=paper  text s3.pct3 x=262 y=@s3.word3.y w=(112 - 36) h=76 font=mono size=36 weight=700 fill=ink align=right valign=middle    "9%"  text s3.rest x=$m y=(@s3.slip3.bottom + 30) w=$cw h=70 font=mono size=26 lineHeight=1.35 fill=paper    "The other 8 per cent is shared between thousands of other pieces. The model picks one, adds it to the sentence and guesses again."