TL;DR
Fine-tuning Large Language Models (LLMs) for classification tasks using standard discriminative heads often triggers "linguistic collapse," completely destroying their ability to explain their reasoning. CLSGen solves this by introducing a dual-head architecture and joint training framework that delivers both highly reliable probability estimates and coherent, well-aligned verbalized explanations without sacrificing the model's generative capabilities.
What Problem Does This Paper Address?
In high-stakes domains like medicine, AI systems cannot act as pure black boxes; practitioners require both Confidence Estimation (how certain the model is) and Verbalized Explanation (why the model made that choice).
While modern decoder-only LLMs excel at generating plausible-sounding explanations, they struggle to provide reliable, calibrated probabilities. Conversely, if you try to fix this by fine-tuning an LLM with a traditional classification head (similar to how we train encoder-only models like BERT), the model suffers from catastrophic forgetting or "linguistic collapse." It learns to output a probability but loses its grasp on language entirely, spitting out gibberish and destroying its core interpretability advantage.
Methods
The authors introduce CLSGen, a framework consisting of a novel dual-head architecture, a joint training methodology, and an explanation-augmented data construction strategy.
1. Dual-Head Architecture
Instead of choosing between text generation or classification, CLSGen does both. Built on top of a decoder-only backbone (Llama-3.1-8B-Instruct), the architecture splits into two heads:
- Language Modeling (LM) Head: The standard head used to autoregressively predict the next token for generating explanations.
- Classification (CLS) Head: A two-layer Multi-Layer Perceptron (MLP) with a Sigmoid activation function attached to the hidden representation of the last token of the input prefix.
2. Joint Fine-Tuning
The model is optimized end-to-end using Low-Rank Adaptation (LoRA) via a combined loss function: $$\mathcal{L}_{total} = \mathcal{L}_{gen} + \mathcal{L}_{cls}$$ Where $\mathcal{L}_{gen}$ is the standard causal language modeling loss (trained via teacher forcing to predict the explanation and a verbalized label), and $\mathcal{L}_{cls}$ is the binary cross-entropy loss from the classification head.
3. Weakly Supervised Data Construction
To train the generation head properly, the authors use a separate, highly capable reasoning model ($\mathcal{M}_{data}$, specifically DeepSeek-R1-Distill-Llama-8B) to generate high-quality chain-of-thought explanations for the training set. They filter out any generations where the teacher model's verbalized label disagrees with the ground-truth gold label.
Datasets
The framework was evaluated on two challenging, long-context benchmarks:
- LCD Benchmark: A long clinical document dataset used to predict 30-day and 90-day post-discharge patient mortality based on discharge notes. It features exceptionally long contexts and low class prevalence.
- CliniFact: A clinical research claim verification dataset requiring scientific reasoning to determine if a PubMed abstract supports or contradicts a given claim.
Key Insights and Ideas
- Linguistic Collapse is Sudden: During classification-only training, the model maintains its text generation capabilities for several epochs before suddenly collapsing entirely (around epoch 11-13 in preliminary tests), resulting in unparseable, meaningless text.
- Joint Training as a Regularizer: Incorporating the language modeling loss ($\mathcal{L}_{gen}$) acts as a powerful regularizer. It prevents linguistic collapse and actually helps the model achieve better classification performance than standard discriminative baselines.
- Shared Internal Representations: Because both heads share the underlying transformer layers, the quantitative probability from the CLS head aligns almost perfectly with the qualitative text rationale from the LM head.
Key Results
CLSGen consistently outperformed inference-only prompting methods and traditional CNN baselines across key metrics:
- Classification Performance: On the 90-day LCD task, CLSGen achieved an AUROC of 0.8574, outperforming the best inference-only baseline (Self-consistency at 0.7164) and beating a traditional CNN (0.8360).
- Structural Robustness: CLSGen maintained near-perfect text parsability (>0.97 on LCD, 1.00 on CliniFact), ensuring that the output format constraints required for downstream clinical applications were strictly met.
- High Alignment: The framework achieved an AUROC-Alignment score between 0.95 and 0.98 across all datasets, proving that the internal probability head and the text generation head are highly synchronized. Furthermore, the Rationale-Label Inconsistency (RLI) was exceptionally low (<0.05), meaning the generated text rarely contradicted the predicted label.
Limitations and Future Work
- Data Filtering Bias: The data construction pipeline discards training instances where the teacher model fails to generate a correct label within 5 trials. This can inadvertently shrink the already small minority class size, potentially making training harder.
- Threshold Sensitivity: Like many classification frameworks, threshold-dependent metrics (such as F1-score) proved sensitive. Tuning thresholds on small, skewed development splits did not always generalize perfectly to the test set, highlighting a need for more robust threshold calibration methods in future work.
Summary updated