An AI told bus drivers when to hold at the terminal. Where drivers followed it, the longest waits fell 40%. Drag how many follow, and watch the buses stop bunching.
See how a city can use AI to run buses, draw plans and share the wheel with machines, always with people still deciding.
Switch the AI advice on, then drag the share of drivers who follow it from 0% to 100%. Watch the gaps between buses shrink. Then we build, piece by piece, the three stories of the lecture: the bus controller, the city-plan generator and the agency frontier of self-driving cars.
You need a feel for averages (a typical value of a list of numbers) and no machine learning. We build the rest from zero.
Based on Lecture 13.2 of MIT MMAI, Multimodal AI (Spring 2026), taught by Paul Liang with guest lecturer Prof. Jinhua Zhao of MIT Cities and Transportation. Lecture slides. Every idea is re-taught here in our own words and devices.
The loop is a toy: six buses on a 60 minute road, where a bus slows down when a long gap ahead means more riders to load. The minutes in the read-out come from this simulation, run live in your browser. The field numbers are the lecture's: 90th percentile headways of 27.6 minutes with no AI, 21.8 where drivers did not follow the advice and 16.4 where they did (slide 16).
Chapter 0
Meet the lecture's three stories, and the one question that links them: who decides, the person or the machine?
You stand at a bus stop on a cold morning. The timetable says a bus comes every ten minutes. You wait twenty. Then three buses arrive together, nose to tail, and the first one is full while the other two roll past nearly empty.
Nobody planned that. The driver of each bus did a sensible job. Yet the whole line behaved badly. Fixing it is not a job for one smart driver. It needs someone, or something, that sees the whole line at once and tells the right bus to wait a minute.
That is the first of three stories in Lecture 13.2 of the MIT course on multimodal AI (AI that works with several kinds of data at once, such as maps, images, text and live sensor feeds). The guest lecturer is Prof. Jinhua Zhao, who studies cities and transportation. His lecture is not about one clever model. It is about how a city can use AI while people stay in charge.
The first story is control and assist. A bus agency uses AI to advise the people who run buses, and a field experiment in Chicago measures what changes. The AI here is a reinforcement learning system, a program that learns by trial and error which action pays off best. Chapters 1 to 5 build it.
The second story is create and work. A city planner asks an image-making AI for a land plan, looks at the result, picks one, and asks for a change. The AI is a diffusion model, a program that makes images by starting from noise and cleaning it up step by step. A trick called ControlNet lets the planner steer it. Chapters 6 to 9 build that.
The third story is agency. Self-driving cars raise a plain question: which decisions does a person keep, and which does the machine take? Chapter 10 gives the lecture's two simple maps for answering it. Chapter 11 gathers the whole lecture on one page.
Look at who does what in each story. In every one, the AI makes a proposal and a person makes the call. The bus AI proposes a hold, and the driver decides whether to follow. The planning AI proposes layouts, and the planner selects one. The self-driving car forces the same question onto the road.
This is called human in the loop: a system where a person sits inside the cycle of decisions, not outside it. The lecture treats it as a design choice, not a weakness. You will see numbers that show why. A good AI that people ignore helps less than a good AI that people follow.
Step through the three stories below. Each one is a loop of four beats. Watch which beats belong to the AI and which belong to people.
Choose a story, then press Next beat. Warm beats belong to the AI, purple beats to people, blue beats to the world (buses, a city, a road).
The four beats per story are our own short summary of slide 9 (bus dispatching), slide 64 (human prompt, selection and refinement) and slides 75 to 78 (agency). The lecture does not draw the car story as a loop; we show it as the same question asked of one trip.
Count the beats. In the bus story, people act in two of four beats. In the planning story, people act in three of four. That is not an accident of drawing. The more creative the job, the more the human keeps the pen.
Why does a course on multimodal AI teach bus dispatching? Because each story needs several kinds of data to work. The bus system joins live bus positions, boarding counts and driver reports. The planning system joins land-use maps, roads, rivers and a sentence of instructions. The car joins cameras, maps and the driver's wishes.
The lecture ends on two slide titles, "Two roles of models" and "Behavior + Computation". The slides give only those words. Our reading: a model helps a city decide, and it also gives people something to talk about. Chapter 11 returns to that.
This lesson follows the lecture in order. You can read it straight through, or jump to the story you care about.
Chapter 1
Measure the cost of uneven gaps, see why a small delay snowballs, and meet the two levers a dispatcher can pull
Picture a line with five buses. The timetable spaces them 15 minutes apart. By mid-morning the picture on the lecture's slide looks very different. Four buses sit one minute apart, nose to tail. Then comes a gap of 57 minutes before the fifth one.
The lecture calls this bus bunching: buses that should be spread out end up travelling in a clump. The gap between two buses at a stop is the headway. Even headways make a good line. Bunching ruins the headways, and the riders pay.
Why does a clump form at all? Start with one bus that runs a little late. Its gap to the bus ahead grows. A longer gap means more riders have gathered at each stop, so this bus spends longer loading them. That makes it later still.
Now look behind it. The bus following has a short gap to the late bus, so few riders wait at its stops. It loads fast and speeds up. It catches the late bus, and the two travel together. The late bus gets slower and the early bus gets faster, so the problem feeds itself. In engineering words this is a positive feedback loop: a change that causes more of the same change.
The cost shows up as waiting. A rider who walks to a stop at a random moment waits until the next bus. How long, on average? If buses come every 15 minutes, the average wait is half the headway: 7.5 minutes.
With uneven headways, the answer changes. A random rider is more likely to land inside a long gap than a short one, just as a dart is more likely to hit a big square than a small one. The long gaps count more. Here is the formula, with each symbol explained below it.
Check it on the slide's picture. Even headways of 15, 15, 15 and 15 minutes give E[h] = 15 and E[h²] = 225, so W = 225 ÷ 30 = 7.5 minutes. Now take the bunched line: gaps of 1, 1, 1 and 57. The average is still 15, because the same four buses cover the same hour. But E[h²] = (1 + 1 + 1 + 3,249) ÷ 4 = 813, so W = 813 ÷ 30 = 27.1 minutes.
The same buses, the same hour, and the average rider now waits 19.6 minutes longer than before. That extra, the wait beyond what even spacing would give, is the excess waiting time. It is the number the lecture's field test tries to shrink. Drag the slider and watch the area under the sawtooth grow.
The line shows one hour with four buses. The sawtooth is how long you would wait if you arrived at that minute. Slide from even spacing to the slide's bunched case and watch the average wait.
At 0% the gaps are 15, 15, 15 and 15 minutes. At 100% they are 1, 1, 1 and 57, read from the picture on slide 3. In between we slide each gap in a straight line from one case to the other. The waits come from the formula above.
Look at the middle of the slider. At 50% the gaps are 8, 8, 8 and 36 minutes. Nothing looks dramatic. Yet the average rider already waits 12.4 minutes, not 7.5. Excess waiting time grows with the square of the unevenness, so it starts quietly and then runs away.
What can an agency do? The lecture names two actions, both taken at the terminal, the stop where a route starts and buses wait between trips. The first is to hold the bus: keep it at the terminal for one minute, two minutes, three minutes, and so on. The second is to move the departure time forward by one, two or three minutes, so a bus that is running behind leaves early.
Take the failure case step by step. Symptom: bus A left the terminal four minutes after the bus ahead, and the next gap is 26 minutes. Measurement: the headways are 4 and 26, so E[h] = 15, E[h²] = 346 and W = 11.5 minutes against 7.5 for even spacing. Fix: hold bus A for six minutes, and the headways become 10 and 20. Now E[h²] = 250 and W = 8.3 minutes.
The hold costs the passengers already on bus A six minutes. It saves far more minutes for everyone waiting at later stops. That trade is the heart of real-time control: spend a little time at one place to save a lot of time elsewhere. The hard part is choosing the right hold for each bus, at each minute, with imperfect information. Chapter 2 hands that choice to a learning program.
Chapter 2
Turn "hold this bus a while" into state, action and reward, and watch a table of scores teach itself which hold to choose
A dispatcher sits in a control room with a screen of moving dots. Bus 12 just reached the terminal. The one ahead left three minutes ago, and a crowd waits at the first stop. Hold bus 12 for four minutes, or send it now? Any answer is a bet, and no rule written in advance covers every morning.
The lecture's slide 5 gives a reason to care. In its example the Chicago Transit Authority (CTA) delivered only 84% of its scheduled service, because drivers were scarce and some did not show up. A line with missing buses and missing drivers cannot follow a fixed plan. It needs a rule that adapts.
Slide 6 asks the control method to be robust, which means it must keep working when the world surprises it. It lists five kinds of surprise. Demand uncertainty: no one knows how many passengers will show up. Supply uncertainty: a driver may be absent. Environment uncertainty: traffic changes. Operation uncertainty: a driver may not follow an instruction. Information uncertainty: the data may be incomplete or wrong.
A hand-written timetable struggles with all five at once. A policy that looks at the live situation and picks an action can cope with them. So the lecture builds the policy by learning, not by writing rules.
Slide 7 quotes Sutton and Barto, the standard textbook on the subject. In plain words: a learner finds out which actions pay off by trying them, and an action can change not only the reward now but the situation that follows. Four parts make the loop.
The reward is the part a human designs. For buses it can be minus the waiting time that riders suffer. Then maximizing reward means minimizing waiting. What comes out of all the trying is a policy: a rule that says which action to take in each state. The slide states it plainly: the learning outcome is a policy.
How does a program learn a policy? The simplest way keeps a table with one row per state and one column per action. Each cell holds a score, called Q, for "how good was this action in this state, on average". At first every score is zero. The agent tries an action, sees the reward and nudges that one cell toward what it saw.
Take one cell. Its score is 0 and the agent earns a reward of −4. The surprise is −4 − 0 = −4, and 0.2 of it is −0.8, so the new score is −0.8. Try the same action again and earn −2. The surprise is −2 − (−0.8) = −1.2. The score moves to −1.04. After many tries it settles near the average reward.
One more rule is needed. If the agent always picks the best-looking action, it never tests the others. So most of the time it picks the best, and some of the time (we use 30%, falling to 5%) it picks at random. That is called exploration. Try the toy below.
Rows are three situations: the gap to the bus ahead is 3, 9 or 15 minutes. Columns are holds of 0, 2, 4 or 6 minutes. Warm cells score well. The ring marks the best action per row. Train and watch the table fill in.
Illustrative toy, not the lecture's model. After a hold of a minutes the new gap is the old gap plus a, plus noise with a spread of 1.5 minutes. The reward is minus how far that gap lands from 9 minutes, minus 0.25 per minute held, a cost for the riders already on board. One step, no future: the real system also looks ahead.
After 200 tries the pattern is plain. When the gap ahead is 3 minutes, the best hold is 6: it pushes the bus to a 9 minute gap. When the gap is 9, the best hold is 0, because the bus is already where it should be. When the gap is 15, every hold only makes it worse, so the best is again 0. The program found a rule no one typed in.
Real dispatching is harder in two ways. The state has many more numbers than three buckets, so a table is too small, and the lecture's system uses a learned function in its place. And the reward is not immediate: a hold now changes the next hour's gaps. The full update adds a term for the best score of the next state, which is how reward from the future flows back. Our Q-learning lesson builds that step by step.
Chapter 3
Follow one minute of data through the real system, from bus sensors to a supervisor's screen to a driver's instruction
A learned policy sitting on a laptop helps no one. To change what a rider sees at a stop, its advice must travel to a person who can act, and that person must trust it enough to act. The lecture calls this the human in the loop, and it shows it three ways in a row.
The first is the choice of route. The slide title sets CTA bus route 81, the actual test route, against route 20, the initial plan. The slide lists why 81 is a hard, useful case. Its terminal, Jefferson Park, serves 10 routes. Its garage, where buses are kept and drivers report, is at Forest Glen. The route has 4 transfers to the subway and 50 stops in each direction. In the morning peak (6 to 9 am) a bus is due every 6 to 9 minutes. Between 15% and 25% of trips go missing. About 7,500 riders use it each weekday.
That mix matters. A route with frequent buses suffers most from bunching, because riders do not look at a timetable. They simply arrive and wait. Missing trips make the gaps worse. A control method that works here, with so much going wrong, is a convincing test.
The second is the system's design. Slide 9 draws it, and its key choice is simple. The AI does not drive buses. It writes a recommendation, and a person carries it out.
Every minute, the system runs a fixed sequence. First it pulls fleet information from the CTA's real-time bus system and stores it in a database called TSMS (the slide gives only the acronym and draws it as the database the whole flow runs through). From that data it makes two predictions. Boarding predictions estimate how many riders will get on at each stop. State prediction forecasts, for each trip now running, the numbers the policy needs: gaps to the buses ahead and behind and the load on board.
Two controllers then read those states. A rule-based controller applies fixed, hand-written rules. The RL-based controller applies the learned policy from Chapter 2. Their suggested actions pass through a filter, a check that removes actions that should not reach people. The survivors update the user screen, the TSMS interface, with recommendations.
Then people take over. A supervisor at the control center reads the screen and tells the drivers, who are on duty or off duty at the garage, what to do. Information also flows back up. Control-center staff log manual updates, and the garage phones in no-shows, drivers who did not turn up. Those reports land in the database too, so the next minute's prediction starts from the truth.
Step through one minute of it below. Each stop shows the kind of data that moves there.
Press Next stage to move the minute's data along. Turn on A driver does not show up first to see the human report join the loop.
The boxes and arrows follow slide 9. The sample messages beside each stage are our illustration of what such data looks like (the field names and numbers are made up); the lecture does not publish its message format.
Notice what the no-show does. In a quiet minute, data flows one way around the top and then to people. With a no-show, the human side feeds the database. That is the lecture's design for information uncertainty: when the bus feed is wrong or incomplete, people who know better can correct it.
The third is the test itself. Slide 10 stresses that the CTA gave real support: its president, its vice president of operations, its garage supervisors and its drivers all took part. MIT built the real-time control database, the algorithm and the user interface. The CTA brought the buses, the people and the authority to run them.
Why stress that? Because the failure that kills many transport AI projects is not a bad algorithm. It is a good algorithm that no one uses. The slide shows that the agency's people, from the top to the drivers, were part of the experiment from the start.
Take the failure case step by step. Symptom: the screen says bus 14 is 3 minutes behind the leader and should be held. Measurement: a phone call shows driver 14 never showed up, so no bus 14 exists, and the "gap" came from a stale record. Fix: the control center logs the no-show, the next minute's state prediction drops bus 14, and the advice is redone for the buses that do exist.
Chapter 4
Read the lecture's results the way an analyst would: what each number counts, and what it leaves out
A field experiment gives you numbers, and numbers can mislead. "Waiting dropped" says little. Dropped for whom, measured how, compared with what? This chapter reads the lecture's result slides one number at a time.
Slide 11 gives the headline: excess waiting time reduced by more than 30%. You met this measure in Chapter 1. It is the wait riders suffer beyond what perfectly even buses would give. A fall of 30% means the unevenness, and the delay it causes, shrank by nearly a third.
Slide 12 breaks the result into three measures. Each answers a different question.
Two slides use the 90th percentile. To find it, sort a list of measurements from smallest to largest and walk 90% of the way along. Nine tenths of the values are at or below it, and one tenth are worse.
Why not use the average? Averages hide the bad days. Take ten headways in minutes: 8, 9, 9, 10, 10, 11, 11, 12, 14 and 30. The average is 12.4, which looks fine. The 90th percentile lies between the ninth value, 14, and the tenth, 30. It tells you that one rider in ten sees a gap that long. People remember the long wait at the stop, so the lecture tracks the tail.
A field result is only useful if you can rebuild it. Take the slide 15 table and redo each percentage. A percentage reduction is the minutes saved divided by the baseline, times 100. Always divide by the baseline of the same measure.
For excess waiting time the baseline is 3.6 minutes. A saving of 0.7 minutes gives 0.7 ÷ 3.6 = 0.194, which the slide rounds to 19%. A saving of 2.1 minutes gives 2.1 ÷ 3.6 = 0.583, which is 58%. For the 90th percentile headway the baseline is 27.6 minutes. A saving of 7.2 gives 7.2 ÷ 27.6 = 0.261, so 26%. A saving of 5.8 gives 0.210, so 21%. A saving of 11.2 gives 0.406, which the slide prints as 40%.
Now see what the tail tells you that the average hides. The same trips that lost only 19% of their average excess wait lost 26% of their longest gaps. Better spacing helps the worst riders most. Those riders remember the long wait, which is why the lecture tracks the tail.
Slides 15 and 16 are the most informative, because they test the system when things go wrong. They split the trips into groups and give the baseline, the result with no AI, for each measure: excess waiting time of 3.6 minutes, and a 90th percentile headway of 27.6 minutes. Then they show three groups of trips with the AI. Choose a group in the device and watch the bars.
The grey bar is the baseline with no AI. The warm bar is the AI result for the group of trips you choose. Switch groups and compare how much each one gains.
All numbers are the lecture's, slide 15: excess wait 3.6 minutes at baseline, then 0.7 less (19%), 0.7 less (19%) and 2.1 less (58%); 90th percentile headway 27.6 minutes at baseline, then 7.2 less (26%), 5.8 less (21%) and 11.2 less (40%). Slide 16 shows the last two as 21.8 and 16.4 minutes.
Read the groups in order. Where there were information problems, the AI still cut excess waiting by 0.7 minutes (19%). Where drivers did not follow the advice, it cut it by the same 0.7 minutes. Where drivers followed, the cut was 2.1 minutes (58%): three times as big.
The pattern repeats for the 90th percentile headway. The longest gaps fell by 7.2 minutes (26%) with information issues, 5.8 minutes (21%) with non-compliant drivers and 11.2 minutes (40%) with compliant drivers. In the compliant group, the worst gap a rider could expect dropped from 27.6 to 16.4 minutes.
Two readings follow. First, the AI is robust: even on the worst trips it did better than no AI. Second, following the advice roughly doubles the 90th percentile gain, and triples the excess-wait gain. The slides do not say why non-compliant trips still improved. One possible reading is that other buses on the same line did follow the advice and smoothed the gaps for everyone. That is our guess and the lecture does not claim it.
Take the failure case step by step. Symptom: a manager sees that the AI line improved by 30% on average and wants to know if the AI works when drivers ignore it. Measurement: split by compliance, as slide 15 does, and the gain for non-compliant trips is 0.7 minutes against 2.1 for compliant ones. Fix: if you want the full gain, work on compliance, which is the subject of Chapter 5.
Chapter 5
Find out why bold advice gets ignored, how a pilot becomes a program, and where the human loop closes at three levels
Chapter 4 ended on a hard fact. Trips where drivers followed the advice gained three times as much as trips where they did not. So the next question is not "is the model good?" but "will the people use it?". The lecture marks it as Observation 3 and asks it outright: do drivers follow the AI guidance?
Compliance is the share of recommendations that people actually carry out. A recommendation says, for example, "hold this bus 4 minutes". If the driver leaves after 1 minute, that recommendation was not followed.
Slide 14 plots compliance against the aggressiveness of the advice: how big a change from the schedule the AI asks for. The bar chart groups recommendations by size, in minutes, with a dashed line at zero. The takeaway is on the slide in words: driver compliance decreases with the aggressiveness of the recommended control actions. Small nudges get followed. Large demands often do not.
Think about why from the driver's seat. A one-minute change costs almost nothing. A five-minute hold means sitting at the terminal while passengers wait and a schedule slips, on an order from a screen the driver cannot see. A sensible person pushes back. The AI may be right, and people still hesitate to trust a surprising order.
Use the chart to see how much this matters. The device below lets you choose how bold the advice is. It reads the compliance share off the slide's chart, then blends the two groups from Chapter 4 to estimate the gain. A weighted average adds each group's result multiplied by its share. If 72 of every 100 trips comply, the blended gain is 0.72 times the compliant gain plus 0.28 times the non-compliant gain.
Each button is a size of recommended adjustment from the schedule, as on slide 14. The bars are how many trips complied. The green number is what that mix gains.
The bar heights are our reading by eye of slide 14, about 30%, 50%, 72%, 43%, 36% and 5%, good to roughly five points. The slide marks the two sides of a dashed line without telling us which is a longer hold, so we call them A and B. The blend is 0.7 + 1.4 × compliance minutes of excess wait saved (0.7 for non-compliant trips, 2.1 for compliant ones, slide 15). It assumes each trip behaves like its group.
Try the extremes. With small advice on side A, about 72% of trips comply, and the blend saves 0.7 + 1.4 × 0.72 = 1.7 minutes, close to half of the 3.6 minute baseline. With big advice on side B, only about 5% comply, and the blend saves 0.7 + 1.4 × 0.05 = 0.77 minutes. The same model, shown a different advice size, is worth twice as much in one case as in the other.
This is the practical meaning of aggressiveness. A planner may prefer the AI to suggest the mathematically best hold. The better engineering question is: what is the best hold that people will carry out? Designing for compliance means sometimes recommending a smaller step, or explaining the reason to the driver.
Slides 17 and 18 move from the test to the future. Slide 17 compares two stages of the Chicago work. The table names them BP2, the pilot, and BP3, the full scale stage. Here is what changed between them.
The last row is the one that counts. A system that only works while its builders sit beside it is a demo. When the agency's own staff run it, it becomes a tool. The same slide's right half, titled "Scaling up: the US transit industry at large", shows a document called Transit Research Consortium 2023, the plan to take the lessons to other agencies.
Slide 18 closes the story with Observation 4: human in the loop, at the control level, the garage level and the organizational level. The slide lists the three words and nothing more. Our reading, built from the earlier slides: at the control level, a person reads the recommendation and decides what to do with a bus. At the garage level, supervisors and drivers decide how the day's crews and trips run. At the organizational level, the agency decides to adopt, run and expand the system. The AI needs a willing person at every one.
Take the failure case step by step. Symptom: the model scores well in testing, yet in the field riders see little change. Measurement: compliance by advice size shows that the biggest recommendations are ignored. Fix: reshape the policy so that it recommends steps people will take, and involve supervisors and drivers in the design, as the CTA's staff were.
Chapter 6
Turn a planner's day into three clear demands: control the mix, respect the site, learn the local style
Move from buses to the land they run on. Imagine you plan a new district. A lake sits in the middle of the plot, a railway cuts across one corner, and the city wants 35% homes, 15% shops and some parking. You sketch a layout. A neighbour group asks for more green space. You redraw. A traffic engineer wants a wider road. You redraw again.
This is the second story of the lecture, introduced as "AI for Generative Urban Design" by Qingyi Wang, Shenhao Wang, Mingyi He, Yuebing Liang and Jinhua Zhao. The slide tags it create and work. The question is whether an AI can draft layouts quickly enough for planners to think with.
Slide 22 makes the stakes concrete with two cities in 1990. Atlanta had 2.5 million people spread over 4,280 square kilometres of built-up land. Barcelona had 2.8 million people on just 162 square kilometres. Per person, that is about 1,700 square kilometres of built-up land per million people in Atlanta, against about 58 in Barcelona: roughly 30 times as much land for each resident. The slide labels Barcelona a "15 minute city", where daily needs sit within a short walk or ride.
The slide's heading says it all: to decarbonize mobility, urban structure is the starting point. A compact city needs fewer car trips. So the layout a planner chooses today shapes the traffic and emissions of decades. The choice deserves many careful tries.
Slide 23 draws the typical planning process. The planner holds many things in mind: zoning (the rules for what may be built where), policy, traffic, social interactions, the natural environment, infrastructure and public engagement. From these the planner produces plans, layouts and visualizations. Then comes feedback, and the planner starts again. The slide's label on that return loop: weeks and months.
Slide 24 redraws it with a generative AI in the middle. The planner gives guidance in plain words, for example "Give me a design in Chicago with 70% apartments, 10% park, 10% retail, and a lot of green space". The AI generates designs. The planner reacts. The return loop is now labelled minutes.
This is not a small speed-up. A loop that takes weeks lets a planner try a few ideas. A loop that takes minutes lets the planner try fifty, and show them to the public in a meeting. The lecture later argues that this changes the job itself (Chapter 9).
Slide 28 asks what planners want, and answers with three expectations of a generative planning tool. Everything in the next three chapters is built to meet one of them.
The slides use one test site to show all three: a patch of land 35 miles north of downtown Chicago, with a lake. The first request asks for 35% residential, 15% commercial and 10% open parking, and the AI draws an aerial image. Change the request to 65% industrial, 20% commercial and 5% open parking, and the image changes. Ask for 100% residential, and it changes again. The land is the same, and the target decides what it becomes.
The lecture is careful about the data. Slide 31 says everything comes from OpenStreetMap, the public map that volunteers maintain. That choice gives the work two good properties, named on the slide: it generalises (it can be applied to many places) and it can be reproduced (anyone can fetch the same data). Two kinds of image are made from it. A land-use map colours each parcel by type: residential, commercial, park, industrial, open parking or farmland. A second map shows the existing infrastructure and natural features, such as roads, railways and water.
As data, each map is an image: a grid of pixels, with a colour code standing for a land-use class. The AI takes the constraint image and a text description, and returns an aerial picture. The device below makes the first two demands concrete in a small way. It is not a diffusion model. It is a plain allocator that shows what "control" and "respect" mean.
Drag the three sliders to request a land-use mix. Turn the lake on or off. The plan fills the free parcels in clusters. Compare what you asked for with what you got.
A toy allocator, not the lecture's model. Parcels are sorted along a smooth seeded pattern so each type forms a cluster. The remaining parcels are left as open land. Targets come from the slides: 35% residential and 15% commercial (slide 27), or 65% industrial and 20% commercial (slide 33). Water and rail take fixed parcels, as a constraint image would.
Try the lake switch. With it on, the water parcels are fixed, and your mix fits into what remains. Ask for 100% residential with the lake on, and the plan reports less than 100% residential: the water is not up for negotiation. That is the second demand. The AI must follow the site, however the request is worded.
Take the failure case step by step. Symptom: a generated plan puts houses on a lake. Measurement: overlay the plan on the constraint map and count the water parcels that have changed. Fix: feed the constraint in as an input the generator must follow. That is just what ControlNet does, and Chapter 7 explains how.
Chapter 7
Add a second, trainable copy of a frozen image model, joined by layers that start at zero, so a map can steer what it draws
Slide 29 asks: can AI do it? The lecture's answer is a model called Stable Diffusion, fine-tuned with ControlNet. To see why that works, we first need to know what Stable Diffusion does, and why a plain one cannot respect a river.
A diffusion model makes a picture by cleaning. Training starts from real pictures and adds a little random noise, again and again, until only static remains. The model learns the reverse job: given a noisy picture, predict the noise, so it can be subtracted. At use time, you start from pure static and subtract predicted noise many times. A picture emerges.
The cleaner is a neural network that reads the noisy picture, plus a short text, and outputs a guess of the noise with the same shape as the picture. Stable Diffusion does this on a compressed version of the image. A 512 × 512 × 3 picture becomes a latent of 64 × 64 × 4, 48 times fewer numbers, and the work happens there. Our diffusion lesson builds the cleaning loop from scratch.
Slide 53 gives two reasons the lecture picks diffusion over GANs, an older kind of image generator. Diffusion models scale better, run in parallel, train more stably and give more detailed images.
Text alone is a weak steering wheel. The words "a lake and a railway, 35% homes" cannot say where the lake is, which way the track bends, or how large it is. The model needs a second input that is itself a picture.
Slide 30 shows the idea in a diagram. The left side is plain Stable Diffusion: descriptions go in, an image comes out. The right side is Stable Diffusion with ControlNet, with a second input labelled constraints. Two boxes sit in the middle. One is a locked copy of Stable Diffusion, drawn with a padlock. The other is a trainable copy.
The reasoning is about safety. Stable Diffusion learned a huge amount about pictures from billions of images. A small set of city maps could easily ruin that if you simply trained all the weights on it, a failure called forgetting. So ControlNet freezes the original, the locked copy, and trains only a duplicate, the trainable copy. The duplicate starts with the same weights, so it already knows how to paint. It only needs to learn how to listen to the constraint image.
The constraint image enters the trainable copy, along with the noisy picture. The copy's outputs travel to the locked model and are added to its own internal features, layer by layer. In effect the trainable copy whispers, "make this part water" to every layer of the locked one.
How do you join the copy to the locked model without breaking it on day one? Slide 30 shows boxes labelled zero convolution at both ends of the trainable copy. A convolution here is a small layer of weights that mixes the channels at each pixel. A zero convolution is one whose weights, and bias, start at exactly zero.
On day one Z is all zeros, so Z(T(x + c)) is zero and y = F(x). The combined model behaves exactly like the original Stable Diffusion. No noise, no shock. Then training begins. The loss still reaches Z, because T(x + c) is not zero, and Z's weights grow a little. Only after Z opens does the constraint start to shape the output. The change is gradual and safe.
The slide's design description is from the ControlNet paper (Zhang, Rao and Agrawala, 2023, arXiv 2302.05543). The sizes above are for a 512 pixel image in that paper's setup. Open the zero convolution yourself.
Four small maps. The locked model draws land. The condition says where a lake must be. The branch carries the condition. The result is the locked map plus the branch, scaled by Z. Drag Z from 0 to 1, like training progress.
A toy with 12 × 8 cells and one made-up channel. "Water" cells score near 1 and land near 0.2. The real feature maps have hundreds of channels and are learned. The key behaviour is the real one: at Z = 0 the combined result equals the locked output exactly.
At 0%, the fourth panel is identical to the first: the lake is ignored. At 100% the lake shows through where the condition says it should be. In between, the water appears at partial strength. Real training does not drive Z in a straight line. It learns it with the pictures and their constraint maps as examples.
Slides 36 to 39 show the second demand, respecting the site. The same description ("City in Chicago. 35% residential, 20% commercial, 5% open parking. Mix of houses and apartments. Dense building coverage.") goes in each time, while the constraint image changes. First comes a waterway, then railways, then roads. Each time, the generated aerial image bends around the added feature, and the last one is compared with the true satellite image of that place.
Slide 40 shows the third demand. A template reads "City in {city name}. 40% residential, 15% industrial, 15% commercial, 10% park, 5% open parking. All houses. Medium building coverage." Fill in Chicago, Dallas or Los Angeles, and the textures change, because the model saw each city in training. Slide 42 adds a bonus: the same inputs give three different designs, because each run starts from different random noise.
Take the failure case step by step. Symptom: a plain text-to-image model puts a street through the lake. Measurement: overlay the lake mask and count the pixels where land-use colours cover water. Fix: pass the mask through a ControlNet branch. The model now sees the lake at every layer, not only in the words.
Chapter 8
Break the city draft into roads, buildings and rendering, and let a person choose between each step
Slide 43 asks: how do planners and AI work together? The lecture answers with one research paper. It is "Human-guided urban form generation using multimodal diffusion models" by He, Liang, Wang, Zheng, Wang, Zhuang, Tian and Zhao, in the journal Building and Environment (2025), presented by Mingyi He. Its title for the method is "a stepwise approach integrating human expertise with diffusion models".
Slide 45 describes urban design as iterative, labour-intensive and slow. Design objectives and existing constraints (infrastructure, nature, who lives there) feed design drafts, then design schemes, then a final proposal. Along the way, planners talk to local government, residents and developers, and each round of feedback sends them back to adjust the strategy.
Slide 46 names three open problems with earlier generative AI: how to include site constraints and expert input, how to support iterative refinement for public participation, and how to evaluate whether the AI follows human designers. The paper's answer is to treat the AI as a partner that works under human direction.
Slide 47 draws the framework as a chain of three stages. Each stage is its own ControlNet model from Chapter 7, and each one takes the previous stage's output as its constraint.
Between stages sits human judgment. The model makes several candidates, the person selects one, and the choice moves on. Slide 64 names the three human acts: prompt (state the instruction), selection (pick a candidate) and refinement (adjust the choice and go again).
A diffusion model reads text, so the human's numbers must become a sentence. Slide 52 shows how. The team takes a real city tile and runs feature extraction: measure its properties. For one tile the slide shows residential 79.2%, commercial 15.4%, manufacturing 0.0%, park 3.6%, mixed use 0.0%, road density 18.0%, building coverage 28.1%, an average building height of 79.25 and a building volume density of 2,224.73%. A fixed template turns these into a prompt.
Slide 49 gives the three templates. Stage 1: "Land use types and road network map of New York. Land use parcels include 79.2% of residential, 15.4% of commercial, 3.6% of park. Road density is 18.0%." Stage 2: "Building height gradient map of New York. Buildings include 15% of low-story, 25% of medium-story, 15% of high-story, and 45% open space." Stage 3: "Satellite image of New York."
In training, each tile is a triple: the target image, the constraint image, and the prompt computed from the tile's own features. Slide 50 says the data cover New York City and Chicago and come from OpenStreetMap, the cities' official data hubs and Mapbox, in four layers: basic, road network, land use and building height. In use, the human types or drags the numbers, and the same template makes the prompt. Build it below, one stage at a time.
Choose a stage, set the human instruction, and press Make candidates. Click the candidate you prefer: it becomes the next stage's input. The box shows the exact prompt text.
The prompt templates are the paper's (slides 49 and 52). The candidate maps are drawn by a toy allocator in your browser, not by a diffusion model, so they show the human choices and the chain and not real city quality. Industrial share is whatever is left after your three land-use sliders, and mixed use is fixed at 0.0%.
Notice the data flow. Stage 2 cannot start until you pick a stage 1 candidate, because its constraint image is that choice. A wrong early pick carries forward. That is the price, and also the point, of the chain: every decision is visible, and a person can go back and change just one.
Slide 63 compares the chain with an end-to-end model that goes straight from site constraints to the building layout. The end-to-end model produces repetitive, uniform patterns that lack diversity. The stepwise route gives clearer, more functionally coherent layouts. The slide lists three reasons: better alignment with instructions, because each intermediate step gives the human a decision point; better output quality; and better human control, because a person can review and refine at each stage.
Slide 69 calls this an example of neuro-symbolic AI: a neural network does the drawing, while a human-readable structure (land use, then buildings, then rendering, each with named numbers) organises the work. We take that as the lecture's own label.
Take the failure case step by step. Symptom: an end-to-end model draws long identical rows of houses whatever you ask. Measurement: compare several outputs for the same site and see little difference between them. Fix: split the job, ask for the land-use plan first, choose, then ask for buildings. Every candidate set now gives you a real choice.
Chapter 9
Score a generated city three ways, read what the experts said, and see how the planner's role shifts
A generated plan can look beautiful and still be wrong. It may ignore the 35% you asked for. It may look the same every time. So the paper does not stop at "it looks good". Slide 54 sets up three tests, and compares the new method with four baselines.
A baseline is a simpler method you must beat. The paper uses four. Pix2Pix turns one image into another and sees only images. Metric-enhanced Pix2Pix adds the numeric measures to its input. LoRA-SD is Stable Diffusion adapted cheaply with low-rank adaptation and given text only. ChatGPT-5 is a general chatbot that also draws. The slide places the last two in an appendix.
The first test is visual fidelity, how close the generated pictures are to real ones. The measure is the Fréchet Inception Distance, or FID. Slide 55 states the rule you need: lower FID means higher fidelity. The method works in two moves. Run many real images and many generated images through a fixed image network that turns each into a list of numbers. Then compare the two clouds of lists: where their centres lie and how their spreads match.
The formula is the standard one from the FID paper (Heusel and colleagues, 2017), which the slide names but does not write out. The slide's finding is that ControlNet clearly beats Pix2Pix on image fidelity, with greater clarity and more precise edges.
The second test is instruction compliance. Ask for 79.2% residential, and measure how much residential the picture really shows. One way to read the shares off a generated image is to count pixels of each land-use colour. The paper then compares the asked-for shares with the measured ones, using four error measures. Each is simple.
Score a plan yourself. The target is the slide's New York tile. Move the sliders to what a model drew.
The grey bars are the target mix. The warm bars are what a model drew. Move the sliders, or use a preset, and watch the four scores.
The target shares are from slide 52 (residential 79.2%, commercial 15.4%, industrial 0.0%, park 3.6%, mixed use 0.0%). The presets are made up for teaching. Mixed use is held at 0.0% in the plan. MAPE skips classes whose target is zero, because you cannot divide by zero. R² is taken over the five classes.
At the target, all four scores are perfect. Nudge residential down by 10 points, and RMSE and MAE rise while R² stays near 1, because 79 and 69 are still far above the other classes. Make industrial 15% where the target is 0%, and MAPE ignores it entirely, while RMSE and R² both notice. This is why the paper reports several measures and not one.
The third test is output diversity: with the same site and the same instruction, does the model give different designs? Slide 60 shows the same land-use mix arranged as centralised parks or dispersed green space, and the same building heights as rows, courtyards or clusters. That is what planners want to see: several good answers to choose from.
Slide 62 adds a user study. Experts rated images on a 1 to 10 scale, seeing only one image per case. Generated images scored close to real ones at all three stages, with slight advantages in road network rationality and site alignment. There were no statistically significant differences: to these experts, generated plans were hard to tell from real ones.
Slides 70 to 73 turn from method to meaning, in three points. First, immediacy changes the dialog: planners must be more responsive, because feedback now comes in minutes. Second, AI enables the public: planning is a tool to allocate power, and if anyone can generate a plan, more voices can join. Third, the essence of the planner's job moves from design creator to design critique, design communicator and design negotiator. The pen passes to the AI. The judgment stays with the person.
Take the failure case step by step. Symptom: a model scores a good FID, yet planners complain that it ignores their numbers. Measurement: compute RMSE and R² on the land-use shares, and they are poor. Fix: judge by all three tests, and train or condition the model on the numbers it must follow.
Chapter 10
Use two simple maps, the agency frontier and the command matrix, to decide who should be in charge of which decision
You get into a car that drives itself. Before the door closes, a long list of small choices has already been made by someone. Where are we going? Which road? How fast through the bend? Was it you, the software, the company that built the car, or the city? Slide 74 names this the third story: AI for autonomous vehicles, and the question of human agency and AV deployment.
An autonomous vehicle, or AV, is a vehicle whose software makes some or all of the driving decisions. Agency is the power to make a choice yourself and have it count. Slide 75 poses the lecture's question: what is the essential difference between an AV and a car that a human drives? Its answer is one phrase: human agency.
Many people picture a car as either human driven or self-driving. Slide 76 says to think in a spectrum of human versus machine decision making: a line with a fully human end, a fully machine end, and a variety of middle points. A car can sit anywhere along it.
Slide 77 adds a second idea: decisions come at different levels. The slide sorts them into three.
Put the two ideas together and you get a grid, with levels up the side and the human to machine spectrum along the bottom. The slide calls the edge of what is possible there the agency frontier: "where human preference and machine intelligence meet". For each level, you choose a point on the spectrum. A point far left says a person decides. A point far right says the machine decides.
A car today often looks like this: the person picks the destination and the route, and the machine helps with the low level, such as cruise control. A robotaxi hands over nearly every level. A rider keeps only the destination. Try setting the three levels yourself.
Each row is a level of decision. Drag its dot from fully human (left) to fully machine (right). The line joining the dots is your frontier.
The three levels and the human to machine axis are from slide 77. The percentages and the three presets are our own illustration; the lecture does not give numbers.
The point of the picture is that each level is its own decision. A designer can hand the machine lane changes but keep the destination for the rider. And the right choice may differ by person, by trip and by day, so the frontier is not fixed.
Agency has a second axis. Who decides also depends on what is going on. Slide 78 draws the command matrix: "the right actor in charge for each scenario". Its rows are operation scenarios, from normal operation through events, accidents, small scale emergencies and large scale emergencies. Its columns are the decision-making parties: consumers, operators, car makers and authorities.
In normal traffic it is natural for the rider, the consumer, to decide. In a flood that closes half a city, it is not natural for each rider's app to pick its own route, because thousands of good individual choices can add up to a jam on the one open road. Someone with the whole view, an authority, may need the wheel. The matrix asks you to fill in, for each scenario, which party leads. Fill in the grid yourself.
For each scenario, press the party you think should be in charge. One party per row.
The rows and columns are from slide 78, which leaves the cells empty. The sketch is our own opinion, not the lecture's, and a reasonable class could argue for others.
Slide 79 treats agency as something that can be traded. Its incentive design framework aims to motivate each decision party to acquire or release control. Control for a private purpose, such as taking the wheel for a drive for fun, is something you pay for. Control for a public purpose, such as handing your route choice to the city during an evacuation, is something you should be paid for.
Slide 79 adds a public policy thread: different layers of property rights (who owns the data, the vehicle, the road) and a richer set of policy tools. Slide 80 names three ways to change behavior: price, rules and norms, set against direct control. Price changes the cost of a choice. A rule forbids or requires it. A norm makes it feel normal. Direct control simply makes the choice for you. The slide sets the three beside direct control and says no more. Our reading: a machine can be steered directly, so AVs make that fourth option real.
Take the failure case step by step. Symptom: during a flood warning, every navigation app sends cars to the same open bridge. Measurement: count vehicles per minute against the bridge's capacity, and it is far above. Fix: in this scenario the matrix says authorities lead, and they set the routes, perhaps with a payment or priority for riders who release control. The numbers in this example are ours.
Chapter 11
Gather the numbers, the checks and the code, and see the lecture's closing idea: behavior and computation belong together
You can now retell Lecture 13.2 from memory. A city can use AI in three ways, and each one keeps a person in the loop. The last slides step back and ask what models are for. This chapter closes that thought, then gives you the numbers, a checklist and the core code to keep.
Slide 82 is titled "Two roles of models", and slide 83 pairs it with communicative planning. The slides carry only these titles, so this is our reading. A model is a tool for prediction and decision, and it is also a tool for conversation: planners, residents and officials argue with each other over what a model draws. A generated plan that people can see and change helps them talk.
Slide 85 names the lecture's final frame, behavior plus computation. On one side stands behavioral thinking: how people feel (emotional), relate to each other (social) and notice things (perceptional). On the other side stands transportation technology: electrification, automation, connectivity and sharing. Joining them is a computational foundation of representation, prediction, explanation, control and creation. Slide 86 adds two more words, communication and the question "What is success?"
You have seen each word at work. Representation: the land-use image and the bus state. Prediction: boarding and state prediction. Explanation: the stepwise chain with named numbers. Control: the hold policy. Creation: the generated plan. Communication: the recommendation screen and the candidates a planner shows to the public. And success: the lecture's repeated answer is that it is measured with people, by their waiting time, by their trust and by their say.
| What | Number | Why it matters |
|---|---|---|
| Bunched line, slide 3 | gaps of 1, 1, 1 and 57 minutes instead of 15 each | Same average gap, 19.6 minutes more wait for a random rider |
| CTA service delivered | 84% | Missing drivers make a fixed plan fail |
| Route 81 | 50 stops each way, 15% to 25% missing trips, 7,500 riders a day | A hard, real test bed |
| Excess waiting time | reduced by more than 30% | The headline field result |
| Access wait, AM period | 37% less, like adding 2 trips | Software gave the benefit of more buses |
| Overcrowding; 90th percentile cycle time | 5% to 20% less; 2.5 minutes (2.4%) less | Better spacing without a slower route |
| Excess wait by group | 0.7 min (info issues), 0.7 (non-compliant), 2.1 (compliant); baseline 3.6 | Robust, and compliance triples the gain |
| 90th percentile headway | 27.6 min baseline; 21.8 (non-compliant); 16.4 (compliant) | The long gaps fall 21% and 40% |
| Pilot to full scale | 1 week to 1 month; route 81 to all Jefferson Park routes | The agency's staff took over the software |
| Planning loop | weeks and months, then minutes | Why generative design changes planners' work |
| Three framework stages | roads and land use, buildings, rendering | A human choice between each stage |
| Agency maps | 3 levels by the human-machine spectrum; 5 scenarios by 4 parties | Agency is split, not on or off |
python# 1. Excess waiting time from a list of headways, in minutes (Chapter 1)
def excess_wait(h):
m = sum(h) / len(h)
m2 = sum(x * x for x in h) / len(h)
return m2 / (2 * m) - m / 2 # excess_wait([1, 1, 1, 57]) is 19.6
# 2. One learning step for the hold table (Chapter 2)
Q[s][a] += alpha * (r - Q[s][a]) # alpha = 0.2
# 3. A recommendation, filtered before a person sees it (Chapter 3)
def advise(state, Q, max_hold=6):
a = max(range(len(Q[state])), key=lambda i: Q[state][i])
return min(HOLDS[a], max_hold) # the filter caps what reaches the screen
# 4. Expected gain when a share of drivers follow (Chapter 5)
def blended_gain(compliance):
return 0.7 + 1.4 * compliance # minutes of excess wait saved
# 5. The ControlNet join (Chapter 7): y has the same shape as x
y = locked(x) + zero_conv(trainable(x + cond))
# 6. The stage 1 prompt, built from numbers (Chapter 8)
def stage1_prompt(city, res, com, ind, park, mix, road):
return (f"Land use types and road network map of {city}. Land use parcels "
f"include {res:.1f}% of residential, {com:.1f}% of commercial, "
f"{ind:.1f}% of industrial, {park:.1f}% of park, {mix:.1f}% of mixed use. "
f"Road density is {road:.1f}%.")
# 7. Instruction compliance scores (Chapter 9)
def rmse(t, g): return (sum((a - b) ** 2 for a, b in zip(t, g)) / len(t)) ** 0.5
def mae(t, g): return sum(abs(a - b) for a, b in zip(t, g)) / len(t)
This session is the second of a pair on cities. Lecture 13.1 asked how fusing space and time data helps a city. This one asked how a city can run and design itself with AI while people keep the final word. The course also covers prescriptive modeling, where predictions turn into decisions, the same step the bus controller takes.
The course meets for lectures and posts its slides and readings on the course schedule. The next session, Week 14.1, covers self-evolving AI.
Now press Present or Teach and explain one story out loud, from memory: why buses bunch and how a hold fixes it, how the Chicago team got advice from a screen to a driver, why ControlNet starts at zero, and who should decide in a flood. Then go back to the buses at the top, set the compliance to 30% and then to 100%, and explain the difference.