LLM Classification Is Feature Engineering
TL;DR Highlight
Using LLM verdicts as logistic regression features lifted irony detection F1 from 0.747 to 0.779.
Who Should Read
A backend developer running LLM prompt classifiers who can't get calibrated probabilities or threshold control.
Core Mechanics
- LLM classifier probabilities can't be trusted
- LLM verdicts are usually hard labels like Ironic/Not.
- Token logprobs and self-reported confidence have no reason to be calibrated.
- So trading off precision and recall in a principled way is hard
- No guarantee the LLM uses your structured data
- Pasting structured data into the prompt doesn't mean the LLM uses it.
- The LLM also doesn't know your population's base rate of positives
- Put a logistic regression on top of the verdict
- Treat the LLM verdict as one feature and fit coefficients on training data.
- With a binary verdict, the fitted probability is just the empirical positive rate per verdict
- Real probabilities give you threshold control
- Other covariates can simply be added to the regression.
- The model can also be swapped for xgboost or a neural network
Community Reactions
- Suggestion to automate prompt generation
- A commenter proposed a strong LLM writing prompts and a weak LLM classifying, feeding a small ML model.
- They would regenerate prompts from the most misclassified examples and add them as features, repeating.
- Experience using LLM decisions as features
- A commenter doing LLM-as-a-judge work said feeding LLM decisions into a classic ML model for the final call works really well.
- Objection that a megaprompt baseline is missing
- A commenter said the post should compare against one prompt listing the properties and asking for reasoning then an answer.
- They expect it to get close to the logistic classifier and generalize better out of distribution.
- Tip to prefer binary questions
- One commenter found binary questions beat multi-class, and answer consistency became an extra pipeline check.
- Point that logprobs may not reflect intent
- A commenter noted structured output may mask disallowed tokens so probabilities differ from the model's original weights.
How to Apply
- Add a logistic regression to your current LLM classifier
- Run the LLM on a labeled validation set and compute the positive rate per verdict.
- Use those rates as probabilities and compare the Brier score to before
- Turn misclassifications into sub-question features
- Read 10 wrong cases and turn shared traits into yes/no questions.
- Extract them all as bool fields in one structured output call
- Merge rule-based features into the same regression
- Add computable values like length, URL presence, and exclamation count next to the LLM features.
- Compare F1 for verdict only, +LLM features, and +rule features
- Set the threshold from business cost
- Once you have probabilities, plot the precision-recall curve.
- Pick the threshold that matches your false-positive cost
Try It
# Paste into Claude or ChatGPT (simplified version of the article's method: feature design only, no code)
You are a classification feature designer. For the task below, write yes/no feature questions an LLM can extract in one call.
Task: {{classification task description}}
Cases the LLM currently gets wrong:
{{5-10 misclassified cases with correct labels}}
Instructions:
1. Summarize common traits of the misclassified cases in 3 lines.
2. Write 10 bool feature questions answerable independently of the verdict.
3. Write a pydantic Field description for each question.
4. Check whether the questions overlap.
Next step: run the questions on your validation data and compare F1 and Brier against the verdict-only model.Terminology
Related Papers
The Judge Can Debias Itself: Awareness and Self-Debiasing for Reliable LLM-as-a-Judge
Warning an LLM judge about bias or letting it self-critique improved 20 of 21 model–bias combinations.
90% of US working hours are spent on tasks not covered well by AI benchmarks
Mapping 29 benchmarks to job tasks shows 90% of US working hours lack good coverage
Postgres 19 delayed after AI reviewers find more bugs than humans can fix
LLM code review surfaced so many bugs that Postgres 19 slipped to November and 8-10 features were reverted
Show HN: Gemini 4 Argon plays StarCraft
LLMs wrote StarCraft bots in one hour; GPT-6 Astra scored highest.
A Plausible Explanation Is Enough to Mislead Multimodal Judges
Adding plausible explanations to fixed answers cut MLLM judges' wrong-answer rejection by 12.7–13.8 points.
Neural networks are clean
Looking at neurons directly shows most have one main job, challenging superposition.