WorksComputer Science
From Arraignment to Resolution: Transformer Models of Court Cases
Abstract
The criminal legal system is composed of many complex decision points, such as which charges are pursued, how bond is determined, plea deal negotiations, and sentencing. Given the profound impact of such decisions, there is a growing need to increase the transparency within this system. While prior machine learning approaches have focused on modeling single decisions (e.g., recidivism), this paper proposes a transformer-based time series model to forecast the outcome of the next proceeding in a case (e.g., charges accepted, bond set, plea deal made, etc.). By modeling a case as an event sequence, we enable a more nuanced analysis to support better oversight and understanding of decision making. We conduct an empirical analysis of thousands of cases using a newly constructed dataset derived from publicly available court records of a mid-sized U.S. city. We fit models that combine textual data from clerk notes with structured information about the defendant, prior charges, and courtroom. Our transformer model achieves micro-F1 on a 20-class multi-label task, a significant improvement over several baselines and comparable to a GRU trained on the same input. We demonstrate how the model can be used to provide insights into decision-making and help court observers identify emerging issues within the jurisdiction studied.
Introduction
Each year, millions of people pass through criminal court in the United States. Each case is the product of a chain of decisions: initial appearance, bond determination, arraignment, continuances, plea negotiations, and, in a minority of cases, trial and sentencing. At every step, decisions are made by judges, prosecutors, and defense attorneys, and those decisions narrow the set of possible outcomes for the defendant. The cumulative effect is significant, determining whether a defendant spends weeks or months in pre-trial detention, what charges are pursued or dropped, and ultimately, what sentence is imposed. Yet, the patterns underlying these decisions are difficult to study at scale. Instead of structured event fields, what actually happens at each proceeding is often recorded in free-text clerk minutes. This combination of unstructured input and missing event labels is a practical barrier. Oversight bodies and researchers who would like to identify disparities or audit decision-making have few tools that operate at the level of the individual proceeding, because building one requires first converting clerk text into a consistent, machine-readable label of what occurred, and fitting proceeding-level outcome models.
Machine learning research on the criminal legal system has not, to date, addressed this gap. The dominant line of work focuses on a single, terminal prediction, such as recidivism, failure-to-appear, or pretrial release, and often uses structured features available at a single point in time [2, 7, 22, 9, 23]. This strand of research collapses an entire case into a single prediction target and obscures how decisions accumulate over the course of a case. No previous research provides a modeling framework for the question most relevant to our research: Given everything that has happened in a case so far, what is likely to happen next?
In this paper, we propose a transformer-based model that answers this question. We treat each case as a chronologically ordered sequence of proceedings, where each proceeding is represented by a multi-modal feature vector combining frozen pre-trained BERT embeddings of clerk notes with structured information about defendant demographics, charges, prior case history, bond amounts, procedural stage, and the assigned court section. At each step, our model predicts a multi-label vector over twenty outcome labels that span a full case, including bond decisions, charging decisions, probable cause determinations, plea entries, trial verdicts, and sentencing. Two features of the task require non-standard design choices. First, proceedings occur at irregular intervals rather than on a fixed temporal grid. To capture this, we represent absolute calendar time as a one-hot month-year vector concatenated into each proceeding’s feature representation, in addition to standard learned positional embeddings that encode step order within a case. Second, multiple events frequently occur within a single proceeding, which we accommodate by applying multi-label supervision at each step.
We construct a balanced dataset of 2,533 cases and 19,459 proceedings from the publicly available court records of a mid-sized U.S. city. We evaluate our model under 5-fold cross-validation against three baselines: a frequency-based random classifier, a multi-layer perceptron that predicts final case outcomes from the features available at the first proceeding, and a GRU trained on the same proceeding representation as the transformer. The transformer model achieves a micro-F1 of .5715 on proceeding-level prediction, a 215% improvement over the random baseline (.1812). The GRU reaches .5886, which is not statistically distinguishable from the transformer. When restricted to terminal outcomes for a fair comparison with the completion-only baseline, the transformer outperforms the MLP completion predictor by .0831 micro-F1.
Our work offers four main contributions. First, we introduce the task of proceeding-level prediction as a new task for criminal justice analysis. Second, we propose a transformer architecture that handles irregular temporal spacing and heterogeneous multi-modal inputs, and evaluate it against baselines. Third, we construct a new dataset of proceeding-level court records annotated with twenty outcomes. The records themselves cannot be redistributed for legal and privacy reasons discussed in Appendix I. Instead, we release our full label extraction and modeling pipeline along with a schema-identical synthetic dataset. Fourth, we conduct a multi-method interpretability analysis that combines ablation studies, Integrated Gradients attributions, counterfactual sensitivity, and clustering of learned representations to characterize both what the model relies on and the structure it has discovered in the data.
Beyond prediction, the model serves as an analytical tool for studying court decision-making in the jurisdiction studied. Counterfactual sensitivity analysis quantifies how predictions shift when case attributes are perturbed, showing that the model is most responsive to prior case count and less sensitive to race. Clustering the learned case representations reveals procedural trajectories, such as cases where charges are refused at the preliminary hearing stage, cases that proceed to trial, and detained defendants who plead guilty and receive jail time. Finally, gaps between confident predictions and observed outcomes flag potential procedural anomalies. Together, these applications let oversight bodies characterize what drives court decisions and flag cases within the studied jurisdiction for closer examination.
Related Work
Prior work on machine learning for criminal court has focused almost exclusively on single-decision prediction. Risk assessments, such as COMPAS, have been scrutinized for cross-racial accuracy disparities [2]. Algorithmic approaches to pretrial release have used gradient-boosted trees [9] and hierarchical Bayesian models [23] to study bail decisions. Legal Judgment Prediction (LJP) extends this paradigm to case text, using methods ranging from SVMs [1] and hierarchical BERT variants [4, 15] to joint multi-task frameworks that predict law articles, charges, and penalties simultaneously [24, 12]. The work most structurally similar to ours is Polo et al. [17], who classify Brazilian proceedings into a three-way status label from clerk-written motions using LSTMs and BERT; however, they collapse all proceedings into a single case-level label rather than predicting the next event. On the sequence modeling side, transformer models for health records [13] and career trajectories [20] demonstrate that such architectures generalize well to irregular event streams with structured covariates, motivating our adoption of the same paradigm for criminal court. Our work differs from all of the above in that we predict the multi-label outcome of the next proceeding rather than a terminal case outcome. Alongside these computational approaches, courts are also studied through non-computational forms of oversight, such as court-watching programs. Courtwatching programs recruit volunteers to observe proceedings and report on bail practices, presence of attorneys, and the conditions within the courtroom, and operate in many US jurisdictions, including Court Watch Massachusetts, Court Watch Chicago, Court Watch NOLA, and Court Watch New York City [8, 18]. These volunteers record what dockets omit, but their capacity limits the scope of their observations. A full survey of related work appears in Appendix § 10.
Dataset
We construct our dataset from the criminal court records of a mid-sized U.S. city, where we have cases of varying complexity and duration. The criminal court system in this city is split across two court types by procedural stage, which we will refer to as Court A and Court B throughout the paper for the sake of anonymity. Court A handles proceedings in the early stages of a case, where events such as initial appearances and bail determinations would occur, while Court B deals with the proceedings of the later stages of the case, having to deal with arraignments, plea hearings, trials, and sentencing. We merge records from both to construct unified case-level sequences.
Proceeding Information Each proceeding contains structured and unstructured information: (1) clerk notes which document judicial decisions, attorney requests, and procedural actions; (2) defendant demographics which include race (6 categories), gender (3 categories), and age at the initiation of a case; (3) criminal charges for an individual for a specific case which draws from a vocabulary of 2,139 charge types; (4) the month-year timestamp that corresponds to this proceeding; (5) bond information (original bond amounts, cumulative bond amounts); (6) the identification of Court A section (for proceedings that take place in Court A); (7) prior criminal history for a given defendant (prior case count and the aggregated prior charges) using only cases that precede the given proceeding.
Outcome Labels We extract outcome labels representing key legal events from clerk notes using a regular expression pipeline (Table 2). These outcomes span the full length of a case, from initial hearings to final case disposition. A subset of 5 outcomes represents case-terminating events (charges refused, probable cause not found, trial verdict
| Label | Count |
| Continuance Occurred | 5,424 |
| Bond Set | 3,703 |
| Court Appointed Public Defender | 3,173 |
| Pre-Trial Conference Held | 3,128 |
| First Appearance Hearing Occurred | 2,589 |
| Charges Refused | 1,848 |
| Defendant in Custody and Not in Court | 1,693 |
| Pled Not Guilty to Charges | 1,633 |
| Probable Cause Found | 1,431 |
| Pled Guilty to Charges | 1,077 |
| Bond Not Set | 991 |
| Defendant Released on Own Recognizance | 899 |
| Sentence Including Jail Time Imposed | 806 |
| State Was Not Present | 685 |
| Domestic Stay-Away Order Imposed | 546 |
| Charges Accepted | 462 |
| Ankle Monitoring Imposed | 456 |
| Probable Cause Not Found | 442 |
| Trial Verdict Reached | 404 |
| Sentence Without Jail Time Imposed | 401 |
| Total | 31,791 |
Table 2. Label distribution
reached, sentences with or without jail time), which we evaluate separately in our baseline comparisons.
We developed the extraction patterns through iterative review of matched and unmatched clerk notes. For manual validation, we sampled and annotated 100 entries to ensure each outcome label appeared at least five times. We found no extraction errors in the sample.
Data Processing We apply several filtering steps, restricting to cases with complete defendant demographics, with a single defendant, with extractable outcome labels, and removing extraction cases that involve multiple jurisdictions. To address class imbalance, we employed stratified sampling to make sure that there is representation of rare but significant outcomes. This was done by first identifying outcomes that appear in fewer than 400 cases and including all such cases in our dataset, then randomly sampling additional cases to reach 2,533 cases.
Table 1 presents key statistics of the balanced dataset. The dataset has major variations within case complexity, from sequences ranging from 2 to 61 proceedings and a median of 7 proceedings per case. Figure 1 shows the right-skewed nature of case lengths, with 58% resolved in less than 8 proceedings, and a long tail up to 61 proceedings. On average, each proceeding has 1.6 labels, which reflects that these proceedings have multiple decisions made at a single proceeding. Table 2 shows the distribution of outcome labels across all proceedings in the dataset. The distribution shows significant class imbalance, as previously stated, and reflects the reality of criminal court proceedings, since most cases involve multiple procedural hearings before reaching a resolution, and most cases are resolved through plea deals.
| Cases | 2,533 |
| Total proceedings | 19,459 |
| Mean sequence length | 7.68 |
| Median sequence length | 7 |
| Max sequence length | 61 |
| Labels/proceeding | 1.63 |
Table 1. Dataset statistics

