How I use LLMs for structured classification without getting garbage output

📰 Dev.to · Berat Bozkurt

Learn how to use LLMs for structured classification without getting garbage output by forcing the model to articulate user impact before labeling, resulting in a 92% hit rate

intermediate Published 15 Jun 2026
Action Steps
  1. Read the PR title, labels, and body carefully using a natural language processing tool
  2. Explain what the change does for the end user in one sentence using an LLM
  3. Classify the PR as one of feature, improvement, bugfix, breaking, or internal using the LLM's output
  4. Return the classification result as JSON
  5. Batch multiple PRs per request to improve cost and speed
Who Needs to Know This

Data scientists and machine learning engineers on a team can benefit from this approach to improve the accuracy of their LLM-based classification models, while product managers can use this technique to automate tasks such as categorizing GitHub pull requests

Key Insight

💡 Forcing the model to articulate user impact before labeling makes it actually read the PR body, resulting in more accurate classifications

Share This
💡 Improve LLM-based classification accuracy by forcing the model to articulate user impact before labeling #LLMs #MachineLearning

Key Takeaways

Learn how to use LLMs for structured classification without getting garbage output by forcing the model to articulate user impact before labeling, resulting in a 92% hit rate

Read full article → ← Back to Reads

Related Videos

5 Levels of AI Agents - From Simple LLM Calls to Multi-Agent Systems
5 Levels of AI Agents - From Simple LLM Calls to Multi-Agent Systems
Dave Ebbelaar (LLM Eng)
Google Gemini AI: Cutting Through the Hype
Google Gemini AI: Cutting Through the Hype
Ian Wootten
Easily Create Voiceovers Using OpenAI's New Text to Speech and Vision Models
Easily Create Voiceovers Using OpenAI's New Text to Speech and Vision Models
Ian Wootten
Ollama on Linux: Easily Install Any LLM on Your Server
Ollama on Linux: Easily Install Any LLM on Your Server
Ian Wootten
Ollama: The Easiest Way to Run Uncensored Llama 2 on a Mac
Ollama: The Easiest Way to Run Uncensored Llama 2 on a Mac
Ian Wootten
AI Showdown: Can Claude 2 from Anthropic Take On ChatGPT?
AI Showdown: Can Claude 2 from Anthropic Take On ChatGPT?
Ian Wootten