The Counterfactual: Separating Industry Slumps From Coder-Specific Change

The coder-employment slowdown raises an attribution problem: did coders simply work in industries that weakened after the pandemic, or did those industries employ fewer coders than their overall employment paths would predict? The Federal Reserve paper addresses that question with an industry counterfactual. This chapter explains what the counterfactual removes, what the remaining gap means, and why the result can support a coder-specific change without proving that every part of the gap was caused by generative AI.

The distinction is important because an occupation is never suspended above the economy. Coders are hired by firms in industries that experience their own booms, corrections, financing pressures, and demand changes. If a software-heavy industry cuts many kinds of workers, coder employment may fall for a broad industry reason. If the industry grows but its coder share falls, the evidence points to a different process. The counterfactual is a disciplined way to keep those explanations apart.

What the counterfactual compares

Start with a simple question. Suppose coders had remained the same share of employment inside each industry. If computer systems design, software, research, manufacturing, finance, and government each followed their observed employment paths, what would total coder employment have looked like? That constructed path is the counterfactual: it lets industries grow or shrink while holding the occupational composition within them constant.

The observed coder series can then be understood as two pieces. One piece is the between-industry component: coders benefit or suffer because the industries that employ them expand or contract. The other is the within-industry component: the coder share changes inside those industries. In plain language, the first asks whether coders were carried along by the fortunes of their workplaces; the second asks whether those workplaces became more or less coder-intensive.

flowchart LR A[Observed coder employment growth] --> C[Compare observed and counterfactual paths] B[Industry growth weighted by coder distribution] --> D[Between-industry counterfactual] D --> C C --> E[Observed minus counterfactual gap] E --> F[Occupation-specific component] F --> G[Consistent with coder-specific substitution] H[Historical episodes] --> I[Validation of decomposition logic] I -. validates method, not today's AI cause .-> F J[Other occupation-specific shocks] -. remain possible .-> E

The paper uses a leave-one-out version of industry growth when constructing the counterfactual. It measures the growth of the rest of an industry rather than allowing coder employment itself to mechanically push up the industry measure. That choice helps avoid a built-in positive correlation between the outcome and its comparison path. The broader intuition remains the same: predict coder employment from the industries’ trajectories while holding the occupational mix fixed, then examine where actual coder employment diverges.

The method answers a question a raw coder chart cannot. A chart may show that coder employment flattened after 2022, but it cannot tell us whether the industries employing coders also flattened. If both moved down together, an industry shock would be a plausible explanation. If the industries continued along a path that should have supported more coders while coder employment lagged, the result is consistent with a change in occupational composition.