A vitriolic debate has engulfed a typically arcane corner of immigration policy: the H-1B visa for college-educated foreigners.

Proponents say the visa is an essential but insufficient pipeline of global talent for hard-to-fill jobs — jobs that have long been part of the lifeblood of the American economy. Critics say visa holders are stealing jobs from American workers and driving down wages. The profanities both sides have lobbed across social media obscure their agreement that the H-1B program isn’t working as well as it should.

Created in 1990, the H-1B is an employer-sponsored visa that authorizes foreigners with “highly specialized knowledge” to work in the U.S. for up to six years. Tech companies and IT consultancies rank among the top recipients. Every year, a government lottery awards 65,000 slots to applicants with an undergraduate degree and another 20,000 to those with advanced degrees (universities and nonprofits are exempt from these caps). The private-sector allocation is typically filled within days.

That companies need to hire the best candidates to remain competitive should be uncontroversial. Ideally, the U.S. system would reliably provide such workers, but too often it fails to. Employers, especially in tech, say domestic workers lack the skills to meet their demands and complain the restrictive cap is hampering innovation in critical sectors, from artificial intelligence to bioweaponry. If the H-1B visa could solve those problems, it’d be worth expanding liberally. It falls short for two reasons.

First, the lottery — by design — doesn’t reward top talent. This deficiency, coupled with loose oversight, has made it vulnerable to gaming and doomed to mediocre results. A recent Bloomberg News investigation found that IT staffing firms routinely flood the pool with entries, often for more visas than they need, crowding out companies that play by the rules. As a result, many of the world’s smartest engineers are shut out from lucrative, in-demand jobs, and shortages at the top end persist.

Second, visa holders with middling skills are more likely to be substitutes for, rather than complements to, American workers. Replenishing the job market with extraordinary talent that can’t be filled domestically increases productivity, innovation and growth; saturating it with lower-paid workers will tend to drive down wages. Official data show that 85% of H-1B petitions are awarded to employers paying well below the median wage.

Bringing the H-1B back to its original purpose should be a priority. Policymakers should start by significantly raising the floor for the H-1B visa salary — from $60,000 today — to a level that more closely matches competitive industry compensation.

Increasing legal immigration will be politically fraught. But few policies have such potential to boost U.S. productivity. Recognizing the shortcomings of the H-1B visa should be the starting point. A more predictable and merit-driven policy would be a win for all sides.

— Bloomberg Opinion