First, I think there's a base, flat fee even if you're in just one day. Next, some kind of pro-rated per annum amount, based on some multiple of the median income in that state. Additional amounts for, I don't know, each day in solitary, whatever documented medical issues arise (it isn't like we can get anyone to write down prison beatings), and so on.
A separate account is created to pay lawyers whose sole job is to scrub the erroneous conviction, from each and every place it exists. I imagine a group to do this.
Another account is created to pay for therapists, pretty much "for life."
I also think something needs to be set aside for assessment of the person's skills and guidance for retraining, five years of college, whatever.
Room and board for, well, I don't know how many years. Your car got repo'd? Yeah, that's a new car for you.
Essentially, the reasonable and fair thing to do would be do whatever is possible to re-integrate people and make them as whole as is possible: financially, psychically, materially, and so on.