Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

incident.io 10 min read How-to mediumAdept

Tricks to fix stubborn prompts

Six practical techniques fix prompts that resist the usual remedies. Split tasks that combine classification and explanation into separate, cheaper and parallelizable calls. Read the full prompt for contradictions, such as a user message saying a message "is related" that overrode the system instructions. Structure prompts with clear headers and the goal up front, have an LLM review prompts for hidden assumptions, and mark the most important rules explicitly. Try other models using your own evals rather than benchmarks; one suite went from 50% failing to 100% passing by switching from GPT-4o to Sonnet. Pre-process inputs, for example replacing merged_at timestamps with time_since_merged so the model doesn't have to calculate durations.

Related posts

  • You can’t vibe code a prompt

    incident.io mediumAdept

    Letting an LLM iteratively rewrite a prompt until evals pass produces overfitted, brittle prompts. In incident.io's Slack-message relevance classifier, Claude fixed one failing case but broke others. Given the whole eval suite, Claude Code hit 100% only by bloating the prompt 7× and hardcoding every test case, which reverted to the original failures once that section was removed. The recommended approach is to write prompts by hand with structurally similar but non-overlapping examples, and use LLMs for generating evals and examples, judging outputs, linting prompts for contradictions, and grading production interactions.

  • Promptim: an experimental library for prompt optimization

    LangChain easyNovice

    Promptim is an open-source, experimental library that automates prompt engineering: given an initial prompt, a LangSmith dataset and custom evaluators, it runs an optimization loop where a metaprompt proposes edits based on scored train-set results, and keeps a new prompt only if it improves dev-split metrics, repeated N times. Optional human feedback via LangSmith annotation queues covers cases without good automated metrics. Unlike DSPy, which optimizes whole compound AI systems and includes fine-tuning and few-shot methods, Promptim focuses narrowly on rewriting a single prompt with a human kept in the loop.

  • Lessons learned from building our first AI product

    incident.io mediumAdept

    incident.io built suggested incident summaries with OpenAI: each time a responder posts an update, GPT proposes a new summary from the update, the Slack conversation and the previous summary, and a human accepts, edits or rejects it. Half of all summary updates are now AI-written. Suggestions are actioned 20% of the time; of those, 63% are accepted, 26% edited and 11% rejected, which is too little conviction to auto-apply summaries. Practical lessons: build a CLI to run prompts against real incident fixture files, force structured output with JSON mode (problem, impact, causes, steps to resolve), give one person uninterrupted time for trial-and-error prompt work, roll out to 10% of customers first, and involve legal early because adding OpenAI as a sub-processor needs customer notice. A shared prompt interface and a single RunPrompt entry point let later AI features reuse the same plumbing.

  • Open LLM Leaderboard: DROP deep dive

    Hugging Face mediumAdept

    Most models scored under 10 F1 on DROP in the Open LLM Leaderboard because of two evaluation bugs. First, answer normalization skipped number canonicalization when a number was followed by a non-space whitespace such as a newline, so a correct "10" never matched the gold "10.0". Second, using "." as the stop token cut floating-point answers short and made high-quality models run on into a hallucinated next prompt, which hurt their bag-of-words F1. Re-scoring by splitting generations on "\n" brought DROP scores in line with overall model quality, but a correct rerun would cover more than 50% of examples, so DROP was removed from the leaderboard until a fixed evaluation exists.

  • Context engineering case studies: Etsy-specific question answering

    Etsy Code as Craft mediumAdept

    Etsy tested whether prompt engineering over embedding-based retrieval, without fine-tuning, could reliably answer Etsy-specific questions. On a 40-question Travel & Entertainment policy set the LLM answered about 86% correctly; on a 50-question seller-forum set it scored about 72%, with errors doubling on the more heterogeneous, opinionated data. Letting the model admit uncertainty and asking it to explain its answer (chain-of-thought) fixed some hallucinations, but adding a contextual preamble often did not help. Asking the model to cite specific source snippets proved the most useful way to flag potential hallucinations.

The quest for software engineering knowledge.

Look:
Layout: