Facebook seems to be inching closer to solving a key Silicon Valley conundrum: how to recruit and retain female engineers.
On Wednesday, the social network released a diversity update, which showed mild improvements across the organization, but a major jump in one area: female new graduate hires in engineering. This year’s new hires are 27% female—a number that is impressive considering the fact that just 18% of computer science majors in the U.S. are women.
While the organization declined to share numbers from previous years, Lori Goler, Facebook’s (FB) VP of People, says this number is an improvement. “What you see in our numbers is a multi-year investment starting to pay off,” she tells Fortune in an exclusive interview. “You’re not seeing a bunch of women we’ve just met for the first time,” she says. It’s the result of years of “relationship-building, training, and investment.”
Goler points to Facebook University (FBU), its summer training program for undergrads from underrepresented groups, as an example of this investment. The hope is that these trainees will join the company after graduation as engineers and business and data analysts (some already have). The program began with 30 engineering students in 2013 and now boasts 500 graduates.
One tool that is especially helpful in recruiting women, Goler says, is having women on campus who have been through the FBU program. Quoting a female engineer in the organization, she quips: “The way to have more women in engineering is to have more women in engineering.”
Subscribe to the Broadsheet, Fortune’s daily newsletter on powerful women.
Back in May, Facebook’s female engineers made the headlines for a very different reason. The Wall Street Journal reported that a former Facebook engineer conducted an internal analysis last year and found that women’s code was rejected more than men’s.
Then and now, Goler maintains that the analysis was done by an engineer who didn’t have access to a complete set of data, and the findings were symptomatic of the fact that the majority of female engineers are at lower levels of the organization. Therefore what looks like preference for code written by men is actually a preference for that written by more senior engineers. (Goler acknowledges that the lack of women in these senior roles is a problem.)
Goler’s team re-ran the analysis accounting for seniority and found no gender bias, she says.
Back in May, the HR chief wrote in an internal memo that the story “almost certainly hurt our ability to attract more women, and it isn’t great for those of us working here, either. In other words, this moves us in the exact wrong direction.” Goler said in her interview with Fortune that her fear of it impacting recruiting hadn’t played out.
The company is seeing greater female representation across the board, with a workforce that is made up of 35% women—an increase of two percentage points since this time last year. The leadership team is 28% female (a 1% increase) and the overall tech team is 19% female (a 2% increase).
One of the organization’s key areas of focus is on retention of female employees—a topic that has gotten more attention in Silicon Valley since former Uber engineer Susan Fowler’s explosive blog post about her experience with sexual harassment and discrimination within the company.
Maxine Williams, Facebook’s global diversity director, says that it has been piloting two new training programs, in addition to its flagship Managing Bias course, in order to foster a culture welcoming to all.
The first, Managing Inclusion, is a program for managers to understand how to support diverse teams, including how to identify micro aggressions. The second, Be the Ally, is a company-wide initiative on understanding various cultural identities.
With regards to sexual harassment, Facebook has employees go through a three-hour Managing a Respectful Workplace training, and has had “robust systems in place” to “identify and report” harassment for more than a decade, Williams says. These systems include a confidential whistleblower hotline.
Recruiting and retaining a diverse workforce is a slow and painstaking process that requires “all sorts of unsexy things,” admits Williams. These include training programs, recruitment, and tracking systems. “There is no silver bullet,” she says.
An earlier version of this article incorrectly stated that 18% of Facebook’s leadership team is female. The correct proportion is 28%.