Each autumn, businesses flock to elite universities like Harvard and Stanford to recruit engineers for their first post-university jobs. Curious students pile into classrooms to hear recruiters deliver their best pitches. These are the first moments when prospective employees size up a company’s culture and assess whether they can see themselves reflected in its future.

More often than not, this is the moment when these companies screw up, according to new research.

Tech companies have employed a host of tactics to help lift the scant number of women and minorities who work within their ranks, like anti-bias training, affinity groups, and software that scans job postings for gendered language. Yet the numbers remain dire. Of men with science, technology engineering, or math (STEM) degrees, 40 percent work in technical careers; only 26 percent of women with STEM degrees do. That means that qualified women are turning away from the field before they even get started.

Some of the problems start in these preliminary recruiting sessions, which routinely discourage women from applying at all, according to a paper published in February by Alison Wynn, a postdoctoral fellow at Stanford University’s Clayman Institute for Gender Research, and Stanford sociology professor Shelley Correll.

In 2012 and 2013, researchers attended 84 introductory sessions held by 66 companies at an elite West Coast university. (They never explicitly name Stanford, but …) Roughly a quarter of attendees at these one-hour sessions were women, on average. The researchers documented an unwelcoming environment for these women, including sexist jokes and imagery, geeky references, a competitive environment, and an absence of women engineers---all of which intimidated or alienated female recruits. “We hear from companies there’s a pipeline problem, that there just aren’t enough people applying for jobs. This is one area where they are able to influence that,” Wynn says. They just don’t.

The chilling effect, according to Wynn, starts with the people companies send to staff recruiting sessions. As students entered, women were often setting up refreshments or raffles and doling out the swag in the back; the presenters were often men, and they rarely introduced the recruiters. If the company sent a female engineer, according to the paper, she often had no speaking role; alternatively, her role was to speak about the company’s culture, while her male peer tackled the tech challenges. Of the sessions Wynn’s research team observed, only 22 percent featured female engineers talking about technical work. When those women did speak, according to the sessions observed, male presenters tended to interrupt them.

Similarly, the follow-up question-and-answer periods were often dominated by male students who commandeered the time, using it to show off their own deep technical know-how in a familiar one-upmanship. Rather than acting as a facilitator for these sessions, male presenters were often drawn into a competitive volley. Wynn and Correll describe one session in which men asked 19 questions and women asked none. Of the five presenters, the two men fielded all the questions while the two female engineers spoke very little; finally, a female recruiter jumped in at the end with application instructions. This clearly didn’t entice female attendees. Of the 51 men attending, only one left the room during the Q&A. Four of the 15 women left.

The paper also describes recruiters using gender stereotypes. One online gaming company showed a slide of a woman wearing a red, skin-tight dress and holding a burning poker card to represent its product. Another company, which makes software to help construct computer graphics, only showed pictures of men—astronauts, computer technicians, soldiers. Presentations were often replete with pop-culture images intended to help them relate to students but instead furthered gender stereotypes. One internet startup, for example, showed an image of Gangnam-style music videos that featured a male artist surrounded by scantily clad women.