Alvarez, 35, who worked in the D.A.'s office for eight years, has built his campaign on a vow to root out public corruption. He has criticized Williams, 46, for not getting any corruption indictments and prosecuting fewer criminal cases in general.
This spring, Williams created a three-person public corruption bureau, staffed by veteran former state prosecutors, which he says has been presenting evidence before a grand jury. Corruption "is significant" but it is not one of his top five issues, he said in an interview last week.
"When I'm out at the bus stop, when I'm at the El, talking to people, they are concerned about the gun violence," Williams said during a taped TV debate . "We're doing things to address that."
Alvarez faces an uphill fight - he lacks the name recognition an incumbent D.A. gets, he's in a city where registered Democrats far outnumber Republicans, and his campaign fund is dwarfed by Williams' in the latest filings.
The D.A.'s post, which now pays just over $170,000, has been a stepping-stone. Ed Rendell was district attorney before he was mayor and governor; the last Republican D.A., Ronald D. Castille, is now the state Supreme Court's chief justice. Williams, a Democrat who took the helm in 2009 after Lynne Abraham's 18-year tenure, is sometimes mentioned as a future mayoral candidate.
After taking over, Williams moved swiftly to transform how the office prosecutes cases. He moved to a community-based "vertical prosecution" model in which cases are heard and tried by city region, and prosecutors are assigned to handle cases from start to finish.
Williams said he acted in part in response to an Inquirer investigative series that reported Philadelphia had the lowest conviction rates for violent crimes among large American cities.
He has moved thousands of misdemeanor cases into "diversion" programs - such as Veteran's Court, Marijuana Court, and Dawn's Court for accused prostitutes. He doubled plea bargains - from 4,000 plea deals in 2008, to 8,352 last year. When Williams took office, only 41 percent of felony cases were going through to trial, he said, because many were tossed out for various reasons - such as police officers or other witnesses not showing up to testify.
Now, he said, "Every month, about 75 percent of felony cases are being held for court."
Some critics, including Alvarez, say taking only the strongest cases to court can create a misleading appearance of a higher success rate. "As a former prosecutor, it's very easy to inflate numbers by crossing out tough cases up front," said George Parry, a defense lawyer who was a top deputy D.A. to Rendell.
According to Municipal Court statistics, 62,774 felony and misdemeanor cases were filed in that court in 2008 under Abraham. In 2012, under Williams, that total fell to 52,396.
"I don't think we are too lenient," Williams said in an interview last week. "It's not the severity of the punishment but the certainty of punishment."
He said he had done away with a long-standing tradition of "throwing every case to the wall and seeing what sticks" in court. Instead, he said, "We are going to make sure that we only charge the right people and we are going to charge them with the right crime."
His predecessor, Abraham, declined to comment for this story.
Williams said it was difficult to get an accurate picture of the latest conviction rates. "We have a very poor data system for collecting information," he told the Inquirer editorial board Wednesday. "It frustrates me."
He blamed the Nutter administration for not providing more funding to his office, where he said computers have data software from the 1980s.
Nutter spokesman Mark McDonald said all departments took deep cuts in 2010 but that the city brought back its funding of the D.A.'s office to $31 million in the 2013 fiscal year, similar to 2007 levels - and had spent $356,256 on new PCs and software licenses for Williams' staff.
For his part, Alvarez took shots at Williams' spending decisions. The office should be about prosecuting crime, "not opening up community action centers . . . some of which have one visitor a day," Alvarez said.
Williams couldn't say how many people use the centers, which are located in Northern Liberties and on North Broad Street and Ogontz Avenue, but he defended launching them.
"Having a visible physical presence in the community," he said, sends a message "about justice."
Instead of community centers, Alvarez said, he would put more resources into a corruption unit and more focus on human trafficking, an organized crime he said isn't being fully addressed.
During their only debate, Williams said Alvarez was demoted to the office's child-support enforcement unit because of "subpar" work as a prosecutor.
Alvarez took exception, saying his work in that unit was special. "To minimize that is disrespectful. . . . That's a slap in the face to those kids," he said.
He said Williams had demoted him for trying to unionize assistant district attorneys. Williams said it was the first he had heard of such an attempt - though a labor lawyer, Lance Green, confirmed that Alvarez and a few other prosecutors had met with him in 2010 to discuss a short-lived unionizing effort.
Alvarez, now in private practice, said he brings a fresh perspective and doesn't have any political connections.
"I worry about my kids' future," the father of two said in an interview last week. "A lot of it comes down to political leaders."
Some defense lawyers praised Williams' overhaul of the office and his weeding-out of misdemeanor cases. Guy Sciolla is a huge fan of the changes. "It's probably saved taxpayers a lot of money, and it's saved us a lot of time chasing pie-in-the-sky expectations of convictions," the defense lawyer said.
Others faulted Williams for not reexamining more convictions when new evidence surfaced. That critique came from lawyer David Rudovsky, along with praise for Williams' use of diversionary programs.
"In respect to more serious cases of wrongful conviction, I haven't seen any change at all," said Rudovsky, who has made a career of righting wrongs done to indigent defendants.
Williams said his office can't do everything.
"We have limited resources," he said. "People want me to do more with animal cruelty . . . but I just can't create a unit."
Raised: Cobbs Creek section of West Philadelphia.
Education: Central High School, diploma, 1985; Pennsylvania State University, B.A. in political science, 1989; law degree, Georgetown University law school, 1992.
Philadelphia inspector general, 2005-08.
Lawyer, Zarwin, Baum, DeVito, Kaplan, Schaer & Toddy P.C., 2003-05.
Assistant Philadelphia district attorney, 1992-2003; Philadelphia district attorney, 2000-present.
Family: Divorced; three daughters.
Raised: Springfield, Va.
Residence: Somerton section of Northeast Philadelphia.
Education: Virginia Military Institute, B.A. in English, 2000; law degree, American University Washington College of Law, 2003.
Employment: Assistant Philadelphia district attorney, 2003-11; lawyer, Lamb McErlane, P.C., West Chester, 2011-present.
Family: Married; one son and one daughter.