Figure 1. Distribution of proceedings per case
Methods
Notation and Setup
Let be our dataset of cases, where
is a chronologically ordered sequence of proceedings of variable length ;
is the corresponding sequence of multi-label outputs, with a binary vector over outcome labels.
At prediction step , the model observes and predicts the next outcome vector , for .
Proceeding Representation
Each proceeding at time is represented by a fused feature vector that concatenates information about the case and defendant:
where is the proceeding text, encodes the defendant’s demographics (race, gender, age at case initiation), is the charge-count vector of case as of proceeding , and is the assigned section of Court A. The term is the multi-label vector at the previous proceeding, which is set to at . is the aggregated set of all prior charges for the defendant prior to the time of proceeding . indicates whether the proceeding occurs in Court A or Court B. are the original and total bond amounts in dollars. is the prior case count of the defendant; is the month-year of the proceeding.
We write for learned embedding functions and for deterministic encoders. is a pretrained bert-base-uncased model [6] whose weights are frozen. discretizes a bond amount into one of nine bins (including a “not set / missing” bin) and returns a one-hot vector. returns a one-hot month-year encoding. Scalars and binary indicators are concatenated directly. (See Appendix § 11 for more details.)
Model Architecture
Given , the model computes:
where is the learned positional embedding, is the upper-triangular causal mask, , , and is the element-wise sigmoid producing independent label probabilities. Under teacher forcing, the encoder output at position produces the prediction for the labels of the next proceeding. At test time, the model never observes the fields from proceeding when predicting . The initial state of the sequence omits all proceeding text, bonds, and prior label features, representing the information available prior to the first appearance hearing.
Training objective
We train the model by minimizing the average binary cross-entropy loss applied independently to each of the labels:
Experiments
We compare with three baselines:
MLP Baseline This baseline trains a static multi-layer perceptron that predicts the final case outcomes based solely on the features available at the initial proceeding in order to determine if time sequence modeling is truly necessary for this task. The input includes the defendant demographics, initial charges, and Court A section, processed through a 3-layer network.
Frequency-Based Random Classifier This baseline establishes a lower bound on performance by sampling labels based on their training frequencies and ignoring the input features entirely. For each test proceeding, given its ground truth label count , we sample labels without replacement. This evaluates our transformer’s ability to perform better than a random guess, which has only been informed by the prevalence of a class in our training data.
GRU Baseline This baseline trains a gated recurrent unit (GRU) on the same proceeding sequences as the transformer. For each proceeding , the GRU updates its hidden state as and predicts . The two models share the same component embeddings, fusion layer, training objective, 896-dimensional hidden representations, optimizer, learning rate scheduler, and cross validation folds. Since recurrence is causal by design, the learned positional embedding PE and the causal mask are not used for this baseline. We select the depth of the GRU based upon validation performance, which is 2 layers.
We primarily evaluate model performance using the micro-averaged precision, recall, and F1 scores.
The step-level results use top- selection, where is the number of outcomes actually observed at each proceeding. Therefore, precision, recall, and micro-F1 score are all equal at this level. We adopt this selection rule to avoid making our main results dependent on a classification threshold, while recognizing that it inflates absolute performance because would not be known in practice. Appendix K reports the threshold-based results. To establish a fair comparison with our first baseline model, we additionally report results in which the transformer’s output is restricted to the subset of completion labels and evaluated only at the final input proceeding of each case. For additional implementation details and results, please see the Appendix.
Classification Results
We evaluate our model across three levels: step-level (prediction at each individual proceeding), completion-level (final case outcome prediction given full case history), and case-level (step-level predictions aggregated across the full case). Because these levels differ in what is predicted and when, metrics are not comparable across them. Step-level metrics are computed over individual proceedings, so a label recurring within a case contributes once per occurrence. On the other hand, case-level metrics are computed over cases, so each label contributes at most once per case. Therefore, support totals will differ. We report results at each level, followed by ablation, interpretability, and fairness analyses.
Table 3 illustrates the step-level performance under 5-fold cross-validation, where the model predicts outcome labels after each individual proceeding. Our full transformer model achieves a microF1 score of , which substantially outperforms the random baseline (). This demonstrates that the model learns meaningful sequential patterns from the data. The GRU baseline reaches , within fold-level variance of the transformer. Although the GRU performs slightly better, we use the transformer for the analyses done because its per-position outputs directly incorporate all prior proceedings rather than relying on a recursively compressed summary, making attributions and case representations comparable across positions within a case.
| Model | F1 | Precision | Recall |
| Transformer | .5715 ± .013 | .5715 ± .013 | .5715 ± .013 |
| GRU Baseline | .5886 ± .013 | .5886 ± .013 | .5886 ± .013 |
| Random Baseline | .1812 ± .004 | .1812 ± .004 | .1812 ± .004 |
Table 3. Step-level performance (mean ± std)
Table 4 reports the performance for completion-level models, where models observe the full case history and predict only the final case outcome. This task is quite different from the one shown above and should not be compared across tables. The transformer completion achieves a micro-F1 of which outperforms the MLP completion baseline () by . This difference is statistically significant across the five folds (95% CI [, ]; , ).
| Model | F1 | Precision | Recall |
| MLP Baseline | .4864 ± .025 | .5118 ± .027 | .4634±.023 |
| Transformer | .5695±.014 | .7534±.010 | .4579 ± .016 |
Table 4. Completion-level performance (mean ± std). Not comparable to Table 3.
Table 5 reports the proceeding-level per-label performance for the full transformer under 5-fold cross-validation. The model performs strongest on frequent outcomes such as “First Appearance Hearing Occurred” and “Court Appointed Public Defender”, but does poorest on rare outcomes such as “Charges Accepted”, “Probable Cause Not Found”, and “Bond Not Set”. (See the Appendix for case-level results, where aggregation across proceedings raises performance substantially.)
| Label | F1 |
| First Appearance Hearing Occurred | |
| Court Appointed Public Defender | |
| Bond Set | |
| Pre-Trial Conference Held | |
| Domestic Stay-Away Order Imposed | |
| Pled Not Guilty to Charges | |
| Charges Refused | |
| State Was Not Present | |
| Probable Cause Found | |
| Defendant Released on Own Recognizance | |
| Continuance Occurred | |
| Ankle Monitoring Imposed | |
| Sentence Without Jail Time Imposed | |
| Pled Guilty to Charges | |
| Sentence Including Jail Time Imposed | |
| Defendant in Custody and Not in Court | |
| Trial Verdict Reached | |
| Probable Cause Not Found | |
| Bond Not Set | |
| Charges Accepted |
Table 5. Proceeding-level per-label F1 performance (mean std over 5 folds), sorted by F1 score.
Ablation Studies To assess the contribution of individual input components, we conducted ablation experiments, systematically removing proceeding text, defendant demographics, prior labels, and combinations of these. Table 6 shows that removing proceeding text yields the largest single-component drop (Micro-F1 of , Micro-F1 of ), which confirms that proceeding text is the primary driver of predictive performance. The combined removal of proceeding text and prior labels produces the largest degradation overall (Micro-F1 of , Micro-F1 of ), which indicates that these two components are jointly critical and partially complementary.
| Model | Micro F1 | Micro-F1 |
| Transformer | ||
| No Text | ||
| No Demographics | ||
| No Prior Labels | ||
| No Text or Prior Labels |
Table 6. Ablation results under 5-fold cross validation relative to the transformer model (mean std)
Applying the model to court analysis
Given the validated predictive model, we next turn to an examination into the ways in which such a
model may be analyzed to provide insights into court decision making and to help court observers identify emerging issues of interest. The findings below reflect practices within the court studied.
Sensitivity
First, we assess how sensitive the model is to demographic and case attributes. As the model has been trained on historical decision making, probing the model in this way provides a method to understand which factors may play a role in decision making. To do so, we conduct a counterfactual perturbation analysis ([11]). For each prediction, we replace a feature value with an alternative value, holding other inputs fixed (e.g., the age of a defendant is modified from young to old). We then record the shift in posterior probability over the predicted labels that results from the feature substitution. We compute the average shift across all proceedings in the held out set (denoted ) and report 95% confidence intervals using the -distribution. Figure 2 shows sample per-label probability shifts for three features: prior case count, age, and race.

