TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How We Taught ChatGPT to Classify Tasks

2 pointsby azianmikealmost 2 years ago

1 comment

azianmikealmost 2 years ago
Hey everyone, I wanted to share how we&#x27;ve been scaling our prompts with classification! For context, we build “ChatGPT for customer support” and our AI-based customer support system has to handle all sorts of questions ranging from &quot;Where&#x27;s my order?&quot; to &quot;Does your product do X?&quot; As our range of support questions increase, we can’t just keep adding more instructions onto a huge, “mono prompt”.<p>For a little background, the task of “Where’s my order” structurally is answered differently than “Does your product do X?”. For the first question, we have to authenticate the user (make sure we don’t give out random order details), make API calls to fetch tracking details, and properly respond. Lots of external information is needed. For “Does your product do X?”, if it’s in the help docs, then we can easily do a retrieval to answer!<p>So, we had to get creative to solve these range of questions. We first realized that separating task-specific prompts (”agents”) performed better. So now we had to figure out how to classify each request and “hand it off” to the right agent. We wanted it to figure out the type of request and then follow a set of actions (we call them &quot;agents&quot;) to solve it. It&#x27;s like telling it, &quot;Hey ChatGPT, classify this task.&quot; And voila, it slots the request into the right category, like recognizing &quot;Where&#x27;s my order?&quot; as an order tracking request. After that, an agent specifically designed to handle order tracking kicks in.<p>You might be wondering, &quot;How do you even teach ChatGPT to classify tasks?&quot; Well, there are two main ingredients: examples and a &#x27;chain of thought&#x27;. The first one&#x27;s simple - give it a bunch of examples for each task, and it starts recognizing patterns. But the second one, that&#x27;s where the magic happens.<p>It&#x27;s like teaching a kid that 1+1=2. “Here’s how you get 2. You first start with one, add another, and end up with two.” That&#x27;s the kind of logic we&#x27;re trying to instill in ChatGPT. Let&#x27;s say we want it to classify a request. We start by teaching it how to classify. For each classification, we help it understand the reasoning. For example, for a &quot;Where&#x27;s my order?&quot; task, we&#x27;d tell it, &quot;The customer is asking for updates about their order, therefore it should be classified as an order tracking request&quot;. After the classification, we guide it to formulate an appropriate response.<p>Using this &#x27;chain of thought&#x27; approach, we&#x27;ve seen a big improvement in how well ChatGPT handles tasks.<p>This whole task classification thing has been a game-changer for us. It&#x27;s letting us automate customer support prompts in a way that we used to do in a “hard coded” way, and we&#x27;re just scratching the surface here. We&#x27;re stoked to see where this takes us and the possibilities for improving customer experience.<p>AI, and especially ChatGPT, has crazy potential for customer support. We&#x27;re on an exciting journey, and we can&#x27;t wait to share more of our adventures with ChatGPT with you all.<p>As a shameless plug, feel free to check us out at <a href="https:&#x2F;&#x2F;www.spryngtime.com&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.spryngtime.com&#x2F;</a><p>If you guys have any ideas or suggestions around chain of thought&#x2F;agents&#x2F;prompt chaining, feel free to hit me up at *[michael@spryngtime.com](mailto:michael@spryngtime.com)*. Cheers!