AssayAssay
04 / 08

Lesson 04 · Workflows · 12 min

Parallelisation

When parts of a task do not depend on each other, they can run at the same time. The guide names two shapes, and they are used for different reasons.

Parallelisation — sectioning and votingsectioningtaskfactstonerisksmergevotingtaskdraftdraftdraftpickwall-clock is the slowest branch · cost is the sum of all of them
Left: independent parts of one task run at once and are merged. Right: the same task runs several times and a selector chooses. Both save wall-clock; neither saves tokens.
SectioningSplit the task into independent sub-tasks, run them together, merge the results. Reduces latency — wall-clock becomes the slowest part rather than the sum.
VotingRun the same task several times and choose between the outputs. Improves quality when diverse attempts beat one, and a selector can tell them apart.

The lab's table shows two times for every pattern: wall-clock, and what it would have cost sequentially. For the sequential patterns those are the same. For the parallel ones, wall-clock is lower — on one run, sectioning did four calls in 2.3 seconds that would have taken 3.1 in series.

That is the honest trade. Parallelisation saves time, not tokens: every branch still runs and still costs. Voting in particular triples the generation cost to buy one better answer, and it only pays when the selector is genuinely better at judging than the generator is at generating.

  • Parallelise when branches are independent and slow. If they are fast, coordination costs more than it saves.
  • Decide in advance what the merge does when one branch fails. Proceeding with partial input and failing entirely are both defensible; not deciding is not.
  • Voting needs a selector with a stated criterion. 'Pick the best' produces a coin flip.

Checkpoint

Record the wall-clock and sequential time for sectioning, and say what the difference is.

“Where is my order 41902? It was due on Tuesday.”

Patterns to compare

Run all three on the compound task. Compare the wall column against the sequential column — the gap is what parallelism bought.

Pick two or more patterns and press Run. They run in turn, and the table fills in as each one finishes.