Figure 2. Counterfactual sensitivity analysis.
Overall, sensitivity is highest for legally relevant covariates and lowest for protected demographic attributes. Prior Case Count produces the largest perturbations, with a mean of .0032. The model predicts that defendants with high prior case counts are less likely to be released on their own recognizance (without paying bail) and are more likely to be in custody and not present at a hearing. These results reflect that prior court involvement is strongly associated with the court decisions recorded here, and also indicate that cases involving defendants with prior charges may have increased delays due to defendants missing hearings while in jail.
Age produces moderate perturbations, with a mean of .0017. The model predicts that younger defendants are more likely to have ankle monitoring imposed (electronic tracking device), to have a public defender appointed, and to have cases where probable cause is found. The increased probability for ankle monitoring may reflect increased perceived flight risk due to weaker community ties, or may reflect assumptions that younger defendants need greater oversight.
Race produces smaller perturbations, with a mean of .0009. We focus on the three largest
groups in the dataset: Black, White, and Hispanic defendants. The model predicts that Black defendants are more likely to have a public defender appointed and more likely to have cases where probable cause is found. While the magnitudes are lower than for Prior Case Count and Age, the directionality is consistent with prior work on racial disparities in criminal courts [16].
Clustering
To discover groups of cases that exhibit similar temporal patterns, we perform a cluster analysis, using case representations learned by the transformer model. We extract the pre-classifier head transformer embeddings, apply StandardScaler normalization followed by L2 normalization, reduce to 50 principal components with Principal Component Analysis, and project to two dimensions with t-SNE. Then, we assign each case to a cluster by running K-Means (, ) directly on the two-dimensional t-SNE coordinates.2 Figure 3 shows the per-label presence across the embedding space colored by cluster; Figure 4 shows the multi-label composition heatmap per cluster. The arrangement of cases in the t-SNE projection corresponds roughly to differences in their procedural trajectories. Variation across Dimension 1 appears to be associated with case time and whether charges are accepted. Dimension 2 is more nuanced, though cases with higher values appear to correspond to cases that conclude with a trial verdict (Figure 3, bottom panel). Because t-SNE dimensions do not have intrinsic meanings, we treat these associations as descriptive patterns rather than definitive interpretations of these axes.

Figure 3. Clustered cases highlighting those containing three outcome labels.

