SAN FRANCISCO — As corporate legal departments push for increased diversity in the outside counsel they hire, many departments are mirroring those efforts in-house, working with a national organization that provides training and education to minority attorneys through several programs.

Early this year, HP Inc. said it would withhold payments from outside counsel that do not meet diversity requirements. And an April 3 The New York Times report said Facebook Inc.’s legal department requires outside counsel teams working directly on a matter to be 33 percent composed of women and ethnic minorities. Law is still one of the least diverse professions, according to many surveys.