Silicon Valley is Mike Judge and Alec Berg’s biting comedy about the American tech industry, now in its fourth season. Every week, we’ll be taking one idea, scene, or joke and explain how it ties to the real Silicon Valley and speaks to an issue at the heart of the industry and its ever-lasting goal to change the world — and make boatloads of money in the process.

Spoilers ahead for the fourth episode of season 4, “Teambuilding Exercise.”

In the fictional tech industry of HBO’s Silicon Valley, the soul-crushing mundanity of grunt work is often treated as a punchline. Like many sitcoms about careerism and the slog of American professional life, it’s considered an insult to have to do boring, seemingly meaningless tasks just because some higher power demands it. But on last night’s episode, Silicon Valley highlighted a rather pernicious aspect of the tech industry that’s currently serving as the foundation of modern artificial intelligence, shining a spotlight on a type of human labor often overlooked when we discuss the marvels of automation.

In “Teambuilding Excercise,” we have Erlich scrambling to transform his “Shazam for food” idea into a workable app, in order to keep the venture capital money flowing. He has Jian-Yang cook up a working prototype of SeeFood, as it’s so appropriately called, but the test app is capable only of identifying whether a certain food is or is not a hot dog. As is the case with most Silicon Valley gags, there’s an elaborate dick joke here. (In a clever twist, HBO commissioned a developer to turn the prototype into a real mobile app you can download right now, if you live in the US.)

AI relies on humans making sense of data

Running out of time and in need of some massive data crunching to expand SeeFood beyond hot dogs, Erlich convinces newly minted Stanford guest lecturer Big Head to let him assign an introductory computer science class with the task of categorizing pictures of food off the internet. It ultimately backfires on Erlich, as the students decide to launch a SeeFood rival of their own. But the task he assigned the class is a very real and illustrative type of tech industry labor, not unlike the work of the Mumbai clickfarm Jared employed last season to boost Pied Piper’s user metrics.

Because many modern AI advancements are thanks to neural networks, and because those networks must be trained with countless examples so they improve over time, companies often need human beings to help the software make sense of the data. That’s especially true of computer vision, where computers are digesting images as a series of 1s and 0s and must be trained to understand what it’s actually looking at. But it’s also quite common in the realm of chatbots, where text exchanges are reviewed after the fact and then cataloged based on how well the software answered a question or performed a task.

You could call the workers that perform these tasks AI trainers or data annotators, but those roles tend to inflate the importance of the work and downplay its grueling nature. Ultimately, what it comes down to is human beings stepping in when a chatbot or AI program needs assistance, or tirelessly reviewing an algorithm’s decision-making and cataloging its mistakes to ensure it improves over time. Think of it like a specific extension of Amazon’s Mechanical Turk marketplace, where human beings are regularly tasked with performing feats computers are not yet capable of doing for tiny fees.

A number of AI startups have popped up over the last few years, as the field has become one of the most sought-after technologies in the industry. Nearly every single one relies on human labor, often secured through short-term contract agreements, to make the reality of the service or software match both the lofty expectations of its creator and the confused expectations of users.

Startups like Magic rely on cheap labor from the Philippines

Take, for example, the startup Magic, which debuted in 2015 as an on-demand concierge service that let you make virtually any request via SMS, so long as it’s legal. Magic launched its service, which once cost $100 per hour and now costs $35, by employing scores of contractors in the Philippines, where human labor is far cheaper than in the US. The company’s long-term goal is to build AI that can automate away some of the more rote behaviors and routine demands, while humans would increasingly be used only for tasks the software could never perform on its own, like calling Amazon customer service. Yet for now that means having a team of around 150 people, dubbed “magicians,” who are essentially treated like virtual robot butlers by a clientele of mostly wealthy Bay Area types.

Other startups aren’t quite as dependent on human labor just to operate, but rely on it nonetheless to make sure the data coming in is instructive. X.ai, which developed an email assistant that helps schedule and manage appointment in your inbox, uses human trainers to review and correct exchanges the bot has with strangers. That way, it sounds less robotic and more natural over time.

Facebook also engages in this blend of software and human input with its M bot. Launched in beta in fall 2015, M acted like a fully automated personal assistant, but it requires a team of human contractors down in Menlo Park to take control of the bot when, say, someone asks it to call Amazon customer service. Because this model is near impossible to scale to Facebook’s gargantuan user base, M won’t likely exit its experimental testing stage anytime soon. Instead, the company has taken the learnings from M and turned them into features for the broader Messenger user base, starting with suggestions for M to perform tasks calling an Uber for you or picking out a sticker to reply with.

While “Teambuilding Exercise” paints Erlich’s request as the whims of a ludicrous con man, categorizing images of food on the internet not so different than annotating an email exchange or observing a stranger conversing with a Facebook chatbot about ordering a burrito. The work is arduous, boring, and — in the case of content moderators who scan social networks for violent or disturbing content — sometimes psychologically torturing. In the real Silicon Valley, you don’t have to make college students do all this dirty work for school credit. You just need to hire someone as a contractor, with few strings attached, and task them with making the AI of the future smarter and better. Hopefully one day, our phones just might be capable of recognizing more than hot dogs.