Twinz build notebook · Article 1
128 bytes to give a brain to 12 million inhabitants
Two mornings stuck in the queue are enough to make you switch bakeries, and one dinner is enough for the whole table to hear about it. I wanted to give that small memory to the 12.25 million inhabitants of my Paris. Each one has 128 bytes to form an opinion. On the first try, a whole neighbourhood dropped sport for restaurants.
Twelve minutes for a baguette
Nobody gets up one morning and decides to change bakeries. One day, the queue takes you twelve minutes where you used to give it three without thinking. You come back the next day, out of habit, and the queue is still there. The day after, your feet turn by themselves one street further on. In the evening, at dinner, you say the bakery downstairs isn't what it used to be. Someone who hasn't set foot in it for a month leaves with a ready-made opinion.
I would like the inhabitants of my city to be able to do that. Twinz (twinzcities.com) builds digital twins of cities that you can visit in three dimensions from a browser. The first one is called Paris (paris.twinzcities.com) and covers the 1,266 municipalities of Île-de-France. It is built on public data from Insee, OpenStreetMap, IGN and Île-de-France Mobilités. It counts 12,255,926 inhabitants. Each has a home, a budget, a job, and a day that carries on when you close the page. In The street refused to stop at the edge of the screen, I told how a one-minute-twenty cartoon led me all the way here.
What they lacked was a way to bear a grudge against a bakery. A grudge, even a slight one, needs somewhere to be stored. When you have twelve million heads to furnish, the question of space comes before all others.
What you can't ask twelve million times
The first idea is to ask a large language model, one of those programs that write the way we talk. With a handful of characters, the result is endearing. At five decisions per person per day, Île-de-France makes more than 61 million of them a day (calculated). Yet my engine runs twenty-four hours of the region in 6 min 10 s, on 8 CPU cores and without a graphics card. That is the measured speed of ×233.36, whose making I describe in the article on the engine. At that pace, about 165,000 decisions must be settled per second (calculated). A large model takes several tenths of a second to return a single one, on a graphics card. The whole city would be left waiting on the pavement.
The other idea is to write the rule yourself: so many points off when it rains, so many points off per kilometre. That is when you discover how little you know about people. Five hundred metres on foot in a downpour, everybody does it. Four kilometres by bike in the same downpour, people give up as soon as a metro line runs nearby. Rain doesn't weigh the same depending on distance, and my rule only knew how to add.
I went to look at how people really travel. The French Ministry of Transport's 2019 national mobility survey (Enquête Mobilité des Personnes) describes 31,820 real urban trips, made by 10,719 households. I set aside 1,003 of them, all in Île-de-France, kept out of training to serve as an exam. For each, the task was to guess what the person had chosen among eight combinations of transport mode and time slot. My simple rule, with its 16 parameters, gets it right 464 times (46.26%). A classic statistical model with 400 parameters finds 545 trips (54.34%). A small neural network finds 570 (56.83%, measured). It fits in 8,068 bytes, and it is built so that a trip never gains points because it is longer or more expensive.
What fits in 128 bytes
This small network knows how people in Île-de-France choose their trips in general. It doesn't know anybody. If every inhabitant received their own copy to tweak to their liking, I would need 98.9 GB of RAM (calculated) for those numbers alone. So I kept it as a single, frozen copy that the whole population consults. It is written in one-byte integers, from -127 to +127. That costs it 0.067% more error, and it returns exactly the same bits on a Mac and on a Linux server.
On the other side, each person owns 128 bytes that belong to them alone. That is less than a text message. For 12.25 million inhabitants, the whole lot weighs 1.46 GiB (calculated). Sixteen bytes set their tastes: they strengthen or soften what the shared network says, depending on whether rain or lost time costs them more or less than their neighbour. Forty-eight more hold their habits per transport mode and per activity, the confidence they place in what they think they know, and small counters of visits and stories. The last sixty-four form their memory of places, an eight-by-eight grid where what they have experienced and what their loved ones have told them is written down. The technical names are on the diagram, and the technical note explains them one by one.
The two rows of the diagram are cache lines, those 64-byte packets the processor grabs in a single move. The grid doesn't have one cell per bakery; space would run out fast. Each place carries a short key of eight numbers, +1s and -1s. To read back what the inhabitant thinks of a place, the processor multiplies a row of their memory by the place's key and adds it up. After a visit, it first erases 3% of what was written (gentle forgetting, ×0.97). It then adds a share of the gap between what the inhabitant expected and what they found, and it bounds each cell between -127 and +127. The whole thing takes 55.6 nanoseconds (measured). When the visit matches what was expected, the gap is zero and there is nothing to correct.
Two bad mornings
Since my inhabitants change their minds visit after visit, I am often asked whether they learn the way chess-playing programs do. That method, reinforcement learning, solves a difficulty my inhabitants don't have. In chess, fifty moves follow one another before you know whether the game is won, and you have to work out which one earned the victory. To do so, programs replay thousands of games kept in reserve, and they become unstable when millions of players change their behaviour at the same time.
At the bakery, the result comes straight away. You expected to wait three minutes, you waited twelve, and you know before you've even paid. Each visit therefore corrects the grid in one go, based on what was just experienced. You can try it below with the inhabitant of Bakery L. Make them wait once: they hesitate. A second time, and they go and buy their bread elsewhere. Then give them mornings without a queue. It will take four for them to become loyal again. On the right, meanwhile, the counter moves towards the 5,000 trials I estimate the other method would need.
Interactive animation 1 · One-step feedback versus reinforcement learning
One step of real feedback at the bakery
The month the whole neighbourhood ate out
My network was good at guessing the survey's trips. I plugged it into a real piece of city: a circle of 1.5 km radius around Place de la Contrescarpe, in the 5th arrondissement. 44,853 inhabitants live there, with their budgets and their days. I gave them 28 days.
I had gone for the simplest option. When an inhabitant wondered what to do, the network answered instead of the engine. By the end of the month, trips out for a meal had been multiplied by 3.62 and sports sessions had fallen by 70.1%. People walked further, 229.47 m on average against 196.11 m in the control neighbourhood (the same one, without the network). They missed more activities, 10,130 against 7,662. I had wanted to give them a mind. I got a whole neighbourhood sitting at the table, no longer setting foot in the gym.
The cause fitted in one line, and I could have seen it earlier. The network had learned on trips. It knows how to compare two ways of getting somewhere. I was asking it to say whether someone was hungry or needed a run, which nobody had taught it, and it answered anyway.
I started again, taking that question away from it. The rule engine keeps needs, schedules and budget: it is the one that knows it's dinner time and what is left of the salary. The network only decides between places of the same kind. Its nudge is bounded between -24 and +24 points, and its mean is zero within each activity category. Faced with three restaurants and a gym, it can give +8 to the first restaurant, -2 to the second and -6 to the third. The sum is zero: a table is chosen, and restaurants have gained nothing over sport. Transport economists know this kind of pairing well; they call it hybrid coupling.
On the same neighbourhood and the same 28 days, meals out came back to 2.80% above the control and sport to 0.81% below. The average walking distance fell by 7.73%, missed activities by 4.06%. The technical note calls these two trials P3 and P4, and the table keeps their labels.
Around the Contrescarpe (44,853 inhabitants, 28 days measured)
| Measured over 28 days | Control without network | First trial (P3) | Second trial (P4) |
|---|---|---|---|
| “Meal out” trips | 71,899 | 260,526 (×3.62) | 73,912 (+2.80%) |
| “Sport” trips | 166,264 | 49,780 (-70.1%) | 164,923 (-0.81%) |
| Average walking distance | 196.11 m | 229.47 m (+17.0%) | 180.95 m (-7.73%) |
| Experienced convenience (higher = better) | -0.0726 | -0.0952 | -0.0633 (+12.76%) |
| Missed activities | 7,662 | 10,130 (+32.2%) | 7,351 (-4.06%) |
| Computation time | 111.20 s | 115.03 s (+4.31%) | 110.59 s (-0.55%) |
Server measurements of 25 November 2026: 44,853 inhabitants and 22.6 million recorded facts per trial. The second trial is even slightly faster than the control, because shorter trips cross the boundary between two parts of the computation less often.
The morning of the fourteenth day
That left what people tell each other when they get home. I took the 44,853 inhabitants again for 28 new days, and split the neighbourhood into two halves. In the west there are 187 places to go out: restaurants, gyms, leisure and cultural venues. On the morning of the fourteenth day, I degraded 99 of them and improved 88 others. In the east, I didn't touch any of the 119 places. They serve as a control.
I warned no one. There is no hidden god in the machine whispering the right addresses, and no list the inhabitants could look up. The only one who knew was me. They learn it the way we do: by pushing the door open, or because someone in the household mentions it, or a colleague. A story weighs four times less than a visit.
I ran three identical copies of this city side by side. In the first, the inhabitants talk to each other, without the network or its memory. In the second, they have the memory and they talk. In the third, they have the memory and keep quiet. Over 28 days, 204,741 stories reached 26,081 people, that is 58.15% of the inhabitants.
Before the shock, 59.00% of outings in the western sector went to the 99 places I was about to degrade. By the fourth week, among those who remember and talk, that share had fallen to 48.75%, that is 10.25 points lower. In the other two copies, the drop stops at 7.17 and 7.18 points. Memory alone therefore does no better than stories alone. It takes the disappointment, and someone to tell it to. In the east, nothing moved (-0.02 points): the bad reputation didn't spill over onto addresses that hadn't earned it.
On the curve below, drag the slider to day 21: the green line drops below the 50% bar, one day ahead of the other two. That day, for the first time, more than half of the sector's outings go to the improved addresses.
Interactive animation 2 · Contrescarpe trial (44,853 inhabitants)
Slide from D12 to D27 along the D14 shock curve
A single simulation might have been lucky. The randomness of a run comes from a starting number, called a seed, and changing it is enough for the month to play out differently. I redid the test with five seeds, that is fifteen 28-day simulations. On day 27 (D27), among those who remember and talk, the improved places receive more than half of the outings with every one of the seeds (5/5), 51.30% on average. In the two control copies, this happens with none of them (0/5). Facing the shock, avoidance gains +45.0% in relative terms and satisfaction +11.41%. In the east, still nothing: no contamination. The price stays modest: +1.68% median computation time, and -2.09% on peak memory.
What I don't know yet
I am the one who degraded those 99 places, on a morning of my choosing. The trial shows that the chain holds from end to end: someone is disappointed, they say so, someone else remembers, and the neighbourhood shifts without anyone having been ordered to. I don't yet know what these inhabitants would do with a real change in the real Paris, one I hadn't prepared.
Nor have I measured this memory across the 12.25 million inhabitants. Its 1.46 GiB will weigh on the processor cache, and my projection puts the region between ×220 and ×232, against ×233.36 measured without it. As long as that figure is only a projection, the network stays switched off on the public server. The passers-by you meet today in the Twinz Paris still live without those 128 bytes.
The equations, the five tests and the bibliography are in the technical note. As for me, among the trial's 204,741 stories, I picture one. A few days after the shock, at the hour when the windows light up, someone comes home from a restaurant where they were a regular and which has just let them down. They say so at dinner. Across the table, a grid of sixty-four cells moves a little, four times less than theirs. The following week, the woman who listened slows down in front of the window. Maybe she goes in anyway. Then she will know for herself, and in the evening it will be her turn to tell.