Figure 4. Labels by cluster.
Cluster 3 () is the most interpretable. It is defined by near-universal Charges Refused (98%),
the highest Probable Cause Not Found rate (42%), and near-zero rates for all plea and sentencing labels, including Pled Guilty to Charges and Trial Verdict Reached. This cluster captures cases terminated at the preliminary hearing stage, where the state’s charges are refused before the case reaches a plea, verdict, or sentencing stage.
Cluster 0 () also shows a high Charges Refused rate (77%) but retains some Probable Cause Found (28%), suggesting cases where charges were ultimately refused after brief engagement with the court. Cluster 4 () has the highest Trial Verdict Reached rate (47%), alongside high Pretrial Conference Held (84%), Continuance Occurred (87%), and Probable Cause Found (66%). This cluster captures the small subset of cases that proceed through the full adversarial process to a verdict.
Cluster 5 () is distinguished by the highest Defendant In Custody And Not In Court rate (55%), high Pled Guilty to Charges (78%), and a high Sentence That Includes Jail Time rate (49%). This profile reflects detained defendants who ultimately enter guilty pleas and receive sentences. Clusters 4 and 5 differ mostly in their disposition mode rather than how far a case progresses. Cluster 5 contains more cases in which the defendant pled guilty, whereas Cluster 4 contains more cases that reach a trial verdict.
Clusters 1 () and 2 () share broadly similar profiles, including high Pled Not Guilty To Charges rates (98% and 97%), high Continuance Occurred rates (84% and 77%), and moderate-to-high sentencing rates. They differ in Pretrial Conference Held rates (90% versus 40%) and Pled Guilty to Charges rates (72% versus 55%). This suggests that Cluster 1 cases undergo more extensive pretrial proceedings before resolution.
Outlier Analysis
One value of this model to oversight is the ability to identify cases that deviate from model expectations. This can help surface potential procedural anomalies that warrant closer inspection. Here, we give examples of how this model could be used for monitoring the use of stay-away orders (SAOs). SAOs are operationally significant because they have immediate behavioral consequences: they prohibit the defendant from contacting or approaching the protected party, and violation carries criminal penalties. Ensuring consistent application of SAOs thus has important safety implications.
In a ten proceeding case involving domestic abuse battery, domestic abuse second offense, and domestic abuse child endangerment, our model predicted a Domestic Stay-Away Order at Step 0 with very high confidence (.995), but there was no Stay Away Order recorded at this step. Given that these charges are squarely within the class of offenses for which a domestic SAO is routinely issued at first appearance in this jurisdiction, and that the second offense designation indicates a repeat-offender pattern already visible in the charge itself, a confident SAO prediction is a legally sensible prediction. The clerk note for Step 0 makes the source of the discrepancy explicit. The court wrote, “The court could not issue a domestic stay away order in this matter as no victim information was provided to the court.” The court was prepared to issue an SAO, however it was blocked due to no victim information available at the time of the hearing. Such cases can arise if, e.g., the police report does not contain victim information or if this information was not transmitted to the court in time for the hearing.
Similar patterns appear elsewhere: another high-confidence false positive (.97) involves a defendant charged with domestic abuse battery whose prior record includes additional domestic-violence offenses, where no SAO was issued at Step 0 because the defendant was never transported to court. This can occur when the defendant is already in jail but was not brought to court by the sheriff’s office. Using the model to identify such discrepancies can help court observers better advocate for reforms that ensure procedural consistency.
Integrated Gradients
Since a major goal of the project is to support oversight rather than automate decision-making, interpretability is critical to our evaluation process. To understand which input components drive model predictions, we use Integrated Gradients [19] implemented through the Captum library (Kokhlikyan et al., 2020).
The BERT text embedding achieves the highest mean raw attribution by a wide margin (), followed by the case embedding () and prior charge embedding (). The BERT embedding attribution is highest for Pled Guilty to Charges () and Sentence That Does Not Include Jail (). The case embedding similarly shows its strongest attributions for Pled Guilty to Charges () and Sentence That Does Not Include Jail Time Was Imposed (), mirroring the BERT embedding’s pattern for sentencing outcomes. (See Appendix § 16 for more details.)
Integrated Gradients and ablation studies (§ 6) independently identify clerk-note text as the dominant predictor, with structured case context (i.e., charges, prior labels, etc.) as a distant second, and defendant demographics, court identifiers, and bond/temporal scalars contributing to a lesser extent. Combined with the counterfactual results in § 7.1, these consistent findings demonstrate that the model relies more on legally relevant content than demographic attributes.
Conclusion
Our results support three conclusions: (1) proceeding-level predictions are feasible at scale, with the full transformer achieving a micro-F1 of .5715 and outperforming random and static MLP baselines and comparable to the GRU baseline; (2) clerk note text is the dominant source of predictive signal, as removing proceeding text produces the largest single-component ablation drop and Integrated Gradients assigns the BERT text embedding the highest attribution scores; (3) the model is more responsive to case-specific information than demographic attributes. Together, these findings show that proceeding-level modeling can move beyond static risk-style prediction toward a more dynamic account of how criminal cases unfold over time. They also suggest that interpretable sequence models can serve as useful tools for empirical court observation, helping researchers and court watchers identify patterns, anomalous cases, and points in the process where legal outcomes appear to shift. We emphasize that our empirical findings characterize the recorded practice of the single jurisdiction we study and should not be read as general claims about criminal courts. The proceeding-level modeling framework itself, however, is not jurisdiction-specific. Applying it elsewhere would require adapting the label extraction and features to local court data and retraining the model [22].
Limitations
One limitation of this analysis is that it relies upon text extraction from clerk notes to identify event outcome labels. While we have validated these through iterative review, errors in our extractors would influence the validity of our results. The reliance on regular expressions comes from the data infrastructure in most US court systems, which rarely gives clean, structured event information for public auditing. The state of a case is also determined by the data entry clerk, which introduces noise that caps the performance of any model trained on our data. Our manual validation confirms that the extracted labels are correct, but it cannot determine how many labels we miss. Each of the twenty labels appeared at least five times in the sample of 100 entries, and every extraction was correct. However, events whose phrasing our patterns fail to match are silently absent from the label set. These false negatives are unobserved by both the model and our evaluation and are treated in the training data as true negatives. Thus, this understates the prevalence of affected outcomes.
Another limitation is generalizability beyond the jurisdiction studied. Although our modeling framework is jurisdiction-agnostic, the patterns identified in the paper reflect the practices of the criminal court system in a mid-sized U.S. city and should not be interpreted as general claims about criminal courts. Applying this elsewhere would require significant local adaptation. The regular expression extractors encode court-specific abbreviations, phrasing, and clerical conventions and would need to be rewritten to fit the local clerk minutes.
Additionally, the charge vocabulary, the Court A and Court B split by procedural stage, and section identifiers are specific to this jurisdiction and would need to be adapted for use elsewhere. The model would also need to be retrained on local data.
A related limitation extends beyond label extraction itself to the underlying records in which the label extractor operates. Clerk minutes and structured fields, such as the case identifier and charge codes, are entered by hand at the time of each proceeding, and our dataset inherits whatever transcription, attribution, and classification errors occur during this process. We have directly observed proceedings that appear in cases in which they do not belong, which is the result of a clerk entering a wrong case identifier when they enter their clerk notes, as well as proceeding text that references events or charges from unrelated matters. These kinds of errors are not unique to the jurisdiction studied in this paper. Because we have no independent ground truth against which to identify these errors at scale, the model is trained on a corpus that contains an unknown rate of cross-case contamination, miscoded charges, and incorrect procedure attributions, which sets a ceiling on achievable performance and may bias per-label metrics.
Another limitation is how the case embedding was set up, as we mapped charge descriptions to dense vectors. We apply a linear projection layer to a vocabulary count vector and initialize its weights randomly rather than using pre-trained semantic embeddings. As a result, the model treats semantically hierarchical charges, such as “Possession of a Schedule 1 Drug” or “Possession of a Schedule 1 (2 Grams)” as orthogonal and unrelated features. The model cannot infer that the specific charge with the dosage is a subclass of the general charge. This means that it must independently learn the consequences of a given charge from scratch. For rare, specific charges, such as the one above, the sparsity of the training data would mean that the model might fail to learn these weights effectively.
A further limitation is that we do not report disaggregated evaluation [3]. Our counterfactual sensitivity analysis (§ 7.1) measures changes under demographic and case-attribute substitution, not whether error rates differ across defendants of different race, age, and gender. Thus, our finding that the model relies more on case characteristics rather than defendant demographics should be interpreted as a result about feature sensitivity and does not establish that performance is equitable across demographic groups. We leave such an evaluation to future work.
Lastly, because we cannot redistribute the source records (Appendix § 18), our specific results are not independently reproducible without obtaining the underlying data from the court. The released pipeline and synthetic dataset allow inspection and rerunning of the method and label extraction, but not the numbers reported here.
Ethical Considerations
Usage
When To Use It
The model is designed as an auditing and oversight tool for researchers, attorneys, reform advocates, and oversight bodies to better understand patterns and bias within the criminal court system’s proceedings. It should be used on retrospective and aggregate analysis rather than individual case adjudication. For example, the model could be used to identify cases where outcomes deviated significantly from predictions, highlighting procedural irregularities or biases that occur for further investigation. It could also serve to measure policy improvement, seeing whether model predictions change after the establishment of a new policy and whether it achieves its intended effect.
When Not to Use It
This model should never be used as an automated decision-maker, as the system is designed to audit human decision-making rather than replacing it. It should not be used to make or influence decisions affecting bail, charging, plea, or sentencing for a defendant. If the model were to replace human judgment, the possible errors that would occur could directly harm defendants, while as an auditing tool, the errors could cause researchers to investigate the reasoning behind them.
Positive Impacts
This research has the potential to increase transparency and accountability within the criminal court system of this jurisdiction by providing the tools that enable the researchers and oversight bodies to identify patterns in outcomes. Public defenders and legal aid organizations can utilize such tools to uncover systemic issues that affect their clients and, therefore, advocate for possible policy changes. Additionally, this research could empower journalists and researchers to conduct more research into the operations of this court system.
Potential Harms
Despite our intentions for this model to be used as an auditing tool, there could be some harms that come along with its deployment. The obvious risk is the potential of misuse, as discussed above. Another significant risk is privacy concerns as the model uses publicly available court records; the aggregation or analysis of data at scale could lead to the identification of individuals.
Mitigation Strategies
We adopt several mitigation strategies to limit the risks identified above.
The first concerns restricting deployment to oversight rather than adjudication. Model outputs are framed throughout the paper as an auditing signal, not a recommendation. We will accompany any public release of the code with explicit documentation that prohibits use of the model to make, recommend, or score individual bail, charging, plea, or sentencing decisions.
The second strategy concerns data minimization. Although the underlying court records are publicly available, we do not redistribute them. Bulk release would allow for linkage of defendants, victims, and witnesses across cases and would defeat expungement relief that the defendants remain entitled to seek. We release code and a synthetic dataset instead. See Appendix § 18.
Third, we document the model’s per-label performance and its weaker outcomes (Probable Cause Not Found, Charges Accepted, Bond Not Set), along with the data quality, extraction, generalizability, and evaluation limitations discussed in the Limitations section.
Acknowledgment
A. Culotta was supported in part by NSF Awards IIS-HCC-2619509, DEB-2550002, CNS-2515250, IIS-HCC-2333537, CNS-2427237, the Louisiana Board of Regents Endowed Chairs for Eminent Scholars program, the Greenberg Family Professorship in Social Entrepreneurship, the Harold L. and Heather E. Jurist Center of Excellence for Artificial Intelligence at Tulane University, and the Tulane University Center of Excellence for Community-Engaged Artificial Intelligence.
Extended Related Work
Machine Learning for Single Decision Points in Criminal Justice
The dominant research efforts in machine learning for criminal justice focus on predicting a single decision or outcome, such as pre-trial release, recidivism, or final case disposition. Kleinberg et al. [9] train gradient-boosted decision trees on 758,027 New York City pretrial cases to forecast failure-to-appear and re-arrest, and found that algorithmic predictions could, in principle, reduce both jail populations and crime rates relative to judges. Williams and Kolter [23] takes an alternative approach at a different decision point, developing a hierarchical Bayesian model of cash bail assignments to disentangle judge-level variation from defendant-level risk while also addressing the infra-marginality problem inherent in observational bail data.
The most widely known operational tool, COMPAS, was shown by Angwin et al. [2] to produce error rates that differed substantially across racial groups. In a closely related study, Dressel and Farid [7] demonstrated that COMPAS is no more accurate than predictions made by laypersons with little or no criminal-justice expertise, and that a logistic regression using only two features matches its overall accuracy of roughly 65%. Wang et al. [22] shows that simple, interpretable models, in some cases compact enough to fit on a single page, can match black-box accuracy on Florida and Kentucky pretrial datasets while outperforming COMPAS, and they further document that recidivism models do not generalize well across jurisdictions and require local retraining.
While this body of work has clarified the methodological foundations and limits of risk assessment, every study above collapses a case into a single prediction target, whether the defendant will reoffend, fail to appear, or receive cash bail, obscuring how decisions accumulate across the multiple proceedings that determine a defendant’s trajectory through the system.
Legal Judgment Prediction From Case Text
Legal Judgment Prediction (LJP), a subtopic of NLP, uses textual descriptions of cases to forecast judicial outcomes. Aletras et al. [1] introduced the task on the European Court of Human Rights and used bag-of-n-grams features and SVMs to predict whether a particular Convention article had been violated and achieved accuracy. Chalkidis et al. [4] extended this benchmark to neural models on a larger European Court of Human Rights corpus and evaluated hierarchical attention networks and BERT-based architectures on binary, multi-label, and case-importance prediction. To accommodate the lengthy nature of legal documents, Chalkidis et al. [5] pre-trained Legal-BERT on legislation, contracts, and court cases. Niklaus et al. [15] introduced the multilingual Swiss-Judgment-Prediction benchmark with hierarchical BERT variants. Ma et al. [14] explicitly moved beyond judge-summarized inputs by representing cases through their multi-stage lifecycle, but their target remains the final disposition.
Recent work has expanded the LJP output structure beyond single-label classification. Zhang et al. [24] proposes HD-LJP, a hierarchical-dependency framework that jointly predicts law articles, charges, and terms of penalty on the CAIL2018 corpus by combining label-topological relation distillation with an ordered task-judicial-logic module in which each subtask’s prediction filters the candidates for the next set. Li et al. [12] formulates the prediction of law articles and charges as a multi-task multi-label problem and inserts label definitions and law-charge alignment knowledge into a transformer decoder model. While these methods relax the single-task or single-label assumption, the prediction target remains the terminal trial outcome of an already-completed case rather than the next event in its evolution.
Closest to our input structure is Polo et al. [17], whose work classifies Brazilian legal proceedings into archived, active, or suspended status from chronological sequences of short clerk-written motions using LSTMs, MLP, and XGBoost classifiers over Word2Vec, Doc2Vec, TF-IDF, and BERT representations. Their setting is similar to ours in that they treat clerical text as a unit of observation and in modeling sequences sequentially. However, they collapse the proceedings into a single three-way status label, and we predict the multi-label event composition of each upcoming proceeding. Across this literature, the prediction target is typically the terminal outcome of a case rather than the next event in its evolution. Our work shifts the unit of prediction to the individual proceeding.
Sequence Models for Event Streams
Most relevant to our methodological setup is work that adapts the Transformer architecture (Vaswani et al., [21]) to sequences of discrete categorical events accompanied by structured covariates. Li et al. [13] introduces a BERT-style transformer model, BEHRT, that represents a patient’s electronic record as a sequence of diagnoses grouped into visits so that predictions are unaffected by the order of events within the same visit. Each diagnosis token’s embedding sums disease code, age, position, and visit-segment embeddings. This model is pretrained on roughly 1.6 million UK primary-care records via masked language modeling and then fine-tuned to predict the diseases that will appear in a patient’s next visit, next 6 months, and next 12 months. This model outperforms CNN and RNN baselines by 8-13% in average precision. We view this model as a foundational model for health, as it is a single pre-trained representation that supports many downstream clinical prediction tasks. Another closely related model is CAREER (Vafa et al., [20]), a transformer-based foundational model that represents an individual’s career as a sequence of jobs and predicts the next occupation, which is conditioned on prior employment history and demographics. CAREER is pre-trained on 24 million job sequences from resumes and is fine-tuned on smaller longitudinal surveys, namely the National Longitudinal Survey of Youth 1979 (NLSY79), its NLSY97 cohort, and the Panel Study of Income Dynamics (PSID), where it outperforms standard econometric baselines.
We treat a criminal case as a sequence of events with structure per-step covariates and learn to predict the next outcome. This applies the same broad recipe to the criminal-court setting. Our corpus is drawn from a single jurisdiction, so we stop short of claiming a foundational model for criminal court at the scale of BEHRT or CAREER. Our setup is otherwise analogous. However, our task differs from these prior efforts in mainly three ways. First, CAREER operates on a regular annual grid in which each timestep corresponds to a calendar year and BEHRT carries irregular timing through a patient-internal age embedding. But in our proceedings, they occur at irregular intervals, which we address through the use of discrete month-year positional encodings in addition to ordinal step indices. Secondly, our sequences are heterogeneously multimodal, as we combine BERT-embedded clerk note text with structured demographic, charge, bond, and procedural stage features rather than just discrete occupation or diagnosis tokens with auxiliary covariates. Third, our supervision is multi-label per step, shared with BEHRT but distinct from CAREER, rather than single-label per step, since multiple events can occur within a single proceeding.
Embedding Components
We describe each component of the proceeding representation below.
Text Embedding () Clerk notes text is encoded using a pre-trained BERT model [6]. The text is tokenized with the corresponding WordPiece tokenizer, truncated to 512 tokens, and then the CLS representation from the final layer is taken as the embedding. BERT is not fine-tuned and uses frozen weights. See Appendix § 17 for additional information on the BERT encoder.
Defendant Demographics () Race (Black, White, Hispanic, Asian, Indigenous, Unknown), Gender (Male, Female, Unknown), and age at case initiation (continuous, in years) are combined into a single representation. Race and gender are encoded as learned embeddings, while age is normalized and concatenated directly.
Case (Charge) Embedding () Current charges for the case as of proceeding are represented as a vocabulary count vector over a fixed charge vocabulary . A linear projection layer maps this sparse count vector to a dense embedding. The projection weights are therefore initialized randomly and learned from scratch during training.
Prior Charge Embedding Aggregated prior charges , which sum charge counts across all cases for the same defendant that began before proceeding , are encoded with the same . Current and prior charges therefore share projection weights and are two separate 192-dimensional blocks, distinguished only by their position in the concatenation.
Prior Label Embedding () The multi-label outcome vector from the immediately preceding proceeding is passed through a linear projection. At , this vector is set to .
Court A Section () The assigned Court A section identifier is encoded as a learned embedding and included only for proceedings that occur in Court A. The embedding is zeroed out for proceedings that take place in Court B.
Bond Amounts () is the bond amount recorded at the defendant’s initial hearing, while reflects the total amounts set or modified over the life of the case. Both are stored once per docket in the source court data and do not vary across proceedings within the same case. The two values are the same when the bond has never been revised and are different when it has been reset, revoked, or modified following new charges or violations. This allows the model to distinguish between a defendant whose bond has remained unchanged since the first appearance and one whose bond history reflects subsequent court action. Both values are encoded with the same deterministic encoder , which discretizes a dollar amount into one of the following bins: {$0, $0–$1,000, $1,000–$5,000, $5,000–$10,000, $10,000–$25,000, $25,000–$50,000, $50,000–$100,000, > $100,000, “Not Set / Missing”}. “Not Set / Missing” is used both when the value is missing and at the sequence’s initial state, where no bond has been observed yet. This returns a one-hot vector.
Temporal Information () The month-year of each proceeding is encoded as a one-hot vector over all the month-year combinations observed in the training data. This discrete encoding complements the learned positional embedding , as indexes ordinal position within the sequence, while the month-year one hot puts each step in terms of absolute calendar time and reflects the irregular spacing between proceedings.
Scalar Features Two scalar indicators are concatenated directly to the feature vector without further transformation: the court-type indicator (0 for Court A, 1 for Court B) and the prior case count , which counts the number of cases for the same defendant that precede this one.
Feature Fusion All components are concatenated along the feature dimension and passed through a single learned linear projection that maps the concatenated vector to the model’s hidden dimension , producing the final proceeding representation .
Interpretability
Integrated Gradients We report attributions for each of the eleven input component groups in Table 9. Attributions are computed within each fold and averaged across folds. Because raw attribution magnitudes depend on component dimensionality, values for the 768-dimensional BERT embedding are not directly comparable to those for scalar features such as prior case count. We therefore also report -scores computed within each outcome (Table 10), showing which inputs drive a given prediction, and across outcomes (Table 11), showing which outcomes a given input is most influential for. Outcomes present in only a single fold have an undefined standard deviation and are marked NA.
| Outcome | Text emb. | Case emb. | Prior charge emb. | Prior label emb. | Court A Sec. emb. | Def. emb. | Temporal | Bond sum | Orig. bond | Court type | Prior cases |
| Bond Set | |||||||||||
| Public Defender Appointed | |||||||||||
| Released on Recognizance | |||||||||||
| Ankle Monitoring Imposed | |||||||||||
| Charges Refused | |||||||||||
| Probable Cause Found | |||||||||||
| Pretrial Conference Held | |||||||||||
| Pled Not Guilty | |||||||||||
| Continuance Occurred | |||||||||||
| In Custody, Not in Court | |||||||||||
| Pled Guilty | |||||||||||
| Trial Verdict Reached | |||||||||||
| Sentence Includes Jail Time | |||||||||||
| Sentence Excludes Jail Time | |||||||||||
| Mean Attribution |
Table 9. Raw attribution magnitude by outcome and feature group. Cells report mean ± standard deviation across folds. Outcome names are abbreviated. See Table 2 for full label names.
| Outcome | Text emb. | Case emb. | Prior charge emb. | Prior label emb. | Court A Sec. emb. | Def. emb. | Temporal | Bond sum | Orig. bond | Court type | Prior cases |
| Bond Set | |||||||||||
| Public Defender Appointed | |||||||||||
| Released on Recognizance | |||||||||||
| Ankle Monitoring Imposed | |||||||||||
| Charges Refused | |||||||||||
| Probable Cause Found | |||||||||||
| Pretrial Conference Held | |||||||||||
| Pled Not Guilty | |||||||||||
| Continuance Occurred | |||||||||||
| In Custody, Not in Court | |||||||||||
| Pled Guilty | |||||||||||
| Trial Verdict Reached | |||||||||||
| Sentence Includes Jail Time | |||||||||||
| Sentence Excludes Jail Time | |||||||||||
| Mean Z-Score Within Label |
Table 10. Within-label standardized attribution by outcome and feature group. Cells report mean ± standard deviation across folds.
| Outcome | Text emb. | Case emb. | Prior charge emb. | Prior label emb. | Court A Sec. emb. | Def. emb. | Temporal | Bond sum | Orig. bond | Court type | Prior cases |
| Bond Set | |||||||||||
| Public Defender Appointed | |||||||||||
| Released on Recognizance | |||||||||||
| Ankle Monitoring Imposed | |||||||||||
| Charges Refused | |||||||||||
| Probable Cause Found | |||||||||||
| Pretrial Conference Held | |||||||||||
| Pled Not Guilty | |||||||||||
| Continuance Occurred | |||||||||||
| In Custody, Not in Court | |||||||||||
| Pled Guilty | |||||||||||
| Trial Verdict Reached | |||||||||||
| Sentence Includes Jail Time | |||||||||||
| Sentence Excludes Jail Time |
Table 11. Across-label standardized attribution by outcome and feature group. Cells report mean standard deviation across folds.
Counterfactual Sensitivity Counterfactual fairness in its strict form requires a fully specified causal graph. Our procedure, which is the process of swapping each demographic value to all other observed values and measuring the resulting shift in predicted probability, provides an empirical proxy that does not require causal identification, while still allowing us to compare the model’s responsiveness to legally relevant features (e.g., prior case count) against protected ones (e.g., race). Full per-label breakdowns for prior case count, age, and race appear in Figure 6–Figure 8.

