Few-Shot and Chain-of-Thought
Explore how few-shot examples and chain-of-thought reasoning enhance AI model outputs in support ticket classification. Understand techniques to prevent label and format drift, design effective prompts with structured outputs, and balance internal reasoning with user-visible explanations for reliable production deployments.
A support system receives ticket text and must output one label from BILLING, BUG, FEATURE, ACCOUNT, OTHER plus a one-sentence rationale. A plain instruction often fails in visible ways, with outputs like Billing Issue instead of BILLING, or a rationale that turns into multiple paragraphs, or two labels when the text mentions both an error and a refund request. Those failures are not subtle, and they break downstream routing.
With that single task in view, two levers change behavior in different ways. Few-shot prompting adds examples so the output matches our label set and formatting, while a reasoning scaffold adds an intermediate structure so the model is more likely to make the same internal decision steps on similar inputs. Neither is guaranteed to improve every run, so we compare them by observing label drift, formatting drift, and rationale length.
The table below shows where each lever helps and what it costs.
Prompt style | Output consistency | Token cost | Brittleness to new cases | Risk of unwanted rationale text |
Zero-shot | Low | Lowest | High | Low |
Few-shot | High | Higher | Medium | Low |
Reasoning scaffold | Medium | Highest | Low | High |
A practical rule holds across models. Use few-shot examples when the main failure is schema and boundary coverage, and use a reasoning scaffold when the main failure is inconsistent intermediate decisions such as choosing between BUG and ACCOUNT based on whether the user can log in.
Setting rules using few-shot examples
Once we know the failure is label or format drift, examples work best when they teach the output contract rather than smuggling in business policy. Keep each example short and consistent, and ...