There are some skeptics out there who see more hype than hope with regard to the new “progressive” prosecutors who’ve been sweeping into office across the nation. But the residents of Philadelphia, at least, seem to have elected the real deal in Larry Krasner, who managed to become the top prosecutor in Philly despite being a former criminal defense attorney who loves to sue the cops.

Among many exciting policies coming out of Krasner’s office is his recent plan to start a sentence review unit. To be clear, this is not a conviction review unit, which focuses on cases that may have been adjudicated incorrectly. What Krasner wants to review are the sentences attached to legitimate convictions. This is cause for real hope. If you want to undo mass incarceration, releasing a few poor souls who never committed any crime in the first place is a good deed but not a solution. Cutting the ridiculous sentences that have so long characterized the American criminal justice system is an actual path forward.

Reviewing sentences might also provide an opportunity to examine the mechanism by which nearly every defendant in the criminal system is convicted: the plea bargain. There has been a lot of great writing about plea bargaining’s “innocence problem,” specifically that the ratio between the trial penalty and the plea bargain penalty is so out of whack that many totally innocent people plead guilty out of fear of a massive sentence after trial.

But what might emerge during the review of sentences in Philadelphia and elsewhere is plea bargaining’s “guilt problem”—that is, that the plea bargain conviction can be totally untethered from what the defendant actually did. Guilty defendants sometimes plead to crimes they never committed to avoid harsh collateral consequences that are attached to the actual crime.

Here’s a real example from my research: A defendant is charged with marijuana possession in Washington state. Knowing that the charge will make him deportable, he negotiates to a charge of inhaling toxic fumes (which is actually a crime in Washington). Inhaling toxic fumes doesn’t carry the same dire immigration consequences, nor does it have any basis in reality. It functions as a sort of floating conviction of convenience.

In Ohio, a local judge has called attention to this issue by documenting 400 felony sex offense charges in his jurisdiction that were negotiated to non–sex crimes offenses, like kidnapping and aggravated assault. These negotiations presumably took place so the defendants could avoid sex offender registration requirements. A public defender in California has noted that her clients will plead guilty to anything to avoid being sex offenders. And courts and prosecutors allow them to do it.

The case law in this area has been scant, but courts have tended to look favorably on these fictions. The New York Court of Appeals held it was no problem that a defendant charged with animal cruelty took a plea to criminal trespass “even though there was no common factual or legal predicate for the charge.” It was perfectly fine, the court said, because the defendant knowingly pleaded guilty to a crime he didn’t commit to avoid the “stigma” associated with an animal cruelty conviction.

It seems like the factual basis requirement that accompanies most pleas under Rule 11 of the Federal Rules of Criminal Procedure (or its state counterpart) would prevent this outcome. In fact, as Justice John Paul Stevens noted in his dissent in 1995’s Libretti v. U.S., a plea should require a legitimate factual basis. But 15 years later in Padilla v. Kentucky, which held that defense attorneys must advise their clients about the immigration consequences of a plea bargain, it was Justice Stevens declaring that prosecutors and defense attorneys should negotiate “creatively” to avoid the deportation consequence for a defendant. But how could the defendant in Padilla—a drug trafficking case—have negotiated around deportation? The reality is that almost all drug charges are deportable offenses. The creativity Stevens describes would’ve had to come in the form of finding a real crime to match imaginary conduct. And indeed that’s exactly what many lawyers do in such cases.

It’s not hard to see how plea bargaining’s guilt problem relates to Krasner’s heralded new sentence review program. Particular sentences are attached to particular convictions. In order to figure out what sentence someone “deserves,” you need to know what they’ve done. And convictions are poor markers for understanding what criminal act someone did or did not perpetrate.

Why is this the case? There are many answers, but one of the most important is that federal and state legislatures have imposed mandatory collateral consequences on a huge range of criminal convictions. These consequences include deportation and sex offender registration, but also the loss of public housing or student aid. (Here’s a state-by-state list of thousands of collateral consequences.) As a result of these consequences, defense attorneys and prosecutors are often looking for a way around noncriminal sanctions that would unfairly harm the defendant. Sometimes, fudging a plea bargain may be the only way.

Sentence review units like the one in Philadelphia are set up to examine defendants’ actual pleas, not the consequences they sought to avoid in making those pleas. Solving plea bargaining’s guilt problem will require a more comprehensive overhaul, one that demands all the stakeholders in the criminal justice system to understand that a guilty plea doesn’t always tell us what a person is guilty of.