Figure 6. Prior Case Count Counterfactual

Figure 8. Race Counterfactual
Proceeding-Level Per-Label Performance
Table 7 reports the proceeding-level per-label performance for the full transformer under 5-fold cross-validation. Performance is evaluated at each individual proceeding against the ground-truth labels (regex-generated) for that step.
| Label | Precision | Recall | F1-Score | Support |
| First Appearance Hearing Occurred | ||||
| Court Appointed Public Defender | ||||
| Bond Set | ||||
| Pre-Trial Conference Held | ||||
| Domestic Stay-Away Order Imposed | ||||
| Pled Not Guilty to Charges | ||||
| Charges Refused | ||||
| State Was Not Present | ||||
| Probable Cause Found | ||||
| Defendant Released on Own Recognizance | ||||
| Continuance Occurred | ||||
| Ankle Monitoring Imposed | ||||
| Sentence Without Jail Time Imposed | ||||
| Pled Guilty to Charges | ||||
| Sentence Including Jail Time Imposed | ||||
| Defendant in Custody and Not in Court | ||||
| Trial Verdict Reached | ||||
| Probable Cause Not Found | ||||
| Bond Not Set | ||||
| Charges Accepted |
Table 7. Proceeding-level per-label performance (mean std over 5 folds), sorted by F1 score.
Case-Level Evaluation
Table 8 reports case-level per-label performance, where proceeding-level predictions are aggregated across all proceedings within a case. Performance is consistently higher than at the proceeding level, as the model has numerous chances across a case to correctly identify whether each outcome ever occurs. Outcomes such as “Continuance Occurred” and “Pled Guilty to Charges” show the largest gains from aggregation, which suggests that these outcomes have distributed lexical indicators that accumulate across proceedings.
| Label | Precision | Recall | F1-Score | Support |
| First Appearance Hearing Occurred | ||||
| Bond Set | ||||
| Court Appointed Public Defender | ||||
| Pled Not Guilty to Charges | ||||
| Pre-Trial Conference Held | ||||
| Continuance Occurred | ||||
| Domestic Stay-Away Order Imposed | ||||
| Charges Refused | ||||
| Pled Guilty to Charges | ||||
| Probable Cause Found | ||||
| Defendant Released on Own Recognizance | ||||
| State Was Not Present | ||||
| Defendant in Custody and Not in Court | ||||
| Sentence Including Jail Time Imposed | ||||
| Ankle Monitoring Imposed | ||||
| Sentence Without Jail Time Imposed | ||||
| Trial Verdict Reached | ||||
| Bond Not Set | ||||
| Probable Cause Not Found | ||||
| Charges Accepted |
Table 8. Per-Class Performance for Case Level Evaluation (Averaged over 5 Folds), Sorted by F1-Score
K-means
Figure 5 shows the results of t-SNE clustering.

Figure 5. Clustering results
Attribution Tables
Table 9–Table 11 report the fold-level attribution summaries used in the feature attribution analysis. Each cell reports the mean and standard deviation across available folds. Cells with NA have an undefined standard deviation because the outcome was present in only one fold.
Implementation Details
The complete experimental pipeline, including BERT embedding pre-computation, 5-fold cross-validation training of the transformer, the random and MLP baselines, all ablation runs, and the interpretability analyses, took approximately 11 hours.
Transformer Architecture This model uses a hidden dimension of 896, 4 transformer encoder layers, 8 attention heads, a feed-forward dimension of 2048, GELU activation functions, and dropout of 0.2. The maximum sequence length is 200. Learned positional embeddings are initialized from and are added to each step. A causal mask is applied at every layer so that proceeding attends to only the proceedings . The fuse layer that maps the concatenated proceeding representation to the model hidden dimension is represented as Linear LayerNorm ReLU Dropout. The model has 29,570,766 trainable parameters (approximately 113 MB at 32-bit precision), with the majority concentrated in the Transformer encoder (27.6M parameters, 93% of the total) and the fuse layer (1.4M parameters, 5%). All other components, including the defendant, case, Court A section, and prior-label embeddings, together account for less than 2% of the parameter count. Note that the cached BERT text embedding is loaded from disk and contributes no trainable parameters to this model. All training was performed on a single NVIDIA RTX A5000 GPU.
Component Dimensions Before fusion, each proceeding representation concatenates: defendant embedding (32), case (charge) embedding (192), BERT text embedding (768), Court A section embedding (32), prior-label embedding (96, from Linear()), prior-charge embedding (192, separate linear projection sharing structure with the case embedding), court-type indicator (1), original-bond one-hot (9), cumulative-bond one-hot (9), prior-case-count scalar (1), and a one-hot month-year vector. The month-year dimension is not fixed. Rather, it is set to the number of years observed in training .
BERT Encoder We use bert-base-uncased to encode clerk notes, and its weights are frozen. Text is tokenized, truncated to 512 tokens, and then we extract the final layer CLS representation. Embeddings are pre-computed once and cached to disk. BERT is not fine-tuned at any stage. We selected bert-base-uncased for its simplicity and scalability, and we leave comparison against larger embedding models and against fine-tuned models to future work.
Optimization The model is trained with AdamW (learning rate , weight decay 0.01), batch size 16, for 20 epochs, with a OneCycleLR schedule (max learning rate base, 30% warmup, cosine annealing, initial divisor 25, final divisor ). Gradients are clipped to norm 1.0, mixed-precision training is enabled, and the loss is unweighted BCEWithLogitsLoss applied per-label.

Figure 7. Age Counterfactual
MLP Baseline The completion-prediction baseline is a 3-layer feed-forward network: Linear() ReLU Linear() ReLU Linear(). Inputs are the features available at the initial proceeding (defendant demographics, initial charges, Court A section), with StandardScaler applied to continuous features and LabelEncoder applied to the Court A section. The model is trained with Adam (learning rate ), cross-entropy loss over the 5 completion classes (single-label), batch size 16, and 20 epochs. At inference, predictions are taken as the argmax over the 5 classes.
GRU Baseline This baseline replaces the transformer encoder with a two-layer unidirectional GRU whose hidden dimension of 896 matches that of the transformer. A Linear() classification layer is applied to the hidden state at each step, and there is a dropout of 0.2 between GRU layers. The baseline reuses the same preceding representation as the transformer, including the embedding functions and fusion layer, which are jointly trained with the GRU. The transformer’s encoder and positional embeddings are unused. The model is trained with Adam (learning rate , weight decay 0.01), batch size 16, for 20 epochs, OneCycleLR scheduling, gradient clipping at norm 1.0, mixed precision, and BCEWithLogitsLoss applied per-label, which is identical to the transformer.
| Model | Macro F1 | Weighted F1 |
| MLP Baseline | .2569 ± .015 | .4389 ± .025 |
| Transformer | .4260 ± .026 | .5650 ± .015 |
Table 13. Completion-level performance (mean ± std). Not comparable to Table 12.
| Model | Macro F1 | Weighted F1 |
| Transformer | .4745 ± .009 | .5671 ± .012 |
| GRU Baseline | .4586 ± .010 | .5732 ± .013 |
| Random Baseline | .1183 ± .002 | .1824 ± .004 |
Table 12. Step-level performance (mean ± std)
Data and Code Availability
We release the full pipeline (label extraction, feature construction, model training, and all interpretability analyses) at https://github.com/tapilab/docket_sequence_modeling. We do not release the underlying court records. Expungement in the jurisdiction studied removes a record from public access without destroying it. A static release cannot honor expungement orders issued after publication, and would permanently reintroduce records that defendants are entitled to have removed. Additionally, the clerk notes name victims, witnesses, and other third parties who are not case participants, and hand-entered free text of this kind cannot be reliably de-identified at scale. In place of the source corpus, we release a synthetic dataset matching the schema, field types, and label vocabulary of the real data.
Macro and Weighted F1 Scores
Tables 12 and 13 report macro-averaged and weighted-averaged F1 scores for the step-level and completion level evaluations. These complement the micro-averaged results in Table 3 and Table 4 in the main paper.
Threshold-Based Results
The step-level results in the paper select the true number of labels at each proceeding. In this appendix section, we report the performance using labels selected by thresholding the sigmoid output for each label. The transformer model achieves a micro-F1 of .5213 using the default 0.5 binary classification threshold and .5288 using a threshold tuned on held-out data within each training fold. These scores are modestly lower than the .5715 achieved under top- selection, though they remain in a practically similar range.
References
- [1]Nikolaos Aletras, Dimitrios Tsarapatsanis, Daniel Preotiuc-Pietro, and Vasileios Lampos. 2016. Predicting judicial decisions of the european court of human rights: A natural language processing perspective. PeerJ computer science, 2:e93.DOI
- [2]Julia Angwin, Jeff Larson, Surya Mattu, and Lauren Kirchner. 2016. Machine bias: There’s software used across the country to predict future criminals, and it’s biased against blacks. ProPublica. Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers), pages 6957–6970, Albuquerque, New Mexico. Association for Computational Linguistics.
- [3]Solon Barocas, Anhong Guo, Ece Kamar, Jacquelyn Krones, Meredith Ringel Morris, Jennifer Wortman Vaughan, W. Duncan Wadsworth, and Hanna Wallach. 2021. Designing disaggregated evaluations of ai systems: Choices, considerations, and tradeoffs. In Proceedings of the 2021 AAAI/ACM Conference on AI, Ethics, and Society, AIES ’21, page 368–378, New York, NY, USA. Association for Computing Machinery.arxiv.org/abs/2103.06076
- [4]Ilias Chalkidis, Ion Androutsopoulos, and Nikolaos Aletras. 2019. Neural legal judgment prediction in English. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4317–4323, Florence, Italy. Association for Computational Linguistics.arxiv.org/abs/1906.02059
- [5]Ilias Chalkidis, Manos Fergadiotis, Prodromos Malakasiotis, Nikolaos Aletras, and Ion Androutsopoulos. 2020. LEGAL-BERT: The muppets straight out of law school. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 2898–2904, Online. Association for Computational Linguistics.arxiv.org/abs/2010.02559
- [6]Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 4171–4186, Minneapolis, Minnesota. Association for Computational Linguistics.arxiv.org/abs/1810.04805
- [7]Julia Dressel and Hany Farid. 2018. The accuracy, fairness, and limits of predicting recidivism. Science Advances, 4(1):eaao5580.DOI
- [8]Nick Gill and Jo Hynes. 2021. Courtwatching: Visibility, publicness, witnessing, and embodiment in legal activism. Area (Oxf), 53(4):569–576.DOI
- [9]Jon Kleinberg, Himabindu Lakkaraju, Jure Leskovec, Jens Ludwig, and Sendhil Mullainathan. 2018. Human decisions and machine predictions*. The Quarterly Journal of Economics, 133(1):237–293.
- [11]Matt J Kusner, Joshua Loftus, Chris Russell, and Ricardo Silva. 2017. Counterfactual fairness. In Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc.arxiv.org/abs/1703.06856
- [12]Ang Li, Yiquan Wu, Ming Cai, Adam Jatowt, Xiang Zhou, Weiming Lu, Changlong Sun, Fei Wu, and Kun Kuang. 2025. Legal judgment prediction based on knowledge-enhanced multi-task and multi-label text classification. In Proceedings of the 2025 Conference of the Nations of the Americas Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers), pages 6957–6970, Albuquerque, New Mexico. Association for Computational Linguistics.DOI
- [13]Yikuan Li, Shishir Rao, José Roberto Ayala Solares, Abdelaali Hassaine, Rema Ramakrishnan, Dexter Canoy, Yajie Zhu, Kazem Rahimi, and Gholamreza Salimi-Khorshidi. 2020. Behrt: Transformer for electronic health records. Scientific Reports, 10(1):7155.
- [14]Luyao Ma, Yating Zhang, Tianyi Wang, Xiaozhong Liu, Wei Ye, Changlong Sun, and Shikun Zhang. 2021. Legal judgment prediction with multi-stage case representation learning in the real court setting. In Proceedings of the 44th International ACM SIGIR Conference on Research and Development in Information Retrieval, SIGIR ’21, page 993–1002, New York, NY, USA. Association for Computing Machinery.DOI
- [15]Joel Niklaus, Ilias Chalkidis, and Matthias Stürmer. 2021. Swiss-judgment-prediction: A multilingual legal judgment prediction benchmark. In Proceedings of the Natural Legal Language Processing Workshop 2021, pages 19–35, Punta Cana, Dominican Republic. Association for Computational Linguistics.arxiv.org/abs/2110.00806
- [16]Emily Owens, Erin M. Kerrison, and Bernardo Santos Da Silveira. 2017. Examining racial disparities in criminal case outcomes among indigent defendants in san francisco. Technical report, Quattrone Center for the Fair Administration of Justice, University of Pennsylvania Law School.
- [17]Felipe Maia Polo, Itamar Ciochetti, and Emerson Bertolo. 2021. Predicting legal proceedings status: approaches based on sequential text data. In Proceedings of the Eighteenth International Conference on Artificial Intelligence and Law, ICAIL ’21, page 264–265. ACM.
- [18]Grace Reinke and Natalie Marx. 2025. Court watching’s promise: A preliminary survey. Law & Social Inquiry, 50(3):823–864.DOI
- [19]Mukund Sundararajan, Ankur Taly, and Qiqi Yan. 2017. Axiomatic attribution for deep networks. In Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 3319–3328. PMLR.arxiv.org/abs/1703.01365
- [20]Keyon Vafa, Emil Palikot, Tianyu Du, Ayush Kanodia, Susan Athey, and David Blei. 2024. CAREER: A foundation model for labor sequence data. Transactions on Machine Learning Research.
- [21]Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc.arxiv.org/abs/1706.03762
- [22]Caroline Wang, Bin Han, Bhrij Patel, and Cynthia Rudin. 2023. In pursuit of interpretable, fair and accurate machine learning for criminal recidivism prediction. Journal of Quantitative Criminology, 39(2):519–581.
- [23]Joshua Williams and J. Zico Kolter. 2021. A bayesian model of cash bail decisions. In Proceedings of the 2021 ACM Conference on Fairness, Accountability, and Transparency, FAccT ’21, page 827–837, New York, NY, USA. Association for Computing Machinery.arxiv.org/abs/2101.12267
- [24]Yunong Zhang, Xiao Wei, and Hang Yu. 2024. Hd-Jip: A hierarchical dependency-based legal judgment prediction framework for multi-task learning. Knowledge-Based Systems, 299:112033.DOI